mirror of
https://github.com/Fennix-Project/Kernel.git
synced 2025-07-06 12:59:18 +00:00
fork() stub and QoL improvements
This commit is contained in:
20
Core/Memory/PageTable.cpp
Normal file
20
Core/Memory/PageTable.cpp
Normal file
@ -0,0 +1,20 @@
|
||||
#include <memory.hpp>
|
||||
|
||||
namespace Memory
|
||||
{
|
||||
void PageTable::Update()
|
||||
{
|
||||
#if defined(a86)
|
||||
asmv("mov %0, %%cr3" ::"r"(this));
|
||||
#elif defined(aa64)
|
||||
asmv("msr ttbr0_el1, %0" ::"r"(this));
|
||||
#endif
|
||||
}
|
||||
|
||||
PageTable PageTable::Fork()
|
||||
{
|
||||
PageTable NewTable;
|
||||
memcpy(&NewTable, this, sizeof(PageTable));
|
||||
return NewTable;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user