Add Memory::GetUserVirtualArea function to the kernel.

This commit is contained in:
Jonas 'Sortie' Termansen 2013-08-20 01:59:43 +02:00
parent 930be00966
commit 68aba3d137
3 changed files with 13 additions and 0 deletions

View File

@ -83,6 +83,7 @@ namespace Sortix
addr_t GetKernelStack();
size_t GetKernelStackSize();
void GetKernelVirtualArea(addr_t* from, size_t* size);
void GetUserVirtualArea(uintptr_t* from, size_t* size);
}
}

View File

@ -192,6 +192,12 @@ namespace Sortix
*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()
{
return KERNEL_STACK_START;

View File

@ -176,6 +176,12 @@ namespace Sortix
*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()
{
return KERNEL_STACK_START;