Re: How do I find whatever combination of things end up defining pcib_get_bus(. . .)?

From: Yuri <yuri_at_aetern.org>
Date: Wed, 28 Dec 2022 01:41:21 UTC
Mark Millard wrote:
> # grep -r "\<pcib_get_bus\>" /usr/13S-src/ | more
> /usr/13S-src/sys/mips/nlm/xlp_pci.c:    busno = pcib_get_bus(dev);
> /usr/13S-src/sys/powerpc/ofw/ofw_pcibus.c:      busno = pcib_get_bus(dev);
> /usr/13S-src/sys/dev/pci/pci.c: busno = pcib_get_bus(dev);
> /usr/13S-src/sys/dev/pci/pci.c: busno = pcib_get_bus(dev);
> /usr/13S-src/sys/dev/pci/pci.c: busno = pcib_get_bus(dev);
> /usr/13S-src/sys/dev/cardbus/cardbus.c:     pcib_get_bus(cbdev), pcib_get_bus(cbdev), 1, 0);
> /usr/13S-src/sys/dev/cardbus/cardbus.c: bus = pcib_get_bus(cbdev);
> /usr/13S-src/sys/dev/hyperv/pcib/vmbus_pcib.c:  busno = pcib_get_bus(dev);
> /usr/13S-src/sys/dev/pccbb/pccbb.c:             b = pcib_get_bus(child);
> /usr/13S-src/sys/dev/pccbb/pccbb_pci.c: sc->pribus = pcib_get_bus(parent);
> /usr/13S-src/sys/x86/pci/qpi.c:         *result = pcib_get_bus(dev);
> /usr/13S-src/sys/x86/pci/pci_bus.c:     bus = pcib_get_bus(dev);
> /usr/13S-src/sys/x86/iommu/intel_drv.c:                 *busno = pcib_get_bus(bus);
> 
> Everything found is a use, not a definition. (I also tried:
> # grep -r "\<pcib_get_bus\>" /usr/obj/BUILDs/13S-CA72-nodbg-clang/ .)
> 
> Historically I've managed to eventually track down definitions
> are are less direct, such as ones that are formed via macros
> that put together names. But, so far, I've not managed to for
> pcib_get_bus .
> 
> So, hopefully, someone can point me to what I've missed.

See __BUS_ACCESSOR() macro in sys/bus.h (I had to have a bit of fun with
`cc -E` to get at it).