load cr3 in dispatcher
This commit is contained in:
@@ -10,11 +10,13 @@
|
||||
Dispatcher::Dispatcher() : life(nullptr) {}
|
||||
|
||||
Thread *Dispatcher::active() const { return life; }
|
||||
extern four_lvl_paging_t paging_tree;
|
||||
|
||||
void Dispatcher::go(Thread *first) {
|
||||
assert(active() == nullptr);
|
||||
setActive(first);
|
||||
mytss.sp0 = first->StackPointer.isr;
|
||||
load_cr3((void*)&paging_tree.l4);
|
||||
first->go();
|
||||
}
|
||||
|
||||
@@ -24,6 +26,7 @@ void Dispatcher::dispatch(Thread *next) {
|
||||
if (current != next) {
|
||||
setActive(next);
|
||||
mytss.sp0 = next->StackPointer.isr;
|
||||
load_cr3((void*)&paging_tree.l4);
|
||||
current->resume(next);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user