When a PCI bridge is not enabled, the secondary bus may still be zero.
This causes an infinite recursive call to enumerate bus 0 which results
in a stack overflow. The easy fix is to skip the recursive bus
enumeration for bridges which do not have the secondary bus initialized.
TEST=Build and run CorebootPayloadPkg on Quark/Galileo Gen2
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
When looping through all PCI functions, code should not look for functions
1-7 if function 0 is not present or if function 0 indicates the device is
not multifunction. Prior to this fix the code would use stale data in a
buffer to determine if a device is multifunction even if function 0 is not
present. This fixes a code bug and provides very small performance
improvements.
PCI 2.3 Specification states: They [multifunction devices] are also
required to always implement function 0 in the device. Implementing other
functions is optional and may be assigned in any order.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Joseph Shifflett <joseph.shifflett@hpe.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18575 6f19259b-4bc3-4df7-8a09-765794883524
Signed-off-by: Sun Rui <rui.sun@intel.com>
Reviewed-by: Fan Jeff <jeff.fan@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13189 6f19259b-4bc3-4df7-8a09-765794883524
These comparisons were not comparing an enum variable
with a member of the same enum type.
GCC 4.5 generated a warning for these comparison
operations.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10932 6f19259b-4bc3-4df7-8a09-765794883524
The EFI_SPECIFICATION_VERSION MACRO is no longer defined in edk2
builds, and this module does not need to support the older < UEFI 2.0
code path.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10096 6f19259b-4bc3-4df7-8a09-765794883524
EFI_SIGNATURE_16 -> SIGNATURE_16
EFI_SIGNATURE_32 -> SIGNATURE_32
EFI_SIGNATURE_64 -> SIGNATURE_64
EFI_FIELD_OFFSET -> OFFSET_OF
EFI_MAX_BIT -> MAX_BIT
EFI_MAX_ADDRESS -> MAX_ADDRESS
These macros are not defined in UEFI spec. It makes more sense to use the equivalent macros in Base.h to avoid alias.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7049 6f19259b-4bc3-4df7-8a09-765794883524
"GLOBAL_REMOVED_IF_UNREFERENCED" must never be used with an "extern" declaration. It can only be used with the declaration of the actual global variable.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@6241 6f19259b-4bc3-4df7-8a09-765794883524