]> git.proxmox.com Git - mirror_edk2.git/commitdiff
OvmfPkg: PciHostBridgeLib: set RootBus->Segment
authorLaszlo Ersek <lersek@redhat.com>
Mon, 25 Jan 2016 22:43:50 +0000 (23:43 +0100)
committerLaszlo Ersek <lersek@redhat.com>
Thu, 3 Mar 2016 17:18:39 +0000 (18:18 +0100)
This is the first of the patches that set the fields of PCI_ROOT_BRIDGE.
The structure is zero-filled as a precaution for later field additions.

Here we set the Segment member explicitly to zero (so that any later
customization can be easier).

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Marcel Apfelbaum <marcel@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
OvmfPkg/Library/PciHostBridgeLib/PciHostBridgeLib.inf

index 25746dd1cfd0c2040a47221478fd21d62d506a8a..39dc2b5acb4ddce050706f42c6a357ce586a2b14 100644 (file)
@@ -17,6 +17,7 @@
 \r
 #include <IndustryStandard/Pci.h>\r
 \r
+#include <Library/BaseMemoryLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/PciHostBridgeLib.h>\r
@@ -63,6 +64,13 @@ InitRootBridge (
   OUT PCI_ROOT_BRIDGE *RootBus\r
   )\r
 {\r
+  //\r
+  // Be safe if other fields are added to PCI_ROOT_BRIDGE later.\r
+  //\r
+  ZeroMem (RootBus, sizeof *RootBus);\r
+\r
+  RootBus->Segment = 0;\r
+\r
   return EFI_OUT_OF_RESOURCES;\r
 }\r
 \r
index b836931912611ae8b9cc42a78f1c450549255951..096d728f3c615f32d84bef36f89ec757ffd1bdb2 100644 (file)
@@ -39,6 +39,7 @@
   OvmfPkg/OvmfPkg.dec\r
 \r
 [LibraryClasses]\r
+  BaseMemoryLib\r
   DebugLib\r
   MemoryAllocationLib\r
   PciLib\r