Esempio n. 1
0
func pciReadConfReg(bus, dev, function, offset uint32) (value uint32) {
	address := pciBuildAddress(bus, dev, function, offset)

	C.outl(C.uint(address), PciAddrPort)

	value = uint32(C.inl(PciDataPort))

	return value
}
Esempio n. 2
0
func pciReadConfReg(bus, dev, function, offset uint32) (value uint32) {
	address := 0x80000000 |
		bus&PciBusMask<<16 |
		dev&PciDevMask<<11 |
		function&PciFuncMask<<8 |
		offset&PciRegMask

	C.outl(C.uint(address), PciAddrPort)

	value = uint32(C.inl(PciDataPort))

	return
}