ia64/xen-unstable

view xen/arch/x86/x86_32/pci.c @ 19835:edfdeb150f27

Fix buildsystem to detect udev > version 124

udev removed the udevinfo symlink from versions higher than 123 and
xen's build-system could not detect if udev is in place and has the
required version.

Signed-off-by: Marc-A. Dahlhaus <mad@wol.de>
author Keir Fraser <keir.fraser@citrix.com>
date Thu Jun 25 13:02:37 2009 +0100 (2009-06-25)
parents 42fe00c6f8b4
children
line source
1 /******************************************************************************
2 * pci.c
3 *
4 * Architecture-dependent PCI access functions.
5 */
7 #include <xen/spinlock.h>
8 #include <xen/pci.h>
9 #include <asm/io.h>
11 #define PCI_CONF_ADDRESS(bus, dev, func, reg) \
12 (0x80000000 | (bus << 16) | (dev << 11) | (func << 8) | (reg & ~3))
14 uint32_t pci_conf_read(uint32_t cf8, uint8_t offset, uint8_t bytes);
15 void pci_conf_write(uint32_t cf8, uint8_t offset, uint8_t bytes, uint32_t data);
17 uint8_t pci_conf_read8(
18 unsigned int bus, unsigned int dev, unsigned int func, unsigned int reg)
19 {
20 BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
21 return pci_conf_read(PCI_CONF_ADDRESS(bus, dev, func, reg), reg & 3, 1);
22 }
24 uint16_t pci_conf_read16(
25 unsigned int bus, unsigned int dev, unsigned int func, unsigned int reg)
26 {
27 BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
28 return pci_conf_read(PCI_CONF_ADDRESS(bus, dev, func, reg), reg & 2, 2);
29 }
31 uint32_t pci_conf_read32(
32 unsigned int bus, unsigned int dev, unsigned int func, unsigned int reg)
33 {
34 BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
35 return pci_conf_read(PCI_CONF_ADDRESS(bus, dev, func, reg), 0, 4);
36 }
38 void pci_conf_write8(
39 unsigned int bus, unsigned int dev, unsigned int func, unsigned int reg,
40 uint8_t data)
41 {
42 BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
43 pci_conf_write(PCI_CONF_ADDRESS(bus, dev, func, reg), reg & 3, 1, data);
44 }
46 void pci_conf_write16(
47 unsigned int bus, unsigned int dev, unsigned int func, unsigned int reg,
48 uint16_t data)
49 {
50 BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
51 pci_conf_write(PCI_CONF_ADDRESS(bus, dev, func, reg), reg & 2, 2, data);
52 }
54 void pci_conf_write32(
55 unsigned int bus, unsigned int dev, unsigned int func, unsigned int reg,
56 uint32_t data)
57 {
58 BUG_ON((bus > 255) || (dev > 31) || (func > 7) || (reg > 255));
59 pci_conf_write(PCI_CONF_ADDRESS(bus, dev, func, reg), 0, 4, data);
60 }
62 int pci_find_ext_capability(int seg, int bus, int devfn, int cap)
63 {
64 return 0;
65 }
67 void acpi_mmcfg_init(void)
68 {
69 return;
70 }