Files
reactos/hal
Hermès Bélusca-Maïto 0d6369af12 [FREELDR][HALX86][SDK] Improve PCI_REGISTRY_INFO::NoBuses handling when 256 PCI buses are on the system (#9614)
SDK `pci.h`:

- Document the fact that `PCI_REGISTRY_INFO::NoBuses` wraps when the
  highest bus number is 255 (i.e. there are 256 PCI buses on the system).

- Introduce a `PCI_GET_NUM_OF_BUSES()` helper macro for retrieving the
  corrected number of buses from the `PCI_REGISTRY_INFO` structure.

  Rationale:
  `PCI_REGISTRY_INFO::NoBuses` is a `UCHAR` (0-255). Thus, this member
  would wrap to 0 for a system having exactly the maximum number of
  allowed PCI buses (256).
  In order to distinguish this case from the one where no PCI system
  (and no bus) is present, verify the `Major/MinorRevision` values.
  If they are initialized (and `NoBuses == 0`), this means that the
  system actually has 256 buses.


FreeLdr:

Add a Doxygen block for `hwpci.c!DetectPciBus()` and use the
`PCI_GET_NUM_OF_BUSES()` macro.


HalX86:

- Change the `PCI_REGISTRY_INFO_INTERNAL::NoBuses` member type to `USHORT`,
  so as to allow describing 256 PCI buses.

- Make `pcibus.c!HalpQueryPciRegistryInfo()` use the `PCI_GET_NUM_OF_BUSES()`
  macro for initializing the internal `NoBuses` value from the retrieved
  PCI registry information.

- Adjust the `BusCount` parameter type in the `HalpGetPciBridgeConfig()`
  and `HalpFixupPciSupportedRanges()` functions (bussupp.c).

- Minor comments fixes (bussupp.c).
2026-10-10 21:48:15 +02:00
..
2023-12-03 00:07:53 +02:00