简体   繁体   中英

Where is the funcion 'pci_bus_write_config_dword' defined in linux source code? (linux-5.15.68)

In linux-5.15.68 source tree, I tried to search for the definition of function 'pci_write_config_dword' and this was calling 'pci_bus_write_config_dword'. So using grep, I searched for the defintio of 'pci_bus_write_config_dword' but only found prototype declaration and many places it is called from. Where is that function defined??
Of course I expect it is dependent on the PCIe RC controller and it envolves writing PCIe controller's registers.

See https://elixir.bootlin.com/linux/latest/source/drivers/pci/access.c#L53

As you see, there is a template to create the function at different sizes, very useful to have type checking, but without repeating all code (which it is mostly similar). The @define just after the template will construct the function for different sizes.

It is not the only place you see such construct. In general: if you see few functions with very similar signature and just a different suffix, and you cannot grep it, check if there is a template.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM