OvmfPkg: PciHostBridgeLib: set RootBus->Segment

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>
This commit is contained in:
Laszlo Ersek 2016-01-25 23:43:50 +01:00
parent dc4d64670a
commit 65de2ef54f
2 changed files with 9 additions and 0 deletions

View File

@ -17,6 +17,7 @@
#include <IndustryStandard/Pci.h>
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PciHostBridgeLib.h>
@ -63,6 +64,13 @@ InitRootBridge (
OUT PCI_ROOT_BRIDGE *RootBus
)
{
//
// Be safe if other fields are added to PCI_ROOT_BRIDGE later.
//
ZeroMem (RootBus, sizeof *RootBus);
RootBus->Segment = 0;
return EFI_OUT_OF_RESOURCES;
}

View File

@ -39,6 +39,7 @@
OvmfPkg/OvmfPkg.dec
[LibraryClasses]
BaseMemoryLib
DebugLib
MemoryAllocationLib
PciLib