public static void FreeIOMemory(UIntPtr addr, UIntPtr bytes) { Tracing.Log(Tracing.Debug, "PageTableService.FreeIOMemory(addr={0:x8}, bytes={1:x})", addr, bytes); MemoryManager.FreeIOMemory(addr, bytes, Thread.CurrentProcess); }
public static void GetUsageStatistics(out ulong allocatedCount, out ulong allocatedBytes, out ulong freedCount, out ulong freedBytes) { MemoryManager.GetUserStatistics( out allocatedCount, out allocatedBytes, out freedCount, out freedBytes); }
public static UIntPtr Allocate(UIntPtr bytes) { UIntPtr addr = MemoryManager.UserAllocate( MemoryManager.PagesFromBytes(bytes), Thread.CurrentProcess, 0, PageType.Unknown); Tracing.Log(Tracing.Debug, "PageTableService.Allocate(bytes={0} addr={1:x8}", bytes, addr); return(addr); }
public static void Free(uint addr, uint bytes) { Tracing.Log(Tracing.Debug, "PageTableService.Free(addr={0:x8}, bytes={1:x})", addr, bytes); // We always round up block allocations to the nearest page, // so round up when freeing, too. MemoryManager.UserFree(addr, MemoryManager.PagesFromBytes(bytes), Thread.CurrentProcess); }
public static UIntPtr AllocateIOMemory(UIntPtr limit, UIntPtr bytes, UIntPtr alignment) { UIntPtr addr = MemoryManager.AllocateIOMemory( limit, bytes, alignment, Thread.CurrentProcess); Tracing.Log(Tracing.Debug, "PageTableService.AllocateIOMemory(limit={0:x}, bytes={1:x}, alignment={2:x}) addr= {3:x8}", limit, bytes, alignment, addr); return(addr); }
public static uint AllocateExtend(uint addr, uint bytes) { uint got = (uint)MemoryManager.UserExtend( addr, MemoryManager.PagesFromBytes(bytes), Thread.CurrentProcess, PageType.Unknown); Tracing.Log(Tracing.Debug, "PageTableService.AllocateExtend(addr={0:x}, bytes={1:x}) addr={2:x8}", addr, bytes, got); return(addr); }
public static uint AllocateIOMemory(uint limit, uint bytes, uint alignment) { uint addr = (uint)MemoryManager.AllocateIOMemory( limit, bytes, alignment, Thread.CurrentProcess); Tracing.Log(Tracing.Debug, "PageTableService.AllocateIOMemory(limit={0:x}, bytes={1:x}, alignment={2:x}) addr= {3:x8}", limit, bytes, alignment, addr); return(addr); }
public static UIntPtr AllocateExtend(UIntPtr addr, UIntPtr bytes) { UIntPtr got = MemoryManager.UserExtend( addr, MemoryManager.PagesFromBytes(bytes), Thread.CurrentProcess, PageType.Unknown); Tracing.Log(Tracing.Debug, "PageTableService.AllocateExtend(addr={0:x}, bytes={1:x}) addr={2:x8}", addr, bytes, got); return(got); }
public static bool Query(UIntPtr queryAddr, out UIntPtr regionAddr, out UIntPtr regionSize) { PageType type = MemoryManager.UserQuery( queryAddr, out regionAddr, out regionSize); bool used = (type != PageType.Unknown); Tracing.Log(Tracing.Debug, "PageTableService.Query(query={0:x8}, addr={1:x8}, size={2:x}) type={3}", queryAddr, regionAddr, regionSize, (uint)type); return(used); }