internal static void Setup() { System.DebugStub.Print("Dma.Setup 1. "); try { CompilerIntrinsics.Cli(); ioMemory = NucleusCalls.PciDmaBuffer(); ioPhysical = NucleusCalls.PciDmaPhysicalAddr(); // The IO-MMU tables map 2MB, aligned by 2MB uint superPageSize = 0x200000; uint ioSuperPage = (ioPhysical + 2 * superPageSize) - (ioPhysical & (superPageSize - 1)); allocOffset = (int)(ioSuperPage - ioPhysical); } finally { CompilerIntrinsics.Sti(); } System.DebugStub.Print("Dma.Setup 2. ioPhysical = 0x" + ioPhysical.ToString("X") + " allocOffset = 0x" + allocOffset.ToString("X") + ". "); }