OvmfPkg/PciHostBridgeLib: clear PCI aperture vars for (re)init
Use ZeroMem() to initialize (or re-initialize) all fields in temporary PCI_ROOT_BRIDGE_APERTURE variables to zero. This is not mandatory but is helpful for future extension: when we add new fields to PCI_ROOT_BRIDGE_APERTURE and the default value of these fields can safely be zero, this code will not suffer from an additional change. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Heyi Guo <heyi.guo@linaro.org> Signed-off-by: Yi Li <phoenix.liyi@huawei.com> Reviewed-by: Ni Ruiyu <ruiyu.ni@intel.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
This commit is contained in:
@@ -221,6 +221,10 @@ PciHostBridgeGetRootBridges (
|
||||
return ScanForRootBridges (Count);
|
||||
}
|
||||
|
||||
ZeroMem (&Io, sizeof (Io));
|
||||
ZeroMem (&Mem, sizeof (Mem));
|
||||
ZeroMem (&MemAbove4G, sizeof (MemAbove4G));
|
||||
|
||||
Attributes = EFI_PCI_ATTRIBUTE_IDE_PRIMARY_IO |
|
||||
EFI_PCI_ATTRIBUTE_IDE_SECONDARY_IO |
|
||||
EFI_PCI_ATTRIBUTE_ISA_IO_16 |
|
||||
|
Reference in New Issue
Block a user