xserver: Branch 'master' - 4 commits
Eric Anholt
anholt at kemper.freedesktop.org
Tue Aug 28 12:05:48 PDT 2007
configure.ac | 34 ----
hw/xfree86/common/xf86.h | 6
hw/xfree86/common/xf86Bus.c | 215 -----------------------------
hw/xfree86/fbdevhw/fbdevhwstub.c | 5
hw/xfree86/loader/xf86sym.c | 2
hw/xfree86/os-support/bsd/bsdResource.c | 99 -------------
hw/xfree86/os-support/bus/Makefile.am | 8 -
hw/xfree86/os-support/bus/Pci.c | 18 --
hw/xfree86/os-support/bus/Pci.h | 41 +----
hw/xfree86/os-support/bus/axpPci.c | 28 ---
hw/xfree86/os-support/bus/bsd_pci.c | 84 +++++++++++
hw/xfree86/os-support/bus/freebsdPci.c | 164 ----------------------
hw/xfree86/os-support/bus/linuxPci.c | 43 -----
hw/xfree86/os-support/bus/netbsdPci.c | 129 -----------------
hw/xfree86/os-support/bus/sparcPci.c | 48 ------
hw/xfree86/os-support/linux/lnxResource.c | 178 ------------------------
hw/xfree86/os-support/shared/stdResource.c | 62 --------
hw/xfree86/os-support/xf86_OSproc.h | 8 -
18 files changed, 105 insertions(+), 1067 deletions(-)
New commits:
diff-tree adf46b57ce6c69ab13a38b09a8104c802d54d052 (from 3fe67d23edaae3ddde20cd5f349aa5dfde1d26a3)
Author: Eric Anholt <eric at anholt.net>
Date: Tue Aug 28 10:08:38 2007 -0700
Replace BSD custom PCI code with a stub implementation thanks to pciaccess.
Note that pciaccess doesn't yet have Net/OpenBSD support, but the relevant
code should go there instead of disconnected code in the X Server.
While here, remove the now-disabled INCLUDE_XF86_NO_DOMAIN from the headers,
and un-disable xf8StdAccResFromOS for those OSes without domain support which
will need it.
diff --git a/configure.ac b/configure.ac
index 6d7db2d..1f3743f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1287,8 +1287,7 @@ XORG_CORE_LIBS="$DIX_LIB $CONFIG_LIB"
AC_SUBST([XORG_CORE_LIBS])
xorg_bus_linuxpci=no
-xorg_bus_freebsdpci=no
-xorg_bus_netbsdpci=no
+xorg_bus_bsdpci=no
xorg_bus_ix86pci=no
xorg_bus_ppcpci=no
xorg_bus_sparcpci=no
@@ -1397,35 +1396,17 @@ return 0;}
freebsd* | kfreebsd*-gnu)
XORG_OS="freebsd"
XORG_OS_SUBDIR="bsd"
- case $host_cpu in
- i*86)
- ;;
- *)
- xorg_bus_freebsdpci="yes"
- ;;
- esac
+ xorg_bus_bsdpci="yes"
;;
netbsd*)
XORG_OS="netbsd"
XORG_OS_SUBDIR="bsd"
- case $host_cpu in
- i*86|amd64*|x86_64*|ia64*)
- ;;
- *)
- xorg_bus_netbsdpci="yes"
- ;;
- esac
+ xorg_bus_bsdpci="yes"
;;
openbsd*)
XORG_OS="openbsd"
XORG_OS_SUBDIR="bsd"
- case $host_cpu in
- i*86|amd64*|x86_64*|ia64*)
- ;;
- *)
- xorg_bus_freebsdpci="yes"
- ;;
- esac
+ xorg_bus_bsdpci="yes"
;;
solaris*)
XORG_OS="solaris"
@@ -1495,6 +1476,7 @@ return 0;}
i*86)
case $host_os in
darwin*) ;;
+ *bsd*) ;;
*) xorg_bus_ix86pci=yes ;;
esac
;;
@@ -1513,8 +1495,7 @@ return 0;}
;;
x86_64*|amd64*)
case $host_os in
- darwin*|freebsd*|kfreebsd*-gnu)
- # FreeBSD uses the system pci interface
+ darwin*|*bsd*)
;;
*)
xorg_bus_ix86pci="yes"
@@ -1608,8 +1589,7 @@ return 0;}
fi
AM_CONDITIONAL([XORG], [test "x$XORG" = xyes])
AM_CONDITIONAL([XORG_BUS_LINUXPCI], [test "x$xorg_bus_linuxpci" = xyes])
-AM_CONDITIONAL([XORG_BUS_FREEBSDPCI], [test "x$xorg_bus_freebsdpci" = xyes])
-AM_CONDITIONAL([XORG_BUS_NETBSDPCI], [test "x$xorg_bus_netbsdpci" = xyes])
+AM_CONDITIONAL([XORG_BUS_BSDPCI], [test "x$xorg_bus_bsdpci" = xyes])
AM_CONDITIONAL([XORG_BUS_IX86PCI], [test "x$xorg_bus_ix86pci" = xyes])
AM_CONDITIONAL([XORG_BUS_PPCPCI], [test "x$xorg_bus_ppcpci" = xyes])
AM_CONDITIONAL([XORG_BUS_SPARCPCI], [test "x$xorg_bus_sparcpci" = xyes])
diff --git a/hw/xfree86/os-support/bus/Makefile.am b/hw/xfree86/os-support/bus/Makefile.am
index fba6e54..381b992 100644
--- a/hw/xfree86/os-support/bus/Makefile.am
+++ b/hw/xfree86/os-support/bus/Makefile.am
@@ -7,12 +7,8 @@ if XORG_BUS_LINUXPCI
PCI_SOURCES += linuxPci.c
endif
-if XORG_BUS_FREEBSDPCI
-PCI_SOURCES += freebsdPci.c
-endif
-
-if XORG_BUS_NETBSDPCI
-PCI_SOURCES += netbsdPci.c
+if XORG_BUS_BSDPCI
+PCI_SOURCES += bsd_pci.c
endif
if XORG_BUS_IX86PCI
diff --git a/hw/xfree86/os-support/bus/Pci.c b/hw/xfree86/os-support/bus/Pci.c
index 31e9023..a34ed99 100644
--- a/hw/xfree86/os-support/bus/Pci.c
+++ b/hw/xfree86/os-support/bus/Pci.c
@@ -286,21 +286,3 @@ xf86scanpci(void)
return success;
}
-
-#ifdef INCLUDE_XF86_NO_DOMAIN
-
-_X_EXPORT pointer
-xf86MapDomainMemory(int ScreenNum, int Flags, struct pci_device *dev,
- ADDRESS Base, unsigned long Size)
-{
- return xf86MapVidMem(ScreenNum, Flags, Base, Size);
-}
-
-IOADDRESS
-xf86MapLegacyIO(struct pci_device *dev)
-{
- (void) dev;
- return 0;
-}
-
-#endif /* INCLUDE_XF86_NO_DOMAIN */
diff --git a/hw/xfree86/os-support/bus/Pci.h b/hw/xfree86/os-support/bus/Pci.h
index 632a7a0..bb93260 100644
--- a/hw/xfree86/os-support/bus/Pci.h
+++ b/hw/xfree86/os-support/bus/Pci.h
@@ -184,35 +184,30 @@
#define PCI_CFGMECH1_MAXDEV 32
+#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || \
+ defined(__DragonFly__)
+#define ARCH_PCI_INIT bsdPciInit
+#endif
+
+#if !defined(ARCH_PCI_INIT)
/*
* Select architecture specific PCI init function
*/
#if defined(__alpha__)
# if defined(linux)
# define ARCH_PCI_INIT axpPciInit
-# elif defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__)
-# define ARCH_PCI_INIT freebsdPciInit
-# define INCLUDE_XF86_NO_DOMAIN
-# elif defined(__NetBSD__)
-# define ARCH_PCI_INIT netbsdPciInit
-# define INCLUDE_XF86_NO_DOMAIN
# endif
#elif defined(__arm__)
# if defined(linux)
# define ARCH_PCI_INIT linuxPciInit
-# define INCLUDE_XF86_NO_DOMAIN
# endif
#elif defined(__hppa__)
# if defined(linux)
# define ARCH_PCI_INIT linuxPciInit
-# define INCLUDE_XF86_NO_DOMAIN
# endif
#elif defined(__ia64__)
# if defined(linux)
# define ARCH_PCI_INIT ia64linuxPciInit
-# elif defined(FreeBSD)
-# define ARCH_PCI_INIT freebsdPciInit
-# define INCLUDE_XF86_NO_DOMAIN
# endif
# define XF86SCANPCI_WRAPPER ia64ScanPCIWrapper
#elif defined(__i386__) || defined(i386)
@@ -221,70 +216,50 @@
# else
# define ARCH_PCI_INIT ix86PciInit
# endif
-# define INCLUDE_XF86_NO_DOMAIN
#elif defined(__mc68000__)
# if defined(linux)
# define ARCH_PCI_INIT linuxPciInit
-# define INCLUDE_XF86_NO_DOMAIN
# endif
#elif defined(__mips__)
# if defined(linux)
# define ARCH_PCI_INIT linuxPciInit
-# define INCLUDE_XF86_NO_DOMAIN
# endif
#elif defined(__powerpc__) || defined(__powerpc64__)
# if defined(linux)
# define ARCH_PCI_INIT linuxPciInit
-# define INCLUDE_XF86_NO_DOMAIN /* Needs kernel work to remove */
-# elif defined(__FreeBSD__) || defined(__OpenBSD__)
-# define ARCH_PCI_INIT freebsdPciInit
-# define INCLUDE_XF86_NO_DOMAIN
-# elif defined(__NetBSD__)
-# define ARCH_PCI_INIT netbsdPciInit
-# define INCLUDE_XF86_NO_DOMAIN
# else
# define ARCH_PCI_INIT ppcPciInit
-# define INCLUDE_XF86_NO_DOMAIN
# endif
#elif defined(__s390__)
# if defined(linux)
# define ARCH_PCI_INIT linuxPciInit
-# define INCLUDE_XF86_NO_DOMAIN
# endif
#elif defined(__sh__)
# if defined(linux)
# define ARCH_PCI_INIT linuxPciInit
-# define INCLUDE_XF86_NO_DOMAIN
# endif
#elif defined(__sparc__) || defined(sparc)
# if defined(linux)
# define ARCH_PCI_INIT linuxPciInit
# elif defined(sun)
# define ARCH_PCI_INIT sparcPciInit
-# elif (defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(__sparc64__)
-# define ARCH_PCI_INIT freebsdPciInit
-# define INCLUDE_XF86_NO_DOMAIN
# endif
# if !defined(__FreeBSD__) && !defined(linux)
# define ARCH_PCI_PCI_BRIDGE sparcPciPciBridge
# endif
#elif defined(__amd64__) || defined(__amd64)
-# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
-# define ARCH_PCI_INIT freebsdPciInit
-# elif defined(linux)
+# if defined(linux)
# define ARCH_PCI_INIT linuxPciInit
# else
# define ARCH_PCI_INIT ix86PciInit
# endif
-# define INCLUDE_XF86_NO_DOMAIN
#endif
+#endif /* !defined(ARCH_PCI_INIT) */
#ifndef ARCH_PCI_INIT
#error No PCI support available for this architecture/OS combination
#endif
-#undef INCLUDE_XF86_NO_DOMAIN
-
extern void ARCH_PCI_INIT(void);
#if defined(XF86SCANPCI_WRAPPER)
diff --git a/hw/xfree86/os-support/bus/bsd_pci.c b/hw/xfree86/os-support/bus/bsd_pci.c
new file mode 100644
index 0000000..bceb108
--- /dev/null
+++ b/hw/xfree86/os-support/bus/bsd_pci.c
@@ -0,0 +1,84 @@
+/*
+ * Copyright © 2007 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER 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.
+ *
+ * Authors:
+ * Eric Anholt <eric at anholt.net>
+ *
+ */
+
+/**
+ * @file bsd_pci.c
+ *
+ * This is a trivial implementation of the remaining PCI support hooks in the
+ * X Server that is unaware of domains.
+ *
+ * Most of even this should go away once drivers are converted and the
+ * old interfaces are confirmed to all be obsolete.
+ */
+
+#ifdef HAVE_XORG_CONFIG_H
+#include <xorg-config.h>
+#endif
+
+#include <stdio.h>
+#include "compiler.h"
+#include "xf86.h"
+#include "xf86Priv.h"
+#include "xf86_OSlib.h"
+#include "Pci.h"
+
+#include "pciaccess.h"
+
+static pciBusFuncs_t bsd_funcs = {
+ .pciAddrBusToHost = pciAddrNOOP,
+};
+
+static pciBusInfo_t bsd_pci = {
+ .configMech = PCI_CFG_MECH_OTHER,
+ .numDevices = 32,
+ .secondary = FALSE,
+ .primary_bus = 0,
+ .funcs = &bsd_funcs,
+ .pciBusPriv = NULL,
+ .bridge = NULL,
+};
+
+_X_EXPORT pointer
+xf86MapDomainMemory(int ScreenNum, int Flags, struct pci_device *dev,
+ ADDRESS Base, unsigned long Size)
+{
+ return xf86MapVidMem(ScreenNum, Flags, Base, Size);
+}
+
+IOADDRESS
+xf86MapLegacyIO(struct pci_device *dev)
+{
+ (void)dev;
+ return 0;
+}
+
+void
+bsdPciInit(void)
+{
+ pciNumBuses = 1;
+ pciBusInfo[0] = &bsd_pci;
+}
diff --git a/hw/xfree86/os-support/bus/freebsdPci.c b/hw/xfree86/os-support/bus/freebsdPci.c
deleted file mode 100644
index ff11c72..0000000
--- a/hw/xfree86/os-support/bus/freebsdPci.c
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * Copyright 1998 by Concurrent Computer Corporation
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Concurrent Computer
- * Corporation not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Concurrent Computer Corporation makes no representations
- * about the suitability of this software for any purpose. It is
- * provided "as is" without express or implied warranty.
- *
- * CONCURRENT COMPUTER CORPORATION DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL CONCURRENT COMPUTER CORPORATION BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- *
- * Copyright 1998 by Metro Link Incorporated
- *
- * Permission to use, copy, modify, distribute, and sell this software
- * and its documentation for any purpose is hereby granted without fee,
- * provided that the above copyright notice appear in all copies and that
- * both that copyright notice and this permission notice appear in
- * supporting documentation, and that the name of Metro Link
- * Incorporated not be used in advertising or publicity pertaining to
- * distribution of the software without specific, written prior
- * permission. Metro Link Incorporated makes no representations
- * about the suitability of this software for any purpose. It is
- * provided "as is" without express or implied warranty.
- *
- * METRO LINK INCORPORATED DISCLAIMS ALL WARRANTIES WITH REGARD
- * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- * AND FITNESS, IN NO EVENT SHALL METRO LINK INCORPORATED BE
- * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY
- * DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
- * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
- * SOFTWARE.
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <stdio.h>
-#include "compiler.h"
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86_OSlib.h"
-#include "Pci.h"
-
-#include <sys/pciio.h>
-
-/*
- * freebsd platform specific PCI access functions -- using /dev/pci
- * needs kernel version 2.2.x
- */
-static CARD32 freebsdPciCfgRead(PCITAG tag, int off);
-static void freebsdPciCfgWrite(PCITAG, int off, CARD32 val);
-static void freebsdPciCfgSetBits(PCITAG tag, int off, CARD32 mask, CARD32 bits);
-
-static pciBusFuncs_t freebsdFuncs0 = {
-/* pciReadLong */ freebsdPciCfgRead,
-/* pciWriteLong */ freebsdPciCfgWrite,
-/* pciSetBitsLong */ freebsdPciCfgSetBits,
-/* pciAddrHostToBus */ pciAddrNOOP,
-/* pciAddrBusToHost */ pciAddrNOOP
-};
-
-static pciBusInfo_t freebsdPci0 = {
-/* configMech */ PCI_CFG_MECH_OTHER,
-/* numDevices */ 32,
-/* secondary */ FALSE,
-/* primary_bus */ 0,
-/* funcs */ &freebsdFuncs0,
-/* pciBusPriv */ NULL,
-/* bridge */ NULL
-};
-
-#if !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__DragonFly__)
-#if X_BYTE_ORDER == X_BIG_ENDIAN
-#ifdef __sparc__
-#ifndef ASI_PL
-#define ASI_PL 0x88
-#endif
-#define PCI_CPU(val) ({ \
-int __ret; \
-__asm__ __volatile__("lduwa [%1] %2, %0" : "=r" (__ret) : "r" (&val), "i" (ASI_PL)); \
-__ret; \
-})
-#else
-#define PCI_CPU(val) (((val >> 24) & 0x000000ff) | \
- ((val >> 8) & 0x0000ff00) | \
- ((val << 8) & 0x00ff0000) | \
- ((val << 24) & 0xff000000))
-#endif
-#else
-#define PCI_CPU(val) (val)
-#endif
-#else /* ! OpenBSD */
-/* OpenBSD has already the bytes in the right order
- for all architectures */
-#define PCI_CPU(val) (val)
-#endif
-
-
-#define BUS(tag) (((tag)>>16)&0xff)
-#define DFN(tag) (((tag)>>8)&0xff)
-
-static int pciFd = -1;
-
-void
-freebsdPciInit()
-{
- pciFd = open("/dev/pci", O_RDWR);
- if (pciFd < 0)
- return;
-
- pciNumBuses = 1;
- pciBusInfo[0] = &freebsdPci0;
-}
-
-static CARD32
-freebsdPciCfgRead(PCITAG tag, int off)
-{
- struct pci_io io;
- int error;
- io.pi_sel.pc_bus = BUS(tag);
- io.pi_sel.pc_dev = DFN(tag) >> 3;
- io.pi_sel.pc_func = DFN(tag) & 7;
- io.pi_reg = off;
- io.pi_width = 4;
- error = ioctl(pciFd, PCIOCREAD, &io);
- if (error)
- return ~0;
- return PCI_CPU(io.pi_data);
-}
-
-static void
-freebsdPciCfgWrite(PCITAG tag, int off, CARD32 val)
-{
- struct pci_io io;
- io.pi_sel.pc_bus = BUS(tag);
- io.pi_sel.pc_dev = DFN(tag) >> 3;
- io.pi_sel.pc_func = DFN(tag) & 7;
- io.pi_reg = off;
- io.pi_width = 4;
- io.pi_data = PCI_CPU(val);
- ioctl(pciFd, PCIOCWRITE, &io);
-}
-
-static void
-freebsdPciCfgSetBits(PCITAG tag, int off, CARD32 mask, CARD32 bits)
-{
- CARD32 val = freebsdPciCfgRead(tag, off);
- val = (val & ~mask) | (bits & mask);
- freebsdPciCfgWrite(tag, off, val);
-}
diff --git a/hw/xfree86/os-support/bus/netbsdPci.c b/hw/xfree86/os-support/bus/netbsdPci.c
deleted file mode 100644
index 7603027..0000000
--- a/hw/xfree86/os-support/bus/netbsdPci.c
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person
- * obtaining a copy of this software and associated documentation
- * files (the "Software"), to deal in the Software without
- * restriction, including without limitation the rights to use, copy,
- * modify, merge, publish, distribute, sublicense, and/or sell copies
- * of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
- * included in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE
- * FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 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.
- *
- * Except as contained in this notice, the name of the XFree86 Project
- * shall not be used in advertising or otherwise to promote the sale,
- * use or other dealings in this Software without prior written
- * authorization from the XFree86 Project.
- */
-
-#ifdef HAVE_XORG_CONFIG_H
-#include <xorg-config.h>
-#endif
-
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <dev/pci/pciio.h>
-
-#include "xf86.h"
-#include "xf86Priv.h"
-#include "xf86OSpriv.h"
-
-#include "Pci.h"
-
-static CARD32 netbsdPciConfRead(PCITAG, int);
-static void netbsdPciConfWrite(PCITAG, int, CARD32);
-static void netbsdPciSetBits(PCITAG, int, CARD32, CARD32);
-
-static int devpci = -1;
-
-static pciBusFuncs_t netbsdFuncs0 = {
-/* pciReadLong */ netbsdPciConfRead,
-/* pciWriteLong */ netbsdPciConfWrite,
-/* pciSetBitsLong */ netbsdPciSetBits,
-/* pciAddrHostToBus */ pciAddrNOOP,
-/* pciAddrBusToHost */ pciAddrNOOP
-};
-
-static pciBusInfo_t netbsdPci0 = {
-/* configMech */ PCI_CFG_MECH_OTHER,
-/* numDevices */ 32,
-/* secondary */ FALSE,
-/* primary_bus */ 0,
-/* funcs */ &netbsdFuncs0,
-/* pciBusPriv */ NULL,
-/* bridge */ NULL
-};
-
-void
-netbsdPciInit()
-{
- struct pciio_businfo pci_businfo;
-
- devpci = open("/dev/pci0", O_RDWR);
- if (devpci == -1)
- FatalError("netbsdPciInit: can't open /dev/pci0\n");
-
- pciNumBuses = 1;
- pciBusInfo[0] = &netbsdPci0;
- /* use businfo to get the number of devs */
- if (ioctl(devpci, PCI_IOC_BUSINFO, &pci_businfo) != 0)
- FatalError("netbsdPciInit: not a PCI bus device");
- netbsdPci0.numDevices = pci_businfo.maxdevs;
-}
-
-static CARD32
-netbsdPciConfRead(PCITAG tag, int reg)
-{
- struct pciio_bdf_cfgreg bdfr;
-
- bdfr.bus = PCI_BUS_FROM_TAG(tag);
- bdfr.device = PCI_DEV_FROM_TAG(tag);
- bdfr.function = PCI_FUNC_FROM_TAG(tag);
- bdfr.cfgreg.reg = reg;
-
- if (ioctl(devpci, PCI_IOC_BDF_CFGREAD, &bdfr) == -1)
- FatalError("netbsdPciConfRead: failed on %d/%d/%d\n",
- bdfr.bus, bdfr.device, bdfr.function);
-
- return (bdfr.cfgreg.val);
-}
-
-static void
-netbsdPciConfWrite(PCITAG tag, int reg, CARD32 val)
-{
- struct pciio_bdf_cfgreg bdfr;
-
- bdfr.bus = PCI_BUS_FROM_TAG(tag);
- bdfr.device = PCI_DEV_FROM_TAG(tag);
- bdfr.function = PCI_FUNC_FROM_TAG(tag);
- bdfr.cfgreg.reg = reg;
- bdfr.cfgreg.val = val;
-
- if (ioctl(devpci, PCI_IOC_BDF_CFGWRITE, &bdfr) == -1)
- FatalError("netbsdPciConfWrite: failed on %d/%d/%d\n",
- bdfr.bus, bdfr.device, bdfr.function);
-}
-
-static void
-netbsdPciSetBits(PCITAG tag, int reg, CARD32 mask, CARD32 bits)
-{
- CARD32 val;
-
- val = netbsdPciConfRead(tag, reg);
- val = (val & ~mask) | (bits & mask);
- netbsdPciConfWrite(tag, reg, val);
-}
diff --git a/hw/xfree86/os-support/shared/stdResource.c b/hw/xfree86/os-support/shared/stdResource.c
index 51d1a2a..2e5c2cf 100644
--- a/hw/xfree86/os-support/shared/stdResource.c
+++ b/hw/xfree86/os-support/shared/stdResource.c
@@ -43,14 +43,13 @@
/* Avoid Imakefile changes */
#include "bus/Pci.h"
-#ifdef USESTDRES
+#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || \
+ defined(__DragonFly__)
#define xf86StdAccResFromOS xf86AccResFromOS
_X_EXPORT resRange PciAvoid[] = {_PCI_AVOID_PC_STYLE, _END};
#endif
-#ifdef INCLUDE_XF86_NO_DOMAIN
-
resPtr
xf86StdAccResFromOS(resPtr ret)
{
@@ -117,5 +116,3 @@ xf86StdAccResFromOS(resPtr ret)
/* XXX add others */
return ret;
}
-
-#endif /* INCLUDE_XF86_NO_DOMAIN */
diff-tree 3fe67d23edaae3ddde20cd5f349aa5dfde1d26a3 (from 9e2112b2b56af099a7f380ece9b5c1d25b20cce4)
Author: Eric Anholt <eric at anholt.net>
Date: Mon Aug 27 19:02:41 2007 -0700
Remove the BusAccWindows resource code which is now unused.
This was a bunch of poorly defined resource ranges per OS/platform combination
which were supposed to represent what regions could potentially have resources
allocated into them.
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 1959f79..3dc08f8 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -77,9 +77,6 @@ static resPtr AccReducers = NULL;
resPtr Acc = NULL;
resPtr osRes = NULL;
-/* allocatable ranges */
-resPtr ResRange = NULL;
-
/* predefined special resources */
_X_EXPORT resRange resVgaExclusive[] = {_VGA_EXCLUSIVE, _END};
_X_EXPORT resRange resVgaShared[] = {_VGA_SHARED, _END};
@@ -1366,11 +1363,6 @@ xf86ResourceBrokerInit(void)
osRes = NULL;
- /* Get the addressable ranges */
- ResRange = xf86BusAccWindowsFromOS();
- xf86MsgVerb(X_INFO, 3, "Addressable bus resource ranges are\n");
- xf86PrintResList(3, ResRange);
-
/* Get the ranges used exclusively by the system */
osRes = xf86AccResFromOS(osRes);
xf86MsgVerb(X_INFO, 3, "OS-reported resource ranges:\n");
diff --git a/hw/xfree86/os-support/bsd/bsdResource.c b/hw/xfree86/os-support/bsd/bsdResource.c
index 37749c9..5868634 100644
--- a/hw/xfree86/os-support/bsd/bsdResource.c
+++ b/hw/xfree86/os-support/bsd/bsdResource.c
@@ -24,59 +24,6 @@ _X_EXPORT resRange PciAvoid[] = {_PCI_AV
#if defined(__alpha__) || defined(__sparc64__) || defined(__amd64__)
resPtr
-xf86BusAccWindowsFromOS(void)
-{
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-resPtr
-xf86PciBusAccWindowsFromOS(void)
-{
- resPtr ret = NULL;
- resRange range;
-
- /*
- * Only allow the upper half of the pci memory range to be used
- * for allocation. The lower half includes magic regions for DMA.
- * XXX this is not right for XP1000's and similar where we use the
- * region 0x40000000-0xbfffffff for DMA but this only matters if
- * the bios screws up the pci region mappings.
- */
- RANGE(range, 0x80000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-#ifdef INCLUDE_UNUSED
-
-resPtr
-xf86IsaBusAccWindowsFromOS(void)
-{
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-#endif /* INCLUDE_UNUSED */
-
-resPtr
xf86AccResFromOS(resPtr ret)
{
resRange range;
@@ -118,52 +65,6 @@ xf86AccResFromOS(resPtr ret)
#elif defined(__powerpc__)
resPtr
-xf86BusAccWindowsFromOS(void)
-{
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-resPtr
-xf86PciBusAccWindowsFromOS(void)
-{
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-#ifdef INCLUDE_UNUSED
-
-resPtr
-xf86IsaBusAccWindowsFromOS(void)
-{
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-#endif /* INCLUDE_UNUSED */
-
-resPtr
xf86AccResFromOS(resPtr ret)
{
resRange range;
diff --git a/hw/xfree86/os-support/bus/axpPci.c b/hw/xfree86/os-support/bus/axpPci.c
index e2f086c..c59c068 100644
--- a/hw/xfree86/os-support/bus/axpPci.c
+++ b/hw/xfree86/os-support/bus/axpPci.c
@@ -363,34 +363,6 @@ xf86MapLegacyIO(struct pci_device *dev)
}
resPtr
-xf86PciBusAccWindowsFromOS(void)
-{
- resPtr pRes = NULL;
- resRange range;
- int domain;
-
- for(domain = 0; domain < pciNumDomains; domain++) {
- if (!xf86DomainInfo[domain]) continue;
-
- RANGE(range, 0, 0xffffffffUL,
- RANGE_TYPE(ResExcMemBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
-
- RANGE(range, 0, 0x0000ffffUL,
- RANGE_TYPE(ResExcIoBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
- }
-
- return pRes;
-}
-
-resPtr
-xf86BusAccWindowsFromOS(void)
-{
- return xf86PciBusAccWindowsFromOS();
-}
-
-resPtr
xf86AccResFromOS(resPtr pRes)
{
resRange range;
diff --git a/hw/xfree86/os-support/bus/linuxPci.c b/hw/xfree86/os-support/bus/linuxPci.c
index b88fae6..11eb4f9 100644
--- a/hw/xfree86/os-support/bus/linuxPci.c
+++ b/hw/xfree86/os-support/bus/linuxPci.c
@@ -549,49 +549,6 @@ xf86MapLegacyIO(struct pci_device *dev)
}
resPtr
-xf86BusAccWindowsFromOS(void)
-{
- struct pci_device *dev;
- struct pci_device_iterator *iter;
- resPtr pRes = NULL;
- resRange range;
-
- iter = pci_id_match_iterator_create(& match_host_bridge);
- while ((dev = pci_device_next(iter)) != NULL) {
- const int domain = dev->domain;
- const struct pciSizes * const sizes = linuxGetSizesStruct(dev);
-
- RANGE(range, 0, (ADDRESS)(sizes->mem_size - 1),
- RANGE_TYPE(ResExcMemBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
-
- RANGE(range, 0, (IOADDRESS)(sizes->io_size - 1),
- RANGE_TYPE(ResExcIoBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
-
- /* FIXME: The old code reserved domain 0 for a special purpose. The
- * FIXME: new code just uses whatever domains the kernel tells it,
- * FIXME: but there is no way to get a domain < 0. What should
- * FIXME: happen here?
- *
- if (domain <= 0)
- break;
- */
- }
-
- pci_iterator_destroy(iter);
-
- return pRes;
-}
-
-resPtr
-xf86PciBusAccWindowsFromOS(void)
-{
- return xf86BusAccWindowsFromOS();
-}
-
-
-resPtr
xf86AccResFromOS(resPtr pRes)
{
struct pci_device *dev;
diff --git a/hw/xfree86/os-support/bus/sparcPci.c b/hw/xfree86/os-support/bus/sparcPci.c
index 82b1d89..6f7113f 100644
--- a/hw/xfree86/os-support/bus/sparcPci.c
+++ b/hw/xfree86/os-support/bus/sparcPci.c
@@ -649,54 +649,6 @@ xf86MapLegacyIO(int ScreenNum, int Flags
}
resPtr
-xf86BusAccWindowsFromOS(void)
-{
- sparcDomainPtr pDomain;
- resPtr pRes = NULL;
- resRange range;
- int domain;
-
- for (domain = 1; domain < pciNumDomains; domain++) {
- if (!(pDomain = xf86DomainInfo[domain]))
- continue;
-
- RANGE(range, 0, pDomain->mem_size - 1,
- RANGE_TYPE(ResExcMemBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
-
- RANGE(range, 0, pDomain->io_size - 1,
- RANGE_TYPE(ResExcIoBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
- }
-
- return pRes;
-}
-
-resPtr
-xf86PciBusAccWindowsFromOS(void)
-{
- sparcDomainPtr pDomain;
- resPtr pRes = NULL;
- resRange range;
- int domain;
-
- for (domain = 1; domain < pciNumDomains; domain++) {
- if (!(pDomain = xf86DomainInfo[domain]))
- continue;
-
- RANGE(range, 0, pDomain->mem_size - 1,
- RANGE_TYPE(ResExcMemBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
-
- RANGE(range, 0, pDomain->io_size - 1,
- RANGE_TYPE(ResExcIoBlock, domain));
- pRes = xf86AddResToList(pRes, &range, -1);
- }
-
- return pRes;
-}
-
-resPtr
xf86AccResFromOS(resPtr pRes)
{
sparcDomainPtr pDomain;
diff --git a/hw/xfree86/os-support/linux/lnxResource.c b/hw/xfree86/os-support/linux/lnxResource.c
index 6f89cdb..bb42d8a 100644
--- a/hw/xfree86/os-support/linux/lnxResource.c
+++ b/hw/xfree86/os-support/linux/lnxResource.c
@@ -31,121 +31,6 @@ _X_EXPORT resRange PciAvoid[] =
#ifdef __alpha__
resPtr
-xf86BusAccWindowsFromOS(void)
-{
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-resPtr
-xf86PciBusAccWindowsFromOS(void)
-{
- resPtr ret = NULL;
- resRange range;
- /*
- * On the Alpha the first 16MB of every 128 Mb segment in
- * sparse address space are an image of the ISA bus range
- */
- if (_bus_base_sparse()) {
- RANGE(range, 0x00000000, 0x07ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x09000000, 0x0fffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x11000000, 0x17ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x19000000, 0x1fffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x21000000, 0x27ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x29000000, 0x2fffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x31000000, 0x37ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x39000000, 0x3fffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x41000000, 0x47ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x49000000, 0x4fffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x51000000, 0x57ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x59000000, 0x5fffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x61000000, 0x67ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x69000000, 0x6fffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x71000000, 0x77ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x79000000, 0x7fffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x81000000, 0x87ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x89000000, 0x8fffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x91000000, 0x97ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0x99000000, 0x9fffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xa1000000, 0xa7ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xa9000000, 0xafffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xb1000000, 0xb7ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xb9000000, 0xbfffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xc1000000, 0xc7ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xc9000000, 0xcfffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xd1000000, 0xd7ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xd9000000, 0xdfffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xe1000000, 0xe7ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xe9000000, 0xefffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xf1000000, 0xf7ffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- RANGE(range, 0xf9000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- } else {
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
- }
- RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-#ifdef INCLUDE_UNUSED
-
-resPtr
-xf86IsaBusAccWindowsFromOS(void)
-{
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-#endif /* INCLUDE_UNUSED */
-
-resPtr
xf86AccResFromOS(resPtr ret)
{
resRange range;
@@ -193,69 +78,6 @@ xf86AccResFromOS(resPtr ret)
defined(__s390__) || \
defined(__hppa__)
- /*
- * XXX this isn't exactly correct but it will get the server working
- * for now until we get something better.
- */
-
-resPtr
-xf86BusAccWindowsFromOS(void)
-{
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
-#if defined(__sparc__) || defined(__powerpc__)
- RANGE(range, 0x00000000, 0x00ffffff, ResExcIoBlock);
-#else
- RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
-#endif
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-resPtr
-xf86PciBusAccWindowsFromOS(void)
-{
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
-#if defined(__sparc__) || defined(__powerpc__)
- RANGE(range, 0x00000000, 0x00ffffff, ResExcIoBlock);
-#else
- RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
-#endif
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-#ifdef INCLUDE_UNUSED
-
-resPtr
-xf86IsaBusAccWindowsFromOS(void)
-{
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
-#if defined(__sparc__) || defined(__powerpc__)
- RANGE(range, 0x00000000, 0x00ffffff, ResExcIoBlock);
-#else
- RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
-#endif
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-#endif /* INCLUDE_UNUSED */
-
resPtr
xf86AccResFromOS(resPtr ret)
{
diff --git a/hw/xfree86/os-support/shared/stdResource.c b/hw/xfree86/os-support/shared/stdResource.c
index 555f805..51d1a2a 100644
--- a/hw/xfree86/os-support/shared/stdResource.c
+++ b/hw/xfree86/os-support/shared/stdResource.c
@@ -44,10 +44,7 @@
#include "bus/Pci.h"
#ifdef USESTDRES
-#define xf86StdBusAccWindowsFromOS xf86BusAccWindowsFromOS
#define xf86StdAccResFromOS xf86AccResFromOS
-#define xf86StdPciBusAccWindowsFromOS xf86PciBusAccWindowsFromOS
-#define xf86StdIsaBusAccWindowsFromOS xf86IsaBusAccWindowsFromOS
_X_EXPORT resRange PciAvoid[] = {_PCI_AVOID_PC_STYLE, _END};
#endif
@@ -55,58 +52,6 @@ _X_EXPORT resRange PciAvoid[] = {_PCI_AV
#ifdef INCLUDE_XF86_NO_DOMAIN
resPtr
-xf86StdBusAccWindowsFromOS(void)
-{
- /* Fallback is to allow addressing of all memory space */
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- /* Fallback is to allow addressing of all I/O space */
- RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-resPtr
-xf86StdPciBusAccWindowsFromOS(void)
-{
- /* Fallback is to allow addressing of all memory space */
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- /* Fallback is to allow addressing of all I/O space */
- RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-#ifdef INCLUDE_UNUSED
-
-resPtr
-xf86StdIsaBusAccWindowsFromOS(void)
-{
- /* Fallback is to allow addressing of all memory space */
- resPtr ret = NULL;
- resRange range;
-
- RANGE(range, 0x00000000, 0xffffffff, ResExcMemBlock);
- ret = xf86AddResToList(ret, &range, -1);
-
- /* Fallback is to allow addressing of all I/O space */
- RANGE(range, 0x00000000, 0x0000ffff, ResExcIoBlock);
- ret = xf86AddResToList(ret, &range, -1);
- return ret;
-}
-
-#endif /* INCLUDE_UNUSED */
-
-resPtr
xf86StdAccResFromOS(resPtr ret)
{
resRange range;
diff --git a/hw/xfree86/os-support/xf86_OSproc.h b/hw/xfree86/os-support/xf86_OSproc.h
index 6f0391d..1d6b842 100644
--- a/hw/xfree86/os-support/xf86_OSproc.h
+++ b/hw/xfree86/os-support/xf86_OSproc.h
@@ -228,17 +228,9 @@ extern PMClose xf86OSPMOpen(void);
#ifdef NEED_OS_RAC_PROTOS
/* RAC-related privs */
/* internal to os-support layer */
-resPtr xf86StdBusAccWindowsFromOS(void);
-resPtr xf86StdPciAccWindowsFromOS(void);
-resPtr xf86StdIsaAccWindowsFromOS(void);
resPtr xf86StdAccResFromOS(resPtr ret);
/* available to the common layer */
-resPtr xf86BusAccWindowsFromOS(void);
-resPtr xf86PciBusAccWindowsFromOS(void);
-#ifdef INCLUDE_UNUSED
-resPtr xf86IsaBusAccWindowsFromOS(void);
-#endif
resPtr xf86AccResFromOS(resPtr ret);
#endif /* NEED_OS_RAC_PROTOS */
diff-tree 9e2112b2b56af099a7f380ece9b5c1d25b20cce4 (from 801c359574d08ff2d6ac75a3325ff522bc862e30)
Author: Eric Anholt <eric at anholt.net>
Date: Mon Aug 27 18:50:34 2007 -0700
Remove unused xf8GetBlock and xf86GetSparse entry points.
diff --git a/hw/xfree86/common/xf86.h b/hw/xfree86/common/xf86.h
index 69d619e..0641074 100644
--- a/hw/xfree86/common/xf86.h
+++ b/hw/xfree86/common/xf86.h
@@ -138,12 +138,6 @@ Bool xf86IsEntityPrimary(int entityIndex
resPtr xf86ReallocatePciResources(int entityIndex, resPtr pRes);
resPtr xf86SetOperatingState(resList list, int entityIndex, int mask);
void xf86EnterServerState(xf86State state);
-resRange xf86GetBlock(unsigned long type, memType size,
- memType window_start, memType window_end,
- memType align_mask, resPtr avoid);
-resRange xf86GetSparse(unsigned long type, memType fixed_bits,
- memType decode_mask, memType address_mask,
- resPtr avoid);
memType xf86ChkConflict(resRange *rgp, int entityIndex);
ScrnInfoPtr xf86FindScreenForEntity(int entityIndex);
Bool xf86NoSharedResources(int screenIndex, resType res);
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 537ddf7..1959f79 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -1549,213 +1549,6 @@ RemoveOverlaps(resPtr target, resPtr lis
#endif
/*
- * Resource request code
- */
-
-#define ALIGN(x,a) ((x) + a) &~(a)
-
-_X_EXPORT resRange
-xf86GetBlock(unsigned long type, memType size,
- memType window_start, memType window_end,
- memType align_mask, resPtr avoid)
-{
- memType min, max, tmp;
- resRange r = {ResEnd,0,0};
- resPtr res_range = ResRange;
-
- if (!size) return r;
- if (window_end < window_start || (window_end - window_start) < (size - 1)) {
- ErrorF("Requesting insufficient memory window!:"
- " start: 0x%lx end: 0x%lx size 0x%lx\n",
- window_start,window_end,size);
- return r;
- }
- type = (type & ~(ResExtMask | ResBios | ResEstimated)) | ResBlock;
-
- while (res_range) {
- if ((type & ResTypeMask) == (res_range->res_type & ResTypeMask)) {
- if (res_range->block_begin > window_start)
- min = res_range->block_begin;
- else
- min = window_start;
- if (res_range->block_end < window_end)
- max = res_range->block_end;
- else
- max = window_end;
- min = ALIGN(min,align_mask);
- /* do not produce an overflow! */
- while (min < max && (max - min) >= (size - 1)) {
- RANGE(r,min,min + size - 1,type);
- tmp = ChkConflict(&r,Acc,SETUP);
- if (!tmp) {
- tmp = ChkConflict(&r,avoid,SETUP);
- if (!tmp) {
- return r;
- }
- }
- min = ALIGN(tmp,align_mask);
- }
- }
- res_range = res_range->next;
- }
- RANGE(r,0,0,ResEnd);
- return r;
-}
-
-#define mt_max ~(memType)0
-#define length sizeof(memType) * 8
-/*
- * make_base() -- assign the lowest bits to the bits set in mask.
- * example: mask 011010 val 0000110 -> 011000
- */
-static memType
-make_base(memType val, memType mask)
-{
- int i,j = 0;
- memType ret = 0
- ;
- for (i = 0;i<length;i++) {
- if ((1 << i) & mask) {
- ret |= (((val >> j) & 1) << i);
- j++;
- }
- }
- return ret;
-}
-
-/*
- * make_base() -- assign the bits set in mask to the lowest bits.
- * example: mask 011010 , val 010010 -> 000011
- */
-static memType
-unmake_base(memType val, memType mask)
-{
- int i,j = 0;
- memType ret = 0;
-
- for (i = 0;i<length;i++) {
- if ((1 << i) & mask) {
- ret |= (((val >> i) & 1) << j);
- j++;
- }
- }
- return ret;
-}
-
-static memType
-fix_counter(memType val, memType old_mask, memType mask)
-{
- mask = old_mask & mask;
-
- val = make_base(val,old_mask);
- return unmake_base(val,mask);
-}
-
-_X_EXPORT resRange
-xf86GetSparse(unsigned long type, memType fixed_bits,
- memType decode_mask, memType address_mask, resPtr avoid)
-{
- resRange r = {ResEnd,0,0};
- memType new_mask;
- memType mask1;
- memType base;
- memType counter = 0;
- memType counter1;
- memType max_counter = ~(memType)0;
- memType max_counter1;
- memType conflict = 0;
-
- /* for sanity */
- type = (type & ~(ResExtMask | ResBios | ResEstimated)) | ResSparse;
-
- /*
- * a sparse address consists of 3 parts:
- * fixed_bits: F bits which hard decoded by the hardware
- * decode_bits: D bits which are used to decode address
- * but which may be set by software
- * address_bits: A bits which are used to address the
- * sparse range.
- * the decode_mask marks all decode bits while the address_mask
- * masks out all address_bits:
- * F D A
- * decode_mask: 0 1 0
- * address_mask: 1 1 0
- */
- decode_mask &= address_mask;
- new_mask = decode_mask;
-
- /*
- * We start by setting the decode_mask bits to different values
- * when a conflict is found the address_mask of the conflicting
- * resource is returned. We remove those bits from decode_mask
- * that are also set in the returned address_mask as they always
- * conflict with resources which use them as address masks.
- * The resoulting mask is stored in new_mask.
- * We continue until no conflict is found or until we have
- * tried all possible settings of new_mask.
- */
- while (1) {
- base = make_base(counter,new_mask) | fixed_bits;
- RANGE(r,base,address_mask,type);
- conflict = ChkConflict(&r,Acc,SETUP);
- if (!conflict) {
- conflict = ChkConflict(&r,avoid,SETUP);
- if (!conflict) {
- return r;
- }
- }
- counter = fix_counter(counter,new_mask,conflict);
- max_counter = fix_counter(max_counter,new_mask,conflict);
- new_mask &= conflict;
- counter ++;
- if (counter > max_counter) break;
- }
- if (!new_mask && (new_mask == decode_mask)) {
- RANGE(r,0,0,ResEnd);
- return r;
- }
- /*
- * if we haven't been successful we also try to modify those
- * bits in decode_mask that are not at the same time set in
- * new mask. These bits overlap with address_bits of some
- * resources. If a conflict with a resource of this kind is
- * found (ie. returned_mask & mask1 != mask1) with
- * mask1 = decode_mask & ~new_mask we cannot
- * use our choice of bits in the new_mask part. We try
- * another choice.
- */
- max_counter = fix_counter(mt_max,mt_max,new_mask);
- mask1 = decode_mask & ~new_mask;
- max_counter1 = fix_counter(mt_max,mt_max,mask1);
- counter = 0;
-
- while (1) {
- counter1 = 0;
- while (1) {
- base = make_base(counter1,mask1);
- RANGE(r,base,address_mask,type);
- conflict = ChkConflict(&r,Acc,SETUP);
- if (!conflict) {
- conflict = ChkConflict(&r,avoid,SETUP);
- if (!conflict) {
- return r;
- }
- }
- counter1 ++;
- if ((mask1 & conflict) != mask1 || counter1 > max_counter1)
- break;
- }
- counter ++;
- if (counter > max_counter) break;
- }
- RANGE(r,0,0,ResEnd);
- return r;
-}
-
-#undef length
-#undef mt_max
-
-/*
* Resource registrarion
*/
diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c
index 9b8dac8..cb2a2b9 100644
--- a/hw/xfree86/loader/xf86sym.c
+++ b/hw/xfree86/loader/xf86sym.c
@@ -333,8 +333,6 @@ _X_HIDDEN void *xfree86LookupTab[] = {
SYMFUNC(xf86IsEntityPrimary)
SYMFUNC(xf86SetOperatingState)
SYMFUNC(xf86EnterServerState)
- SYMFUNC(xf86GetBlock)
- SYMFUNC(xf86GetSparse)
SYMFUNC(xf86ChkConflict)
SYMFUNC(xf86FindScreenForEntity)
SYMFUNC(xf86RegisterStateChangeNotificationCallback)
diff-tree 801c359574d08ff2d6ac75a3325ff522bc862e30 (from 7d54399cfdaa7f54e28828267a76b89c4e8e798f)
Author: Eric Anholt <eric at anholt.net>
Date: Mon Aug 27 15:46:05 2007 -0700
Fix fbdevhwstub for pci-rework.
diff --git a/hw/xfree86/fbdevhw/fbdevhwstub.c b/hw/xfree86/fbdevhw/fbdevhwstub.c
index 56ba929..191a6d3 100644
--- a/hw/xfree86/fbdevhw/fbdevhwstub.c
+++ b/hw/xfree86/fbdevhw/fbdevhwstub.c
@@ -1,4 +1,3 @@
-
#ifdef HAVE_XORG_CONFIG_H
#include <xorg-config.h>
#endif
@@ -23,13 +22,13 @@ fbdevHWFreeRec(ScrnInfoPtr pScrn)
Bool
-fbdevHWProbe(pciVideoPtr pPci, char *device, char **namep)
+fbdevHWProbe(struct pci_device *pPci, char *device, char **namep)
{
return FALSE;
}
Bool
-fbdevHWInit(ScrnInfoPtr pScrn, pciVideoPtr pPci, char *device)
+fbdevHWInit(ScrnInfoPtr pScrn, struct pci_device *pPci, char *device)
{
xf86Msg(X_ERROR, "fbdevhw is not available on this platform\n");
return FALSE;
More information about the xorg-commit
mailing list