private bool KernelToUserInt32(AMemory Memory, long Address, int Value) { if (Memory.IsMapped(Address)) { Memory.WriteInt32ToSharedAddr(Address, Value); return(true); } return(false); }
private bool UserToKernelInt32(AMemory Memory, long Address, out int Value) { if (Memory.IsMapped(Address)) { Value = Memory.ReadInt32(Address); return(true); } Value = 0; return(false); }
private void FreePages(long Position, long PagesCount) { for (long Page = 0; Page < PagesCount; Page++) { long VA = Position + Page * PageSize; if (!CpuMemory.IsMapped(VA)) { continue; } long PA = CpuMemory.GetPhysicalAddress(VA); Allocator.Free(PA, PageSize); } }