Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Dec 2022 19:40:26 -0800
From:      Mark Millard <marklmi@yahoo.com>
To:        Yuri <yuri@aetern.org>
Cc:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   Re: How do I find whatever combination of things end up defining pcib_get_bus(. . .)?
Message-ID:  <7DE1B7B5-9A74-43DC-B3B3-89D91834501B@yahoo.com>
In-Reply-To: <0988689f-4434-f9f3-42c3-9f9622d31022@aetern.org>
References:  <5D802E64-9B2D-4ECB-9889-18C17ED4F788.ref@yahoo.com> <5D802E64-9B2D-4ECB-9889-18C17ED4F788@yahoo.com> <0988689f-4434-f9f3-42c3-9f9622d31022@aetern.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Dec 27, 2022, at 17:41, Yuri <yuri@aetern.org> wrote:

> Mark Millard wrote:
>> # grep -r "\<pcib_get_bus\>" /usr/13S-src/ | more
>> /usr/13S-src/sys/mips/nlm/xlp_pci.c:    busno =3D pcib_get_bus(dev);
>> /usr/13S-src/sys/powerpc/ofw/ofw_pcibus.c:      busno =3D =
pcib_get_bus(dev);
>> /usr/13S-src/sys/dev/pci/pci.c: busno =3D pcib_get_bus(dev);
>> /usr/13S-src/sys/dev/pci/pci.c: busno =3D pcib_get_bus(dev);
>> /usr/13S-src/sys/dev/pci/pci.c: busno =3D 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 =3D pcib_get_bus(cbdev);
>> /usr/13S-src/sys/dev/hyperv/pcib/vmbus_pcib.c:  busno =3D =
pcib_get_bus(dev);
>> /usr/13S-src/sys/dev/pccbb/pccbb.c:             b =3D =
pcib_get_bus(child);
>> /usr/13S-src/sys/dev/pccbb/pccbb_pci.c: sc->pribus =3D =
pcib_get_bus(parent);
>> /usr/13S-src/sys/x86/pci/qpi.c:         *result =3D =
pcib_get_bus(dev);
>> /usr/13S-src/sys/x86/pci/pci_bus.c:     bus =3D pcib_get_bus(dev);
>> /usr/13S-src/sys/x86/iommu/intel_drv.c:                 *busno =3D =
pcib_get_bus(bus);
>>=20
>> Everything found is a use, not a definition. (I also tried:
>> # grep -r "\<pcib_get_bus\>" /usr/obj/BUILDs/13S-CA72-nodbg-clang/ .)
>>=20
>> 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 .
>>=20
>> So, hopefully, someone can point me to what I've missed.
>=20
> See __BUS_ACCESSOR() macro in sys/bus.h (I had to have a bit of fun =
with
> `cc -E` to get at it).

Thanks.

Looks like could have explored with just PCIB_ and found:

/usr/13S-src/sys/dev/pci/pcivar.h:#define       PCIB_ACCESSOR(var, ivar, =
type)                                   \
/usr/13S-src/sys/dev/pci/pcivar.h:PCIB_ACCESSOR(domain,         DOMAIN,  =
       uint32_t)
/usr/13S-src/sys/dev/pci/pcivar.h:PCIB_ACCESSOR(bus,            BUS,     =
       uint32_t)
/usr/13S-src/sys/dev/pci/pcivar.h:#undef PCIB_ACCESSOR

and the #define line would have shown:

#define PCIB_ACCESSOR(var, ivar, type)                                   =
\
    __BUS_ACCESSOR(pcib, var, PCIB, ivar, type)

But in everything I did I was explicit about "get" as part of the
text I explored with.

=3D=3D=3D
Mark Millard
marklmi at yahoo.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7DE1B7B5-9A74-43DC-B3B3-89D91834501B>