diff options
-rw-r--r-- | OvmfPkg/PciHostBridgeDxe/PciHostBridge.h | 8 | ||||
-rw-r--r-- | OvmfPkg/PciHostBridgeDxe/PciRootBridgeIo.c | 32 |
2 files changed, 25 insertions, 15 deletions
diff --git a/OvmfPkg/PciHostBridgeDxe/PciHostBridge.h b/OvmfPkg/PciHostBridgeDxe/PciHostBridge.h index 05b8cecf80..d2c28bcd20 100644 --- a/OvmfPkg/PciHostBridgeDxe/PciHostBridge.h +++ b/OvmfPkg/PciHostBridgeDxe/PciHostBridge.h @@ -581,6 +581,13 @@ typedef struct { RES_STATUS Status;
} PCI_RES_NODE;
+#pragma pack(1)
+typedef struct {
+ EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR SpaceDesc[TypeMax];
+ EFI_ACPI_END_TAG_DESCRIPTOR EndDesc;
+} RESOURCE_CONFIGURATION;
+#pragma pack()
+
#define PCI_ROOT_BRIDGE_SIGNATURE SIGNATURE_32('e', '2', 'p', 'b')
typedef struct {
@@ -609,6 +616,7 @@ typedef struct { EFI_PCI_ROOT_BRIDGE_DEVICE_PATH DevicePath;
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL Io;
+ RESOURCE_CONFIGURATION ConfigBuffer;
} PCI_ROOT_BRIDGE_INSTANCE;
diff --git a/OvmfPkg/PciHostBridgeDxe/PciRootBridgeIo.c b/OvmfPkg/PciHostBridgeDxe/PciRootBridgeIo.c index 5de28b18eb..c61fd1d7db 100644 --- a/OvmfPkg/PciHostBridgeDxe/PciRootBridgeIo.c +++ b/OvmfPkg/PciHostBridgeDxe/PciRootBridgeIo.c @@ -1,6 +1,7 @@ /** @file
PCI Root Bridge Io Protocol implementation
+ Copyright (C) 2015, Red Hat, Inc.
Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available
@@ -15,19 +16,18 @@ #include "PciHostBridge.h"
#include "IoFifo.h"
-typedef struct {
- EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR SpaceDesp[TypeMax];
- EFI_ACPI_END_TAG_DESCRIPTOR EndDesp;
-} RESOURCE_CONFIGURATION;
-
-RESOURCE_CONFIGURATION Configuration = {
- {{0x8A, 0x2B, 1, 0, 0, 0, 0, 0, 0, 0},
- {0x8A, 0x2B, 0, 0, 0, 32, 0, 0, 0, 0},
- {0x8A, 0x2B, 0, 0, 6, 32, 0, 0, 0, 0},
- {0x8A, 0x2B, 0, 0, 0, 64, 0, 0, 0, 0},
- {0x8A, 0x2B, 0, 0, 6, 64, 0, 0, 0, 0},
- {0x8A, 0x2B, 2, 0, 0, 0, 0, 0, 0, 0}},
- {0x79, 0}
+STATIC
+CONST
+RESOURCE_CONFIGURATION mConfigurationTemplate = {
+ {
+ { 0x8A, 0x2B, 1, 0, 0, 0, 0, 0, 0, 0 }, // SpaceDesc[TypeIo]
+ { 0x8A, 0x2B, 0, 0, 0, 32, 0, 0, 0, 0 }, // SpaceDesc[TypeMem32]
+ { 0x8A, 0x2B, 0, 0, 6, 32, 0, 0, 0, 0 }, // SpaceDesc[TypePMem32]
+ { 0x8A, 0x2B, 0, 0, 0, 64, 0, 0, 0, 0 }, // SpaceDesc[TypeMem64]
+ { 0x8A, 0x2B, 0, 0, 6, 64, 0, 0, 0, 0 }, // SpaceDesc[TypePMem64]
+ { 0x8A, 0x2B, 2, 0, 0, 0, 0, 0, 0, 0 } // SpaceDesc[TypeBus]
+ },
+ { 0x79, 0 } // EndDesc
};
//
@@ -2607,12 +2607,14 @@ RootBridgeIoConfiguration ( UINTN Index;
PrivateData = DRIVER_INSTANCE_FROM_PCI_ROOT_BRIDGE_IO_THIS (This);
+ CopyMem (&PrivateData->ConfigBuffer, &mConfigurationTemplate,
+ sizeof mConfigurationTemplate);
for (Index = 0; Index < TypeMax; Index++) {
if (PrivateData->ResAllocNode[Index].Status == ResAllocated) {
EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR *Desc;
- Desc = &Configuration.SpaceDesp[Index];
+ Desc = &PrivateData->ConfigBuffer.SpaceDesc[Index];
Desc->AddrRangeMin = PrivateData->ResAllocNode[Index].Base;
Desc->AddrRangeMax = PrivateData->ResAllocNode[Index].Base +
PrivateData->ResAllocNode[Index].Length - 1;
@@ -2620,7 +2622,7 @@ RootBridgeIoConfiguration ( }
}
- *Resources = &Configuration;
+ *Resources = &PrivateData->ConfigBuffer;
return EFI_SUCCESS;
}
|