mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Add Memory::GetUserVirtualArea function to the kernel.
This commit is contained in:
parent
930be00966
commit
68aba3d137
3 changed files with 13 additions and 0 deletions
|
@ -83,6 +83,7 @@ namespace Sortix
|
||||||
addr_t GetKernelStack();
|
addr_t GetKernelStack();
|
||||||
size_t GetKernelStackSize();
|
size_t GetKernelStackSize();
|
||||||
void GetKernelVirtualArea(addr_t* from, size_t* size);
|
void GetKernelVirtualArea(addr_t* from, size_t* size);
|
||||||
|
void GetUserVirtualArea(uintptr_t* from, size_t* size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -192,6 +192,12 @@ namespace Sortix
|
||||||
*size = VIRTUAL_AREA_UPPER - VIRTUAL_AREA_LOWER;
|
*size = VIRTUAL_AREA_UPPER - VIRTUAL_AREA_LOWER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GetUserVirtualArea(uintptr_t* from, size_t* size)
|
||||||
|
{
|
||||||
|
*from = 0x400000; // 4 MiB.
|
||||||
|
*size = 0x800000000000 - *from; // 128 TiB - 4 MiB.
|
||||||
|
}
|
||||||
|
|
||||||
addr_t GetKernelStack()
|
addr_t GetKernelStack()
|
||||||
{
|
{
|
||||||
return KERNEL_STACK_START;
|
return KERNEL_STACK_START;
|
||||||
|
|
|
@ -176,6 +176,12 @@ namespace Sortix
|
||||||
*size = VIRTUAL_AREA_UPPER - VIRTUAL_AREA_LOWER;
|
*size = VIRTUAL_AREA_UPPER - VIRTUAL_AREA_LOWER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GetUserVirtualArea(uintptr_t* from, size_t* size)
|
||||||
|
{
|
||||||
|
*from = 0x400000; // 4 MiB.
|
||||||
|
*size = 0x80000000 - *from; // 2 GiB - 4 MiB.
|
||||||
|
}
|
||||||
|
|
||||||
addr_t GetKernelStack()
|
addr_t GetKernelStack()
|
||||||
{
|
{
|
||||||
return KERNEL_STACK_START;
|
return KERNEL_STACK_START;
|
||||||
|
|
Loading…
Reference in a new issue