Example #1
0
        private bool KernelToUserInt32(AMemory Memory, long Address, int Value)
        {
            if (Memory.IsMapped(Address))
            {
                Memory.WriteInt32ToSharedAddr(Address, Value);

                return(true);
            }

            return(false);
        }
Example #2
0
        private bool UserToKernelInt32(AMemory Memory, long Address, out int Value)
        {
            if (Memory.IsMapped(Address))
            {
                Value = Memory.ReadInt32(Address);

                return(true);
            }

            Value = 0;

            return(false);
        }
Example #3
0
        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);
            }
        }