diff --git a/hw/xfree86/os-support/bsd/Makefile.am b/hw/xfree86/os-support/bsd/Makefile.am index 7133c0f21..b01ea5bca 100644 --- a/hw/xfree86/os-support/bsd/Makefile.am +++ b/hw/xfree86/os-support/bsd/Makefile.am @@ -27,9 +27,7 @@ if ALPHA_VIDEO # Cheat here and piggyback other alpha bits on ALPHA_VIDEO. ARCH_SOURCES = \ alpha_video.c \ - bsd_ev56.c \ - bsd_axp.c \ - $(srcdir)/../shared/xf86Axp.c + bsd_ev56.c endif if ARM_VIDEO diff --git a/hw/xfree86/os-support/bsd/alpha_video.c b/hw/xfree86/os-support/bsd/alpha_video.c index b65b76289..236def6ff 100644 --- a/hw/xfree86/os-support/bsd/alpha_video.c +++ b/hw/xfree86/os-support/bsd/alpha_video.c @@ -36,8 +36,6 @@ #include #endif -#include "xf86Axp.h" - #include "xf86_OSlib.h" #include "xf86OSpriv.h" @@ -47,43 +45,9 @@ #define MAP_FLAGS (MAP_FILE | MAP_SHARED) #endif -axpDevice bsdGetAXP(void); - #ifndef __NetBSD__ extern unsigned long dense_base(void); - -static int axpSystem = -1; -static unsigned long hae_thresh; -static unsigned long hae_mask; - -static int -has_bwx(void) -{ - static int bwx = 0; - size_t len = sizeof(bwx); - int error; - -#ifdef __OpenBSD__ - int mib[3]; - - mib[0] = CTL_MACHDEP; - mib[1] = CPU_CHIPSET; - mib[2] = CPU_CHIPSET_BWX; - - if ((error = sysctl(mib, 3, &bwx, &len, NULL, 0)) < 0) - return FALSE; - else - return bwx; -#else - if ((error = sysctlbyname("hw.chipset.bwx", &bwx, &len, 0, 0)) < 0) - return FALSE; - else - return bwx; -#endif -} #else /* __NetBSD__ */ -static unsigned long hae_thresh = (1UL << 24); -static unsigned long hae_mask = 0xf8000000UL; /* XXX - should use xf86AXP.c */ static struct alpha_bus_window *abw; static int abw_count = -1; @@ -97,16 +61,6 @@ init_abw(void) } } -static int -has_bwx(void) -{ - if (abw_count < 0) - init_abw(); - - xf86Msg(X_INFO, "has_bwx = %d\n", abw[0].abw_abst.abst_flags & ABST_BWX ? 1 : 0); /* XXXX */ - return abw[0].abw_abst.abst_flags & ABST_BWX; -} - static unsigned long dense_base(void) { @@ -216,18 +170,6 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem) { checkDevMem(TRUE); - if (has_bwx()) { - xf86Msg(X_PROBED, "Machine type has 8/16 bit access\n"); - } - else { - xf86Msg(X_PROBED, "Machine needs sparse mapping\n"); -#ifndef __NetBSD__ - if (axpSystem == -1) - axpSystem = bsdGetAXP(); - hae_thresh = xf86AXPParams[axpSystem].hae_thresh; - hae_mask = xf86AXPParams[axpSystem].hae_mask; -#endif /* __NetBSD__ */ - } pVidMem->initialised = TRUE; } diff --git a/hw/xfree86/os-support/bsd/bsd_axp.c b/hw/xfree86/os-support/bsd/bsd_axp.c deleted file mode 100644 index e7a36f8bf..000000000 --- a/hw/xfree86/os-support/bsd/bsd_axp.c +++ /dev/null @@ -1,71 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include "os.h" -#include "xf86.h" -#include "xf86Priv.h" -#include "shared/xf86Axp.h" -#include -#include "xf86_OSlib.h" -#include -#include - -axpDevice bsdGetAXP(void); - -/* - * BSD does a very nice job providing system information to - * user space programs. Unfortunately it doesn't provide all - * the information required. Therefore we just obtain the - * system type and look up the rest from a list we maintain - * ourselves. - */ - -typedef struct { - char *name; - int type; -} _AXP; - -static _AXP axpList[] = { - {"apecs", APECS}, - {"pyxis", PYXIS}, - {"cia", CIA}, - {"irongate", IRONGATE}, - {"lca", LCA}, - {"t2", T2}, - {"tsunami", TSUNAMI}, - {NULL, SYS_NONE} -}; - -axpDevice -bsdGetAXP(void) -{ - int i; - char sysname[64]; - size_t len = sizeof(sysname); - -#ifdef __OpenBSD__ - int mib[3]; - int error; - - mib[0] = CTL_MACHDEP; - mib[1] = CPU_CHIPSET; - mib[2] = CPU_CHIPSET_TYPE; - - if ((error = sysctl(mib, 3, &sysname, &len, NULL, 0)) < 0) -#else - if ((sysctlbyname("hw.chipset.type", &sysname, &len, 0, 0)) < 0) -#endif - FatalError("bsdGetAXP: can't find machine type\n"); -#ifdef DEBUG - xf86Msg(X_INFO, "AXP is a: %s\n", sysname); -#endif - for (i = 0;; i++) { - if (axpList[i].name == NULL) - return SYS_NONE; - if (!strcmp(sysname, axpList[i].name)) - return axpList[i].type; - } -} diff --git a/hw/xfree86/os-support/linux/Makefile.am b/hw/xfree86/os-support/linux/Makefile.am index 6fd317ae6..50fcd1f28 100644 --- a/hw/xfree86/os-support/linux/Makefile.am +++ b/hw/xfree86/os-support/linux/Makefile.am @@ -2,9 +2,6 @@ noinst_LTLIBRARIES = liblinux.la if LINUX_ALPHA noinst_LTLIBRARIES += liblinuxev56.la -PLATFORM_PCI_SUPPORT = \ - $(srcdir)/lnx_axp.c \ - $(srcdir)/../shared/xf86Axp.c liblinuxev56_la_CFLAGS = $(AM_CFLAGS) -mcpu=ev56 @@ -34,16 +31,12 @@ liblinux_la_SOURCES = lnx_init.c lnx_video.c \ $(srcdir)/../shared/sigio.c \ $(ACPI_SRCS) \ $(APM_SRCS) \ - $(LOGIND_SRCS) \ - $(PLATFORM_PCI_SUPPORT) + $(LOGIND_SRCS) AM_CFLAGS = -DUSESTDRES -DHAVE_SYSV_IPC $(DIX_CFLAGS) $(XORG_CFLAGS) $(PLATFORM_DEFINES) AM_CPPFLAGS = $(XORG_INCS) $(PLATFORM_INCLUDES) $(LIBDRM_CFLAGS) -EXTRA_DIST = \ - $(srcdir)/../shared/xf86Axp.h - if LINUX_ALPHA liblinux_la_LIBADD = liblinuxev56.la endif diff --git a/hw/xfree86/os-support/linux/lnx_axp.c b/hw/xfree86/os-support/linux/lnx_axp.c deleted file mode 100644 index d65a3a487..000000000 --- a/hw/xfree86/os-support/linux/lnx_axp.c +++ /dev/null @@ -1,103 +0,0 @@ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include -#include "xf86.h" -#include "shared/xf86Axp.h" - -axpDevice lnxGetAXP(void); - -typedef struct { - char *sysName; - char *sysVari; - char *cpu; - axpDevice sys; -} AXP; - -static AXP axpList[] = { - {"Tsunami", NULL, NULL, TSUNAMI}, - {"Eiger", NULL, NULL, TSUNAMI}, - {"Noname", NULL, NULL, LCA}, - {"AlphaBook1", NULL, NULL, LCA}, - {"EB66", NULL, NULL, LCA}, - {"EB64+", NULL, NULL, APECS}, - {"Noritake", NULL, "EV5", CIA}, - {"Noritake", NULL, "EV56", CIA}, - {"Noritake", NULL, NULL, APECS}, - {"XL", NULL, NULL, APECS}, - {"Avanti", NULL, NULL, APECS}, - {"Mikasa", NULL, "EV5", CIA}, - {"Mikasa", NULL, "EV56", CIA}, - {"Mikasa", NULL, NULL, APECS}, - {"EB164", "EB164", NULL, CIA}, - {"EB164", "PC164", NULL, CIA}, - {"EB164", "LX164", NULL, PYXIS}, - {"EB164", "SX164", NULL, PYXIS}, - {"EB164", "RX164", NULL, POLARIS}, - {"Alcor", NULL, NULL, CIA}, - {"Takara", NULL, NULL, CIA}, - {"Sable", NULL, "EV5", T2_GAMMA}, - {"Sable", NULL, "EV56", T2_GAMMA}, - {"Sable", NULL, NULL, T2}, - {"Rawhide", NULL, NULL, MCPCIA}, - {"Jensen", NULL, NULL, JENSEN}, - {"Miata", NULL, NULL, PYXIS_CIA}, - {"Ruffian", NULL, NULL, PYXIS_CIA}, - {"Nautilus", NULL, NULL, IRONGATE}, - {NULL, NULL, NULL, SYS_NONE} -}; - -axpDevice -lnxGetAXP(void) -{ - FILE *file; - int count = 0; - char res[256]; - char cpu[255]; - char systype[255]; - char sysvari[255]; - - if (!(file = fopen("/proc/cpuinfo", "r"))) - return SYS_NONE; - do { - if (!fgets(res, 0xff, file)) - return SYS_NONE; - switch (count) { - case 1: - sscanf(res, "cpu model : %s", cpu); - DebugF("CPU %s\n", cpu); - break; - case 5: - sscanf(res, "system type : %s", systype); - DebugF("system type : %s\n", systype); - break; - case 6: - sscanf(res, "system variation : %s", sysvari); - DebugF("system variation: %s\n", sysvari); - break; - } - count++; - } while (count < 8); - - fclose(file); - - count = 0; - - do { - if (!axpList[count].sysName || !strcmp(axpList[count].sysName, systype)) { - if (axpList[count].sysVari && - strcmp(axpList[count].sysVari, sysvari)) { - count++; - continue; - }; - if (axpList[count].cpu && strcmp(axpList[count].cpu, cpu)) { - count++; - continue; - } - return axpList[count].sys; - } - count++; - } while (1); -} diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c index 018d92152..c09d71947 100644 --- a/hw/xfree86/os-support/linux/lnx_video.c +++ b/hw/xfree86/os-support/linux/lnx_video.c @@ -38,9 +38,6 @@ #include "xf86Priv.h" #include "xf86_OSlib.h" #include "xf86OSpriv.h" -#ifdef __alpha__ -#include "shared/xf86Axp.h" -#endif static Bool ExtendedEnabled = FALSE; @@ -68,49 +65,13 @@ extern int iopl(int __level); #endif -#ifdef __alpha__ -#define BUS_BASE bus_base -#else -#define BUS_BASE (0) -#endif /* __alpha__ */ - /***************************************************************************/ /* Video Memory Mapping section */ /***************************************************************************/ -#if defined (__alpha__) -extern void sethae(unsigned long hae); -extern unsigned long _bus_base __P((void)) __attribute__ ((const)); -extern unsigned long _bus_base_sparse __P((void)) __attribute__ ((const)); - -extern axpDevice lnxGetAXP(void); -static axpDevice axpSystem = -1; -static Bool needSparse; -static unsigned long hae_thresh; -static unsigned long hae_mask; -static unsigned long bus_base; -#endif - void xf86OSInitVidMem(VidMemInfoPtr pVidMem) { -#ifdef __alpha__ - if (axpSystem == -1) { - axpSystem = lnxGetAXP(); - if ((needSparse = (_bus_base_sparse() > 0))) { - hae_thresh = xf86AXPParams[axpSystem].hae_thresh; - hae_mask = xf86AXPParams[axpSystem].hae_mask; - } - bus_base = _bus_base(); - } - if (needSparse) { - xf86Msg(X_INFO, "Machine needs sparse mapping\n"); - } - else { - xf86Msg(X_INFO, "Machine type has 8/16 bit access\n"); - } -#endif /* __alpha__ */ - pVidMem->initialised = TRUE; } diff --git a/hw/xfree86/os-support/shared/xf86Axp.c b/hw/xfree86/os-support/shared/xf86Axp.c deleted file mode 100644 index 5f2f3985e..000000000 --- a/hw/xfree86/os-support/shared/xf86Axp.c +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2000 by The XFree86 Project, Inc. - * - * 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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 copyright holder(s) - * and author(s) 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 copyright holder(s) and author(s). - */ - -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#include "xf86Axp.h" - -axpParams xf86AXPParams[] = { - {SYS_NONE, 0, 0, 0} - , - {TSUNAMI, 0, 0, 0} - , - {LCA, 1 << 24, 0xf8000000, 1UL << 32} - , - {APECS, 1 << 24, 0xf8000000, 1UL << 32} - , - {T2, 0, 0xFC000000, 1UL << 31} - , - {T2_GAMMA, 0, 0xFC000000, 1UL << 31} - , - {CIA, 0, 0xE0000000, 1UL << 34} - , - {MCPCIA, 0, 0xf8000000, 1UL << 31} - , - {JENSEN, 0, 0xE000000, 1UL << 32} - , - {POLARIS, 0, 0, 0} - , - {PYXIS, 0, 0, 0} - , - {PYXIS_CIA, 0, 0xE0000000, 1UL << 34} - , - {IRONGATE, 0, 0, 0} -}; diff --git a/hw/xfree86/os-support/shared/xf86Axp.h b/hw/xfree86/os-support/shared/xf86Axp.h deleted file mode 100644 index fded9d8c9..000000000 --- a/hw/xfree86/os-support/shared/xf86Axp.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifdef HAVE_XORG_CONFIG_H -#include -#endif - -#ifndef _XF86_AXP_H_ -#define _XF86_AXP_H_ - -typedef enum { - SYS_NONE, - TSUNAMI, - LCA, - APECS, - T2, - T2_GAMMA, - CIA, - MCPCIA, - JENSEN, - POLARIS, - PYXIS, - PYXIS_CIA, - IRONGATE -} axpDevice; - -typedef struct { - axpDevice id; - unsigned long hae_thresh; - unsigned long hae_mask; - unsigned long size; -} axpParams; - -extern axpParams xf86AXPParams[]; - -#endif