1 #ifndef ASM_PCI_H 2 #define ASM_PCI_H 3 /* 4 * Copyright (C) 2013, Red Hat Inc, Michael S. Tsirkin <mst@redhat.com> 5 * 6 * This work is licensed under the terms of the GNU LGPL, version 2. 7 */ 8 #include "libcflat.h" 9 #include "pci.h" 10 #include "x86/asm/io.h" 11 12 static inline uint32_t pci_config_read(pcidevaddr_t dev, uint8_t reg) 13 { 14 uint32_t index = reg | (dev << 8) | (0x1 << 31); 15 outl(index, 0xCF8); 16 return inl(0xCFC); 17 } 18 19 #endif 20