Module Name: src Committed By: riastradh Date: Mon Mar 3 19:02:31 UTC 2025
Modified Files: src/sys/dev/acpi: acpi_mcfg.c src/sys/dev/pci: pci_resource.c pci_resource.h Log Message: pci_resource(9): Handle multiple ranges of the same type. Rather than having the caller fill in an array indexed by range type of a single start/end pair for each type, the caller will now do: struct pci_resource_info info; memset(&info, 0, sizeof(info)); pci_resource_add_range(&info, PCI_RANGE_MEM, mstart1, mend1); pci_resource_add_range(&info, PCI_RANGE_MEM, mstart2, mend2); pci_resource_add_range(&info, PCI_RANGE_MEM, mstart3, mend3); pci_resource_add_range(&info, PCI_RANGE_PMEM, pstart1, pend1); pci_resource_add_range(&info, PCI_RANGE_IO, iostart1, ioend1); ... While here, fix a format string -- 0x% or %# is enough to say that the output is hexadecimal; we don't need to belabour the point by printing a `0x0x' prefix! XXX While this handles multiple io/mem/prefetchable-mem ranges, it doesn't yet handle multiple bus ranges, which we have seen in practice, e.g. on orion o6. TBD. ok jmcneill@ PR port-amd64/59118: Thinkpad T495s - iwm PCI BAR is zero To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/dev/acpi/acpi_mcfg.c cvs rdiff -u -r1.5 -r1.6 src/sys/dev/pci/pci_resource.c cvs rdiff -u -r1.1 -r1.2 src/sys/dev/pci/pci_resource.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.