ARM与Intel处理器中断机制解析
1. 调度器初始化与启动代码示例
以下是一段初始化和启动调度器的代码:
int main () {
// Set the task functions :
TaskFunctions [0] = Task0 ;
TaskFunctions [1] = Task1 ;
TaskFunctions [2] = Task2 ;
TaskFunctions [3] = Task3 ;
// Init scheduler :
InitScheduler ( stackRegion , TCB , TaskFunctions );
current_task = 0;
// Set up vectored interrupts and enable CPU ’s interrupts
_register_handler ( _vector_table , INT_MODE_VECTORED );
_enable_global_interrupts ();
// Environment call - start the scheduler :
__asm__ volatile (" ecall ");
// We should never return here ...
while (1) {}
return 0;
}
这段代码的主要步骤如下:
1. 设置任务函数数组,将不同的任务函数赋值给数组元素。
2. 初
超级会员免费看
订阅专栏 解锁全文
19

被折叠的 条评论
为什么被折叠?



