fix sp loading
This commit is contained in:
@@ -28,12 +28,12 @@ void Thread::kickoff(uintptr_t param1, uintptr_t param2, uintptr_t param3) {
|
||||
((void(*)())thread->start)();
|
||||
}
|
||||
|
||||
void Thread::load_paging(){
|
||||
void Thread::load_paging(Thread* t){
|
||||
paging_tree.l2.entries[32] = {
|
||||
.present = 1,
|
||||
.write = 1,
|
||||
.user = 1,
|
||||
.address = (uintptr_t)(this->subtable) >> 12
|
||||
.address = (uintptr_t)(t->subtable) >> 12
|
||||
};
|
||||
load_cr3((void*)&paging_tree.l4);
|
||||
}
|
||||
@@ -67,7 +67,7 @@ Thread::Thread() : Thread(false, 0) {}
|
||||
//}
|
||||
|
||||
void Thread::resume(Thread *next) {
|
||||
load_paging();
|
||||
load_paging(next);
|
||||
context_switch(&next->context, &context);
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ void* Thread::operator new(size_t sz) noexcept
|
||||
|
||||
|
||||
void Thread::go() {
|
||||
load_paging();
|
||||
load_paging(this);
|
||||
context_launch(&context);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user