write kernel sp to tss in dispatcher

This commit is contained in:
2025-11-26 06:46:19 +01:00
parent 4ffae9e1f0
commit 3808f494af
7 changed files with 21 additions and 14 deletions

View File

@@ -41,10 +41,11 @@ Thread::Thread (bool kernel, void * start): queue_link(nullptr), isKernel(kerne
prepareContext(StackPointer.isr, context, kickoff, reinterpret_cast<uintptr_t>(this), 0, 0);
}
Thread::Thread() : queue_link(nullptr), id(idCounter++), kill_flag(false) {
void *tos = reinterpret_cast<void *>(reserved_stack_space_isr + STACK_SIZE);
prepareContext(tos, context, kickoff, reinterpret_cast<uintptr_t>(this), 0, 0);
}
Thread::Thread() : Thread(false, 0) {}
//Thread::Thread() : queue_link(nullptr), id(idCounter++), kill_flag(false) {
// void *tos = reinterpret_cast<void *>(reserved_stack_space_isr + STACK_SIZE);
// prepareContext(tos, context, kickoff, reinterpret_cast<uintptr_t>(this), 0, 0);
//}
void Thread::resume(Thread *next) {
assert(next != nullptr && "Pointer to next Thread must not be nullptr!");