summaryrefslogtreecommitdiffstats
path: root/sys/i386/pci
diff options
context:
space:
mode:
authorkmacy <kmacy@FreeBSD.org>2008-08-15 20:51:31 +0000
committerkmacy <kmacy@FreeBSD.org>2008-08-15 20:51:31 +0000
commit8c05b8ec899e2b20d5eb286770d302b94f0e4536 (patch)
tree01c30bdd7553d9c3ff945b2422e697cffe0f9b20 /sys/i386/pci
parent6bfca819a4bf3b98d63e7f4aaed6fa5b0520008a (diff)
downloadFreeBSD-src-8c05b8ec899e2b20d5eb286770d302b94f0e4536.zip
FreeBSD-src-8c05b8ec899e2b20d5eb286770d302b94f0e4536.tar.gz
Integrate support for xen in to i386 common code.
MFC after: 1 month
Diffstat (limited to 'sys/i386/pci')
-rw-r--r--sys/i386/pci/pci_cfgreg.c10
-rw-r--r--sys/i386/pci/pci_pir.c9
2 files changed, 18 insertions, 1 deletions
diff --git a/sys/i386/pci/pci_cfgreg.c b/sys/i386/pci/pci_cfgreg.c
index e8be305..6c78fd5 100644
--- a/sys/i386/pci/pci_cfgreg.c
+++ b/sys/i386/pci/pci_cfgreg.c
@@ -82,9 +82,11 @@ static struct mtx pcicfg_mtx;
static int pcireg_cfgread(int bus, int slot, int func, int reg, int bytes);
static void pcireg_cfgwrite(int bus, int slot, int func, int reg, int data, int bytes);
+#ifndef XEN
static int pcireg_cfgopen(void);
static int pciereg_cfgopen(void);
+#endif
static int pciereg_cfgread(int bus, int slot, int func, int reg,
int bytes);
static void pciereg_cfgwrite(int bus, int slot, int func, int reg,
@@ -105,6 +107,7 @@ pci_i386_map_intline(int line)
return (line);
}
+#ifndef XEN
static u_int16_t
pcibios_get_version(void)
{
@@ -125,6 +128,7 @@ pcibios_get_version(void)
}
return (args.ebx & 0xffff);
}
+#endif
/*
* Initialise access to PCI configuration space
@@ -132,6 +136,9 @@ pcibios_get_version(void)
int
pci_cfgregopen(void)
{
+#ifdef XEN
+ return (0);
+#else
static int opened = 0;
u_int16_t vid, did;
u_int16_t v;
@@ -175,6 +182,7 @@ pci_cfgregopen(void)
}
return(1);
+#endif
}
/*
@@ -353,6 +361,7 @@ pcireg_cfgwrite(int bus, int slot, int func, int reg, int data, int bytes)
mtx_unlock_spin(&pcicfg_mtx);
}
+#ifndef XEN
/* check whether the configuration mechanism has been correctly identified */
static int
pci_cfgcheck(int maxdev)
@@ -530,6 +539,7 @@ pciereg_cfgopen(void)
devmax = 32;
return (1);
}
+#endif /* !XEN */
#define PCIE_PADDR(bar, reg, bus, slot, func) \
((bar) | \
diff --git a/sys/i386/pci/pci_pir.c b/sys/i386/pci/pci_pir.c
index 52fb62f..c275de0 100644
--- a/sys/i386/pci/pci_pir.c
+++ b/sys/i386/pci/pci_pir.c
@@ -138,6 +138,9 @@ pci_pir_open(void)
int i;
uint8_t ck, *cv;
+#ifdef XEN
+ return;
+#else
/* Don't try if we've already found a table. */
if (pci_route_table != NULL)
return;
@@ -148,7 +151,7 @@ pci_pir_open(void)
sigaddr = bios_sigsearch(0, "_PIR", 4, 16, 0);
if (sigaddr == 0)
return;
-
+#endif
/* If we found something, check the checksum and length. */
/* XXX - Use pmap_mapdev()? */
pt = (struct PIR_table *)(uintptr_t)BIOS_PADDRTOVADDR(sigaddr);
@@ -479,7 +482,11 @@ pci_pir_biosroute(int bus, int device, int func, int pin, int irq)
args.eax = PCIBIOS_ROUTE_INTERRUPT;
args.ebx = (bus << 8) | (device << 3) | func;
args.ecx = (irq << 8) | (0xa + pin);
+#ifdef XEN
+ return (0);
+#else
return (bios32(&args, PCIbios.ventry, GSEL(GCODE_SEL, SEL_KPL)));
+#endif
}
OpenPOWER on IntegriCloud