diff -ur xc.vanilla/config/cf/Imake.cf xc/config/cf/Imake.cf
--- xc.vanilla/config/cf/Imake.cf	Tue Dec  5 22:40:45 1995
+++ xc/config/cf/Imake.cf	Sat May 25 20:27:28 1996
@@ -395,13 +395,19 @@
 # define Win32Architecture
 #endif /* WIN32 */
 
-#ifdef linux 
+#ifdef linux
 # define MacroIncludeFile <linux.cf>
 # define MacroFile linux.cf
 # undef linux
 # define LinuxArchitecture
-# define i386Architecture
-# undef i386
+# ifdef 386
+#  define i386Architecture
+#  undef i386
+# endif
+# if defined(__sparc__) || defined(sparc)
+#  define SparcArchitecture
+#  undef sparc
+# endif
 #endif /* linux */
 
 #ifdef __uxp__
diff -ur xc.vanilla/config/cf/Imake.rules xc/config/cf/Imake.rules
--- xc.vanilla/config/cf/Imake.rules	Wed Jan 17 17:09:39 1996
+++ xc/config/cf/Imake.rules	Fri Jun  7 14:59:42 1996
@@ -2195,9 +2195,9 @@
 #ifndef MakeDirectories
 #define MakeDirectories(step,dirs)					@@\
 step::									@@\
-	@MakeFlagsToShellFlags(i,set +e); \				@@\
+	@MakeFlagsToShellFlags(i,set +e); 				@@\
 	DirFailPrefix@for i in dirs; do if [ -d $(DESTDIR)$$i ]; then \	@@\
-		set +x; else (set -x; $(MKDIRHIER) $(DESTDIR)$$i); fi \	@@\
+		set +x; else (set -x; $(MKDIRHIER) $(DESTDIR)$$i); fi; \ @@\
 	done
 #endif /* MakeDirectories */
 
diff -ur xc.vanilla/config/cf/linux.cf xc/config/cf/linux.cf
--- xc.vanilla/config/cf/linux.cf	Sat Feb  3 01:00:56 1996
+++ xc/config/cf/linux.cf	Mon Jun  3 10:48:47 1996
@@ -4,20 +4,20 @@
 #define OSName			Linux
 #endif
 #ifndef OSVendor
-#define OSVendor		Slackware 2.3.0 ELF
+#define OSVendor		RedHat 4.0 (sparc)
 #endif
 #ifndef OSMajorVersion
 #define OSMajorVersion		1
 #endif
 #ifndef OSMinorVersion
-#define OSMinorVersion		2
+#define OSMinorVersion		99
 #endif
 #ifndef OSTeenyVersion
-#define OSTeenyVersion		11
+#define OSTeenyVersion		10
 #endif
 
 #ifndef UseElfFormat
-#if OSMinorVersion > 1
+#if OSMinorVersion > 1 || OSMajorVersion > 1
 #define UseElfFormat		YES
 #else
 #define UseElfFormat		NO
@@ -49,7 +49,7 @@
 #define SetTtyGroup		YES
 
 #if UseElfFormat
-#if OSMinorVersion > 1
+#if OSMinorVersion > 1 || OSMajorVersion > 1
 #define CcCmd			gcc
 #define AsCmd			as
 #define LdCmd			ld
@@ -59,15 +59,23 @@
 #define LdCmd			ld -m elf_i386
 #endif
 #define AsmDefines		-D__ELF__
+#ifdef i386Architecture
 #define CplusplusCmd		g++ -b i486-linuxelf
 #else
+#define CplusplusCmd		g++
+#endif
+#else
 #define CcCmd			gcc
-#if OSMinorVersion < 2
+#if OSMinorVersion < 2 && OSMajorVersion < 2
 #define AsCmd			as
 #define LdCmd			ld
 #else
+#ifdef i386Architecture
 #define AsCmd			/usr/i486-linuxaout/bin/as
 #define LdCmd			ld -m i386linux
+#else
+#error a.out not supported.
+#endif
 #endif
 #define AsmDefines		-DUSE_GAS -U__ELF__
 #endif
@@ -79,15 +87,31 @@
 #define PreProcessCmd		CcCmd -E
 #define PostIncDir		`CcCmd --print-libgcc-file-name | sed 's/libgcc.a/include/'`
 #define LdCombineFlags		-r
+#ifdef i386Architecture
 #define OptimizedCDebugFlags	-O2 -m486
 #define StandardDefines		-Dlinux -D__i386__ -D_POSIX_SOURCE \
 				-D_BSD_SOURCE -D_GNU_SOURCE -DX_LOCALE
+#elif defined(SparcArchitecture)
+#define OptimizedCDebugFlags	-O2
+#define StandardDefines		-Dlinux -D__sparc__ -D_POSIX_SOURCE \
+				-D_BSD_SOURCE -D_GNU_SOURCE -DX_LOCALE
+#else
+#error Architecture not supported.
+#endif
 #define XawI18nDefines		-DUSE_XWCHAR_STRING -DUSE_XMBTOWC
 #define HasWChar32		YES
 #define StandardCppDefines	-traditional StandardDefines
+#ifdef i386Architecture
 #define ServerOSDefines		XFree86ServerOSDefines -DDDXTIME
 #define ExtensionOSDefines	-DXTESTEXT1
 #define ServerExtraDefines	-DGCCUSESGAS XFree86ServerDefines
+#elif defined(SparcArchitecture)
+#define ServerOSDefines		-DDDXOSINIT
+#define ExtensionOSDefines	-DXTESTEXT1
+#define ServerExtraDefines	-DGCCUSESGAS
+#else
+#error Architecture not supported.
+#endif
 #define ConnectionFlags		-DUNIXCONN -DTCPCONN
 #define InstUidFlags		-s -m 4711
 
@@ -112,4 +136,24 @@
 #endif
 
 #include <lnxLib.rules>
+#ifdef i386Architecture
 #include <xfree86.cf>
+#elif defined(SparcArchitecture)
+#ifndef Xsun24Server
+#define Xsun24Server	YES		/* Multiple depths, Color, Mono */
+#endif
+#ifndef XsunServer
+#define XsunServer	YES		/* Color 8-bit and Mono */
+#endif
+#ifndef XsunMonoServer
+#define XsunMonoServer	YES		/* Mono only */
+#endif
+#ifndef HasNdbm
+#define HasNdbm		YES
+#endif
+#ifndef DBMLibrary
+#define DBMLibrary	/usr/lib/libdb.a
+#endif
+#else
+#error Architecture not supported.
+#endif
diff -ur xc.vanilla/config/cf/site.def xc/config/cf/site.def
--- xc.vanilla/config/cf/site.def	Thu Dec 14 19:04:57 1995
+++ xc/config/cf/site.def	Fri Jun  7 16:28:08 1996
@@ -32,6 +32,9 @@
 
 #ifdef BeforeVendorCF
 
+#undef ForceNormalLib
+#define ForceNormalLib	YES
+
 /* #include <host.def> */
 
 /*
@@ -100,6 +103,9 @@
 #endif
 */
 
+#if defined(SparcArchitecture) && defined(LinuxArchitecture)
+#define InstallXserverSetUID YES
+#endif
 /* #include <host.def> */
 
 #endif /* AfterVendorCF */
diff -ur xc.vanilla/fonts/PEX/to_wfont.y xc/fonts/PEX/to_wfont.y
--- xc.vanilla/fonts/PEX/to_wfont.y	Mon Nov 21 23:11:41 1994
+++ xc/fonts/PEX/to_wfont.y	Sun May 26 10:43:00 1996
@@ -617,7 +617,7 @@
 	}
 
 	(void) fclose(fp);
-	freeall();
+/*	freeall(); */
 #	undef BY_BYE
 }
 
diff -ur xc.vanilla/lib/Xau/Imakefile xc/lib/Xau/Imakefile
--- xc.vanilla/lib/Xau/Imakefile	Thu Sep 21 17:28:17 1995
+++ xc/lib/Xau/Imakefile	Fri Jun  7 17:34:52 1996
@@ -6,6 +6,7 @@
 #define LibName Xau
 #define SoRev SOXAUTHREV
 
+
 #include <Threads.tmpl>
 
        LINTLIBS = $(LINTXLIB)
diff -ur xc.vanilla/programs/Xserver/Imakefile xc/programs/Xserver/Imakefile
--- xc.vanilla/programs/Xserver/Imakefile	Sat Feb  3 00:44:47 1996
+++ xc/programs/Xserver/Imakefile	Thu May 23 18:52:47 1996
@@ -11,7 +11,7 @@
 #include <Server.tmpl>
 
 #define PreFbLibs $(DIX) $(OS) $(FONT)
-#define BarePostFbLibs $(MFB) $(MI)
+#define BarePostFbLibs $(MFB) $(MI) $(CBRT)
 #define PostFbLibs BarePostFbLibs $(EXTENSIONS)
 #define NoMfbBarePostFbLibs $(MI)
 #define NoMfbPostFbLibs NoMfbBarePostFbLibs $(EXTENSIONS)
diff -ur xc.vanilla/programs/Xserver/cfb/cfbcmap.c xc/programs/Xserver/cfb/cfbcmap.c
--- xc.vanilla/programs/Xserver/cfb/cfbcmap.c	Mon Apr 18 02:28:46 1994
+++ xc/programs/Xserver/cfb/cfbcmap.c	Thu May 23 18:52:47 1996
@@ -34,6 +34,7 @@
 #include "scrnintstr.h"
 #include "colormapst.h"
 #include "resource.h"
+#include <syslog.h>
 
 #ifdef	STATIC_COLOR
 
@@ -156,6 +157,7 @@
 	limr = pVisual->redMask >> pVisual->offsetRed;
 	limg = pVisual->greenMask >> pVisual->offsetGreen;
 	limb = pVisual->blueMask >> pVisual->offsetBlue;
+
 	for(i = 0; i <= maxent; i++)
 	{
 	    /* rescale to [0..65535] then rgb bits */
@@ -302,8 +304,9 @@
     if (CreateColormap(pScreen->defColormap, pScreen, pVisual, &cmap,
 		       (pVisual->class & DynamicClass) ? AllocNone : AllocAll,
 		       0)
-	!= Success)
+	!= Success) {
 	return FALSE;
+    }
     wp = pScreen->whitePixel;
     bp = pScreen->blackPixel;
     if ((AllocColor(cmap, &ones, &ones, &ones, &wp, 0) !=
diff -ur xc.vanilla/programs/Xserver/cfb/stipsparc.s xc/programs/Xserver/cfb/stipsparc.s
--- xc.vanilla/programs/Xserver/cfb/stipsparc.s	Mon Apr 18 02:29:09 1994
+++ xc/programs/Xserver/cfb/stipsparc.s	Mon May 27 09:24:03 1996
@@ -85,7 +85,7 @@
 #define ForEachBits	LY4
 #define NextBits	LY5
 
-#ifdef SVR4
+#if defined(SVR4) || ( defined(linux) && defined(__ELF__) )
 #ifdef TETEXT
 #define	_cfbStippleStack	cfbStippleStackTE
 #else
diff -ur xc.vanilla/programs/Xserver/cfb/stipsprc32.s xc/programs/Xserver/cfb/stipsprc32.s
--- xc.vanilla/programs/Xserver/cfb/stipsprc32.s	Mon Apr 18 02:29:10 1994
+++ xc/programs/Xserver/cfb/stipsprc32.s	Mon Jun  3 10:57:49 1996
@@ -81,7 +81,7 @@
 #define ForEachBits	LY4
 #define NextBits	LY5
 
-#ifdef SVR4
+#if defined(SVR4) || ( defined(linux) && defined(__ELF__) )
 #ifdef TETEXT
 #define	_cfb32StippleStack	cfb32StippleStackTE
 #else
diff -ur xc.vanilla/programs/Xserver/hw/sun/Imakefile xc/programs/Xserver/hw/sun/Imakefile
--- xc.vanilla/programs/Xserver/hw/sun/Imakefile	Thu Jul 28 22:44:16 1994
+++ xc/programs/Xserver/hw/sun/Imakefile	Mon Jun  3 10:52:24 1996
@@ -21,6 +21,12 @@
 OFILES = sunInit.o sunInitMono.o sunInExMono.o sunInitMulti.o
 #endif
 
+#ifdef LinuxArchitecture
+LINUXOBJS = linux.o
+#else
+LINUXOBJS =
+#endif
+
 OBJS = 	sunCfb.o \
 	sunCfb24.o \
 	sunCursor.o \
@@ -30,7 +36,8 @@
 	sunMfb.o \
 	sunMouse.o \
 	sunGX.o \
-	sunKeyMap.o
+	sunKeyMap.o \
+	$(LINUXOBJS)
 
    INCLUDES = -I. -I../.. -I../../mi -I../../mfb -I../../cfb -I../../cfb32 \
 	      -I../../include -I$(INCLUDESRC) -I$(FONTINCSRC)
diff -ur xc.vanilla/programs/Xserver/hw/sun/constype.c xc/programs/Xserver/hw/sun/constype.c
--- xc.vanilla/programs/Xserver/hw/sun/constype.c	Thu Oct  5 12:36:06 1995
+++ xc/programs/Xserver/hw/sun/constype.c	Sat May 25 22:25:52 1996
@@ -58,7 +58,11 @@
 	dev = argv[1];
 	argc--; argv++;
     } else
+#ifndef linux
 	dev = "/dev/fb";
+#else
+	dev = "/dev/fb0";
+#endif
     consoleid = wu_fbid(dev, &retval);
     if (argc > 1 && strncmp (argv[1], "-num", strlen(argv[1])) == 0)
 	print_num = 1;
@@ -76,7 +80,11 @@
 #include <sys/fbio.h>
 #else
 #ifndef __NetBSD__
+# ifndef linux
 #include <sun/fbio.h>
+# else
+#include <asm/fbio.h>
+# endif
 #else
 #include <machine/fbio.h>
 #endif
diff -ur xc.vanilla/programs/Xserver/hw/sun/kbd_mode.c xc/programs/Xserver/hw/sun/kbd_mode.c
--- xc.vanilla/programs/Xserver/hw/sun/kbd_mode.c	Thu Oct  5 12:36:40 1995
+++ xc/programs/Xserver/hw/sun/kbd_mode.c	Sat May 25 22:25:24 1996
@@ -53,8 +53,37 @@
 #endif
 #else
 #ifndef __NetBSD__
+# ifndef linux
 #include <sundev/kbio.h>
 #include <sundev/kbd.h>
+# else
+#include <asm/kbio.h>
+/*
+ * Commands to the Sun-2 keyboard.
+ */
+#define KBD_CMD_RESET           0x01    /* Reset keyboard as if power-up */
+#define KBD_CMD_BELL            0x02    /* Turn on the bell */
+#define KBD_CMD_NOBELL          0x03    /* Turn off the bell */
+#define KBD_CMD_LED1            0x04    /* Turn on LED 1 */
+#define KBD_CMD_NOLED1          0x05    /* Turn off LED 1 */
+#define KBD_CMD_LED2            0x06    /* Turn on LED 2 */
+#define KBD_CMD_NOLED2          0x07    /* Turn off LED 2 */
+ 
+/*
+ * Commands to the Type 3 keyboard.  KBD_CMD_BELL & KBD_CMD_NOBELL work
+ * as well.
+ */
+#define KBD_CMD_CLICK           0x0A    /* Turn on the click annunciator */
+#define KBD_CMD_NOCLICK         0x0B    /* Turn off the click annunciator */
+ 
+/*
+ * Commands to the Type 4 keyboard, in addition to those above.
+ */
+#define KBD_CMD_SETLED          0x0E    /* Set keyboard LED's */
+#define KBD_CMD_GETLAYOUT       0x0F    /* Request that keyboard indicate layout
+ */
+
+# endif
 #else
 #include <machine/kbio.h>
 #include <machine/kbd.h>
diff -ur xc.vanilla/programs/Xserver/hw/sun/linux.c xc/programs/Xserver/hw/sun/linux.c
--- xc.vanilla/programs/Xserver/hw/sun/linux.c	Wed May 29 15:15:05 1996
+++ xc/programs/Xserver/hw/sun/linux.c	Tue Jun  4 15:39:43 1996
@@ -0,0 +1,421 @@
+/* $Xsun: xc/programs/Xserver/hw/sun/linux.c,v 3.3 1995/06/24 10:29:11 dawes Exp $ */
+/*
+ * Copyright 1992 by Orest Zborowski <obz@Kodak.com>
+ * Copyright 1993 by David Wexelblat <dwex@goblin.org>
+ * Copyright 1996 by Jakub Jelinek <jj@sunsite.mff.cuni.cz>
+ *
+ * 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 names of Orest Zborowski and David Wexelblat 
+ * not be used in advertising or publicity pertaining to distribution of 
+ * the software without specific, written prior permission.  Orest Zborowski
+ * and David Wexelblat make no representations about the suitability of this 
+ * software for any purpose.  It is provided "as is" without express or 
+ * implied warranty.
+ *
+ * OREST ZBOROWSKI AND DAVID WEXELBLAT DISCLAIMS ALL WARRANTIES WITH REGARD 
+ * TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 
+ * FITNESS, IN NO EVENT SHALL OREST ZBOROWSKI OR DAVID WEXELBLAT 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.
+ *
+ */
+/* $XConsortium: linux.c /main/4 1995/11/13 05:58:38 kaleb $ */
+
+#define NEED_EVENTS
+#include "sun.h"
+#include <linux/vt.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <asm/ioctls.h>
+#include <signal.h>
+#include <linux/kd.h>
+#include <errno.h>
+#include <stdio.h>
+
+static Bool KeepTty = FALSE;
+static int VTnum = -1;
+static int activeVT = -1;
+int consoleFd = -1;
+int vtno;
+static Bool linuxExiting = FALSE;
+Bool vtRequestsPending = FALSE;
+Bool vtOn = TRUE;
+Bool vtSema = TRUE;
+DevicePtr linuxMouse, linuxKeyboard;
+Bool NoVT = FALSE;
+static int cursorOn = FALSE;
+
+static PixmapPtr ppix = NULL;
+static struct LeaveState {
+    PixmapPtr ppix;
+    pointer sunscreen;
+}  *linuxLeaveState = NULL;
+
+static void linuxEnterLeaveVT(Bool enter, int screen_idx)
+{
+    ScreenPtr pScreen = screenInfo.screens[screen_idx];
+    PixmapPtr pspix = (PixmapPtr)pScreen->devPrivate;
+    BoxRec pixBox;
+    RegionRec pixReg;
+    DDXPointRec pixPt;
+    
+    pixBox.x1 = 0; pixBox.x2 = pScreen->width;
+    pixBox.y1 = 0; pixBox.y2 = pScreen->height;
+    pixPt.x = 0; pixPt.y = 0;
+    (pScreen->RegionInit)(&pixReg, &pixBox, 1);
+    if (enter) {
+        pointer sunscreen = linuxLeaveState[screen_idx].sunscreen;
+        if (pspix->devPrivate.ptr != sunscreen && linuxLeaveState[screen_idx].ppix) {
+            pspix->devPrivate.ptr = sunscreen;
+    	    switch (ppix->drawable.bitsPerPixel) {
+    	    	case 1:
+    	            mfbDoBitblt(&ppix->drawable, &pspix->drawable, GXcopy, &pixReg, &pixPt);
+    	            break;
+    	        case 8:
+    	            cfbDoBitblt(&ppix->drawable, &pspix->drawable, GXcopy, &pixReg, &pixPt, 0xFF);
+    	            break;
+    	        case 16:
+    	            cfbDoBitblt(&ppix->drawable, &pspix->drawable, GXcopy, &pixReg, &pixPt, 0xFFFF);
+    	            break;
+    	        case 32:
+    	            cfbDoBitblt(&ppix->drawable, &pspix->drawable, GXcopy, &pixReg, &pixPt, 0xFFFFFFFF);
+    	            break;
+    	    }
+            
+        }
+    } else {
+    	ppix = (pScreen->CreatePixmap)(pScreen, pScreen->width, 
+    				       pScreen->height, pScreen->rootDepth);
+    	if (ppix) {
+    	    switch (ppix->drawable.bitsPerPixel) {
+    	    	case 1:
+    	            mfbDoBitblt(&pspix->drawable, &ppix->drawable, GXcopy, &pixReg, &pixPt);
+    	            break;
+    	        case 8:
+    	            cfbDoBitblt(&pspix->drawable, &ppix->drawable, GXcopy, &pixReg, &pixPt, 0xFF);
+    	            break;
+    	        case 16:
+    	            cfbDoBitblt(&pspix->drawable, &ppix->drawable, GXcopy, &pixReg, &pixPt, 0xFFFF);
+    	            break;
+    	        case 32:
+    	            cfbDoBitblt(&pspix->drawable, &ppix->drawable, GXcopy, &pixReg, &pixPt, 0xFFFFFFFF);
+    	            break;
+    	    }
+    	    linuxLeaveState[screen_idx].sunscreen = pspix->devPrivate.ptr;
+    	    pspix->devPrivate.ptr = ppix->devPrivate.ptr;
+    	}
+    	linuxLeaveState[screen_idx].ppix = ppix;
+    }
+}
+
+static void vtRequest(int sig)
+{
+    vtRequestsPending = TRUE;
+    signal(SIGUSR1,vtRequest);
+}
+
+static void linuxEnterLeaveDev(Bool enter)
+{
+    int j;
+
+    if (!enter)
+	linuxLeaveState = (struct LeaveState *) xalloc (sizeof (struct LeaveState *) * screenInfo.numScreens);
+    if (!linuxLeaveState) return;
+    for (j = 0; j < screenInfo.numScreens; j++)
+	linuxEnterLeaveVT(enter, j);
+    if (enter) {
+    	int fd;
+    	Firm_event evBuf[20];
+    	sunKbdPrivPtr kbdPriv;
+    	DeviceIntPtr pKeyboard;
+    	
+	if (linuxLeaveState)
+	    xfree(linuxLeaveState);
+	SaveScreens(SCREEN_SAVER_FORCER,ScreenSaverReset);
+	EnableDevice((DeviceIntPtr)linuxMouse);
+	EnableDevice((DeviceIntPtr)linuxKeyboard);
+	pKeyboard = (DeviceIntPtr)LookupKeyboardDevice();
+	kbdPriv = (sunKbdPrivPtr)(pKeyboard->public.devicePrivate);
+	fd = kbdPriv->fd;
+	read (fd, evBuf, sizeof(evBuf));
+    } else {
+	DisableDevice((DeviceIntPtr)linuxMouse);
+	DisableDevice((DeviceIntPtr)linuxKeyboard);
+    }
+}
+
+static void VTSwitch()
+{
+    ColormapPtr cmap;
+    int j;
+
+    if (NoVT) return;	
+    vtRequestsPending = FALSE;
+    if (vtSema) {
+	if (!linuxExiting)
+	    linuxEnterLeaveDev(FALSE);
+	else
+	    ErrorF("Exiting...\n\n");
+	if (ioctl(consoleFd, VT_RELDISP, 1) < 0) {
+	    if (!linuxExiting)
+	        linuxEnterLeaveDev(TRUE);
+	    else
+	    	ErrorF("Exiting failed\n\n");
+	} else {
+	    CursorPtr pCursor;
+	    sunCursorPtr pCurPriv;
+	
+	    vtSema = FALSE;
+    	    for (j = 0; j < screenInfo.numScreens; j++) {
+        	pCurPriv = (&(GetScreenPrivate(screenInfo.screens[j])->hardwareCursor));
+        	if (pCurPriv && pCurPriv->has_cursor && pCurPriv->pCursor != NULL) {
+    	            pCursor = pCurPriv->pCursor;
+	    	    sunDisableCursor(screenInfo.screens[j]);
+	    	    pCurPriv->pCursor = pCursor;
+	    	}
+    	    }
+	    vtOn = FALSE;
+	}
+    } else {
+	sunCursorPtr pCurPriv;
+	
+    	vtOn = TRUE;
+    	
+    	for (j = 0; j < screenInfo.numScreens; j++) {
+            pCurPriv = (&(GetScreenPrivate(screenInfo.screens[j])->hardwareCursor));
+            if (pCurPriv && pCurPriv->has_cursor && pCurPriv->pCursor != NULL) {
+	    	sunRealizeCursor(screenInfo.screens[j], pCurPriv->pCursor);
+    	    }
+    	}
+	if (ioctl(consoleFd, VT_RELDISP, VT_ACKACQ) < 0) {
+	    vtOn = FALSE;
+	    return;
+	}
+	vtSema = TRUE;
+	for (j = 0; j < screenInfo.numScreens; j++) {
+	    SetupScreen(screenInfo.screens[j]);
+
+	    /* Hack to restore correct cmap */
+	    cmap = pPrivate->installedMap;
+	    if (cmap) {
+	        WalkTree(cmap->pScreen,TellLostMap,(pointer) &(cmap->mid));
+	        pPrivate->installedMap = NULL;
+	        sunInstallColormap(cmap);
+	    }
+	}
+	linuxEnterLeaveDev(TRUE);
+    }
+}
+
+/* ARGSUSED */
+void linuxBlock(pointer blockData, OSTimePtr pTimeout, pointer pReadmask)
+{
+}
+
+/* ARGSUSED */
+void linuxWakeup(pointer blockData, int result, pointer pReadmask)
+{
+    if (vtRequestsPending) VTSwitch();
+}
+
+void OpenLinuxConsole()
+{
+    int i, fd;
+    struct vt_mode VT;
+    char vtname[11];
+    struct vt_stat vts;
+
+    if (NoVT) return;
+    if (serverGeneration == 1) 
+    {
+	/* check if we're run with euid==0 */
+	if (geteuid() != 0)
+	{
+	    FatalError("OpenLinuxConsole: Server must be suid root\n");
+	}
+
+	RegisterBlockAndWakeupHandlers(linuxBlock, linuxWakeup, (void *)0);
+	/*
+	 * setup the virtual terminal manager
+	 */
+	if (VTnum != -1)
+	{
+	    vtno = VTnum;
+	}
+	else 
+	{
+	    if ((fd = open("/dev/console",O_WRONLY,0)) < 0) 
+	    {
+		FatalError(
+		    "OpenLinuxConsole: Cannot open /dev/console (%s)\n",
+		    strerror(errno));
+	    }
+	    if ((ioctl(fd, VT_OPENQRY, &vtno) < 0) ||
+		(vtno == -1))
+	    {
+		FatalError("OpenLinuxConsole: Cannot find a free VT\n");
+	    }
+	    close(fd);
+	}
+	ErrorF("(using VT number %d)\n\n", vtno);
+
+	sprintf(vtname,"/dev/tty%d",vtno); /* /dev/tty1-64 */
+
+	if (!KeepTty)
+	{
+	    setpgrp();
+	}
+
+	if ((consoleFd = open(vtname, O_RDWR|O_NDELAY, 0)) < 0)
+	{
+	    FatalError("OpenLinuxConsole: Cannot open %s (%s)\n",
+		       vtname, strerror(errno));
+	}
+
+	/* change ownership of the vt */
+	chown(vtname, getuid(), getgid());
+
+	/*
+	 * the current VT device we're running on is not "console", we want
+	 * to grab all consoles too
+	 */
+	chown("/dev/console", getuid(), getgid());
+	chown("/dev/tty0", getuid(), getgid());
+
+	/*
+	 * Linux doesn't switch to an active vt after the last close of a vt,
+	 * so we do this ourselves by remembering which is active now.
+	 */
+	if (ioctl(consoleFd, VT_GETSTATE, &vts) == 0)
+	{
+	    activeVT = vts.v_active;
+	}
+	
+	if (!KeepTty)
+	{
+	    /*
+	     * Detach from the controlling tty to avoid char loss
+	     */
+	    if ((i = open("/dev/tty",O_RDWR)) >= 0)
+	    {
+		ioctl(i, TIOCNOTTY, 0);
+		close(i);
+	    }
+	}
+
+	/*
+	 * now get the VT
+	 */
+	if (ioctl(consoleFd, VT_ACTIVATE, vtno) != 0)
+	{
+	    ErrorF("OpenLinuxConsole: VT_ACTIVATE failed\n");
+	}
+	if (ioctl(consoleFd, VT_WAITACTIVE, vtno) != 0)
+	{
+	    ErrorF("OpenLinuxConsole: VT_WAITACTIVE failed\n");
+	}
+	if (ioctl(consoleFd, VT_GETMODE, &VT) < 0) 
+	{
+	    FatalError ("OpenLinuxConsole: VT_GETMODE failed\n");
+	}
+
+	signal(SIGUSR1, vtRequest);
+
+	VT.mode = VT_PROCESS;
+	VT.relsig = SIGUSR1;
+	VT.acqsig = SIGUSR1;
+	if (ioctl(consoleFd, VT_SETMODE, &VT) < 0) 
+	{
+	    FatalError("OpenLinuxConsole: VT_SETMODE VT_PROCESS failed\n");
+	}
+    }
+    else 
+    {
+	/* serverGeneration != 1 */
+	/*
+	 * now get the VT
+	 */
+	if (ioctl(consoleFd, VT_ACTIVATE, vtno) != 0)
+	{
+	    ErrorF("OpenLinuxConsole: VT_ACTIVATE failed\n");
+	}
+	if (ioctl(consoleFd, VT_WAITACTIVE, vtno) != 0)
+	{
+	    ErrorF("OpenLinuxConsole: VT_WAITACTIVE failed\n");
+	}
+    }
+    return;
+}
+
+void CloseLinuxConsole()
+{
+    struct vt_mode   VT;
+    int j;
+
+    if (NoVT) return;
+    /*
+     * Perform a switch back to the active VT when we were started
+     */
+    for (j = 0; j < MAXSCREENS; j++) {
+    	if (sunFbs[j].fd != -1) {
+    	    if (sunFbs[j].origcmap.count == 16) {
+    	        ioctl(sunFbs[j].fd, FBIOPUTCMAP, &sunFbs[j].origcmap);
+    	    }
+    	    close(sunFbs[j].fd);
+    	}
+    }
+    if (ioctl(consoleFd, VT_GETMODE, &VT) != -1)
+    {
+	VT.mode = VT_AUTO;
+	if (ioctl(consoleFd, VT_SETMODE, &VT) < 0) { /* set dflt vt handling */
+	    ErrorF("OpenLinuxConsole: VT_SETMODE failed\n");
+	}
+    }
+    linuxExiting = TRUE;
+    if (activeVT >= 0)
+    {
+	if (ioctl(consoleFd, VT_ACTIVATE, activeVT) < 0) {
+	    ErrorF("OpenLinuxConsole: VT_ACTIVATE failed\n");
+	}
+	if (ioctl(consoleFd, VT_WAITACTIVE, activeVT) < 0) {
+	    ErrorF("OpenLinuxConsole: VT_WAITACTIVE failed\n");
+	}
+	activeVT = -1;
+    }
+    close(consoleFd);                /* make the vt-manager happy */
+    return;
+}
+
+int linuxProcessArgument (int argc, char *argv[], int i)
+{
+	/*
+	 * Keep server from detaching from controlling tty.  This is useful 
+	 * when debugging (so the server can receive keyboard signals.
+	 */
+	if (!strcmp(argv[i], "-novt"))
+	{
+		NoVT = TRUE;
+		return 1;
+	}
+	if (!strcmp(argv[i], "-keeptty"))
+	{
+		KeepTty = TRUE;
+		return 1;
+	}
+	if ((argv[i][0] == 'v') && (argv[i][1] == 't'))
+	{
+		if (sscanf(argv[i], "vt%2d", &VTnum) == 0)
+		{
+			UseMsg();
+			VTnum = -1;
+			return 0;
+		}
+		return 1;
+	}
+	return 0;
+}
diff -ur xc.vanilla/programs/Xserver/hw/sun/sun.h xc/programs/Xserver/hw/sun/sun.h
--- xc.vanilla/programs/Xserver/hw/sun/sun.h	Sun Oct  8 16:11:23 1995
+++ xc/programs/Xserver/hw/sun/sun.h	Tue Jun  4 13:00:25 1996
@@ -33,10 +33,15 @@
 /* system headers common to both SunOS and Solaris */
 #include <sys/param.h>
 #include <sys/file.h>
-#include <sys/filio.h>
 #include <sys/ioctl.h>
 #include <sys/resource.h>
 
+#ifndef linux
+#include <sys/filio.h>
+#else
+#include <linux/termios.h>
+#endif
+
 #ifdef SVR4
 # ifdef X_POSIX_C_SOURCE
 #  define _POSIX_C_SOURCE X_POSIX_C_SOURCE
@@ -51,8 +56,8 @@
 
 #include <fcntl.h>
 
-#ifndef __bsdi_
-# ifndef __NetBSD__
+#if !defined(__bsdi_) && !defined(linux)
+# ifndef __NetBSD__ 
 #  ifndef i386
 #   include <poll.h>
 #  else
@@ -86,7 +91,7 @@
 # include <stropts.h>
 # define usleep(usec) poll((struct pollfd *) 0, (size_t) 0, usec / 1000)
 #else
-# ifndef __NetBSD__
+# if !defined (__NetBSD__) && !defined (linux)
 #  include <sun/fbio.h>
 #  include <sundev/kbd.h>
 #  include <sundev/kbio.h>
@@ -99,6 +104,57 @@
 extern int setrlimit();
 extern int getpagesize();
 # else
+#  ifdef linux
+#define KB_KLUNK        0x00            /* Micro Switch 103SD32-2 */
+#define KB_VT100        0x01            /* Keytronics VT100 compatible */
+#define KB_SUN2         0x02            /* Sun-2 custom keyboard */
+#define KB_SUN3         0x03            /* Type 3 Sun keyboard */
+#define KB_SUN4         0x04            /* Type 4 Sun keyboard */
+#define KB_VT220        0x81            /* Emulation vt220 */
+#define KB_VT220I       0x82            /* International vt220 Emulation */
+
+#define KB_ASCII        0x0F            /* Ascii terminal masquerading as kbd */
+
+/*
+ * Commands to the Sun-2 keyboard.
+ */
+#define KBD_CMD_RESET           0x01    /* Reset keyboard as if power-up */
+#define KBD_CMD_BELL            0x02    /* Turn on the bell */
+#define KBD_CMD_NOBELL          0x03    /* Turn off the bell */
+#define KBD_CMD_LED1            0x04    /* Turn on LED 1 */
+#define KBD_CMD_NOLED1          0x05    /* Turn off LED 1 */
+#define KBD_CMD_LED2            0x06    /* Turn on LED 2 */
+#define KBD_CMD_NOLED2          0x07    /* Turn off LED 2 */
+ 
+/*
+ * Commands to the Type 3 keyboard.  KBD_CMD_BELL & KBD_CMD_NOBELL work
+ * as well.
+ */
+#define KBD_CMD_CLICK           0x0A    /* Turn on the click annunciator */
+#define KBD_CMD_NOCLICK         0x0B    /* Turn off the click annunciator */
+ 
+/*
+ * Commands to the Type 4 keyboard, in addition to those above.
+ */
+#define KBD_CMD_SETLED          0x0E    /* Set keyboard LED's */
+#define KBD_CMD_GETLAYOUT       0x0F    /* Request that keyboard indicate layout
+ */
+ 
+/*
+ * Type 4 keyboard LED masks (used to set LED's)
+ */
+#define LED_NUM_LOCK    0x1
+#define LED_COMPOSE     0x2
+#define LED_SCROLL_LOCK 0x4
+#define LED_CAPS_LOCK   0x8
+
+# include <asm/fbio.h>
+# include <asm/kbio.h>
+# include <asm/vuid_event.h>
+# include <asm/memreg.h>
+# include <signal.h>
+#endif
+
 #  ifdef __NetBSD__
 #   include <machine/fbio.h>
 #   include <machine/kbd.h>
@@ -246,6 +302,9 @@
     struct fbtype   info;	/* Frame buffer characteristics */
     void	    (*EnterLeave)();/* screen switch */
     unsigned char*  fbPriv;	/* fbattr stuff, for the real type */
+#ifdef linux
+    struct fbcmap   origcmap;
+#endif    
 } fbFd;
 
 typedef Bool (*sunFbInitProc)(
@@ -261,6 +320,12 @@
     sunFbInitProc	init;	/* init procedure for this fb */
     char*		name;	/* /usr/include/fbio names */
 } sunFbDataRec;
+
+#ifdef linux
+extern Bool		vtOn;
+#else
+#define vtOn TRUE
+#endif
 
 #ifdef XKB
 extern Bool		noXkbExtension;
diff -ur xc.vanilla/programs/Xserver/hw/sun/sunCfb.c xc/programs/Xserver/hw/sun/sunCfb.c
--- xc.vanilla/programs/Xserver/hw/sun/sunCfb.c	Thu Oct  5 12:36:45 1995
+++ xc/programs/Xserver/hw/sun/sunCfb.c	Mon Jun  3 11:07:14 1996
@@ -97,6 +97,7 @@
 {
     struct fbcmap sunCmap;
 
+    if (!vtOn) return;
     sunCmap.index = dex;
     sunCmap.count = count;
     sunCmap.red = &rmap[dex];
@@ -270,7 +271,7 @@
 }
 
 #if !defined(i386) && !defined(__bsdi__) /* { */
-
+#ifndef linux /* Only have definitions for cg6 */
 #ifdef SVR4
 #include <sys/cg2reg.h>
 #else
@@ -399,6 +400,7 @@
 	cfbCreateDefColormap, sunSaveScreen, (int) ((CG4Ptr) 0)->cpixel);
 }
 
+#endif /* !linux */
 #ifdef FBTYPE_SUNFAST_COLOR /* { */
 
 #define CG6_MMAP_OFFSET 0x70000000
@@ -421,8 +423,9 @@
 			sunFbs[screen].info.fb_height + CG6_IMAGE_OFFSET
 	if ((fb = sunMemoryMap (FBSIZE,
 			     (off_t) CG6_MMAP_OFFSET, 
-			     sunFbs[screen].fd)) == NULL)
+			     sunFbs[screen].fd)) == NULL) {
 	    return FALSE;
+        }
 	sunFbs[screen].fb = fb;
 #undef FBSIZE
     }
@@ -436,8 +439,9 @@
 	    sunFbs[screen].info.fb_depth))
 	return FALSE;
     if (sunNoGX == FALSE) {
-	if (!sunGXInit (pScreen, &sunFbs[screen]))
+	if (!sunGXInit (pScreen, &sunFbs[screen])) {
 	    return FALSE;
+	}
     }
     if (!sunCfbFinishScreenInit(pScreen,
 	    sunFbs[screen].fb + CG6_IMAGE_OFFSET,
@@ -445,14 +449,16 @@
 	    sunFbs[screen].info.fb_height,
 	    monitorResolution, monitorResolution, 
 	    sunFbs[screen].info.fb_width,
-	    sunFbs[screen].info.fb_depth))
+	    sunFbs[screen].info.fb_depth)) {
 	return FALSE;
+    }
     if (sunNoGX == FALSE) {
 	miSetZeroLineBias(pScreen, GXZEROLINEBIAS);
     }
     CGScreenInit (pScreen);
-    if (!sunScreenInit (pScreen))
+    if (!sunScreenInit (pScreen)) {
 	return FALSE;
+    }
     sunSaveScreen (pScreen, SCREEN_SAVER_OFF);
     return cfbCreateDefColormap(pScreen);
 }
diff -ur xc.vanilla/programs/Xserver/hw/sun/sunCursor.c xc/programs/Xserver/hw/sun/sunCursor.c
--- xc.vanilla/programs/Xserver/hw/sun/sunCursor.c	Mon Apr 18 02:29:35 1994
+++ xc/programs/Xserver/hw/sun/sunCursor.c	Tue Jun  4 11:06:20 1996
@@ -46,7 +46,7 @@
 
 static void sunLoadCursor();
 
-static Bool
+Bool
 sunRealizeCursor (pScreen, pCursor)
     ScreenPtr	pScreen;
     CursorPtr	pCursor;
@@ -54,6 +54,7 @@
     SetupCursor(pScreen);
     int	    x, y;
 
+    if (!vtOn) return TRUE;
     /* miRecolorCursor does this */
     if (pCurPriv->pCursor == pCursor)
     {
@@ -119,6 +120,7 @@
     DDXPointRec	ptSrc;
     unsigned char   source_temp[1024], mask_temp[1024];
 
+    if (!vtOn) return;
     fbcursor.set = FB_CUR_SETALL;
     fbcursor.enable = 1;
     fbcursor.pos.x = x;
@@ -182,6 +184,7 @@
     SetupCursor(pScreen);
     struct fbcurpos pos;
 
+    if (!vtOn) return;
     pos.x = x;
     pos.y = y;
     ioctl (sunFbs[pScreen->myNum].fd, FBIOSCURPOS, &pos);
@@ -266,6 +269,7 @@
     SetupCursor (pScreen);
     struct fbcursor fbcursor;
 
+    if (!vtOn) return;
     if (pCurPriv->has_cursor)
     {
     	fbcursor.set = FB_CUR_SETCUR;
diff -ur xc.vanilla/programs/Xserver/hw/sun/sunFbs.c xc/programs/Xserver/hw/sun/sunFbs.c
--- xc.vanilla/programs/Xserver/hw/sun/sunFbs.c	Thu Oct  5 12:36:47 1995
+++ xc/programs/Xserver/hw/sun/sunFbs.c	Thu May 23 19:00:46 1996
@@ -103,7 +103,7 @@
     mapsize = ((int) len + pagemask) & ~pagemask;
     addr = 0;
 
-#if !defined(__bsdi__) && !defined(_MAP_NEW)
+#if !defined(linux) && (!defined(__bsdi__) && !defined(_MAP_NEW))
     if ((addr = (caddr_t) valloc (mapsize)) == NULL) {
 	Error ("Couldn't allocate frame buffer memory");
 	(void) close (fd);
@@ -118,12 +118,13 @@
      */
     if ((int)(mapaddr = (pointer) mmap (addr,
 		mapsize,
-		PROT_READ | PROT_WRITE, MAP_PRIVATE,
-		fd, off)) == -1)
+		PROT_READ | PROT_WRITE, MAP_PRIVATE|_MAP_NEW,
+		fd, off)) == -1){
 	mapaddr = (pointer) mmap (addr,
 		    mapsize,
-		    PROT_READ | PROT_WRITE, MAP_SHARED,
+		    PROT_READ | PROT_WRITE, MAP_SHARED|_MAP_NEW,
 		    fd, off);
+}
     if (mapaddr == (pointer) -1) {
 	Error ("mapping frame buffer memory");
 	(void) close (fd);
@@ -267,8 +268,9 @@
     if (!fb) {
 	if ((fb = sunMemoryMap ((size_t) sunFbs[scrn].info.fb_size, 
 			     offset, 
-			     sunFbs[scrn].fd)) == NULL)
+			     sunFbs[scrn].fd)) == NULL) {
 	    return FALSE;
+        }
 	sunFbs[scrn].fb = fb;
     }
     /* mfbScreenInit() or cfbScreenInit() */
diff -ur xc.vanilla/programs/Xserver/hw/sun/sunGX.c xc/programs/Xserver/hw/sun/sunGX.c
--- xc.vanilla/programs/Xserver/hw/sun/sunGX.c	Fri Jun 16 00:32:58 1995
+++ xc/programs/Xserver/hw/sun/sunGX.c	Fri May 31 13:27:44 1996
@@ -418,7 +418,7 @@
     int width, height;
     int dstx, dsty;
 {
-    if (pSrcDrawable->type != DRAWABLE_WINDOW)
+    if (pSrcDrawable->type != DRAWABLE_WINDOW || !vtOn)
 	return cfbCopyArea (pSrcDrawable, pDstDrawable,
             pGC, srcx, srcy, width, height, dstx, dsty);
     return cfbBitBlt (pSrcDrawable, pDstDrawable,
@@ -552,6 +552,8 @@
     RegionPtr		ret;
     int			(*doBitBlt)();
 
+    if (!vtOn) return cfbCopyPlane(pSrcDrawable, pDstDrawable, pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
+    
     if (pSrcDrawable->bitsPerPixel == 1 && pDstDrawable->bitsPerPixel == 8)
     {
     	if (bitPlane == 1)
@@ -664,6 +666,11 @@
     int		    n;
     int		    xorg, yorg;
 
+    if (!vtOn) {
+        cfbPolyFillRect(pDrawable, pGC, nrectFill, prectInit);
+        return;
+    }
+
     priv = (cfbPrivGC *) pGC->devPrivates[cfbGCPrivateIndex].ptr;
     prgnClip = priv->pCompositeClip;
     prect = prectInit;
@@ -815,6 +822,10 @@
     register int    r;
     BoxPtr	    extents;
 
+    if (!vtOn) {
+        (gxPriv->FillSpans)(pDrawable, pGC, n, ppt, pwidth, fSorted);
+        return;
+    }
     GXDrawInit(gx,pGC->fgPixel,gx_solid_rop_table[pGC->alu]|POLY_O,pGC->planemask)
     if (gxPriv->stipple)
 	GXStippleInit(gx,gxPriv->stipple);
@@ -1074,6 +1085,10 @@
     int			old_width = 0;
 #endif
 
+    if (!vtOn) {
+        (gxPriv->PolyFillArc)(pDraw, pGC, narcs, parcs);
+        return;
+    }
     GXDrawInit(gx,pGC->fgPixel,gx_solid_rop_table[pGC->alu]|POLY_O,pGC->planemask);
     if (gxPriv->stipple)
 	GXStippleInit(gx,gxPriv->stipple);
@@ -1191,6 +1206,10 @@
     } GXPointRec, *GXPointPtr;
     GXPointPtr	    tri, qua;
 
+    if (!vtOn) {
+        (gxPriv->FillPolygon)(pDrawable, pGC, shape, mode, count, ptsIn);
+        return;
+    }
     if (count < 3)
 	return;
     if (shape != Convex && count > 4)
@@ -1324,6 +1343,10 @@
     int		    r;
     unsigned char   *baseAddr, *loAddr, *hiAddr, *saveAddr = 0, save;
 
+    if (!vtOn) {
+        (gxPriv->PolySegment)(pDrawable, pGC, nseg, pSeg);
+        return;
+    }
     GXDrawInit(gx,pGC->fgPixel,gx_solid_rop_table[pGC->alu]|POLY_O,pGC->planemask);
     if (gxPriv->stipple)
 	GXStippleInit(gx,gxPriv->stipple);
@@ -1391,6 +1414,10 @@
     Bool	    careful;
     Bool	    capNotLast;
 
+    if (!vtOn) {
+        (gxPriv->Polylines)(pDrawable, pGC, mode, npt, ppt);
+        return;
+    }
     if (!--npt)
 	return;
     GXDrawInit(gx,pGC->fgPixel,gx_solid_rop_table[pGC->alu]|POLY_O,pGC->planemask);
@@ -1513,6 +1540,11 @@
     int		    r;
     int		    x, y;
 
+    if (!vtOn) {
+        miPolyRectangle (pDrawable, pGC, nrect, prect);
+        return;
+    }
+    
     GXDrawInit(gx,pGC->fgPixel,gx_solid_rop_table[pGC->alu]|POLY_N,pGC->planemask);
     if (gxPriv->stipple)
 	GXStippleInit(gx,gxPriv->stipple);
@@ -1551,6 +1583,11 @@
     BoxPtr	    extents;
     BoxRec	    box;
 
+    if (!vtOn) {
+        sunGXPrivGCPtr gxPriv = sunGXGetGCPrivate (pGC);
+        (gxPriv->PolyGlyphBlt)(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
+        return;
+    }
     clip = ((cfbPrivGC *)(pGC->devPrivates[cfbGCPrivateIndex].ptr))->pCompositeClip;
     extents = &clip->extents;
 
@@ -1634,6 +1671,11 @@
     RegionPtr	    clip;
     unsigned long   rop;
 
+    if (!vtOn) {
+        sunGXPrivGCPtr gxPriv = sunGXGetGCPrivate (pGC);
+        (gxPriv->ImageGlyphBlt)(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
+        return;
+    }
     widthGlyph = FONTMAXBOUNDS(pfont,characterWidth);
     h = FONTASCENT(pfont) + FONTDESCENT(pfont);
     clip = ((cfbPrivGC *)(pGC->devPrivates[cfbGCPrivateIndex].ptr))->pCompositeClip;
@@ -1744,6 +1786,11 @@
     CharInfoPtr *ppci;		/* array of character info */
     pointer pglyphBase;		/* start of array of glyphs */
 {
+    if (!vtOn) {
+        sunGXPrivGCPtr gxPriv = sunGXGetGCPrivate (pGC);
+        (gxPriv->PolyGlyphBlt)(pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
+        return;
+    }
     sunGXTEGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, (char *) 1);
 }
 
@@ -2380,6 +2427,19 @@
 		pGC->ops->devPrivate.val = 1;
 	    }
 	}
+#ifdef linux	
+	if (newops = cfbMatchCommon (pGC, devPriv))
+	{
+	    gxPriv->FillSpans = newops->FillSpans;
+	    gxPriv->PolyFillArc = newops->PolyFillArc;
+	    gxPriv->FillPolygon = newops->FillPolygon;
+	    gxPriv->PolySegment = newops->PolySegment;
+	    gxPriv->Polylines = newops->Polylines;
+	    gxPriv->PolyGlyphBlt = newops->PolyGlyphBlt;
+	    gxPriv->ImageGlyphBlt = newops->ImageGlyphBlt;
+	}
+#endif	
+	
     }
 
     canGX = pGC->fillStyle == FillSolid || gxPriv->stipple;
@@ -2388,8 +2448,15 @@
     if (new_line)
     {
 	pGC->ops->FillPolygon = miFillPolygon;
-	if (devPriv->oneRect && canGX)
+	if (devPriv->oneRect && canGX) 
+	{
+#ifdef linux	
+	    gxPriv->FillPolygon = miFillPolygon;
+	    if (pGC->fillStyle == FillSolid)
+	        gxPriv->FillPolygon = (devPriv->rop == GXcopy) ? cfbFillPoly1RectCopy : cfbFillPoly1RectGeneral;
+#endif	        
 	    pGC->ops->FillPolygon = sunGXFillPoly1Rect;
+	}
 	if (pGC->lineWidth == 0)
 	{
 	    if ((pGC->lineStyle == LineSolid) && (pGC->fillStyle == FillSolid))
@@ -2420,6 +2487,10 @@
 	    {
 		if (devPriv->oneRect && canGX && widOK)
 		{
+#ifdef linux		
+		    gxPriv->PolySegment = cfb8SegmentSS1Rect;
+		    gxPriv->Polylines = cfb8LineSS1Rect;
+#endif		    
 		    pGC->ops->PolySegment = sunGXPolySeg1Rect;
 		    pGC->ops->Polylines = sunGXPolylines1Rect;
 		}
@@ -2466,6 +2537,13 @@
         {
 	    if (pGC->fillStyle == FillSolid) 
 	    {
+#ifdef linux
+		gxPriv->PolyGlyphBlt = 
+#ifdef WriteBitGroup
+			(devPriv->rop == GXcopy) ? cfbPolyGlyphBlt8 : 
+#endif
+			miPolyGlyphBlt;
+#endif	    
 		if (TERMINALFONT (pGC->font))
 		    pGC->ops->PolyGlyphBlt = sunGXPolyTEGlyphBlt;
 		else
@@ -2483,9 +2561,14 @@
 
 
     if (new_fillspans) {
-	if (canGX)
-	    pGC->ops->FillSpans = sunGXFillSpans;
-	else switch (pGC->fillStyle) {
+	switch (pGC->fillStyle) {
+	case FillSolid:
+	    switch(devPriv->rop) {
+	        case GXcopy: pGC->ops->FillSpans = cfbSolidSpansCopy; break;
+	        case GXxor: pGC->ops->FillSpans = cfbSolidSpansXor; break;
+	        default: pGC->ops->FillSpans = cfbSolidSpansGeneral; break;
+	    }
+	    break;
 	case FillTiled:
 	    if (devPriv->pRotatedPixmap)
 	    {
@@ -2512,6 +2595,12 @@
 	default:
 	    FatalError("cfbValidateGC: illegal fillStyle\n");
 	}
+	if (canGX) {
+#ifdef linux	
+	    gxPriv->FillSpans = pGC->ops->FillSpans;
+#endif	    
+	    pGC->ops->FillSpans = sunGXFillSpans;
+	}
     } /* end of new_fillspans */
 
     if (new_fillarea) {
@@ -2519,6 +2608,11 @@
 	pGC->ops->PolyFillArc = miPolyFillArc;
 	if (canGX)
 	{
+#ifdef linux
+	    gxPriv->PolyFillArc = miPolyFillArc;
+	    if (pGC->fillStyle == FillSolid)
+		gxPriv->PolyFillArc = (devPriv->rop == GXcopy) ? cfbPolyFillArcSolidCopy : cfbPolyFillArcSolidGeneral;	    
+#endif	
 	    pGC->ops->PolyFillArc = sunGXPolyFillArc;
 	    pGC->ops->PolyFillRect = sunGXPolyFillRect;
 	    if (devPriv->oneRect)
@@ -2554,6 +2648,20 @@
     gxPriv = sunGXGetGCPrivate(pGC);
     gxPriv->type = DRAWABLE_WINDOW;
     gxPriv->stipple = 0;
+#ifdef linux    
+    gxPriv->FillSpans = cfbSolidSpansCopy;
+    gxPriv->PolyFillArc = cfbPolyFillArcSolidCopy;
+    gxPriv->FillPolygon = miFillPolygon;
+    gxPriv->PolySegment = cfbSegmentSS;
+    gxPriv->Polylines = cfbLineSS;
+#ifdef WriteBitGroup    
+    gxPriv->PolyGlyphBlt = cfbImageGlyphBlt8;
+    gxPriv->ImageGlyphBlt = cfbPolyGlyphBlt8;
+#else
+    gxPriv->PolyGlyphBlt = miImageGlyphBlt;
+    gxPriv->ImageGlyphBlt = miPolyGlyphBlt;
+#endif    
+#endif    
     return TRUE;
 }
 
@@ -2733,6 +2841,10 @@
     WindowPtr	pBgWin;
     pPrivWin = (cfbPrivWin *)(pWin->devPrivates[cfbWindowPrivateIndex].ptr);
 
+    if (!vtOn) {
+    	cfbPaintWindow(pWin, pRegion, what);
+        return;
+    }
     switch (what) {
     case PW_BACKGROUND:
 	stipple = sunGXGetWindowPrivate(pWin);
@@ -2828,6 +2940,11 @@
     WindowPtr pwinRoot;
     extern WindowPtr *WindowTable;
 
+    if (!vtOn) {
+    	cfbCopyWindow(pWin, ptOldOrg, prgnSrc);
+    	return;
+    }
+    
     pwinRoot = WindowTable[pWin->drawable.pScreen->myNum];
 
     prgnDst = REGION_CREATE(pWin->drawable.pScreen, NULL, 1);
diff -ur xc.vanilla/programs/Xserver/hw/sun/sunGX.h xc/programs/Xserver/hw/sun/sunGX.h
--- xc.vanilla/programs/Xserver/hw/sun/sunGX.h	Mon Apr 18 02:29:39 1994
+++ xc/programs/Xserver/hw/sun/sunGX.h	Fri May 31 10:27:07 1996
@@ -229,6 +229,89 @@
 typedef struct _sunGXPrivGC {
     int		    type;
     sunGXStipplePtr stipple;
+    
+    void	(* FillSpans)(
+#if NeedNestedPrototypes
+		DrawablePtr /*pDrawable*/,
+		GCPtr /*pGC*/,
+		int /*nInit*/,
+		DDXPointPtr /*pptInit*/,
+		int * /*pwidthInit*/,
+		int /*fSorted*/
+#endif
+);
+
+    void	(* Polylines)(
+#if NeedNestedPrototypes
+		DrawablePtr /*pDrawable*/,
+		GCPtr /*pGC*/,
+		int /*mode*/,
+		int /*npt*/,
+		DDXPointPtr /*pptInit*/
+#endif
+);
+
+    void	(* PolySegment)(
+#if NeedNestedPrototypes
+		DrawablePtr /*pDrawable*/,
+		GCPtr /*pGC*/,
+		int /*nseg*/,
+		xSegment * /*pSegs*/
+#endif
+);
+
+    void	(* PolyArc)(
+#if NeedNestedPrototypes
+		DrawablePtr /*pDrawable*/,
+		GCPtr /*pGC*/,
+		int /*narcs*/,
+		xArc * /*parcs*/
+#endif
+);
+
+    void	(* FillPolygon)(
+#if NeedNestedPrototypes
+		DrawablePtr /*pDrawable*/,
+		GCPtr /*pGC*/,
+		int /*shape*/,
+		int /*mode*/,
+		int /*count*/,
+		DDXPointPtr /*pPts*/
+#endif
+);
+
+    void	(* PolyFillArc)(
+#if NeedNestedPrototypes
+		DrawablePtr /*pDrawable*/,
+		GCPtr /*pGC*/,
+		int /*narcs*/,
+		xArc * /*parcs*/
+#endif
+);
+
+    void	(* ImageGlyphBlt)(
+#if NeedNestedPrototypes
+		DrawablePtr /*pDrawable*/,
+		GCPtr /*pGC*/,
+		int /*x*/,
+		int /*y*/,
+		unsigned int /*nglyph*/,
+		CharInfoPtr * /*ppci*/,
+		pointer /*pglyphBase*/
+#endif
+);
+
+    void	(* PolyGlyphBlt)(
+#if NeedNestedPrototypes
+		DrawablePtr /*pDrawable*/,
+		GCPtr /*pGC*/,
+		int /*x*/,
+		int /*y*/,
+		unsigned int /*nglyph*/,
+		CharInfoPtr * /*ppci*/,
+		pointer /*pglyphBase*/
+#endif
+);
 } sunGXPrivGCRec, *sunGXPrivGCPtr;
 
 #define sunGXGetGCPrivate(g)	    ((sunGXPrivGCPtr) \
diff -ur xc.vanilla/programs/Xserver/hw/sun/sunInit.c xc/programs/Xserver/hw/sun/sunInit.c
--- xc.vanilla/programs/Xserver/hw/sun/sunInit.c	Thu Oct  5 12:36:49 1995
+++ xc/programs/Xserver/hw/sun/sunInit.c	Tue Jun  4 15:36:20 1996
@@ -50,6 +50,7 @@
 #include    "mi.h"
 #include    "mibstore.h"
 #include    "cfb.h"
+#include <errno.h>
 
 /* maximum pixmap depth */
 #ifndef SUNMAXDEPTH
@@ -85,7 +86,7 @@
 #endif
 );
 #define CG3I sunCG3Init
-#if defined(i386) || defined(__bsdi__) /* { */
+#if defined(linux) || defined(i386) || defined(__bsdi__) /* { */
 #define CG2I NULL
 #define CG4I NULL
 #else /* }{ */
@@ -240,7 +241,11 @@
 #if SUNMAXDEPTH > 8 /* { */
     CGEIGHT0DEV,
 #endif /* } */
+#ifndef linux
     "/dev/fb"
+#else
+    "/dev/fb0"
+#endif
 };
 #endif /* } */
 
@@ -279,7 +284,11 @@
     static int		devFbUsed;
 
     sunFbs[screen].fd = -1;
+#ifndef linux    
     if (strcmp (device, "/dev/fb") == 0 && devFbUsed)
+#else
+    if (strcmp (device, "/dev/fb0") == 0 && devFbUsed)
+#endif    
 	return FALSE;
     if (access (device, R_OK | W_OK) == -1)
 	return FALSE;
@@ -311,9 +320,9 @@
 	    if (fbattr)
 		sunFbs[screen].info = fbattr->fbtype;
 	    sunFbs[screen].fbPriv = (pointer) fbattr;
-	    if (fbattr && 
-		fbattr->fbtype.fb_type < FBTYPE_LASTPLUSONE && 
-		!sunFbData[fbattr->fbtype.fb_type].init) {
+	    if ((fbattr) && 
+		(fbattr->fbtype.fb_type < FBTYPE_LASTPLUSONE) && 
+		(!sunFbData[fbattr->fbtype.fb_type].init)) {
 		int _i;
 		ret = FALSE;
 		for (_i = 0; _i < FB_ATTR_NEMUTYPES; _i++) {
@@ -334,6 +343,17 @@
     }
     if (!ret)
 	sunFbs[screen].fd = -1;
+#ifdef linux
+    else {
+        sunFbs[screen].origcmap.index = 0;
+        sunFbs[screen].origcmap.count = 16;
+        sunFbs[screen].origcmap.red = (unsigned char *)xalloc(64);
+        sunFbs[screen].origcmap.green = (unsigned char *)xalloc(64);
+        sunFbs[screen].origcmap.blue = (unsigned char *)xalloc(64);
+        if (ioctl (sunFbs[screen].fd, FBIOGETCMAP, &(sunFbs[screen].origcmap)) < 0)
+            sunFbs[screen].origcmap.count = 0;
+    }
+#endif	
     return ret;
 }
 
@@ -442,7 +462,7 @@
  * matter since no 386i has ever been shipped with a type 3 keyboard.
  * SunOS 4.1 no longer needs this kludge.
  */
-#if !defined(i386) && !defined(KIOCGKEY)
+#if !defined(i386) && defined(KIOCGKEY)
 #define TYPE4KEYBOARDOVERRIDE
 #endif
 
@@ -520,6 +540,9 @@
     }
 }
 
+#ifdef linux
+extern void OpenLinuxConsole();
+#endif
 /*-
  *-----------------------------------------------------------------------
  * InitOutput --
@@ -579,6 +602,9 @@
 	    ErrorF("InitOutput: can't put stderr in non-block mode\n");
 	}
     }
+#ifdef linux
+    OpenLinuxConsole();
+#endif    
     pScreenInfo->imageByteOrder = IMAGE_BYTE_ORDER;
     pScreenInfo->bitmapScanlineUnit = BITMAP_SCANLINE_UNIT;
     pScreenInfo->bitmapScanlinePad = BITMAP_SCANLINE_PAD;
@@ -596,16 +622,20 @@
 	for (scr = 0; scr < MAXSCREENS; scr++)
 	    sunFbs[scr].fd = -1;
 	devList = GetDeviceList (argc, argv);
-	for (i = 0, scr = 0; devList[i] != NULL && scr < MAXSCREENS; i++)
-	    if (OpenFrameBuffer (devList[i], scr))
+	for (i = 0, scr = 0; devList[i] != NULL && scr < MAXSCREENS; i++) {
+	    if (OpenFrameBuffer (devList[i], scr)) {
 		scr++;
+            }
+        }
 	sunDevsInited = TRUE;
 	xfree (devList);
     }
-    for (scr = 0; scr < MAXSCREENS; scr++)
-	if (sunFbs[scr].fd != -1)
+    for (scr = 0; scr < MAXSCREENS; scr++) {
+	if (sunFbs[scr].fd != -1) {
 	    (void) AddScreen (sunFbData[sunFbs[scr].info.fb_type].init, 
 			      argc, argv);
+	}
+    }
     (void) OsSignal(SIGWINCH, SIG_IGN);
 }
 
@@ -630,11 +660,18 @@
 {
     DevicePtr	p, k;
     extern Bool mieqInit();
+#ifdef linux
+    extern DevicePtr linuxMouse, linuxKeyboard;
+#endif    
 
     p = AddInputDevice(sunMouseProc, TRUE);
     k = AddInputDevice(sunKbdProc, TRUE);
     if (!p || !k)
 	FatalError("failed to create input devices in InitInput");
+#ifdef linux
+    linuxMouse = p;
+    linuxKeyboard = k;
+#endif	
 
     RegisterPointerDevice(p);
     RegisterKeyboardDevice(k);
@@ -664,7 +701,6 @@
     }
 }
 
-
 #if SUNMAXDEPTH == 8
 
 Bool
@@ -850,14 +886,14 @@
 	bsFuncs = &cfbBSFuncRec;
 	break;
     case 16:
-	pScreen->CloseScreen = cfb16CloseScreen;
+	pScreen->CloseScreen = cfbCloseScreen;
 	pScreen->devPrivates[cfb16ScreenPrivateIndex].ptr =
 	    pScreen->devPrivate;
 	pScreen->devPrivate = oldDevPrivate;
 	bsFuncs = &cfb16BSFuncRec;
 	break;
     case 32:
-	pScreen->CloseScreen = cfb32CloseScreen;
+	pScreen->CloseScreen = cfbCloseScreen;
 	pScreen->devPrivates[cfb32ScreenPrivateIndex].ptr =
 	    pScreen->devPrivate;
 	pScreen->devPrivate = oldDevPrivate;
diff -ur xc.vanilla/programs/Xserver/hw/sun/sunIo.c xc/programs/Xserver/hw/sun/sunIo.c
--- xc.vanilla/programs/Xserver/hw/sun/sunIo.c	Thu Oct  5 12:36:52 1995
+++ xc/programs/Xserver/hw/sun/sunIo.c	Tue Jun  4 11:15:57 1996
@@ -188,7 +188,13 @@
 void
 ddxGiveUp()
 {
+#ifdef linux
+    extern void CloseLinuxConsole();
+#endif    
     AbortDDX ();
+#ifdef linux
+    CloseLinuxConsole();
+#endif    
 }
 
 int
@@ -199,6 +205,13 @@
 {
     extern void UseMsg();
 
+#ifdef linux
+    extern int linuxProcessArgument(int argc, char *argv[], int i);
+    int ret;
+    
+    ret = linuxProcessArgument(argc, argv, i);
+    if (ret) return ret;
+#endif
 #ifndef XKB
     if (strcmp (argv[i], "-ar1") == 0) {	/* -ar1 int */
 	if (++i >= argc) UseMsg ();
@@ -277,4 +290,10 @@
     ErrorF("-cg4frob            don't use the mono plane of the cgfour\n");
     ErrorF("-noGX               treat the GX as a dumb frame buffer\n");
 #endif
+#ifdef linux
+    ErrorF("vtXX                use the specified VT number\n");
+    ErrorF("-keeptty               ");
+    ErrorF("don't detach controlling tty (for debugging only)\n");
+#endif
 }
+
diff -ur xc.vanilla/programs/Xserver/hw/sun/sunKbd.c xc/programs/Xserver/hw/sun/sunKbd.c
--- xc.vanilla/programs/Xserver/hw/sun/sunKbd.c	Sat Feb  3 21:49:34 1996
+++ xc/programs/Xserver/hw/sun/sunKbd.c	Mon Jun  3 13:36:49 1996
@@ -80,6 +80,11 @@
 extern KeySymsRec sunKeySyms[];
 extern SunModmapRec* sunModMaps[];
 
+#ifdef linux
+extern int consoleFd;
+#include <linux/vt.h>
+#endif
+
 long	  	  sunAutoRepeatInitiate = 1000 * AUTOREPEAT_INITIATE;
 long	  	  sunAutoRepeatDelay = 1000 * AUTOREPEAT_DELAY;
 
@@ -783,7 +788,7 @@
 	|| ksym == SunXK_Compose
 	|| (keyModifiers & LockMask))) 
 	return TRUE;
-
+	
     kptr = &device->key->down[keycode >> 3];
     bit = 1 << (keycode & 7);
     if ((*kptr & bit) &&
@@ -835,6 +840,10 @@
     xEvent		xE;
     BYTE		keycode;
     CARD8		keyModifiers;
+#ifdef linux
+    KeySym		ksym;
+    extern Bool		NoVT;
+#endif    
 
     keycode = (fe->id & 0x7f) + MIN_KEYCODE;
 
@@ -855,6 +864,33 @@
     xE.u.keyButtonPointer.time = TVTOMILLI(fe->time);
     xE.u.u.type = ((fe->value == VKEY_UP) ? KeyRelease : KeyPress);
     xE.u.u.detail = keycode;
+    
+#ifdef linux
+    if ((device->key->state & ControlMask)
+    	&& (device->key->state & Mod3Mask))
+    	switch (ksym = device->key->curKeySyms.map[(fe->id - 1) * device->key->curKeySyms.mapWidth]) {
+    		case XK_BackSpace:
+    			if (xE.u.u.type == KeyPress)
+    			    GiveUp(0);
+    			return;
+    		case XK_F1:
+    		case XK_F2:
+    		case XK_F3:
+    		case XK_F4:
+    		case XK_F5:
+    		case XK_F6:
+    		case XK_F7:
+    		case XK_F8:
+    		case XK_F9:
+    		case XK_F10:
+    		case XK_F11:
+    		case XK_F12:
+    			if (!NoVT && xE.u.u.type == KeyPress)
+    			    ioctl(consoleFd, VT_ACTIVATE, ksym - XK_F1 + 1);
+    			return;
+    	}
+#endif
+
 #ifdef XKB
     if (noXkbExtension) {
 #endif
diff -ur xc.vanilla/programs/Xserver/include/servermd.h xc/programs/Xserver/include/servermd.h
--- xc.vanilla/programs/Xserver/include/servermd.h	Thu Jan  4 23:21:22 1996
+++ xc/programs/Xserver/include/servermd.h	Thu May 23 19:00:46 1996
@@ -133,7 +133,7 @@
 
 #if (defined(sun) && !(defined(i386) && defined(SVR4))) || \
     (defined(AMOEBA) && (defined(sparc) || defined(mc68000))) || \
-    (defined(__NetBSD__) && (defined(__sparc__) || defined(mc68000)))
+    ((defined(sparc) || defined(__NetBSD__)) && (defined(__sparc__) || defined(mc68000))) 
 
 #if defined(sun386) || defined(sun5)
 # define IMAGE_BYTE_ORDER	LSBFirst        /* Values for the SUN only */
@@ -313,7 +313,7 @@
      (defined(__NetBSD__) && defined(__i386__)) || \
      defined(__FreeBSD__) || \
      defined(MACH386) || \
-     defined(linux) || \
+     (defined(linux) && !defined(sparc)) || \
      (defined(AMOEBA) && defined(i80386)) || \
      defined(MINIX))
 
diff -ur xc.vanilla/programs/Xserver/mi/miarc.c xc/programs/Xserver/mi/miarc.c
--- xc.vanilla/programs/Xserver/mi/miarc.c	Wed Dec  6 23:05:38 1995
+++ xc/programs/Xserver/mi/miarc.c	Thu May 23 19:00:46 1996
@@ -69,7 +69,7 @@
 #include "Xfuncproto.h"
 
 static double miDsin(), miDcos(), miDasin(), miDatan2();
-double	cbrt(
+extern double	cbrt(
 #if NeedFunctionPrototypes
 	     double
 #endif
diff -ur xc.vanilla/programs/rgb/Imakefile xc/programs/rgb/Imakefile
--- xc.vanilla/programs/rgb/Imakefile	Sat Jan 27 00:22:18 1996
+++ xc/programs/rgb/Imakefile	Tue May 28 10:11:30 1996
@@ -20,7 +20,7 @@
          OBJS = $(OBJS1) $(OBJS2)
      PROGRAMS = $(RGB_PROG) showrgb
 #if !UseRgbTxt
-#ifdef BSD386Architecture
+#if defined(BSD386Architecture) || ( defined(SparcArchitecture) && defined(LinuxArchitecture) ) )
     DATAFILES = rgb.db
       DATADEP = rgb.db
 #else
diff -ur xc.vanilla/programs/xterm/main.c xc/programs/xterm/main.c
--- xc.vanilla/programs/xterm/main.c	Sun Dec 10 23:23:29 1995
+++ xc/programs/xterm/main.c	Thu May 23 19:00:47 1996
@@ -354,6 +354,40 @@
 #endif
 #endif
 
+#ifdef linux /* Lets undefine all the SunOS specific stuff */
+#undef TIOCHPCL
+#undef TIOCMODG
+#undef TIOCMODS
+#undef TIOCGETP
+#undef TIOCSETP
+#undef TIOCSETN
+#undef TIOCFLUSH
+#undef TIOCSETC
+#undef TIOCGETC
+#undef TIOCTCNTL
+#undef TIOCSIGNAL
+#undef TIOCSETX
+#undef TIOCGETX
+#undef TIOCSSIZE
+#undef TIOCGSIZE
+#undef TIOCUCNTL
+#undef TIOCREMOTE
+#undef TIOCSTART
+#undef TIOCSTOP
+#undef TIOCGLTC
+#undef TIOCSLTC
+#undef TIOCCDTR
+#undef TIOCSDTR
+#undef TIOCCBRK
+#undef TIOCSBRK
+#undef TIOCLGET
+#undef TIOCLSET
+#undef TIOCLBIC
+#undef TIOCLBIS
+#undef TIOCISPACE
+#undef TIOCISIZE
+#endif
+
 #ifndef X_NOT_STDC_ENV
 #include <stdlib.h>
 #else
@@ -405,7 +439,7 @@
 static struct ltchars d_ltc;
 #endif	/* TIOCSLTC */
 
-#ifdef __sgi
+#if defined(__sgi) || (defined(linux) && defined(sparc))
 #undef TIOCLSET /* XXX why is this undef-ed again? */
 #endif
 
@@ -437,6 +471,9 @@
 /* allow use of system default characters if defined and reasonable */
 #ifndef CEOF
 #define CEOF ('D'&037)
+#endif
+#ifndef CDSUSP
+#define CDSUSP ('Y'&037)
 #endif
 #ifndef CSUSP
 #define CSUSP ('Z'&037)
