Example #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
}
Example #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
}
Example #3
0
func pciWriteConfReg(bus, dev, function, offset, value uint32) {
	address := pciBuildAddress(bus, dev, function, offset)

	C.outl(C.uint(address), PciAddrPort)
	C.outl(C.uint(value), PciDataPort)
}