Kernel: make config_mem and MapSharedPages members of KernelSystem

This commit is contained in:
Weiyi Wang 2018-10-25 10:51:00 -04:00
parent 95790218f2
commit 773ec47629
8 changed files with 37 additions and 21 deletions

View file

@ -25,7 +25,7 @@ TEST_CASE("Memory::IsValidVirtualAddress", "[core][memory]") {
SECTION("CONFIG_MEMORY_VADDR and SHARED_PAGE_VADDR should be valid after mapping them") {
auto process = kernel.CreateProcess(kernel.CreateCodeSet("", 0));
Kernel::MapSharedPages(process->vm_manager);
kernel.MapSharedPages(process->vm_manager);
CHECK(Memory::IsValidVirtualAddress(*process, Memory::CONFIG_MEMORY_VADDR) == true);
CHECK(Memory::IsValidVirtualAddress(*process, Memory::SHARED_PAGE_VADDR) == true);
}
@ -47,7 +47,7 @@ TEST_CASE("Memory::IsValidVirtualAddress", "[core][memory]") {
SECTION("Unmapping a VAddr should make it invalid") {
auto process = kernel.CreateProcess(kernel.CreateCodeSet("", 0));
Kernel::MapSharedPages(process->vm_manager);
kernel.MapSharedPages(process->vm_manager);
process->vm_manager.UnmapRange(Memory::CONFIG_MEMORY_VADDR, Memory::CONFIG_MEMORY_SIZE);
CHECK(Memory::IsValidVirtualAddress(*process, Memory::CONFIG_MEMORY_VADDR) == false);
}