diff options
| author | varung <varung@ami.com> | 2026-10-01 11:57:16 +0300 |
|---|---|---|
| committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2026-10-19 09:48:00 +0300 |
| commit | 1e1fb123c84b5898bbb3cca127f97ab1c237bccd (patch) | |
| tree | 7e9287690566859d652d3dec3d9ec2f08642c709 /UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem | |
| parent | edf84b744a52d6be61d25eecd523a551d4b217df (diff) | |
| download | edk2-1e1fb123c84b5898bbb3cca127f97ab1c237bccd.tar.xz | |
MdeModulePkg/PciBusDxe: Consume PCI bridge register macros
Replace hardcoded PCI configuration-space offsets with the type-safe
macros from MdePkg/Include/IndustryStandard/Pci22.h. This removes magic
numbers from the PciBus driver and makes the code easier to read and
maintain. No functional change.
1. MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c
- GatherDeviceInfo() / InitializePciDevice(): use
PCI_BASE_ADDRESSREG_OFFSET and PCI_BASE_ADDRESSREG5_OFFSET as the
BAR scan loop bounds instead of 0x10/0x24.
- GatherPpbInfo(): use PCI_BASE_ADDRESSREG_OFFSET /
PCI_BASE_ADDRESSREG1_OFFSET for the two PPB BARs, and the
PCI_BRIDGE_* offset macros instead of 0x1C/0x24/0x28.
- GatherP2CInfo(): use PCI_BASE_ADDRESSREG_OFFSET instead of 0x10
for the CardBus bridge BAR.
- InitializePpb(): use the PCI_BRIDGE_* offset macros instead of
hardcoded offsets (0x1C/0x1D/0x20/0x22/0x24/0x26/0x28/0x2C/0x30/0x32)
when initializing the I/O, 32-bit memory, and 64-bit memory windows
to their disabled state (base set to all-ones, limit to all-zeros).
- IsPciDeviceRejected(): use PCI_CARD_MEMORY_BASE_0,
PCI_CARD_IO_BASE_0_LOWER, and PCI_CARD_IO_LIMIT_1_LOWER in place of
0x1C/0x2C/0x38 for the CardBus BAR scan, and
PCI_BASE_ADDRESSREG1_OFFSET / PCI_BASE_ADDRESSREG5_OFFSET instead of
0x14/0x24 for the standard PCI BAR scan.
- ResetAllPpbBusNumber(): use PCI_BRIDGE_PRIMARY_BUS_REGISTER_OFFSET
instead of 0x18.
2. MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c
- Use PCI_BASE_ADDRESSREG_OFFSET / PCI_BASE_ADDRESSREG5_OFFSET as the
BAR scan loop bounds instead of 0x10/0x24.
3. MdeModulePkg/Bus/Pci/PciBusDxe/PciResourceSupport.c
- ProgramPpbAperture(): replace hardcoded PCI bridge aperture offsets
with the PCI_BRIDGE_* macros in the PPB_IO_RANGE, PPB_MEM32_RANGE,
PPB_PMEM32_RANGE, and PPB_PMEM64_RANGE cases.
4. MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumerator.c
- Use PCI_BRIDGE_PRIMARY_BUS_REGISTER_OFFSET,
PCI_BRIDGE_SECONDARY_BUS_REGISTER_OFFSET, and
PCI_BRIDGE_SUBORDINATE_BUS_REGISTER_OFFSET instead of 0x18/0x19/0x1A
when programming and reading the bridge bus-number registers.
5. MdeModulePkg/Bus/Pci/PciBusDxe/PciDeviceSupport.c
- Use PCI_INT_LINE_OFFSET instead of 0x3C when writing the device
Interrupt Line register to 0xFF (no connection / unknown).
References:
- PCI Local Bus Specification, Revision 2.2
- PCI-to-PCI Bridge Architecture Specification, Revision 1.2
- PCI Express Base Specification, Revision 7.0
Cc: Sachin Ganesh <sachinganesh@ami.com>
Cc: Dhanaraj V <vdhanaraj@ami.com>
Cc: Sergiy Yakovlev <sergiyy@ami.com>
Cc: Dhiinesh M <dhiineshm@ami.com>
Signed-off-by: Varun G <varung@ami.com>
Diffstat (limited to 'UnitTestFrameworkPkg/Library/UnitTestPersistenceLibSimpleFileSystem')
0 files changed, 0 insertions, 0 deletions
