示例#1
0
 void
 ArchCpu::_swap(kernel::sys::sched::task::Task *prev,
     kernel::sys::sched::task::Task *next)
 {
   set_cr3((uint32_t)(next->vmap.pgd));
   cpu_switch(&prev->tsk_context.kregs, &next->tsk_context.kregs);
 }
示例#2
0
文件: context.c 项目: AndrewD/prex
/*
 * Switch to new context
 *
 * Kernel mode registers and kernel stack pointer are switched to
 * the next context.
 *
 * It is assumed all interrupts are disabled by caller.
 *
 * TODO: FPU context is not switched as of now.
 */
void
context_switch(context_t prev, context_t next)
{
	cpu_switch(&prev->kregs, &next->kregs);
}