fix sp loading

This commit is contained in:
2026-02-17 12:38:09 +01:00
parent 6412d8f104
commit d445540620
2 changed files with 5 additions and 5 deletions

View File

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

View File

@@ -109,7 +109,7 @@ class Thread {
*/ */
void go(); void go();
void load_paging(); void load_paging(Thread* t);
/*! \brief Switches from the currently running thread to the `next` one. /*! \brief Switches from the currently running thread to the `next` one.
* *