summaryrefslogtreecommitdiff
path: root/hw/xfree86/os-support/bus
diff options
context:
space:
mode:
Diffstat (limited to 'hw/xfree86/os-support/bus')
-rw-r--r--hw/xfree86/os-support/bus/460gxPCI.c1
-rw-r--r--hw/xfree86/os-support/bus/460gxPCI.h1
-rw-r--r--hw/xfree86/os-support/bus/Makefile.am2
-rw-r--r--hw/xfree86/os-support/bus/Pci.c1
-rw-r--r--hw/xfree86/os-support/bus/Pci.h1
-rw-r--r--hw/xfree86/os-support/bus/Sbus.c1
-rw-r--r--hw/xfree86/os-support/bus/axpPci.c1
-rw-r--r--hw/xfree86/os-support/bus/e8870PCI.c1
-rw-r--r--hw/xfree86/os-support/bus/e8870PCI.h1
-rw-r--r--hw/xfree86/os-support/bus/freebsdPci.c1
-rw-r--r--hw/xfree86/os-support/bus/ix86Pci.c1
-rw-r--r--hw/xfree86/os-support/bus/linuxPci.c60
-rw-r--r--hw/xfree86/os-support/bus/netbsdPci.c1
-rw-r--r--hw/xfree86/os-support/bus/ppcPci.c1
-rw-r--r--hw/xfree86/os-support/bus/sparcPci.c1
-rw-r--r--hw/xfree86/os-support/bus/xf86Pci.h1
-rw-r--r--hw/xfree86/os-support/bus/xf86Sbus.h1
-rw-r--r--hw/xfree86/os-support/bus/zx1PCI.c1
-rw-r--r--hw/xfree86/os-support/bus/zx1PCI.h1
19 files changed, 24 insertions, 55 deletions
diff --git a/hw/xfree86/os-support/bus/460gxPCI.c b/hw/xfree86/os-support/bus/460gxPCI.c
index 255dfa12f..44ee97687 100644
--- a/hw/xfree86/os-support/bus/460gxPCI.c
+++ b/hw/xfree86/os-support/bus/460gxPCI.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/460gxPCI.c,v 1.4 2003/08/29 21:08:06 tsi Exp $ */
/*
* Copyright (C) 2002-2003 The XFree86 Project, Inc. All Rights Reserved.
*
diff --git a/hw/xfree86/os-support/bus/460gxPCI.h b/hw/xfree86/os-support/bus/460gxPCI.h
index 65a19b2f0..2905d4787 100644
--- a/hw/xfree86/os-support/bus/460gxPCI.h
+++ b/hw/xfree86/os-support/bus/460gxPCI.h
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/460gxPCI.h,v 1.1 2003/01/02 18:12:48 tsi Exp $ */
/*
* Copyright (C) 2002-2003 The XFree86 Project, Inc. All Rights Reserved.
*
diff --git a/hw/xfree86/os-support/bus/Makefile.am b/hw/xfree86/os-support/bus/Makefile.am
index 308a01b31..c56f3d717 100644
--- a/hw/xfree86/os-support/bus/Makefile.am
+++ b/hw/xfree86/os-support/bus/Makefile.am
@@ -53,6 +53,6 @@ libbus_la_SOURCES = Pci.c Pci.h $(PCI_SOURCES) $(PLATFORM_PCI_SOURCES) \
INCLUDES = $(XORG_INCS)
-AM_CFLAGS = $(XORG_CFLAGS) @SERVER_DEFINES@ @LOADER_DEFINES@
+AM_CFLAGS = $(XORG_CFLAGS)
EXTRA_DIST = $(sdk_HEADERS)
diff --git a/hw/xfree86/os-support/bus/Pci.c b/hw/xfree86/os-support/bus/Pci.c
index 15006e179..ea6ac4ec0 100644
--- a/hw/xfree86/os-support/bus/Pci.c
+++ b/hw/xfree86/os-support/bus/Pci.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.c,v 1.82 2004/01/16 15:39:04 tsi Exp $ */
/*
* Pci.c - New server PCI access functions
*
diff --git a/hw/xfree86/os-support/bus/Pci.h b/hw/xfree86/os-support/bus/Pci.h
index a91c6b27d..0f1af2086 100644
--- a/hw/xfree86/os-support/bus/Pci.h
+++ b/hw/xfree86/os-support/bus/Pci.h
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Pci.h,v 1.45 2004/02/02 03:55:31 dawes Exp $ */
/*
* Copyright 1998 by Concurrent Computer Corporation
*
diff --git a/hw/xfree86/os-support/bus/Sbus.c b/hw/xfree86/os-support/bus/Sbus.c
index 22d84be17..c864e3385 100644
--- a/hw/xfree86/os-support/bus/Sbus.c
+++ b/hw/xfree86/os-support/bus/Sbus.c
@@ -20,7 +20,6 @@
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Sbus.c,v 1.2tsi Exp $ */
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
diff --git a/hw/xfree86/os-support/bus/axpPci.c b/hw/xfree86/os-support/bus/axpPci.c
index 660f008e1..9acc4ab5b 100644
--- a/hw/xfree86/os-support/bus/axpPci.c
+++ b/hw/xfree86/os-support/bus/axpPci.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/axpPci.c,v 1.14 2002/12/11 02:44:28 dawes Exp $ */
/*
* Copyright 1998 by Concurrent Computer Corporation
*
diff --git a/hw/xfree86/os-support/bus/e8870PCI.c b/hw/xfree86/os-support/bus/e8870PCI.c
index 65b0c0474..8e0f95ac0 100644
--- a/hw/xfree86/os-support/bus/e8870PCI.c
+++ b/hw/xfree86/os-support/bus/e8870PCI.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/e8870PCI.c,v 1.2 2003/07/17 15:08:22 tsi Exp $ */
/*
* Copyright (C) 2002-2003 The XFree86 Project, Inc. All Rights Reserved.
*
diff --git a/hw/xfree86/os-support/bus/e8870PCI.h b/hw/xfree86/os-support/bus/e8870PCI.h
index 9efa0ed6d..89726270a 100644
--- a/hw/xfree86/os-support/bus/e8870PCI.h
+++ b/hw/xfree86/os-support/bus/e8870PCI.h
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/e8870PCI.h,v 1.1 2003/02/23 20:26:49 tsi Exp $ */
/*
* Copyright (C) 2002-2003 The XFree86 Project, Inc. All Rights Reserved.
*
diff --git a/hw/xfree86/os-support/bus/freebsdPci.c b/hw/xfree86/os-support/bus/freebsdPci.c
index 2868dafa7..61cb405a8 100644
--- a/hw/xfree86/os-support/bus/freebsdPci.c
+++ b/hw/xfree86/os-support/bus/freebsdPci.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/freebsdPci.c,v 1.4 2002/07/24 19:06:52 tsi Exp $ */
/*
* Copyright 1998 by Concurrent Computer Corporation
*
diff --git a/hw/xfree86/os-support/bus/ix86Pci.c b/hw/xfree86/os-support/bus/ix86Pci.c
index b091ec425..fd7bdf6c8 100644
--- a/hw/xfree86/os-support/bus/ix86Pci.c
+++ b/hw/xfree86/os-support/bus/ix86Pci.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/ix86Pci.c,v 1.25 2003/09/24 02:43:34 dawes Exp $ */
/*
* ix86Pci.c - x86 PCI driver
*
diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c
index 0714c9cea..a3c07f330 100644
--- a/hw/xfree86/os-support/bus/linuxPci.c
+++ b/hw/xfree86/os-support/bus/linuxPci.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/linuxPci.c,v 1.9 2002/09/24 16:14:16 tsi Exp $ */
/*
* Copyright 1998 by Concurrent Computer Corporation
*
@@ -421,7 +420,7 @@ xf86GetPciHostConfigFromTag(PCITAG Tag)
*
* Please keep this table in ascending vendor/device order.
*/
-static struct pciSizes {
+static const struct pciSizes {
unsigned short vendor, device;
unsigned long io_size, mem_size;
} pciControllerSizes[] = {
@@ -444,9 +443,12 @@ static struct pciSizes {
};
#define NUM_SIZES (sizeof(pciControllerSizes) / sizeof(pciControllerSizes[0]))
-static unsigned long
-linuxGetIOSize(PCITAG Tag)
+static const struct pciSizes *
+linuxGetSizesStruct(PCITAG Tag)
{
+ static const struct pciSizes default_size = {
+ 0, 0, 1U << 16, (unsigned long)(1ULL << 32)
+ };
pciConfigPtr pPCI;
int i;
@@ -454,47 +456,31 @@ linuxGetIOSize(PCITAG Tag)
if ((pPCI = xf86GetPciHostConfigFromTag(Tag))) {
/* Look up vendor/device */
for (i = 0; i < NUM_SIZES; i++) {
- if (pPCI->pci_vendor > pciControllerSizes[i].vendor)
- continue;
- if (pPCI->pci_vendor < pciControllerSizes[i].vendor)
- break;
- if (pPCI->pci_device > pciControllerSizes[i].device)
- continue;
- if (pPCI->pci_device < pciControllerSizes[i].device)
- break;
- return pciControllerSizes[i].io_size;
+ if ((pPCI->pci_vendor == pciControllerSizes[i].vendor)
+ && (pPCI->pci_device == pciControllerSizes[i].device)) {
+ return & pciControllerSizes[i];
+ }
}
}
- return 1U << 16; /* Default to 64K */
+ /* Default to 64KB I/O and 4GB memory. */
+ return & default_size;
}
-static void
-linuxGetSizes(PCITAG Tag, unsigned long *io_size, unsigned long *mem_size)
+static __inline__ unsigned long
+linuxGetIOSize(PCITAG Tag)
{
- pciConfigPtr pPCI;
- int i;
+ const struct pciSizes * const sizes = linuxGetSizesStruct(Tag);
+ return sizes->io_size;
+}
- *io_size = (1U << 16); /* Default to 64K */
- *mem_size = (unsigned long)(1ULL << 32); /* Default to 4G */
+static __inline__ void
+linuxGetSizes(PCITAG Tag, unsigned long *io_size, unsigned long *mem_size)
+{
+ const struct pciSizes * const sizes = linuxGetSizesStruct(Tag);
- /* Find host bridge */
- if ((pPCI = xf86GetPciHostConfigFromTag(Tag))) {
- /* Look up vendor/device */
- for (i = 0; i < NUM_SIZES; i++) {
- if (pPCI->pci_vendor > pciControllerSizes[i].vendor)
- continue;
- if (pPCI->pci_vendor < pciControllerSizes[i].vendor)
- break;
- if (pPCI->pci_device > pciControllerSizes[i].device)
- continue;
- if (pPCI->pci_device < pciControllerSizes[i].device)
- break;
- *io_size = pciControllerSizes[i].io_size;
- *mem_size = pciControllerSizes[i].mem_size;
- break;
- }
- }
+ *io_size = sizes->io_size;
+ *mem_size = sizes->mem_size;
}
_X_EXPORT int
diff --git a/hw/xfree86/os-support/bus/netbsdPci.c b/hw/xfree86/os-support/bus/netbsdPci.c
index 7dbbfdec7..ee52c89cc 100644
--- a/hw/xfree86/os-support/bus/netbsdPci.c
+++ b/hw/xfree86/os-support/bus/netbsdPci.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/netbsdPci.c,v 1.4 2003/08/24 17:37:04 dawes Exp $ */
/*
* Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved.
*
diff --git a/hw/xfree86/os-support/bus/ppcPci.c b/hw/xfree86/os-support/bus/ppcPci.c
index 3e5ea3187..49c1a2a39 100644
--- a/hw/xfree86/os-support/bus/ppcPci.c
+++ b/hw/xfree86/os-support/bus/ppcPci.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/ppcPci.c,v 1.8 2002/07/24 19:06:52 tsi Exp $ */
/*
* ppcPci.c - PowerPC PCI access functions
*
diff --git a/hw/xfree86/os-support/bus/sparcPci.c b/hw/xfree86/os-support/bus/sparcPci.c
index 5e0ef5b18..5dd6b9369 100644
--- a/hw/xfree86/os-support/bus/sparcPci.c
+++ b/hw/xfree86/os-support/bus/sparcPci.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/sparcPci.c,v 1.14 2003/08/24 17:37:04 dawes Exp $ */
/*
* Copyright (C) 2001-2003 The XFree86 Project, Inc. All Rights Reserved.
*
diff --git a/hw/xfree86/os-support/bus/xf86Pci.h b/hw/xfree86/os-support/bus/xf86Pci.h
index 69254ce8c..fdb88e832 100644
--- a/hw/xfree86/os-support/bus/xf86Pci.h
+++ b/hw/xfree86/os-support/bus/xf86Pci.h
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Pci.h,v 1.39 2003/08/24 17:37:05 dawes Exp $ */
/*
* Copyright 1998 by Concurrent Computer Corporation
*
diff --git a/hw/xfree86/os-support/bus/xf86Sbus.h b/hw/xfree86/os-support/bus/xf86Sbus.h
index 21b05cba4..cff5e808a 100644
--- a/hw/xfree86/os-support/bus/xf86Sbus.h
+++ b/hw/xfree86/os-support/bus/xf86Sbus.h
@@ -20,7 +20,6 @@
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/xf86Sbus.h,v 1.3 2001/04/20 17:02:43 tsi Exp $ */
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
diff --git a/hw/xfree86/os-support/bus/zx1PCI.c b/hw/xfree86/os-support/bus/zx1PCI.c
index b6a33d27c..d83bc9116 100644
--- a/hw/xfree86/os-support/bus/zx1PCI.c
+++ b/hw/xfree86/os-support/bus/zx1PCI.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/zx1PCI.c,v 1.8 2004/01/16 15:39:38 tsi Exp $ */
/*
* Copyright (C) 2002-2003 The XFree86 Project, Inc. All Rights Reserved.
*
diff --git a/hw/xfree86/os-support/bus/zx1PCI.h b/hw/xfree86/os-support/bus/zx1PCI.h
index 2795b4459..f2b279382 100644
--- a/hw/xfree86/os-support/bus/zx1PCI.h
+++ b/hw/xfree86/os-support/bus/zx1PCI.h
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/zx1PCI.h,v 1.1 2003/02/23 20:26:49 tsi Exp $ */
/*
* Copyright (C) 2002-2003 The XFree86 Project, Inc. All Rights Reserved.
*