示例#1
0
文件: pciconfig.go 项目: gyn/mass
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
}
示例#2
0
文件: pcidumper.go 项目: gyn/mass
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
}
示例#3
0
文件: pciconfig.go 项目: gyn/mass
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)
}