[PATCH 01/22] bsd: Remove some reference arm code behind #if 0

Adam Jackson ajax at redhat.com
Tue Jul 22 08:46:21 PDT 2014


git history is reference enough, thanks.

Signed-off-by: Adam Jackson <ajax at redhat.com>
---
 hw/xfree86/os-support/bsd/arm_video.c | 139 ----------------------------------
 1 file changed, 139 deletions(-)

diff --git a/hw/xfree86/os-support/bsd/arm_video.c b/hw/xfree86/os-support/bsd/arm_video.c
index 6a977c2..e295c92 100644
--- a/hw/xfree86/os-support/bsd/arm_video.c
+++ b/hw/xfree86/os-support/bsd/arm_video.c
@@ -487,142 +487,3 @@ xf86DisableIO()
 }
 
 #endif                          /* USE_ARC_MMAP */
-
-#if 0
-/*
- * XXX This is here for reference.  It needs to be handled differently for the
- * ND.
- */
-#if defined(USE_ARC_MMAP) || defined(__arm32__)
-
-#ifdef USE_ARM32_MMAP
-#define	DEV_MEM_IOBASE	0x43000000
-#endif
-
-static Bool ScreenEnabled[MAXSCREENS];
-static Bool ExtendedEnabled = FALSE;
-static Bool InitDone = FALSE;
-
-Bool
-xf86EnableIOPorts(ScreenNum)
-int ScreenNum;
-{
-    int i;
-    int fd;
-    void *base;
-
-#ifdef __arm32__
-    struct memAccess *memInfoP;
-    int *Size;
-#endif
-
-    ScreenEnabled[ScreenNum] = TRUE;
-
-    if (ExtendedEnabled)
-        return TRUE;
-
-#ifdef USE_ARC_MMAP
-    if ((fd = open("/dev/ttyC0", O_RDWR)) >= 0) {
-        /* Try to map a page at the pccons I/O space */
-        base = (void *) mmap((caddr_t) 0, 65536, PROT_READ | PROT_WRITE,
-                             MAP_FLAGS, fd, (off_t) 0x0000);
-
-        if (base != (void *) -1) {
-            IOPortBase = base;
-        }
-        else {
-            xf86Msg(X_ERROR,
-                    "EnableIOPorts: failed to mmap %s (%s)\n",
-                    "/dev/ttyC0", strerror(errno));
-        }
-    }
-    else {
-        xf86Msg(X_ERROR, "EnableIOPorts: failed to open %s (%s)\n",
-                "/dev/ttyC0", strerror(errno));
-    }
-#endif
-
-#ifdef __arm32__
-    IOPortBase = (unsigned int) -1;
-
-    if ((memInfoP = checkMapInfo(TRUE, MMIO_REGION)) != NULL) {
-        /* 
-         * xf86MapInfoMap maps an offset from the start of video IO
-         * space (e.g. 0x3B0), but IOPortBase is expected to map to
-         * physical address 0x000, so subtract the start of video I/O
-         * space from the result.  This is safe for now becase we
-         * actually mmap the start of the page, then the start of video
-         * I/O space is added as an internal offset.
-         */
-        IOPortBase = (unsigned int) xf86MapInfoMap(memInfoP, (caddr_t) 0x0, 0L)
-            - memInfoP->memInfo.u.map_info_mmap.internal_offset;
-        ExtendedEnabled = TRUE;
-        return TRUE;
-    }
-#ifdef USE_ARM32_MMAP
-    checkDevMem(TRUE);
-
-    if (devMemFd >= 0 && useDevMem) {
-        base = (void *) mmap((caddr_t) 0, 0x400, PROT_READ | PROT_WRITE,
-                              MAP_FLAGS, devMemFd, (off_t) DEV_MEM_IOBASE);
-
-        if (base != (void *) -1)
-            IOPortBase = (unsigned int) base;
-    }
-
-    if (IOPortBase == (unsigned int) -1) {
-        xf86Msg(X_WARNING,
-                "xf86EnableIOPorts: failed to open mem device or map IO base. \n\
-Make sure you have the Aperture Driver installed, or a kernel built with the INSECURE option\n");
-        return FALSE;
-    }
-#else
-    /* We don't have the IOBASE, so we can't map the address */
-    xf86Msg(X_WARNING,
-            "xf86EnableIOPorts: failed to open mem device or map IO base. \n\
-Try building the server with USE_ARM32_MMAP defined\n");
-    return FALSE;
-#endif
-#endif
-
-    ExtendedEnabled = TRUE;
-
-    return TRUE;
-}
-
-void
-xf86DisableIOPorts(ScreenNum)
-int ScreenNum;
-{
-    int i;
-
-#ifdef __arm32__
-    struct memAccess *memInfoP;
-#endif
-
-    ScreenEnabled[ScreenNum] = FALSE;
-
-#ifdef __arm32__
-    if ((memInfoP = checkMapInfo(FALSE, MMIO_REGION)) != NULL) {
-        xf86MapInfoUnmap(memInfoP, 0);
-    }
-#endif
-
-#ifdef USE_ARM32_MMAP
-    if (!ExtendedEnabled)
-        return;
-
-    for (i = 0; i < MAXSCREENS; i++)
-        if (ScreenEnabled[i])
-            return;
-
-    munmap((caddr_t) IOPortBase, 0x400);
-    IOPortBase = (unsigned int) -1;
-    ExtendedEnabled = FALSE;
-#endif
-
-    return;
-}
-
-#endif                          /* USE_ARC_MMAP || USE_ARM32_MMAP */
-#endif
-- 
1.9.3



More information about the xorg-devel mailing list