mirror of https://gitlab.com/nakst/essence
fix building nvme driver
This commit is contained in:
parent
3ca9b4724b
commit
eddf4f5b65
|
@ -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)) {
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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++) {
|
||||
|
|
Loading…
Reference in New Issue