开发者

how does macro to get base address register from kernel works

I am trying to understand working of pci_resource_start function So I browsed code via cscope and searched for string pci_resource_start and got following in pci.h

 #define pci_resource_start(dev, bar)    ((dev)->resource[(bar)].start)

I am not able to understand how does this above macro works. How does it above macro gets appropr开发者_高级运维iate base address register in configuration space?


The macro's purpose is merely to improve readability in source code, it does not cause any address to be retrieved. In fact, the address (denoted by the start member) has already been discovered earlier on when the PCI bus and/or device was scanned/initialized. ("Start" in this case also means "start of address range" rather than "begin doing something".) Details of this are most likely to be found in one of the files named pci.c.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜