MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pcireg_cfgwrite

Function pcireg_cfgwrite

freebsd/amd64/pci/pci_cfgreg.c:190–212  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

188}
189
190static void
191pcireg_cfgwrite(int bus, int slot, int func, int reg, int data, int bytes)
192{
193 int port;
194
195 mtx_lock_spin(&pcicfg_mtx);
196 port = pci_cfgenable(bus, slot, func, reg, bytes);
197 if (port != 0) {
198 switch (bytes) {
199 case 1:
200 outb(port, data);
201 break;
202 case 2:
203 outw(port, data);
204 break;
205 case 4:
206 outl(port, data);
207 break;
208 }
209 pci_cfgdisable();
210 }
211 mtx_unlock_spin(&pcicfg_mtx);
212}
213
214int
215pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus)

Callers 1

pci_cfgregwriteFunction · 0.70

Calls 5

pci_cfgenableFunction · 0.70
pci_cfgdisableFunction · 0.70
outbFunction · 0.50
outwFunction · 0.50
outlFunction · 0.50

Tested by

no test coverage detected