set stackpointers in thread obj
This commit is contained in:
@@ -36,14 +36,14 @@ void Thread::kickoffUsermode (Thread *object){
|
||||
}
|
||||
|
||||
Thread::Thread (bool kernel, void * start): queue_link(nullptr), isKernel(kernel), start(start), 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);
|
||||
StackPointer.isr = reinterpret_cast<void *>(reserved_stack_space_isr + STACK_SIZE);
|
||||
StackPointer.user = reinterpret_cast<void *>(reserved_stack_space_user + STACK_SIZE);
|
||||
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 + STACK_SIZE);
|
||||
prepareContext(tos, context, kickoff, reinterpret_cast<uintptr_t>(this), 0,
|
||||
0);
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user