fix building nvme driver

This commit is contained in:
nakst 2021-10-26 19:54:25 +01:00
parent 3ca9b4724b
commit eddf4f5b65
5 changed files with 5 additions and 5 deletions

View File

@ -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)) {

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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++) {