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); }
/* * 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); }