Updated StackGuard

This commit is contained in:
Alex
2022-12-15 03:06:55 +02:00
parent 83a5b2a4ee
commit a3664662f3
2 changed files with 10 additions and 2 deletions

View File

@ -23,14 +23,18 @@ namespace Memory
}
this->StackBottom = (void *)USER_STACK_BASE;
this->StackTop = (void *)(USER_STACK_BASE + USER_STACK_SIZE);
this->StackPhyiscalBottom = AllocatedStack;
this->StackPhyiscalTop = (void *)((uint64_t)AllocatedStack + USER_STACK_SIZE);
this->Size = USER_STACK_SIZE;
}
else
{
this->StackBottom = KernelAllocator.RequestPages(TO_PAGES(STACK_SIZE));
this->StackPhyiscalBottom = this->StackBottom;
debug("StackBottom: %p", this->StackBottom);
memset(this->StackBottom, 0, STACK_SIZE);
this->StackTop = (void *)((uint64_t)this->StackBottom + STACK_SIZE);
this->StackPhyiscalTop = this->StackTop;
this->Size = STACK_SIZE;
}
trace("Allocated stack at %p", this->StackBottom);