Skip to content

Commit

Permalink
PCIBridge: Enable MMIO after BAR set
Browse files Browse the repository at this point in the history
  • Loading branch information
Goldfish64 committed Oct 28, 2023
1 parent 02b8186 commit 92ffee9
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion MacHyperVSupport/PCIBridge/HyperVPCIBridgePrivate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ IOReturn HyperVPCIBridge::allocatePCIConfigWindow() {
//
// Allocate PCI config window. TODO: handle lack of high MMIO space.
//
_pciConfigSpace = _hvModuleDevice->allocateRange(kHyperVPCIBridgeWindowSize, PAGE_SIZE, true);
_pciConfigSpace = _hvModuleDevice->allocateRange(kHyperVPCIBridgeWindowSize, PAGE_SIZE, false);
if (_pciConfigSpace == 0) {
HVSYSLOG("Could not allocate range for PCI config window");
return kIOReturnNoResources;
Expand Down Expand Up @@ -328,6 +328,12 @@ IOReturn HyperVPCIBridge::queryResourceRequirements() {
}
}

//
// Enable memory I/O on device.
//
if (status == kIOReturnSuccess) {
writePCIConfig(kIOPCIConfigCommand, sizeof (UInt16), readPCIConfig(kIOPCIConfigCommand, sizeof (UInt16)) | kIOPCICommandMemorySpace);
}
return status;
}

Expand Down

0 comments on commit 92ffee9

Please sign in to comment.