Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define PCI_CONFIG_DATA 0x0CFC
- #define PCI_CONFIG_ADDRESS 0x0CF8
- uint32_t pci_config_readd(pci_bdf_t addr,uint offset) {
- int bus=addr.bus;
- int dev=addr.dev;
- int func=addr.func;
- uint32_t val;
- int address = 0x80000000|(bus<<16)|(dev<<11)|(func<<8)|(offset&0xFC);
- outl(PCI_CONFIG_ADDRESS,address);
- val = inl(PCI_CONFIG_DATA);
- return val;
- }
- uint barOffset = 0x010; //Bar 0
- uint32_t pci_read=pci_config_readd(addr,barOffset);
- const uint8_t *pci=(uint8_t*)((uint32_t)(pci_read & 0xFFFFFF00));
Advertisement
Add Comment
Please, Sign In to add comment