Esempio n. 1
0
        public static void AcpiOsUnmapMemory(void *LogicalAddress, uint Length)
        {
            // Align address down so we can get the offset
            uint down   = Paging.AlignDown((uint)LogicalAddress);
            uint offset = (uint)LogicalAddress - down;

            // Length in rounded pagesize
            uint len = Paging.AlignUp(Length + offset);

            Paging.UnMapKeepPhysical((void *)down, (int)len);
        }
Esempio n. 2
0
        public static void *AcpiOsMapMemory(ulong PhysicalAddress, uint Length)
        {
            // Align address down so we can get the offset
            uint down   = Paging.AlignDown((uint)PhysicalAddress);
            uint offset = (uint)PhysicalAddress - down;

            // Length in rounded pagesize
            uint len = Paging.AlignUp(Length + offset);

            // Map
            void *mapped = Paging.MapToVirtual(Paging.CurrentDirectory, (int)down, (int)len, Paging.PageFlags.Present | Paging.PageFlags.Writable);

            return((void *)((uint)mapped + offset));
        }