CVS commit: xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus

2018-12-31 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Tue Jan  1 00:40:01 UTC 2019

Modified Files:
xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus:
netbsdSbus.c

Log Message:
s/pointer/void */ in a few places.  remove now (void *) casts.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c
diff -u xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c:1.5 xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c:1.6
--- xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c:1.5	Sat Aug 20 21:15:07 2016
+++ xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c	Tue Jan  1 00:40:01 2019
@@ -611,10 +611,10 @@ sparcDriverName(void)
 return name;
 }
 
-pointer
+void *
 xf86MapSbusMem(sbusDevicePtr psdp, unsigned long offset, unsigned long size)
 {
-pointer ret;
+void * ret;
 
 if (psdp->fd == -1) {
 	psdp->fd = open(psdp->device, O_RDWR);
@@ -623,20 +623,20 @@ xf86MapSbusMem(sbusDevicePtr psdp, unsig
 } else if (psdp->fd < 0)
 	return NULL;
 
-ret = (pointer) mmap (NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE,
+ret = mmap (NULL, size, PROT_READ | PROT_WRITE, MAP_PRIVATE,
 			  psdp->fd, offset);
-if (ret == (pointer) -1) {
-	ret = (pointer) mmap (NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED,
+if (ret == (void *) -1) {
+	ret = mmap (NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED,
 			  psdp->fd, offset);
 }
-if (ret == (pointer) -1)
+if (ret == (void *) -1)
 	return NULL;
 
 return ret;
 }
 
 void
-xf86UnmapSbusMem(sbusDevicePtr psdp, pointer addr, unsigned long size)
+xf86UnmapSbusMem(sbusDevicePtr psdp, void * addr, unsigned long size)
 {
 munmap (addr, size);
 }



CVS commit: xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus

2015-02-26 Thread Soren Jacobsen
Module Name:xsrc
Committed By:   snj
Date:   Thu Feb 26 21:30:00 UTC 2015

Modified Files:
xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus: Pci.h

Log Message:
we've been happily using bsdPciInit since xorg was first imported.
remove local changes that were only relevant in the xfree86 days.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 \
xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/Pci.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/Pci.h
diff -u xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/Pci.h:1.7 xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/Pci.h:1.8
--- xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/Pci.h:1.7	Tue Aug  2 07:15:04 2011
+++ xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/Pci.h	Thu Feb 26 21:30:00 2015
@@ -148,14 +148,8 @@
 #endif /* defined(linux) */
 
 #ifndef ARCH_PCI_INIT
-#if defined(__NetBSD__)
-#  define ARCH_PCI_INIT netbsdPciInit
-#  define INCLUDE_XF86_MAP_PCI_MEM
-#  define INCLUDE_XF86_NO_DOMAIN
-#else
 #error No PCI support available for this architecture/OS combination
 #endif
-#endif
 
 extern void ARCH_PCI_INIT(void);
 



CVS commit: xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus

2014-06-18 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Wed Jun 18 16:49:46 UTC 2014

Modified Files:
xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus:
netbsdSbus.c

Log Message:
OFIOCNEXTPROP - OFIOCGET
now this can actually work


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 \
xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c
diff -u xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c:1.3 xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c:1.4
--- xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c:1.3	Wed Apr 13 05:14:00 2011
+++ xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c	Wed Jun 18 16:49:46 2014
@@ -117,7 +117,7 @@ promGetProperty(const char *prop, int *l
 ofio.of_buf = of_buf;
 ofio.of_buflen = sizeof(of_buf);
 
-if (ioctl(promFd, OFIOCNEXTPROP, ofio)  0)
+if (ioctl(promFd, OFIOCGET, ofio)  0)
 	return 0;
 
 of_buf[ofio.of_buflen] = '\0';
@@ -137,10 +137,9 @@ promGetBool(const char *prop)
 ofio.of_buf = of_buf;
 ofio.of_buflen = sizeof(of_buf);
 
-if (ioctl(promFd, OFIOCNEXTPROP, ofio)  0)
+if (ioctl(promFd, OFIOCGET, ofio)  0)
 	return 0;
-
-if (!ofio.of_buflen)
+if (ofio.of_buflen  0)
 	return 0;
 
 return 1;
@@ -160,12 +159,15 @@ promSetNode(sbusPromNodePtr pnode)
 
 if (!pnode-node || pnode-node == -1)
 	return -1;
+
 if (pnode-cookie[0]  PROM_NODE_SIBLING)
 	node = promGetSibling(pnode-cookie[1]);
 else
 	node = promGetChild(pnode-cookie[1]);
+
 if (pnode-node != node)
 	return -1;
+
 return 0;
 }
 
@@ -197,14 +199,17 @@ sparcPromInit(void)
 	promOpenCount++;
 	return 0;
 }
+
 promFd = open(/dev/openprom, O_RDONLY, 0);
 if (promFd == -1)
 	return -1;
+
 promRootNode = promGetSibling(0);
 if (!promRootNode) {
 	sparcPromClose();
 	return -1;
 }
+
 promIsP1275();
 promOpenCount++;
 
@@ -214,17 +219,19 @@ sparcPromInit(void)
 char *
 sparcPromGetProperty(sbusPromNodePtr pnode, const char *prop, int *lenp)
 {
-if (promSetNode(pnode))
+ if (promSetNode(pnode))
 	return NULL;
-return promGetProperty(prop, lenp);
+
+ return promGetProperty(prop, lenp);
 }
 
 int
 sparcPromGetBool(sbusPromNodePtr pnode, const char *prop)
 {
-if (promSetNode(pnode))
+ if (promSetNode(pnode))
 	return 0;
-return promGetBool(prop);
+
+ return promGetBool(prop);
 }
 
 static void
@@ -242,14 +249,18 @@ promWalkAssignNodes(int node, int oldnod
 	prop = promGetProperty(name, len);
 	if (!prop || len = 0)
 		break;
+
 	while ((*prop = 'A'  *prop = 'Z') || *prop == ',')
 		prop++;
+
 	for (i = 0; sbusDeviceTable[i].devId; i++)
 		if (!strcmp(prop, sbusDeviceTable[i].promName))
 		break;
+
 	devId = sbusDeviceTable[i].devId;
-	if (!devId)
+	if(!devId)
 		break;
+
 	if (!sbus) {
 		if (devId == SBUS_DEVICE_FFB) {
 		/*
@@ -261,13 +272,16 @@ promWalkAssignNodes(int node, int oldnod
 		} else if (devId != SBUS_DEVICE_CG14)
 		break;
 	}
+
 	for (i = 0; i  32; i++) {
 		if (!devicePtrs[i] || devicePtrs[i]-devId != devId)
 		continue;
+
 		if (devicePtrs[i]-node.node) {
 		if ((devicePtrs[i]-node.cookie[0]  ~PROM_NODE_SIBLING) =
 			(flags  ~PROM_NODE_SIBLING))
 			continue;
+
 		for (j = i + 1, pNode = devicePtrs[i]-node; j  32; j++) {
 			if (!devicePtrs[j] || devicePtrs[j]-devId != devId)
 			continue;



CVS commit: xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus

2011-04-12 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Wed Apr 13 05:14:00 UTC 2011

Modified Files:
xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus:
netbsdSbus.c

Log Message:
fix sbusDeviceTable to actually include driver names


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c
diff -u xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c:1.2 xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c:1.3
--- xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c:1.2	Fri Jun 26 18:17:42 2009
+++ xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c	Wed Apr 13 05:14:00 2011
@@ -54,22 +54,22 @@
 sbusDevicePtr *xf86SbusInfo = NULL;
 
 struct sbus_devtable sbusDeviceTable[] = {
-{ SBUS_DEVICE_BW2, FBTYPE_SUN2BW, bwtwo, Sun Monochrome (bwtwo) },
-{ SBUS_DEVICE_CG2, FBTYPE_SUN2COLOR, cgtwo, Sun Color2 (cgtwo) },
-{ SBUS_DEVICE_CG3, FBTYPE_SUN3COLOR, cgthree, Sun Color3 (cgthree) },
-{ SBUS_DEVICE_CG4, FBTYPE_SUN4COLOR, cgfour, Sun Color4 (cgfour) },
-{ SBUS_DEVICE_CG6, FBTYPE_SUNFAST_COLOR, cgsix, Sun GX },
-{ SBUS_DEVICE_CG8, FBTYPE_MEMCOLOR, cgeight, Sun CG8/RasterOps },
-{ SBUS_DEVICE_CG12, FBTYPE_SUNGP3, cgtwelve, Sun GS (cgtwelve) },
-{ SBUS_DEVICE_CG14, FBTYPE_MDICOLOR, cgfourteen, Sun SX },
-{ SBUS_DEVICE_GT, FBTYPE_SUNGT, gt, Sun Graphics Tower },
-{ SBUS_DEVICE_MGX, -1, mgx, Quantum 3D MGXplus },
-{ SBUS_DEVICE_LEO, FBTYPE_SUNLEO, leo, Sun ZX or Turbo ZX },
-{ SBUS_DEVICE_TCX, FBTYPE_TCXCOLOR, tcx, Sun TCX },
-{ SBUS_DEVICE_FFB, FBTYPE_CREATOR, ffb, Sun FFB },
-{ SBUS_DEVICE_FFB, FBTYPE_CREATOR, afb, Sun Elite3D },
-{ SBUS_DEVICE_P9100, FBTYPE_P9100, pnozz, Weitek P9100 },
-{ SBUS_DEVICE_AG10E, FBTYPE_AG10E, ag10e, Fujitsu AG-10e },
+{ SBUS_DEVICE_BW2, FBTYPE_SUN2BW, bwtwo, sunbw2, Sun Monochrome (bwtwo) },
+{ SBUS_DEVICE_CG2, FBTYPE_SUN2COLOR, cgtwo, NULL, Sun Color2 (cgtwo) },
+{ SBUS_DEVICE_CG3, FBTYPE_SUN3COLOR, cgthree, suncg3, Sun Color3 (cgthree) },
+{ SBUS_DEVICE_CG4, FBTYPE_SUN4COLOR, cgfour, NULL,  Sun Color4 (cgfour) },
+{ SBUS_DEVICE_CG6, FBTYPE_SUNFAST_COLOR, cgsix, suncg6, Sun GX },
+{ SBUS_DEVICE_CG8, FBTYPE_MEMCOLOR, cgeight, NULL, Sun CG8/RasterOps },
+{ SBUS_DEVICE_CG12, FBTYPE_SUNGP3, cgtwelve, NULL, Sun GS (cgtwelve) },
+{ SBUS_DEVICE_CG14, FBTYPE_MDICOLOR, cgfourteen, suncg14, Sun SX },
+{ SBUS_DEVICE_GT, FBTYPE_SUNGT, gt, NULL, Sun Graphics Tower },
+{ SBUS_DEVICE_MGX, -1, mgx, NULL, Quantum 3D MGXplus },
+{ SBUS_DEVICE_LEO, FBTYPE_SUNLEO, leo, sunleo, Sun ZX or Turbo ZX },
+{ SBUS_DEVICE_TCX, FBTYPE_TCXCOLOR, tcx, suntcx, Sun TCX or S24 },
+{ SBUS_DEVICE_FFB, FBTYPE_CREATOR, ffb, sunffb, Sun FFB },
+{ SBUS_DEVICE_FFB, FBTYPE_CREATOR, afb, sunffb, Sun Elite3D },
+{ SBUS_DEVICE_P9100, FBTYPE_P9100, pnozz, pnozz, Weitek P9100 },
+{ SBUS_DEVICE_AG10E, FBTYPE_AG10E, ag10e, ag10e, Fujitsu AG-10e },
 { 0, 0, NULL }
 };
 
@@ -139,6 +139,7 @@
 
 if (ioctl(promFd, OFIOCNEXTPROP, ofio)  0)
 	return 0;
+
 if (!ofio.of_buflen)
 	return 0;
 
@@ -557,9 +558,10 @@
 		break;
 	while ((*prop = 'A'  *prop = 'Z') || *prop == ',')
 		prop++;
-	for (i = 0; sbusDeviceTable[i].devId; i++)
+	for (i = 0; sbusDeviceTable[i].devId; i++) {
 		if (!strcmp(prop, sbusDeviceTable[i].promName))
 		break;
+	}
 	devId = sbusDeviceTable[i].devId;
 	if (!devId)
 		break;



CVS commit: xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus

2009-06-26 Thread Michael Lorenz
Module Name:xsrc
Committed By:   macallan
Date:   Fri Jun 26 18:17:42 UTC 2009

Modified Files:
xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus:
netbsdSbus.c

Log Message:
add sparcDriverName() - from Sbus.c


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 \
xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c
diff -u xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c:1.1 xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c:1.2
--- xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c:1.1	Fri Oct 24 19:34:08 2008
+++ xsrc/external/mit/xorg-server/dist/hw/xfree86/os-support/bus/netbsdSbus.c	Fri Jun 26 18:17:42 2009
@@ -22,6 +22,10 @@
  */
 /* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/bus/Sbus.c,v 1.2 2001/10/28 03:34:01 tsi Exp $ */
 
+#ifdef HAVE_XORG_CONFIG_H
+#include xorg-config.h
+#endif
+
 #include fcntl.h
 #include stdio.h
 #include unistd.h
@@ -537,6 +541,60 @@
 return i;
 }
 
+static char *
+promWalkGetDriverName(int node, int oldnode)
+{
+int nextnode;
+int len;
+char *prop;
+int devId, i;
+
+prop = promGetProperty(device_type, len);
+if (prop  (len  0)) do {
+	if (!strcmp(prop, display)) {
+	prop = promGetProperty(name, len);
+	if (!prop || len = 0)
+		break;
+	while ((*prop = 'A'  *prop = 'Z') || *prop == ',')
+		prop++;
+	for (i = 0; sbusDeviceTable[i].devId; i++)
+		if (!strcmp(prop, sbusDeviceTable[i].promName))
+		break;
+	devId = sbusDeviceTable[i].devId;
+	if (!devId)
+		break;
+	if (sbusDeviceTable[i].driverName)
+		return sbusDeviceTable[i].driverName;
+	}
+} while (0);
+
+nextnode = promGetChild(node);
+if (nextnode) {
+	char *name;
+	name = promWalkGetDriverName(nextnode, node);
+	if (name)
+	return name;
+}
+
+nextnode = promGetSibling(node);
+if (nextnode)
+	return promWalkGetDriverName(nextnode, node);
+return NULL;
+}
+
+char *
+sparcDriverName(void)
+{
+char *name;
+
+if (sparcPromInit()  0)
+	return NULL;
+promGetSibling(0);
+name = promWalkGetDriverName(promRootNode, 0);
+sparcPromClose();
+return name;
+}
+
 pointer
 xf86MapSbusMem(sbusDevicePtr psdp, unsigned long offset, unsigned long size)
 {