[Xorg-commit] xc/programs/Xserver/hw/xfree86/os-support/bsd alpha_video.c,1.1.4.1,1.1.4.2 bsd_kbd.c,1.1.4.1,1.1.4.2 bsd_mouse.c,1.1.4.1,1.1.4.2

Kaleb Keithley xorg-commit at pdx.freedesktop.org
Wed May 9 17:30:30 EEST 2007


Committed by: kaleb

Update of /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/bsd
In directory pdx:/home/kaleb/xorg/xc.XORG-CURRENT/programs/Xserver/hw/xfree86/os-support/bsd

Modified Files:
      Tag: XORG-CURRENT
	alpha_video.c bsd_kbd.c bsd_mouse.c 
Log Message:
merge most of XFree86 RC3 (4.3.99.903) from vendor branch.
bug #214


Index: alpha_video.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/bsd/alpha_video.c,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/alpha_video.c	26 Nov 2003 22:49:01 -0000	1.1.4.1
+++ b/alpha_video.c	23 Feb 2004 21:36:45 -0000	1.1.4.2
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/alpha_video.c,v 1.5 2003/04/03 16:50:04 dawes Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/alpha_video.c,v 1.6 2003/12/30 15:18:30 herrb Exp $ */
 /*
  * Copyright 1992 by Rich Murphey <Rich at Rice.edu>
  * Copyright 1993 by David Wexelblat <dwex at goblin.org>
@@ -121,7 +121,7 @@
 static int abw_count = -1;
 
 static void
-init_abw()
+init_abw(void)
 {
 	if (abw_count < 0) {
 		abw_count = alpha_bus_getwindows(ALPHA_BUS_TYPE_PCI_MEM, &abw);
@@ -142,7 +142,7 @@
 }
 
 static unsigned long
-dense_base()
+dense_base(void)
 {
 	if (abw_count < 0)
 		init_abw();
@@ -154,7 +154,7 @@
 }
 
 static unsigned long
-memory_base()
+memory_base(void)
 {
 	if (abw_count < 0)
 		init_abw();
@@ -284,11 +284,13 @@
 	    xf86Msg(X_PROBED,"Machine needs sparse mapping\n");
 	    pVidMem->mapMem = mapVidMemSparse;
 	    pVidMem->unmapMem = unmapVidMemSparse;
+#ifndef __NetBSD__
 	    if (axpSystem == -1)
                 axpSystem = bsdGetAXP(); 
 	    hae_thresh = xf86AXPParams[axpSystem].hae_thresh;
             hae_mask = xf86AXPParams[axpSystem].hae_mask;
             sparse_size = xf86AXPParams[axpSystem].size;
+#endif /* __NetBSD__ */
 	}
 	pVidMem->initialised = TRUE;
 }
@@ -314,7 +316,7 @@
 			 MAP_FLAGS, devMemFd, (off_t)Base + BUS_BASE_BWX);
 	    if (base == MAP_FAILED)
 	    {
-		FatalError("%s: could not mmap %s [s=%x,a=%x] (%s)\n",
+		FatalError("%s: could not mmap %s [s=%lx,a=%lx] (%s)\n",
 			   "xf86MapVidMem", DEV_MEM, Size, Base, 
 			   strerror(errno));
 	    }
@@ -324,7 +326,7 @@
 	/* else, mmap /dev/vga */
 	if ((unsigned long)Base < 0xA0000 || (unsigned long)Base >= 0xC0000)
 	{
-		FatalError("%s: Address 0x%x outside allowable range\n",
+		FatalError("%s: Address 0x%lx outside allowable range\n",
 			   "xf86MapVidMem", Base);
 	}
 	base = mmap(0, Size,
@@ -372,7 +374,7 @@
 	if ((long)ptr == -1)
 	{
 		xf86Msg(X_WARNING, 
-			"xf86ReadBIOS: %s mmap[s=%x,a=%x,o=%x] failed (%s)\n",
+			"xf86ReadBIOS: %s mmap[s=%x,a=%lx,o=%lx] failed (%s)\n",
 			DEV_MEM, Len, Base, Offset, strerror(errno));
 		return(-1);
 	}
@@ -446,7 +448,9 @@
 
 #define vuip    volatile unsigned int *
 
+#ifndef __NetBSD__
 static unsigned long msb_set = 0;
+#endif
 static pointer memSBase = 0;
 static pointer memBase = 0;
 
@@ -490,6 +494,7 @@
 	u_int64_t hae;
 };
 
+#ifndef __NetBSD__
 static int
 sethae(u_int64_t hae)
 {
@@ -505,6 +510,7 @@
 	return -1;
 #endif
 }
+#endif /* __NetBSD__ */
 
 static pointer
 mapVidMemSparse(int ScreenNum, unsigned long Base, unsigned long Size, int flags)
@@ -552,11 +558,13 @@
 readSparse8(pointer Base, register unsigned long Offset)
 {
     register unsigned long result, shift;
+#ifndef __NetBSD__
     register unsigned long msb;
-
+#endif
     mem_barrier();
     Offset += (unsigned long)Base - (unsigned long)memBase;
     shift = (Offset & 0x3) << 3;
+#ifndef __NetBSD__
       if (Offset >= (hae_thresh)) {
         msb = Offset & hae_mask;
         Offset -= msb;
@@ -565,7 +573,7 @@
 	msb_set = msb;
 	}
       }
-
+#endif
     result = *(vuip) ((unsigned long)memSBase + (Offset << 5));
     result >>= shift;
     return 0xffUL & result;
@@ -575,11 +583,14 @@
 readSparse16(pointer Base, register unsigned long Offset)
 {
     register unsigned long result, shift;
+#ifndef __NetBSD__
     register unsigned long msb;
+#endif
 
     mem_barrier();
     Offset += (unsigned long)Base - (unsigned long)memBase;
     shift = (Offset & 0x2) << 3;
+#ifndef __NetBSD__
     if (Offset >= (hae_thresh)) {
         msb = Offset & hae_mask;
         Offset -= msb;
@@ -588,6 +599,7 @@
 	msb_set = msb;
       }
     }
+#endif
     result = *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2)));
     result >>= shift;
     return 0xffffUL & result;
@@ -603,11 +615,14 @@
 static void
 writeSparse8(int Value, pointer Base, register unsigned long Offset)
 {
+#ifndef __NetBSD__
     register unsigned long msb;
+#endif
     register unsigned int b = Value & 0xffU;
 
     write_mem_barrier();
     Offset += (unsigned long)Base - (unsigned long)memBase;
+#ifndef __NetBSD__
     if (Offset >= (hae_thresh)) {
       msb = Offset & hae_mask;
       Offset -= msb;
@@ -616,17 +631,21 @@
 	msb_set = msb;
       }
     }
+#endif
     *(vuip) ((unsigned long)memSBase + (Offset << 5)) = b * 0x01010101;
 }
 
 static void
 writeSparse16(int Value, pointer Base, register unsigned long Offset)
 {
+#ifndef __NetBSD__
     register unsigned long msb;
+#endif
     register unsigned int w = Value & 0xffffU;
 
     write_mem_barrier();
     Offset += (unsigned long)Base - (unsigned long)memBase;
+#ifndef __NetBSD__
     if (Offset >= (hae_thresh)) {
       msb = Offset & hae_mask;
       Offset -= msb;
@@ -635,6 +654,7 @@
 	msb_set = msb;
       }
     }
+#endif
     *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2))) =
       w * 0x00010001;
 
@@ -651,10 +671,13 @@
 static void
 writeSparseNB8(int Value, pointer Base, register unsigned long Offset)
 {
+#ifndef __NetBSD__
     register unsigned long msb;
+#endif
     register unsigned int b = Value & 0xffU;
 
     Offset += (unsigned long)Base - (unsigned long)memBase;
+#ifndef __NetBSD__
     if (Offset >= (hae_thresh)) {
       msb = Offset & hae_mask;
       Offset -= msb;
@@ -663,16 +686,20 @@
 	msb_set = msb;
       }
     }
+#endif
     *(vuip) ((unsigned long)memSBase + (Offset << 5)) = b * 0x01010101;
 }
 
 static void
 writeSparseNB16(int Value, pointer Base, register unsigned long Offset)
 {
+#ifndef __NetBSD__
     register unsigned long msb;
+#endif
     register unsigned int w = Value & 0xffffU;
 
     Offset += (unsigned long)Base - (unsigned long)memBase;
+#ifndef __NetBSD__
     if (Offset >= (hae_thresh)) {
       msb = Offset & hae_mask ;
       Offset -= msb;
@@ -681,6 +708,7 @@
 	msb_set = msb;
       }
     }
+#endif
     *(vuip)((unsigned long)memSBase+(Offset<<5)+(1<<(5-2))) =
       w * 0x00010001;
 }

Index: bsd_kbd.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.c,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/bsd_kbd.c	26 Nov 2003 22:49:01 -0000	1.1.4.1
+++ b/bsd_kbd.c	23 Feb 2004 21:36:45 -0000	1.1.4.2
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.c,v 1.8 2003/11/04 03:16:58 tsi Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_kbd.c,v 1.9 2004/01/07 17:05:28 tsi Exp $ */
 
 /*
  * Copyright (c) 2002 by The XFree86 Project, Inc.
@@ -497,7 +497,7 @@
 #endif
            default:
                xf86Msg(X_ERROR, "%s: Unsupported wskbd type \"%d\"",
-                                pKbd->wsKbdType, pInfo->name);
+                                pInfo->name, pKbd->wsKbdType);
                close(pInfo->fd);
                return FALSE;
        }

Index: bsd_mouse.c
===================================================================
RCS file: /cvs/xorg/xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_mouse.c,v
retrieving revision 1.1.4.1
retrieving revision 1.1.4.2
diff -u -d -r1.1.4.1 -r1.1.4.2
--- a/bsd_mouse.c	26 Nov 2003 22:49:01 -0000	1.1.4.1
+++ b/bsd_mouse.c	23 Feb 2004 21:36:45 -0000	1.1.4.2
@@ -1,4 +1,4 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_mouse.c,v 1.26 2003/10/10 20:56:05 herrb Exp $ */
+/* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bsd/bsd_mouse.c,v 1.28 2004/02/06 17:15:36 tsi Exp $ */
 
 /*
  * Copyright (c) 1999-2003 by The XFree86 Project, Inc.
@@ -80,6 +80,16 @@
 	DEFAULT_PS2_DEV,
 	NULL
 };
+#elif defined(__OpenBSD__) && defined(WSCONS_SUPPORT)
+/* Only wsmouse mices are autoconfigured for now on OpenBSD */
+#define DEFAULT_WSMOUSE_DEV		"/dev/wsmouse"
+#define DEFAULT_WSMOUSE0_DEV		"/dev/wsmouse0"
+
+static const char *mouseDevs[] = {
+	DEFAULT_WSMOUSE_DEV,
+	DEFAULT_WSMOUSE0_DEV,
+	NULL
+};
 #endif
 
 static int
@@ -141,6 +151,8 @@
 {
 #if defined(__FreeBSD__)
     return "Auto";
+#elif defined(__OpenBSD__) && defined(WSCONS_SUPPORT)
+    return "WSMouse";
 #else
     return NULL;
 #endif
@@ -195,7 +207,7 @@
 		    protoPara[0] = mode.syncmask[0];
 		    protoPara[1] = mode.syncmask[1];
 		}
-    		xf86MsgVerb(X_INFO, 3, "%s: SetupAuto: protocol is %s\n",
+		xf86MsgVerb(X_INFO, 3, "%s: SetupAuto: protocol is %s\n",
 			    pInfo->name, devproto[i].name);
 		return devproto[i].name;
 	    }
@@ -325,7 +337,50 @@
 }
 #endif
 
-#if defined(WSCONS_SUPPORT)
+#if defined(__OpenBSD__) && defined(WSCONS_SUPPORT)
+
+/* Only support wsmouse configuration for now */
+static const char *
+SetupAuto(InputInfoPtr pInfo, int *protoPara)
+{
+
+    xf86MsgVerb(X_INFO, 3, "%s: SetupAuto: protocol is %s\n",
+		pInfo->name, "wsmouse");
+    return "wsmouse";
+}
+
+static void
+SetMouseRes(InputInfoPtr pInfo, const char *protocol, int rate, int res)
+{
+
+    xf86MsgVerb(X_INFO, 3, "%s: SetMouseRes: protocol %s rate %d res %d\n",
+	    pInfo->name, protocol, rate, res);
+}
+
+static const char *
+FindDevice(InputInfoPtr pInfo, const char *protocol, int flags)
+{
+    int fd = -1;
+    const char **pdev;
+
+    for (pdev = mouseDevs; *pdev; pdev++) {
+	SYSCALL(fd = open(*pdev, O_RDWR | O_NONBLOCK));
+	if (fd != -1) {
+	    /* Set the Device option. */
+	    pInfo->conf_idev->commonOptions =
+		xf86AddNewOption(pInfo->conf_idev->commonOptions, 
+				 "Device", *pdev);
+	    xf86Msg(X_INFO, "%s: found Device \"%s\"\n",
+		    pInfo->name, *pdev);
+	    close(fd);
+	    break;
+	}
+    }
+    return *pdev;
+}
+#endif /* __OpenBSD__ && WSCONS_SUPPORT */
+
+#ifdef WSCONS_SUPPORT
 #define NUMEVENTS 64
 
 static void
@@ -718,7 +773,11 @@
     p->SetBMRes = SetSysMouseRes;
     p->SetMiscRes = SetSysMouseRes;
 #endif
-#if defined(__FreeBSD__)
+#if defined(__OpenBSD__) && defined(WSCONS_SUPPORT)
+    p->SetupAuto = SetupAuto;
+    p->SetMiscRes = SetMouseRes;
+#endif
+#if defined(__FreeBSD__) || defined(__OpenBSD__)
     p->FindDevice = FindDevice;
 #endif
     p->PreInit = bsdMousePreInit;





More information about the xorg-commit mailing list