xref: /kvm-unit-tests/lib/x86/asm/pci.h (revision 9ae19a633c0484a56df69cd2d4487242f3f27587)
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/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