mirror of
https://github.com/reactos/reactos.git
synced 2026-11-22 23:45:58 +08:00
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).