Refactor gsTCB struct for debugging and update usage in related files

This commit is contained in:
EnderIce2
2024-03-13 03:41:12 +02:00
parent e021c1d9eb
commit 2ffd8e3c34
3 changed files with 27 additions and 20 deletions

View File

@ -452,7 +452,7 @@ namespace Tasking
sf->rax = si->tf.rax;
sf->Flags = si->tf.rflags.raw;
sf->ReturnAddress = si->tf.rip;
gs->TempStack = si->tf.rsp;
gs->TempStack = (void *)si->tf.rsp;
SignalMask.store(si->SignalMask);

View File

@ -508,10 +508,13 @@ namespace Tasking
this->Stack = new Memory::StackGuard(true, this->vma);
gsTCB *gsT = (gsTCB *)this->vma->RequestPages(TO_PAGES(sizeof(gsTCB)));
#ifdef DEBUG
gsT->__stub = 0xFFFFFFFFFFFFFFFF;
#endif
gsT->ScPages = TO_PAGES(STACK_SIZE);
gsT->SyscallStackBase = this->vma->RequestPages(gsT->ScPages);
gsT->SyscallStack = (uintptr_t)gsT->SyscallStackBase + STACK_SIZE - 0x10;
gsT->SyscallStack = (void *)((uintptr_t)gsT->SyscallStackBase + STACK_SIZE - 0x10);
debug("New syscall stack created: %#lx (base: %#lx) with gs base at %#lx",
gsT->SyscallStack, gsT->SyscallStackBase, gsT);