mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-05-27 06:54:35 +00:00
memory: Kernel threads require more memory for stack
Threads will now use 128 KiB
This commit is contained in:
parent
86a119ea51
commit
23301b8c1b
@ -128,16 +128,16 @@ namespace Memory
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Memory::KernelStackManager::StackAllocation sa = StackManager.DetailedAllocate(STACK_SIZE);
|
Memory::KernelStackManager::StackAllocation sa = StackManager.DetailedAllocate(LARGE_STACK_SIZE);
|
||||||
this->StackBottom = sa.VirtualAddress;
|
this->StackBottom = sa.VirtualAddress;
|
||||||
this->StackTop = (void *)((uintptr_t)this->StackBottom + STACK_SIZE);
|
this->StackTop = (void *)((uintptr_t)this->StackBottom + LARGE_STACK_SIZE);
|
||||||
this->StackPhysicalBottom = sa.PhysicalAddress;
|
this->StackPhysicalBottom = sa.PhysicalAddress;
|
||||||
this->StackPhysicalTop = (void *)((uintptr_t)this->StackPhysicalBottom + STACK_SIZE);
|
this->StackPhysicalTop = (void *)((uintptr_t)this->StackPhysicalBottom + LARGE_STACK_SIZE);
|
||||||
this->Size = STACK_SIZE;
|
this->Size = LARGE_STACK_SIZE;
|
||||||
|
|
||||||
debug("StackBottom: %#lx", this->StackBottom);
|
debug("StackBottom: %#lx", this->StackBottom);
|
||||||
|
|
||||||
for (size_t i = 0; i < TO_PAGES(STACK_SIZE); i++)
|
for (size_t i = 0; i < TO_PAGES(LARGE_STACK_SIZE); i++)
|
||||||
{
|
{
|
||||||
AllocatedPages pa = {
|
AllocatedPages pa = {
|
||||||
.PhysicalAddress = (void *)((uintptr_t)this->StackPhysicalBottom + (i * PAGE_SIZE)),
|
.PhysicalAddress = (void *)((uintptr_t)this->StackPhysicalBottom + (i * PAGE_SIZE)),
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
#define PAGE_SIZE_1G 0x40000000 /* 1 GiB */
|
#define PAGE_SIZE_1G 0x40000000 /* 1 GiB */
|
||||||
|
|
||||||
#define STACK_SIZE 0x4000 /* 16 KiB */
|
#define STACK_SIZE 0x4000 /* 16 KiB */
|
||||||
|
#define LARGE_STACK_SIZE 0x20000 /* 128 KiB */
|
||||||
#define USER_STACK_SIZE 0x2000 /* 8 KiB */
|
#define USER_STACK_SIZE 0x2000 /* 8 KiB */
|
||||||
|
|
||||||
/* To pages */
|
/* To pages */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user