diff --git a/drivers/nvme.cpp b/drivers/nvme.cpp index 9109006..e496c23 100644 --- a/drivers/nvme.cpp +++ b/drivers/nvme.cpp @@ -325,7 +325,7 @@ bool NVMeController::Access(struct NVMeDrive *drive, uint64_t offsetBytes, size_ if (!prp2) { prp2 = prpListPages[ioSubmissionQueueTail]; - MMArchRemap(MMGetKernelSpace(), prpListVirtual, prp2); + MMRemapPhysical(MMGetKernelSpace(), prpListVirtual, prp2); uintptr_t index = 0; while (!KDMABufferIsComplete(buffer)) { diff --git a/kernel/kernel.h b/kernel/kernel.h index 051136f..d0cdb49 100644 --- a/kernel/kernel.h +++ b/kernel/kernel.h @@ -127,7 +127,6 @@ extern "C" { bool MMArchMapPage(MMSpace *space, uintptr_t physicalAddress, uintptr_t virtualAddress, unsigned flags); // Returns false if the page was already mapped. void MMArchUnmapPages(MMSpace *space, uintptr_t virtualAddressStart, uintptr_t pageCount, unsigned flags, size_t unmapMaximum = 0, uintptr_t *resumePosition = nullptr); - void MMArchRemap(MMSpace *space, const void *virtualAddress, uintptr_t newPhysicalAddress); // Must be done with interrupts disabled; does not invalidate on other processors. bool MMArchMakePageWritable(MMSpace *space, uintptr_t virtualAddress); bool MMArchHandlePageFault(uintptr_t address, uint32_t flags); void MMArchInvalidatePages(uintptr_t virtualAddressStart, uintptr_t pageCount); diff --git a/kernel/memory.cpp b/kernel/memory.cpp index 9f888d1..beb80ca 100644 --- a/kernel/memory.cpp +++ b/kernel/memory.cpp @@ -2091,9 +2091,9 @@ bool MMFaultRange(uintptr_t address, uintptr_t byteCount, uint32_t flags = ES_FL return true; } -void MMArchRemap(MMSpace *space, const void *virtualAddress, uintptr_t newPhysicalAddress) { +void MMRemapPhysical(MMSpace *space, const void *virtualAddress, uintptr_t newPhysicalAddress) { if (ProcessorAreInterruptsEnabled()) { - KernelPanic("MMArchRemap - Cannot remap address with interrupts enabled (does not invalidate the page on other processors).\n"); + KernelPanic("MMRemapPhysical - Cannot remap address with interrupts enabled (does not invalidate the page on other processors).\n"); } MMArchMapPage(space, newPhysicalAddress, (uintptr_t) virtualAddress, MM_MAP_PAGE_OVERWRITE | MM_MAP_PAGE_NO_NEW_TABLES); diff --git a/kernel/module.h b/kernel/module.h index 21a9743..28c6e6f 100644 --- a/kernel/module.h +++ b/kernel/module.h @@ -345,6 +345,7 @@ MMSpace *MMGetCurrentProcessSpace(); // Limited by region type flags. void *MMMapPhysical(MMSpace *space, uintptr_t address, size_t bytes, uint64_t caching); +void MMRemapPhysical(MMSpace *space, const void *virtualAddress, uintptr_t newPhysicalAddress); // Must be done with interrupts disabled; does not invalidate on other processors. void *MMStandardAllocate(MMSpace *space, size_t bytes, uint32_t flags, void *baseAddress = nullptr, bool commitAll = true); bool MMFree(MMSpace *space, void *address, size_t expectedSize = 0, bool userOnly = false); void MMAllowWriteCombiningCaching(MMSpace *space, void *virtualAddress); diff --git a/kernel/terminal.cpp b/kernel/terminal.cpp index 27de221..cd8ad4f 100644 --- a/kernel/terminal.cpp +++ b/kernel/terminal.cpp @@ -361,7 +361,7 @@ void KernelPanic(const char *format, ...) { EsPrint("Enter address: "); uintptr_t address = DebugReadNumber(); uintptr_t offset = address & (K_PAGE_SIZE - 1); - MMArchRemap(kernelMMSpace, pmm.pmManipulationRegion, address - offset); + MMRemapPhysical(kernelMMSpace, pmm.pmManipulationRegion, address - offset); uintptr_t *data = (uintptr_t *) ((uint8_t *) pmm.pmManipulationRegion + offset); for (uintptr_t i = 0; i < 8 && (offset + 8 * sizeof(uintptr_t) < K_PAGE_SIZE); i++) {