diff -u --recursive --new-file v1.3.64/linux/CREDITS linux/CREDITS
--- v1.3.64/linux/CREDITS	Wed Feb 14 14:37:05 1996
+++ linux/CREDITS	Fri Feb 16 09:47:15 1996
@@ -869,6 +869,14 @@
 D: Keeper of the Jargon File and curator of the Retrocomputing Museum
 D: Author, Emacs VC and GUD modes
 
+N: Bernhard Kaindl
+E: bartelt@computerhaus.at
+D: Author of a menu based configuration tool, kmenu, which 
+D: is the precedessor of 'make menuconfig' and 'make xconfig'.
+S: Tallak 95
+S: 8103 Rein
+S: Austria
+
 N: William E. Roadcap
 E: roadcapw@cfw.com
 W: http://www.cfw.com/~roadcapw
diff -u --recursive --new-file v1.3.64/linux/Documentation/Configure.help linux/Documentation/Configure.help
--- v1.3.64/linux/Documentation/Configure.help	Fri Feb 16 11:34:02 1996
+++ linux/Documentation/Configure.help	Sat Feb 17 09:19:36 1996
@@ -297,9 +297,39 @@
 
 Using SRM as bootloader
 CONFIG_ALPHA_SRM
-#####
-##### Don't know what this is about.
-#####
+  This selects whether the Linux kernel on an Alpha machines is being
+  booted through SRM (the DEC Unix firmware).  If you use MILO, answer
+  "no" here.  Except for Cabriolet and some other evaluation-board based
+  machines, this option has no effect and can be set to either value
+  with no ill effects.
+
+Kernel KGDB support
+CONFIG_KGDB
+  Selects whether kernel debugging via serial line should be enabled.
+  Enable this option only if you really plan on debugging the Linux
+  kernel.  If you enable this option, take a look at
+  arch/alpha/kernel/kgdb.c and search for SERIAL_LINE to find out
+  what serial port the kernel will use (either /dev/ttyS0 or
+  /dev/ttyS1).  Then, hook up a serial line to another machine
+  (must be another 64-bit machine when debugging a 64-bit kernel)
+  and start "gdb vmlinux" on that machine.  Then boot the kernel on
+  the target system with boot option "kgdb".  The kernel will display:
+     kgdb: stealing /dev/ttyS0 and initializing it to 38400 baud
+     kgdb: waiting for gdb to connect...
+  At this point, enter the following commands on the system running
+  gdb:
+     gdb> set remotebaud 38400
+     gdb> set target remote /dev/<whatever>
+  After a few seconds, gdb should respond with the usual prompt, showing
+  the source at which the kernel is currently executing.  You can now
+  use the normal gdb features such as breakpoints to debug the kernel.
+  WARNING: when CONFIG_KGDB is enabled, send a Ctrl-C character over
+  the serial line will drop the kernel into the debugger!
+
+Kernel tracing support
+CONFIG_KGDB_TRACING
+  Enabling this option allows to collect kernel execution traces.  Don't
+  try this at home!
 
 Echo console messages on /dev/ttyS1
 CONFIG_SERIAL_ECHO
@@ -310,9 +340,10 @@
 
 TGA Console Support
 CONFIG_TGA_CONSOLE
-#####
-##### Has something to do with Alpha.
-#####
+  Many Alpha systems are shipped with a graphics card that implements the
+  TGA interface (much like the VGA standard, but older TGA adaptors are
+  *not* VGA compatible).  On such systems, this option needs to be enabled
+  such that the TGA driver rather than the standard VGA driver is used.
 
 PCI bios support
 CONFIG_PCI
@@ -457,7 +488,7 @@
   to be created as loadable modules, you also have the responsibility
   to load the corresponding module (via insmod/modprobe) before you
   use it.  If you select Y here, the kernel will take care of this
-  all by itself, together with a user level daemon; "kerneld".
+  all by itself, together with a user level daemon, "kerneld".
   Note that "kerneld" will also automatically unload all unused
   modules, so you don't have to use "rmmod" either.
   There are some other "kernel callouts" that will be available
@@ -523,6 +554,13 @@
   the programs lynx, netscape or Mosaic). Information about the
   multicast capabilities of the various network cards is contained in
   drivers/net/README.multicast. For most people, it's safe to say N.
+
+IP: optimize as router not host
+  Some Linux network drivers use a technique called copy and checksum
+  to optimize host performance. For a machine which is forwarding most
+  packets to another host this is however a loss. This parameter turns
+  off copy and checksum from devices. It may also do other changes in
+  future.
 
 IP: firewalling
 CONFIG_IP_FIREWALL
diff -u --recursive --new-file v1.3.64/linux/Makefile linux/Makefile
--- v1.3.64/linux/Makefile	Fri Feb 16 11:34:03 1996
+++ linux/Makefile	Sat Feb 17 11:10:58 1996
@@ -1,6 +1,6 @@
 VERSION = 1
 PATCHLEVEL = 3
-SUBLEVEL = 64
+SUBLEVEL = 65
 
 ARCH = i386
 
@@ -268,7 +268,10 @@
 endif
 
 modules: include/linux/version.h
-	@set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i CFLAGS="$(CFLAGS) $(MODFLAGS)" modules; done
+	@set -e; \
+	for i in $(SUBDIRS); \
+	do $(MAKE) -C $$i CFLAGS="$(CFLAGS) $(MODFLAGS)" MAKING_MODULES=1 modules; \
+	done
 
 modules_install:
 	@( \
diff -u --recursive --new-file v1.3.64/linux/Rules.make linux/Rules.make
--- v1.3.64/linux/Rules.make	Fri Feb  9 17:52:56 1996
+++ linux/Rules.make	Sat Feb 17 08:32:34 1996
@@ -172,9 +172,17 @@
 $(LX_OBJS) $(OX_OBJS): $(TOPDIR)/include/linux/modversions.h
 	$(CC) $(CFLAGS) -DMODVERSIONS -DEXPORT_SYMTAB -c $(@:.o=.c)
 
-dep fastdep $(M_OBJS): $(TOPDIR)/include/linux/modversions.h
+dep fastdep: $(TOPDIR)/include/linux/modversions.h
 
 endif
+$(M_OBJS): $(TOPDIR)/include/linux/modversions.h
+ifdef MAKING_MODULES
+$(O_OBJS) $(L_OBJS): $(TOPDIR)/include/linux/modversions.h
+endif
+# This is needed to ensure proper dependency for multipart modules such as
+# fs/ext.o.  (Otherwise, not all subobjects will be recompiled when
+# version information changes.)
+
 endif
 
 #
diff -u --recursive --new-file v1.3.64/linux/arch/alpha/config.in linux/arch/alpha/config.in
--- v1.3.64/linux/arch/alpha/config.in	Fri Feb  9 17:52:56 1996
+++ linux/arch/alpha/config.in	Sat Feb 17 09:19:36 1996
@@ -29,14 +29,15 @@
 
 choice 'Alpha system type' \
 	"Avanti		CONFIG_ALPHA_AVANTI		\
-	 Jensen		CONFIG_ALPHA_JENSEN		\
-	 Noname		CONFIG_ALPHA_NONAME		\
 	 Cabriolet	CONFIG_ALPHA_CABRIOLET		\
 	 EB66		CONFIG_ALPHA_EB66		\
 	 EB66+		CONFIG_ALPHA_EB66P		\
-	 EB64+		CONFIG_ALPHA_EB64P" Cabriolet
+	 EB64+		CONFIG_ALPHA_EB64P		\
+	 Jensen		CONFIG_ALPHA_JENSEN		\
+	 Noname		CONFIG_ALPHA_NONAME		\
+	 Platform2000	CONFIG_ALPHA_P2K" Cabriolet
 if [ "$CONFIG_ALPHA_NONAME" = "y" -o "$CONFIG_ALPHA_EB66" = "y" \
-	-o "$CONFIG_ALPHA_EB66P" = "y" ]
+	-o "$CONFIG_ALPHA_EB66P" = "y" -o "$CONFIG_ALPHA_P2K" = "y" ]
 then
 	define_bool CONFIG_PCI y
 	define_bool CONFIG_ALPHA_LCA y
diff -u --recursive --new-file v1.3.64/linux/arch/alpha/defconfig linux/arch/alpha/defconfig
--- v1.3.64/linux/arch/alpha/defconfig	Sun Feb 11 15:32:43 1996
+++ linux/arch/alpha/defconfig	Sat Feb 17 09:19:36 1996
@@ -16,6 +16,7 @@
 # CONFIG_ALPHA_JENSEN is not set
 # CONFIG_ALPHA_NONAME is not set
 # CONFIG_ALPHA_CABRIOLET is not set
+# CONFIG_ALPHA_P2K is not set
 # CONFIG_ALPHA_EB66 is not set
 # CONFIG_ALPHA_EB66P is not set
 CONFIG_ALPHA_EB64P=y
diff -u --recursive --new-file v1.3.64/linux/arch/alpha/kernel/apecs.c linux/arch/alpha/kernel/apecs.c
--- v1.3.64/linux/arch/alpha/kernel/apecs.c	Sun Oct 29 11:38:47 1995
+++ linux/arch/alpha/kernel/apecs.c	Sat Feb 17 09:19:36 1996
@@ -120,19 +120,20 @@
 	unsigned int stat0, value;
 	unsigned int haxr2 = 0; /* to keep gcc quiet */
 
-#ifdef CONFIG_ALPHA_AVANTI
+#ifdef CONFIG_ALPHA_SRM
+	/* some SRMs step on these registers during a machine check: */
 	register long s0 asm ("9");
 	register long s1 asm ("10");
 	register long s2 asm ("11");
 	register long s3 asm ("12");
 	register long s4 asm ("13");
 	register long s5 asm ("14");
-	asm volatile ("# %0" : "r="(s0));/* SRM X4.2 on Avanti steps on this */
-	asm volatile ("# %0" : "r="(s1));/* SRM X4.2 on Avanti steps on this */
-	asm volatile ("# %0" : "r="(s2));/* SRM X4.2 on Avanti steps on this */
-	asm volatile ("# %0" : "r="(s3));/* SRM X4.2 on Avanti steps on this */
-	asm volatile ("# %0" : "r="(s4));/* SRM X4.2 on Avanti steps on this */
-	asm volatile ("# %0" : "r="(s5));/* SRM X4.2 on Avanti steps on this */
+	asm volatile ("# %0" : "r="(s0));
+	asm volatile ("# %0" : "r="(s1));
+	asm volatile ("# %0" : "r="(s2));
+	asm volatile ("# %0" : "r="(s3));
+	asm volatile ("# %0" : "r="(s4));
+	asm volatile ("# %0" : "r="(s5));
 #endif
 
 	save_flags(flags);	/* avoid getting hit by machine check */
@@ -200,13 +201,14 @@
 		mb();
 	}
 	restore_flags(flags);
-#ifdef CONFIG_ALPHA_AVANTI
-	asm volatile ("# %0" :: "r"(s0));/* SRM X4.2 on Avanti steps on this */
-	asm volatile ("# %0" :: "r"(s1));/* SRM X4.2 on Avanti steps on this */
-	asm volatile ("# %0" :: "r"(s2));/* SRM X4.2 on Avanti steps on this */
-	asm volatile ("# %0" :: "r"(s3));/* SRM X4.2 on Avanti steps on this */
-	asm volatile ("# %0" :: "r"(s4));/* SRM X4.2 on Avanti steps on this */
-	asm volatile ("# %0" :: "r"(s5));/* SRM X4.2 on Avanti steps on this */
+#ifdef CONFIG_ALPHA_SRM
+	/* some SRMs step on these registers during a machine check: */
+	asm volatile ("# %0" :: "r"(s0));
+	asm volatile ("# %0" :: "r"(s1));
+	asm volatile ("# %0" :: "r"(s2));
+	asm volatile ("# %0" :: "r"(s3));
+	asm volatile ("# %0" :: "r"(s4));
+	asm volatile ("# %0" :: "r"(s5));
 #endif
 	return value;
 }
diff -u --recursive --new-file v1.3.64/linux/arch/alpha/kernel/bios32.c linux/arch/alpha/kernel/bios32.c
--- v1.3.64/linux/arch/alpha/kernel/bios32.c	Fri Feb 16 11:34:03 1996
+++ linux/arch/alpha/kernel/bios32.c	Sat Feb 17 09:19:37 1996
@@ -85,15 +85,35 @@
 static unsigned int	io_base	 = 64*KB;	/* <64KB are (E)ISA ports */
 static unsigned int	mem_base = 16*MB;	/* <16MB is ISA memory */
 
+/*
+ * Disable PCI device DEV so that it does not respond to I/O or memory
+ * accesses.
+ */
+static void disable_dev(struct pci_dev *dev)
+{
+	struct pci_bus *bus;
+	unsigned short cmd;
+
+	bus = dev->bus;
+	pcibios_read_config_word(bus->number, dev->devfn, PCI_COMMAND, &cmd);
+
+	/* hack, turn it off first... */
+	cmd &= (~PCI_COMMAND_IO & ~PCI_COMMAND_MEMORY & ~PCI_COMMAND_MASTER);
+	pcibios_write_config_word(bus->number, dev->devfn, PCI_COMMAND, cmd);
+}
+
 
 /*
  * Layout memory and I/O for a device:
  */
+#define MAX(val1, val2) ( ((val1) > (val2)) ? val1 : val2)
+
 static void layout_dev(struct pci_dev *dev)
 {
 	struct pci_bus *bus;
 	unsigned short cmd;
 	unsigned int base, mask, size, reg;
+	unsigned int alignto;
 
 	bus = dev->bus;
 	pcibios_read_config_word(bus->number, dev->devfn, PCI_COMMAND, &cmd);
@@ -110,6 +130,7 @@
 			/* this base-address register is unused */
 			continue;
 		}
+
 		/*
 		 * We've read the base address register back after
 		 * writing all ones and so now we must decode it.
@@ -123,7 +144,9 @@
 			base &= PCI_BASE_ADDRESS_IO_MASK;
 			mask = (~base << 1) | 0x1;
 			size = (mask & base) & 0xffffffff;
-			base = ALIGN(io_base, size);
+			/* align to multiple of size of minimum base */
+			alignto = MAX(0x400, size) ;
+			base = ALIGN(io_base, alignto );
 			io_base = base + size;
 			pcibios_write_config_dword(bus->number, dev->devfn, 
 						   reg, base | 0x1);
@@ -133,7 +156,6 @@
 			 * Memory space base address register.
 			 */
 			cmd |= PCI_COMMAND_MEMORY;
-
 			type = base & PCI_BASE_ADDRESS_MEM_TYPE_MASK;
 			base &= PCI_BASE_ADDRESS_MEM_MASK;
 			mask = (~base << 1) | 0x1;
@@ -183,7 +205,9 @@
 			 * address space must be accessed through
 			 * dense memory space only!
 			 */
-			base = ALIGN(mem_base, size);
+			/* align to multiple of size of minimum base */
+			alignto = MAX(0x1000, size) ;
+			base = ALIGN(mem_base, alignto);
 			if (size > 7 * 16*MB) {
 				printk("bios32 WARNING: slot %d, function %d "
 				       "requests  %dB of contiguous address "
@@ -192,15 +216,15 @@
 				       PCI_SLOT(dev->devfn),
 				       PCI_FUNC(dev->devfn), size);
 			} else {
-				if (((base / 16*MB) & 0x7) == 0) {
+				if (((base / (16*MB)) & 0x7) == 0) {
 					base &= ~(128*MB - 1);
 					base += 16*MB;
-					base  = ALIGN(base, size);
+					base  = ALIGN(base, alignto);
 				}
-				if (base / 128*MB != (base + size) / 128*MB) {
+				if (base / (128*MB) != (base + size) / (128*MB)) {
 					base &= ~(128*MB - 1);
 					base += (128 + 16)*MB;
-					base  = ALIGN(base, size);
+					base  = ALIGN(base, alignto);
 				}
 			}
 			mem_base = base + size;
@@ -222,6 +246,7 @@
 		 */
 		cmd |= PCI_COMMAND_IO;
 	}
+
 	pcibios_write_config_word(bus->number, dev->devfn, PCI_COMMAND,
 				  cmd | PCI_COMMAND_MASTER);
 }
@@ -244,6 +269,21 @@
 	bmem = mem_base = ALIGN(mem_base, 1*MB);
 
 	/*
+	 * There are times when the PCI devices have already been
+	 * setup (e.g., by MILO or SRM).  In these cases there is a
+	 * window during which two devices may have an overlapping
+	 * address range.  To avoid this causing trouble, we first
+	 * turn off the I/O and memory address decoders for all PCI
+	 * devices.  They'll be re-enabled only once all address
+	 * decoders are programmed consistently.
+	 */
+	for (dev = bus->devices; dev; dev = dev->sibling) {
+		if (dev->class >> 16 != PCI_BASE_CLASS_BRIDGE) {
+		        disable_dev(dev) ;
+		}
+	}
+
+	/*
 	 * Allocate space to each device:
 	 */
 	for (dev = bus->devices; dev; dev = dev->sibling) {
@@ -405,6 +445,7 @@
 {
 	struct pci_dev *dev;
 	unsigned char pin;
+
 	/*
 	 * Go through all devices, fixing up irqs as we see fit:
 	 */
@@ -489,6 +530,7 @@
 		{   -1,   -1,   -1,    -1,    -1},	/* IdSel 8,  SIO         */
 		{ 16+3, 16+3, 16+8, 16+12, 16+16}       /* IdSel 9,  slot 3, J22 */
 	};
+
 	common_fixup(5, 9, 5, irq_tab, 0x398);
 }
 
@@ -549,9 +591,11 @@
 
 
 /*
- * Fixup configuration for Noname (AXPpci33) and Avanti (AlphaStation 240).
+ * Fixup configuration for all boards that route the PCI interrupts
+ * through the SIO PCI/ISA bridge.  This includes Noname (AXPpci33),
+ * Avanti (AlphaStation) and Kenetics's Platform 2000.
  */
-static inline void avanti_and_noname_fixup(void)
+static inline void sio_fixup(void)
 {
 	struct pci_dev *dev;
 	/*
@@ -573,16 +617,24 @@
 	 * driven at all).
 	 */
 	static const char pirq_tab[][5] = {
+#ifdef CONFIG_ALPHA_P2K
+		{ 0,  0, -1, -1, -1}, /* idsel  6 (53c810) */
+		{-1, -1, -1, -1, -1}, /* idsel  7 (SIO: PCI/ISA bridge) */
+		{ 1,  1,  2,  3,  0}, /* idsel  8 (slot A) */
+		{ 2,  2,  3,  0,  1}, /* idsel  9 (slot B) */
+		{-1, -1, -1, -1, -1}, /* idsel 10 (unused) */
+		{-1, -1, -1, -1, -1}, /* idsel 11 (unused) */
+		{ 3,  3, -1, -1, -1}, /* idsel 12 (CMD0646) */
+#else
 		{ 3,  3,  3,  3,  3}, /* idsel  6 (53c810) */ 
 		{-1, -1, -1, -1, -1}, /* idsel  7 (SIO: PCI/ISA bridge) */
-		{ 2,  2, -1, -1, -1}, /* idsel  8 (slot closest to ISA) */
+		{ 2,  2, -1, -1, -1}, /* idsel  8 (Noname hack: slot closest to ISA) */
 		{-1, -1, -1, -1, -1}, /* idsel  9 (unused) */
 		{-1, -1, -1, -1, -1}, /* idsel 10 (unused) */
-		{ 0,  0,  2,  1,  0}, /* idsel 11 (slot furthest from ISA) KN25_PCI_SLOT0 */
-		{ 1,  1,  0,  2,  1}, /* idsel 12 (middle slot) KN25_PCI_SLOT1 */
-#ifdef CONFIG_ALPHA_AVANTI
-		{ 1,  2,  1,  0,  2}, /* idsel 13 KN25_PCI_SLOT2 */
-#endif /* CONFIG_ALPHA_AVANTI */
+		{ 0,  0,  2,  1,  0}, /* idsel 11 KN25_PCI_SLOT0 */
+		{ 1,  1,  0,  2,  1}, /* idsel 12 KN25_PCI_SLOT1 */
+		{ 2,  2,  1,  0,  2}, /* idsel 13 KN25_PCI_SLOT2 */
+#endif
 	};
 	/*
 	 * route_tab selects irq routing in PCI/ISA bridge so that:
@@ -607,12 +659,17 @@
 	level_bits = 0;
 	for (dev = pci_devices; dev; dev = dev->next) {
 		dev->irq = 0;
-		if (dev->bus->number != 0 ||
-		    PCI_SLOT(dev->devfn) < 6 ||
+		if (dev->bus->number != 0) {
+			printk("bios32.sio_fixup: don't know how to fixup devices on bus %d\n",
+			       dev->bus->number);
+			continue;
+		}
+		if (PCI_SLOT(dev->devfn) < 6 ||
 		    PCI_SLOT(dev->devfn) >= 6 + sizeof(pirq_tab)/sizeof(pirq_tab[0]))
 		{
-			printk("bios32.avanti_and_noname_fixup: no dev on bus %d, slot %d!!\n",
-			       dev->bus->number, PCI_SLOT(dev->devfn));
+			printk("bios32.sio_fixup: "
+			       "weird, found device %04x:%04x in non-existent slot %d!!\n",
+			       dev->vendor, dev->device, PCI_SLOT(dev->devfn));
 			continue;
 		}
 		pcibios_read_config_byte(dev->bus->number, dev->devfn,
@@ -646,31 +703,10 @@
 	/*
 	 * Now, make all PCI interrupts level sensitive.  Notice:
 	 * these registers must be accessed byte-wise.  outw() doesn't
-	 * work, for some reason.
+	 * work.
 	 */
 	outb((level_bits >> 0) & 0xff, 0x4d0);
 	outb((level_bits >> 8) & 0xff, 0x4d1);
-
-#if PCI_MODIFY
-	{
-		unsigned char hostid;
-		/*
-		 * SRM console version X3.9 seems to reset the SCSI
-		 * host-id to 0 no matter what console environment
-		 * variable pka0_host_id is set to.  Thus, if the
-		 * host-id reads out as a zero, we set it to 7.  The
-		 * SCSI controller is on the motherboard on bus 0,
-		 * slot 6
-		 */
-		if (pcibios_read_config_byte(0, PCI_DEVFN(6, 0), 0x84, &hostid)
-		    == PCIBIOS_SUCCESSFUL && (hostid == 0))
-		{
-			pcibios_write_config_byte(0, PCI_DEVFN(6, 0),
-						  0x84, 7);
-		}
-	}
-#endif /* !PCI_MODIFY */
-
 	enable_ide(0x26e);
 }
 
@@ -691,9 +727,9 @@
 	/*
 	 * Now is the time to do all those dirty little deeds...
 	 */
-#if defined(CONFIG_ALPHA_NONAME) || defined(CONFIG_ALPHA_AVANTI)
-	avanti_and_noname_fixup();
-#elif defined(CONFIG_ALPHA_CABRIOLET)
+#if defined(CONFIG_ALPHA_NONAME) || defined(CONFIG_ALPHA_AVANTI) || defined(CONFIG_ALPHA_P2K)
+	sio_fixup();
+#elif defined(CONFIG_ALPHA_CABRIOLET) || defined(CONFIG_ALPHA_EB164)
 	cabriolet_fixup();
 #elif defined(CONFIG_ALPHA_EB66P)
 	eb66p_fixup();
diff -u --recursive --new-file v1.3.64/linux/arch/alpha/kernel/entry.S linux/arch/alpha/kernel/entry.S
--- v1.3.64/linux/arch/alpha/kernel/entry.S	Sun Feb 11 15:32:43 1996
+++ linux/arch/alpha/kernel/entry.S	Sat Feb 17 09:31:24 1996
@@ -10,7 +10,7 @@
 #define rti	.long PAL_rti
 #define SIGCHLD	20
 
-#define NR_SYSCALLS 320
+#define NR_SYSCALLS 350
 #define osf_vfork sys_fork
 
 /*
@@ -626,7 +626,7 @@
 	.quad do_entSys, sys_sync, sys_kill, do_entSys, sys_setpgid
 	.quad do_entSys, sys_dup, sys_pipe, do_entSys, do_entSys
 	.quad sys_open, do_entSys, sys_getxgid, osf_sigprocmask, do_entSys
-/*50*/	.quad do_entSys, sys_acct, do_entSys, do_entSys, sys_ioctl
+/*50*/	.quad do_entSys, sys_acct, sys_sigpending, do_entSys, sys_ioctl
 	.quad do_entSys, do_entSys, sys_symlink, sys_readlink, sys_execve
 	.quad sys_umask, sys_chroot, do_entSys, sys_getpgrp, sys_getpagesize
 	.quad do_entSys, osf_vfork, sys_newstat, sys_newlstat, do_entSys
@@ -637,20 +637,20 @@
 	.quad do_entSys, sys_getitimer, sys_gethostname, sys_sethostname, sys_getdtablesize
 	.quad sys_dup2, sys_newfstat, sys_fcntl, sys_select, do_entSys
 	.quad sys_fsync, sys_setpriority, sys_socket, sys_connect, sys_accept
-/*100*/	.quad sys_getpriority, sys_send, sys_recv, sys_sigreturn, sys_bind
+/*100*/	.quad osf_getpriority, sys_send, sys_recv, sys_sigreturn, sys_bind
 	.quad sys_setsockopt, sys_listen, do_entSys, do_entSys, do_entSys
 	.quad do_entSys, sys_sigsuspend, do_entSys, do_entSys, do_entSys
 	.quad do_entSys, sys_gettimeofday, sys_getrusage, sys_getsockopt, do_entSys
 	.quad sys_readv, sys_writev, sys_settimeofday, sys_fchown, sys_fchmod
 	.quad sys_recvfrom, sys_setreuid, sys_setregid, sys_rename, sys_truncate
-	.quad sys_ftruncate, do_entSys, sys_setgid, sys_sendto, sys_shutdown
+	.quad sys_ftruncate, sys_flock, sys_setgid, sys_sendto, sys_shutdown
 	.quad sys_socketpair, sys_mkdir, sys_rmdir, sys_utimes, do_entSys
 	.quad do_entSys, sys_getpeername, do_entSys, do_entSys, sys_getrlimit
 	.quad sys_setrlimit, do_entSys, sys_setsid, sys_quotactl, do_entSys
 /*150*/	.quad sys_getsockname, do_entSys, do_entSys, do_entSys, do_entSys
 	.quad do_entSys, sys_sigaction, do_entSys, do_entSys, osf_getdirentries
 	.quad osf_statfs, osf_fstatfs, do_entSys, do_entSys, do_entSys
-	.quad osf_getdomainname, do_entSys, do_entSys, do_entSys, do_entSys
+	.quad osf_getdomainname, sys_setdomainname, do_entSys, do_entSys, do_entSys
 	.quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
 	.quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
 	.quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
@@ -660,14 +660,14 @@
 /*200*/	.quad sys_msgctl, sys_msgget, sys_msgrcv, sys_msgsnd, sys_semctl
 	.quad sys_semget, sys_semop, osf_utsname, do_entSys, osf_shmat
 	.quad sys_shmctl, sys_shmdt, sys_shmget, do_entSys, do_entSys
+	.quad do_entSys, do_entSys, sys_msync, do_entSys, do_entSys
 	.quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
 	.quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
-	.quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
-	.quad do_entSys, do_entSys, do_entSys, do_entSys, sys_getsid
+	.quad do_entSys, do_entSys, do_entSys, sys_getpgid, sys_getsid
 	.quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
 	.quad do_entSys, do_entSys, do_entSys, do_entSys, osf_proplist_syscall
 	.quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
-/*250*/	.quad do_entSys, osf_usleep_thread, do_entSys, do_entSys, do_entSys
+/*250*/	.quad do_entSys, osf_usleep_thread, do_entSys, do_entSys, sys_sysfs
 	.quad do_entSys, osf_getsysinfo, osf_setsysinfo, do_entSys, do_entSys
 	.quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
 	.quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
@@ -681,4 +681,10 @@
 /*300*/	.quad sys_bdflush, sys_sethae, sys_mount, sys_adjtimex, sys_swapoff
 	.quad sys_getdents, alpha_create_module, sys_init_module, sys_delete_module, sys_get_kernel_syms
 	.quad sys_syslog, sys_reboot, sys_clone, sys_uselib, sys_mlock
-	.quad sys_munlock, sys_mlockall, sys_munlockall, do_entSys, do_entSys
+	.quad sys_munlock, sys_mlockall, sys_munlockall, sys_sysinfo, sys_sysctl
+	.quad sys_idle, sys_umount, sys_swapon, sys_times, sys_personality
+	.quad sys_setfsuid, sys_setfsgid, sys_ustat, sys_statfs, sys_fstatfs
+	.quad sys_sched_setparam, sys_sched_getparam, sys_sched_setscheduler, sys_sched_getscheduler, sys_sched_yield
+	.quad sys_sched_get_priority_max, sys_sched_get_priority_min, sys_sched_rr_get_interval, do_entSys /* sys_afs_syscall */, sys_newuname
+	.quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
+	.quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
diff -u --recursive --new-file v1.3.64/linux/arch/alpha/kernel/irq.c linux/arch/alpha/kernel/irq.c
--- v1.3.64/linux/arch/alpha/kernel/irq.c	Fri Feb 16 11:34:04 1996
+++ linux/arch/alpha/kernel/irq.c	Sat Feb 17 09:19:37 1996
@@ -577,6 +577,9 @@
 		    (((unsigned long)cache_27)<<24));
 #endif
 	irqs &= irqmask & ~1;	/* always mask out irq 0---it's the unused timer */
+#ifdef CONFIG_ALPHA_P2K
+	irqs &= ~(1 << 8);	/* mask out irq 8 since that's the unused RTC input to PIC */
+#endif
 	if (!irqs)
 		return 0;
 	i = ffz(~irqs);
@@ -616,7 +619,7 @@
 			return;
 		case 3:
 #if defined(CONFIG_ALPHA_JENSEN) || defined(CONFIG_ALPHA_NONAME) || \
-    defined(CONFIG_ALPHA_SRM)
+    defined(CONFIG_ALPHA_P2K) || defined(CONFIG_ALPHA_SRM)
 			srm_device_interrupt(vector, &regs);
 #elif NR_IRQS == 33
 			cabriolet_and_eb66p_device_interrupt(vector, &regs);
diff -u --recursive --new-file v1.3.64/linux/arch/alpha/kernel/ksyms.c linux/arch/alpha/kernel/ksyms.c
--- v1.3.64/linux/arch/alpha/kernel/ksyms.c	Fri Feb  9 17:52:56 1996
+++ linux/arch/alpha/kernel/ksyms.c	Sat Feb 17 09:19:37 1996
@@ -7,8 +7,9 @@
 
 #include <linux/string.h>
 #include <linux/module.h>
-# include <asm/io.h>
-# include <asm/hwrpb.h>
+#include <linux/string.h>
+#include <asm/io.h>
+#include <asm/hwrpb.h>
 
 extern void bcopy (const char *src, char *dst, int len);
 extern struct hwrpb_struct *hwrpb;
@@ -32,8 +33,6 @@
 	X(_outb),
 	X(_outw),
 	X(_outl),
-	X(bcopy),	/* generated by gcc-2.7.0 for string assignments */
-	X(hwrpb),
 	X(__divl),
 	X(__reml),
 	X(__divq),
@@ -42,10 +41,39 @@
 	X(__remlu),
 	X(__divqu),
 	X(__remqu),
-	X(strlen),	/* used by ftape */
+	X(strcat),
+	X(strcmp),
+	X(strcpy),
+	X(strlen),
+	X(strncmp),
+	X(strncpy),
+	X(strnlen),
+	X(strstr),
+	X(hwrpb),
 	X(memcmp),
 	X(memmove),
+	X(__memcpy),
 	X(__constant_c_memset),
+	/*
+	 * The following are special because they're not called
+	 * explictly (the C compiler or assembler generates them in
+	 * response to division operations).  Fortunately, their
+	 * interface isn't gonna change any time soon now, so it's OK
+	 * to leave it out of version control.
+	 */
+# undef bcopy
+# undef memcpy
+# undef memset
+	XNOVERS(__divl),
+	XNOVERS(__divlu),
+	XNOVERS(__divq),
+	XNOVERS(__divqu),
+	XNOVERS(__reml),
+	XNOVERS(__remlu),
+	XNOVERS(__remq),
+	XNOVERS(__remqu),
+	XNOVERS(__memcpy),
+	XNOVERS(__memset),
 #include <linux/symtab_end.h>
 };
 
diff -u --recursive --new-file v1.3.64/linux/arch/alpha/kernel/lca.c linux/arch/alpha/kernel/lca.c
--- v1.3.64/linux/arch/alpha/kernel/lca.c	Tue Dec 26 04:45:34 1995
+++ linux/arch/alpha/kernel/lca.c	Sat Feb 17 09:19:37 1996
@@ -338,7 +338,7 @@
 
 void mem_error (unsigned long esr, unsigned long ear)
 {
-    printk("    %s %s error to %s occurred at address %x",
+    printk("    %s %s error to %s occurred at address %x\n",
 	   (esr & ESR_CEE) ? "Correctable" : ((esr & ESR_UEE) ? "Uncorrectable" : "A"),
 	   (esr & ESR_WRE) ? "write" : "read",
 	   (esr & ESR_SOR) ? "b-cache" : "memory",
diff -u --recursive --new-file v1.3.64/linux/arch/alpha/kernel/osf_sys.c linux/arch/alpha/kernel/osf_sys.c
--- v1.3.64/linux/arch/alpha/kernel/osf_sys.c	Tue Dec 26 04:45:34 1995
+++ linux/arch/alpha/kernel/osf_sys.c	Sat Feb 17 09:19:37 1996
@@ -125,6 +125,17 @@
 	return count - buf.count;
 }
 
+asmlinkage int osf_getpriority(int which, int who)
+{
+	extern int sys_getpriority(int, int);
+	/*
+	 * Alpha syscall convention has no problem returning negative
+	 * values:
+	 */
+	return 20 - sys_getpriority(which, who);
+}
+
+
 /*
  * Heh. As documented by DEC..
  */
diff -u --recursive --new-file v1.3.64/linux/arch/alpha/kernel/setup.c linux/arch/alpha/kernel/setup.c
--- v1.3.64/linux/arch/alpha/kernel/setup.c	Tue Dec 26 04:45:34 1995
+++ linux/arch/alpha/kernel/setup.c	Sat Feb 17 09:19:38 1996
@@ -142,12 +142,6 @@
 #endif
 }
 
-asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on)
-{
-	return -EIO;
-}
-
-
 /*
  * BUFFER is PAGE_SIZE bytes long.
  */
diff -u --recursive --new-file v1.3.64/linux/arch/alpha/kernel/signal.c linux/arch/alpha/kernel/signal.c
--- v1.3.64/linux/arch/alpha/kernel/signal.c	Mon Jan  8 14:10:27 1996
+++ linux/arch/alpha/kernel/signal.c	Sat Feb 17 09:19:38 1996
@@ -19,7 +19,7 @@
 #define _S(nr) (1<<((nr)-1))
 #define _BLOCKABLE (~(_S(SIGKILL) | _S(SIGSTOP)))
 
-asmlinkage int sys_waitpid(pid_t pid,unsigned long * stat_addr, int options);
+asmlinkage int sys_wait4(int, int *, int, struct rusage *);
 asmlinkage void ret_from_sys_call(void);
 asmlinkage int do_signal(unsigned long, struct pt_regs *, struct switch_stack *,
 	unsigned long, unsigned long);
@@ -251,7 +251,7 @@
 			if (signr != SIGCHLD)
 				continue;
 			/* check for SIGCHLD: it's special */
-			while (sys_waitpid(-1,NULL,WNOHANG) > 0)
+			while (sys_wait4(-1, NULL, WNOHANG, NULL) > 0)
 				/* nothing */;
 			continue;
 		}
diff -u --recursive --new-file v1.3.64/linux/arch/alpha/kernel/traps.c linux/arch/alpha/kernel/traps.c
--- v1.3.64/linux/arch/alpha/kernel/traps.c	Tue Dec 26 04:45:34 1995
+++ linux/arch/alpha/kernel/traps.c	Sat Feb 17 09:19:38 1996
@@ -11,7 +11,6 @@
 #include <linux/mm.h>
 #include <linux/sched.h>
 #include <linux/tty.h>
-#include <linux/config.h>
 
 #include <asm/gentrap.h>
 #include <asm/segment.h>
@@ -220,6 +219,44 @@
 }
 
 /*
+ * Convert an s-floating point value in memory format to the
+ * corresponding value in register format.  The exponent
+ * needs to be remapped to preserve non-finite values
+ * (infinities, not-a-numbers, denormals).
+ */
+static inline unsigned long s_mem_to_reg (unsigned long s_mem)
+{
+	unsigned long frac    = (s_mem >>  0) & 0x7fffff;
+	unsigned long sign    = (s_mem >> 31) & 0x1;
+	unsigned long exp_msb = (s_mem >> 30) & 0x1;
+	unsigned long exp_low = (s_mem >> 23) & 0x7f;
+	unsigned long exp;
+
+	exp = (exp_msb << 10) | exp_low;	/* common case */
+	if (exp_msb) {
+		if (exp_low == 0x7f) {
+			exp = 0x3ff;
+		}
+	} else {
+		if (exp_low == 0x00) {
+			exp = 0x000;
+		} else {
+			exp |= (0x7 << 8);
+		}
+	}
+	return (sign << 63) | (exp << 52) | (frac << 29);
+}
+
+/*
+ * Convert an s-floating point value in register format to the
+ * corresponding value in memory format.
+ */
+static inline unsigned long s_reg_to_mem (unsigned long s_reg)
+{
+	return ((s_reg >> 62) << 30) | ((s_reg << 5) >> 34);
+}
+
+/*
  * Handle user-level unaligned fault.  Handling user-level unaligned
  * faults is *extremely* slow and produces nasty messages.  A user
  * program *should* fix unaligned faults ASAP.
@@ -236,8 +273,7 @@
  *
  * Sigh. We *do* have to handle some FP operations, because GCC will
  * uses them as temporary storage for integer memory to memory copies.
- * However, we need to deal with stt/ldt only as they are the only
- * fp load/stores that preserve the bit pattern.
+ * However, we need to deal with stt/ldt and sts/lds only.
  */
 asmlinkage void do_entUnaUser(void * va, unsigned long opcode, unsigned long reg,
 			      unsigned long * frame)
@@ -246,6 +282,8 @@
 	unsigned long *reg_addr, *pc_addr, usp, zero = 0;
 	static int cnt = 0;
 	static long last_time = 0;
+	extern void alpha_write_fp_reg (unsigned long reg, unsigned long val);
+	extern unsigned long alpha_read_fp_reg (unsigned long reg);
 
 	pc_addr = frame + 7 + 20 + 1;			/* pc in PAL frame */
 
@@ -265,7 +303,7 @@
 
 	dir = VERIFY_READ;
 	if (opcode & 0x4) {
-		/* it's a stl, stq, or stt */
+		/* it's a stl, stq, stt, or sts */
 		dir = VERIFY_WRITE;
 	}
 	size = 4;
@@ -307,13 +345,20 @@
 	}
 
 	switch (opcode) {
-	      case 0x23: alpha_write_fp_reg(reg, ldq_u(va)); break; /* ldt */
-	      case 0x27: stq_u(alpha_read_fp_reg(reg), va);  break; /* stt */
+	      case 0x22:						/* lds */
+		alpha_write_fp_reg(reg, s_mem_to_reg(ldl_u(va)));
+		break;
+	      case 0x26:						/* lds */
+		alpha_write_fp_reg(reg, s_reg_to_mem(ldl_u(va)));
+		break;
+
+	      case 0x23: alpha_write_fp_reg(reg, ldq_u(va)); break;	/* ldt */
+	      case 0x27: stq_u(alpha_read_fp_reg(reg), va);  break;	/* stt */
 
-	      case 0x28: *reg_addr = (int) ldl_u(va);	     break; /* ldl */
-	      case 0x29: *reg_addr = ldq_u(va);		     break; /* ldq */
-	      case 0x2c: stl_u(*reg_addr, va);		     break; /* stl */
-	      case 0x2d: stq_u(*reg_addr, va);		     break; /* stq */
+	      case 0x28: *reg_addr = (int) ldl_u(va);	     break;	/* ldl */
+	      case 0x29: *reg_addr = ldq_u(va);		     break;	/* ldq */
+	      case 0x2c: stl_u(*reg_addr, va);		     break;	/* stl */
+	      case 0x2d: stq_u(*reg_addr, va);		     break;	/* stq */
 	      default:
 		*pc_addr -= 4;	/* make pc point to faulting insn */
 		send_sig(SIGBUS, current, 1);
diff -u --recursive --new-file v1.3.64/linux/arch/i386/boot/compressed/Makefile linux/arch/i386/boot/compressed/Makefile
--- v1.3.64/linux/arch/i386/boot/compressed/Makefile	Wed Feb  7 15:11:20 1996
+++ linux/arch/i386/boot/compressed/Makefile	Fri Feb 16 14:41:41 1996
@@ -43,7 +43,7 @@
 # You cannot compress a file and have the kernel uncompress it, it must
 # be stdin
 piggy.o:	$(SYSTEM)
-	tmppiggy=/tmp/$$.piggy; \
+	tmppiggy=/tmp/$$$$.piggy; \
 	rm -f $$tmppiggy $$tmppiggy.gz; \
 	$(OBJDUMP) $(OBJDUMP_FLAGS) -o $(IMAGE_OFFSET) $(SYSTEM) > $$tmppiggy; \
 	gzip -f -9 < $$tmppiggy > $$tmppiggy.gz; \
diff -u --recursive --new-file v1.3.64/linux/arch/i386/kernel/signal.c linux/arch/i386/kernel/signal.c
--- v1.3.64/linux/arch/i386/kernel/signal.c	Wed Dec 27 09:12:12 1995
+++ linux/arch/i386/kernel/signal.c	Sat Feb 17 08:07:01 1996
@@ -152,10 +152,16 @@
 	struct sigaction * sa;
 
 	while ((signr = current->signal & mask)) {
+		/*
+		 *	This stops gcc flipping out. Otherwise the assembler
+		 *	including volatiles for the inline function to get
+		 *	current combined with this gets it confused.
+		 */
+	        struct task_struct *t=current;
 		__asm__("bsf %3,%1\n\t"
 			"btrl %1,%0"
-			:"=m" (current->signal),"=r" (signr)
-			:"0" (current->signal), "1" (signr));
+			:"=m" (t->signal),"=r" (signr)
+			:"0" (t->signal), "1" (signr));
 		sa = current->sig->action + signr;
 		signr++;
 		if ((current->flags & PF_PTRACED) && signr != SIGKILL) {
diff -u --recursive --new-file v1.3.64/linux/arch/i386/kernel/smp.c linux/arch/i386/kernel/smp.c
--- v1.3.64/linux/arch/i386/kernel/smp.c	Wed Feb  7 15:11:21 1996
+++ linux/arch/i386/kernel/smp.c	Sat Feb 17 08:07:01 1996
@@ -1,5 +1,5 @@
 /*
- *	Intel MP v1.1 specification support routines for multi-pentium 
+ *	Intel MP v1.1/v1.4 specification support routines for multi-pentium 
  *	hosts.
  *
  *	(c) 1995 Alan Cox, CymruNET Ltd  <alan@cymru.net>
@@ -7,6 +7,7 @@
  *	Much of the core SMP work is based on previous work by Thomas Radke, to
  *	whom a great many thanks are extended.
  *
+ *
  *	This code is released under the GNU public license version 2 or
  *	later.
  *
@@ -15,7 +16,7 @@
  *		Jose Renau	:	Handle single CPU case.
  *		Alan Cox	:	By repeated request 8) - Total BogoMIP report.
  *		Greg Wright	:	Fix for kernel stacks panic.
- *
+ *		Erich Boleyn	:	MP v1.4 and additional changes.
  */
 
 #include <linux/kernel.h>
@@ -33,13 +34,12 @@
 #include <asm/pgtable.h>
 #include <asm/smp.h>
 
-extern void *vremap(unsigned long offset, unsigned long size);	/* Linus hasnt put this in the headers yet */
-
 static int smp_found_config=0;				/* Have we found an SMP box 				*/
 
 unsigned long cpu_present_map = 0;			/* Bitmask of existing CPU's 				*/
 int smp_num_cpus;					/* Total count of live CPU's 				*/
 int smp_threads_ready=0;				/* Set when the idlers are all forked 			*/
+volatile unsigned long cpu_number_map[NR_CPUS];		/* which CPU maps to which logical number		*/
 volatile unsigned long cpu_callin_map[NR_CPUS] = {0,};	/* We always use 0 the rest is ready for parallel delivery */
 volatile unsigned long smp_invalidate_needed;		/* Used for the invalidate map thats also checked in the spinlock */
 struct cpuinfo_x86 cpu_data[NR_CPUS];			/* Per cpu bogomips and other parameters 		*/
@@ -49,8 +49,9 @@
 static unsigned char *kstack_base,*kstack_end;		/* Kernel stack list pointers 				*/
 static int smp_activated = 0;				/* Tripped once we need to start cross invalidating 	*/
 static volatile int smp_commenced=0;			/* Tripped when we start scheduling 		    	*/
-static unsigned char nlong=0;				/* Apparent value for boot CPU 				*/
-unsigned char *apic_reg=((unsigned char *)&nlong)-0x20;	/* Later set to the vremap() of the APIC 		*/
+unsigned long apic_addr=0xFEE00000;			/* Address of APIC (defaults to 0xFEE00000)		*/
+unsigned long nlong = 0;				/* dummy used for apic_reg address + 0x20		*/
+unsigned char *apic_reg=((unsigned char *)(&nlong))-0x20;/* Later set to the vremap() of the APIC 		*/
 unsigned long apic_retval;				/* Just debugging the assembler.. 			*/
 unsigned char *kernel_stacks[NR_CPUS];			/* Kernel stack pointers for CPU's (debugging)		*/
 
@@ -76,6 +77,14 @@
 volatile unsigned long smp_idle_map=0;			/* Map for idle processors 				*/
 #endif
 
+/*#define SMP_DEBUG*/
+
+#ifdef SMP_DEBUG
+#define SMP_PRINTK(x)	printk x
+#else
+#define SMP_PRINTK(x)
+#endif
+
 
 /* 
  *	Checksum an MP configuration block.
@@ -139,9 +148,9 @@
 		printk("Checksum error.\n");
 		return 1;
 	}
-	if(mpc->mpc_spec!=0x01)
+	if(mpc->mpc_spec!=0x01 && mpc->mpc_spec!=0x04)
 	{
-		printk("Unsupported version (%d)\n",mpc->mpc_spec);
+		printk("Bad Config Table version (%d)!!\n",mpc->mpc_spec);
 		return 1;
 	}
 	memcpy(str,mpc->mpc_oem,8);
@@ -151,6 +160,9 @@
 	str[12]=0;
 	printk("Product ID: %s ",str);
 	printk("APIC at: 0x%lX\n",mpc->mpc_lapic);
+
+	/* set the local APIC address */
+	apic_addr = mpc->mpc_lapic;
 	
 	/*
 	 *	Now process the configuration blocks.
@@ -173,6 +185,7 @@
 							(m->mpc_cpufeature&
 								CPU_MODEL_MASK)>>4),
 						m->mpc_apicver);
+#ifdef SMP_DEBUG						
 					if(m->mpc_featureflag&(1<<0))
 						printk("    Floating point unit present.\n");
 					if(m->mpc_featureflag&(1<<7))
@@ -181,9 +194,10 @@
 						printk("    64 bit compare & exchange supported.\n");
 					if(m->mpc_featureflag&(1<<9))
 						printk("    Internal APIC present.\n");
+#endif						
 					if(m->mpc_cpuflag&CPU_BOOTPROCESSOR)
 					{
-						printk("    Bootup CPU\n");
+						SMP_PRINTK(("    Bootup CPU\n"));
 						boot_cpu_id=m->mpc_apicid;
 						nlong = boot_cpu_id<<24;	/* Dummy 'self' for bootup */
 					}
@@ -205,9 +219,9 @@
 					(struct mpc_config_bus *)mpt;
 				memcpy(str,m->mpc_bustype,6);
 				str[6]=0;
-				printk("Bus #%d is %s\n",
+				SMP_PRINTK(("Bus #%d is %s\n",
 					m->mpc_busid,
-					str);
+					str));
 				mpt+=sizeof(*m);
 				count+=sizeof(*m);
 				break; 
@@ -261,8 +275,8 @@
 	unsigned long *bp=(unsigned long *)base;
 	struct intel_mp_floating *mpf;
 	
-/*	printk("Scan SMP from %p for %ld bytes.\n",
-		bp,length);*/
+	SMP_PRINTK(("Scan SMP from %p for %ld bytes.\n",
+		bp,length));
 	if(sizeof(*mpf)!=16)
 		printk("Error: MPF size\n");
 	
@@ -273,11 +287,14 @@
 			mpf=(struct intel_mp_floating *)bp;
 			if(mpf->mpf_length==1 && 
 				!mpf_checksum((unsigned char *)bp,16) &&
-				mpf->mpf_specification==1)
+				(mpf->mpf_specification == 1
+				 || mpf->mpf_specification == 4) )
 			{
-				printk("Intel multiprocessing (MPv1.1) available.\n");
+				printk("Intel MultiProcessor Specification v1.%d\n", mpf->mpf_specification);
 				if(mpf->mpf_feature2&(1<<7))
-					printk("    IMCR and PIC mode supported.\n");
+					printk("    IMCR and PIC compatibility mode.\n");
+				else
+					printk("    Virtual Wire compatibility mode.\n");
 				smp_found_config=1;
 				/*
 				 *	Now see if we need to read further.
@@ -436,7 +453,7 @@
 	 *	Activate our APIC
 	 */
 	 
-/*	printk("CALLIN %d\n",smp_processor_id());*/
+	SMP_PRINTK(("CALLIN %d\n",smp_processor_id()));
  	l=apic_read(APIC_SPIV);
  	l|=(1<<8);		/* Enable */
  	apic_write(APIC_SPIV,l);
@@ -461,11 +478,12 @@
 	*(long *)0=1;		 OOPS... */
 	local_invalidate();
 	while(!smp_commenced);
+	if (cpu_number_map[cpuid] == -1)
+		while(1);
 	local_invalidate();
-/*	printk("Commenced..\n");*/
+	SMP_PRINTK(("Commenced..\n"));
 	
-	/* This assumes the processor id's are consecutive 0..n-1 -  FIXME */
-	load_TR(cpuid);
+	load_TR(cpu_number_map[cpuid]);
 /*	while(1);*/
 }
 
@@ -492,22 +510,42 @@
 	if(apic_reg == NULL)
 		panic("Unable to map local apic.\n");
 		
+#ifdef SMP_DEBUG		
+	{
+		int reg;
+
+		reg = apic_read(APIC_VERSION);
+		printk("Getting VERSION: %x\n", reg);
+
+		apic_write(APIC_VERSION, 0);
+		reg = apic_read(APIC_VERSION);
+		printk("Getting VERSION: %x\n", reg);
+
+		reg = apic_read(APIC_LVT0);
+		printk("Getting LVT0: %x\n", reg);
+
+		reg = apic_read(APIC_LVT1);
+		printk("Getting LVT1: %x\n", reg);
+	}
+#endif
+	
 	/*
 	 *	Now scan the cpu present map and fire up anything we find.
 	 */
 	 
-	 
 	kernel_stacks[boot_cpu_id]=(void *)init_user_stack;	/* Set up for boot processor first */
 
 	smp_store_cpu_info(boot_cpu_id);			/* Final full version of the data */
 	
 	active_kernel_processor=boot_cpu_id;
+
+	SMP_PRINTK(("CPU map: %lx\n", cpu_present_map));
 		
 	for(i=0;i<NR_CPUS;i++)
 	{
 		if((cpu_present_map&(1<<i)) && i!=boot_cpu_id)		/* Rebooting yourself is a bad move */
 		{
-			unsigned long cfg;
+			unsigned long cfg, send_status, accept_status;
 			int timeout;
 			
 			/*
@@ -519,7 +557,7 @@
 				panic("No memory for processor stacks.\n");
 			kernel_stacks[i]=stack;
 			install_trampoline(stack);
-			
+
 			printk("Booting processor %d stack %p: ",i,stack);			/* So we set whats up   */
 				
 			/*
@@ -530,65 +568,181 @@
 			cfg|=(1<<8);		/* Enable APIC */
 			apic_write(APIC_SPIV,cfg);
 			
-			for(timeout=0;timeout<50000;timeout++)
+			/*
+			 *	This gunge runs the startup process for
+			 *	the targeted processor.
+			 */
+
+#ifdef EEK
+			SMP_PRINTK(("Setting warm reset code and vector.\n"));
+
+			CMOS_WRITE(0xa, 0xf);
+			*((volatile unsigned short *) 0x467) = (unsigned short)(stack>>4);
+			*((volatile unsigned short *) 0x469) = 0;
+#endif
+
+			apic_write(APIC_ESR, 0);
+			accept_status = (apic_read(APIC_ESR) & 0xEF);
+			send_status = 0;
+			accept_status = 0;
+
+			SMP_PRINTK(("Asserting INIT.\n"));
+
+			cfg=apic_read(APIC_ICR2);
+			cfg&=0x00FFFFFF;
+			apic_write(APIC_ICR2, cfg|SET_APIC_DEST_FIELD(i)); 			/* Target chip     	*/
+			cfg=apic_read(APIC_ICR);
+			cfg&=~0xCDFFF;								/* Clear bits 		*/
+			cfg|=0x0000c500;	/* Urgh.. fix for constants */
+			apic_write(APIC_ICR, cfg);						/* Send IPI */
+
+			timeout = 0;
+			do {
+				udelay(1000);
+				if ((send_status = (!(apic_read(APIC_ICR) & 0x00001000))))
+					break;
+			} while (timeout++ < 1000);
+
+#ifdef EEK2
+			if (send_status) {
+				apic_write(APIC_ESR, 0);
+				accept_status = (apic_read(APIC_ESR) & 0xEF);
+			}
+#endif
+
+			if (send_status && !accept_status)
 			{
-				/*
-				 *	This gunge sends an IPI (Inter Processor Interrupt) to the
-				 *	processor we wish to wake. When the startup IPI is received
-				 *	the target CPU does a real mode jump to the stack base.
-				 *
-				 *	We do the following
-				 *
-				 *	Time 0	: Send a STARTUP IPI (This is all that is needed).
-				 *	Time 20000  : Send an INIT IPI for broken boards.
-				 *	Time 20001  : Send a second STARTUP IPI for broken boards.
-				 *
-				 *	We can't just do INIT/STARTUP - that breaks the correctly
-				 *	implemented ASUS boards.
-				 */
+				SMP_PRINTK(("Deasserting INIT.\n"));
 			
-				if(timeout==20000)
-				{
-					cfg=apic_read(APIC_ICR2);
-					cfg&=0x00FFFFFF;
-					apic_write(APIC_ICR2, cfg|SET_APIC_DEST_FIELD(i));			/* Target chip     	*/
-					cfg=apic_read(APIC_ICR);
-					cfg&=~0xFDFFF	;							/* Clear bits 		*/
-					cfg|=APIC_DEST_DM_INIT;                                                 /* INIT the CPU         */
-					apic_write(APIC_ICR, cfg);                                              /* Kick the second      */
-					printk("\nBuggy motherboard ?, trying an INIT IPI: ");
-					udelay(10);                                                             /* Masses of time       */
+				cfg=apic_read(APIC_ICR2);
+				cfg&=0x00FFFFFF;
+				apic_write(APIC_ICR2, cfg|SET_APIC_DEST_FIELD(i));			/* Target chip     	*/
+				cfg=apic_read(APIC_ICR);
+				cfg&=~0xCDFFF;								/* Clear bits 		*/
+				cfg|=0x00008500;
+				apic_write(APIC_ICR, cfg);						/* Send IPI */
+
+				timeout = 0;
+				do {
+					udelay(1000);
+					if ((send_status = !(apic_read(APIC_ICR) & 0x00001000) ))
+						break;
+				} while (timeout++ < 1000);
+
+				if (send_status) {
+					udelay(1000000);
+					apic_write(APIC_ESR, 0);
+					accept_status = (apic_read(APIC_ESR) & 0xEF);
 				}
-				if(timeout==0||timeout==20001)
-				{
-					cfg=apic_read(APIC_ICR);
-					cfg&=~0xFDFFF   ;                                                       /* Clear bits           */
-					cfg|=APIC_DEST_FIELD|APIC_DEST_DM_STARTUP|(((unsigned long)stack)>>12);	/* Boot on the stack 	*/		
-					apic_write(APIC_ICR, cfg);						/* Kick the second 	*/
-					udelay(10);								/* Masses of time 	*/
-					cfg=apic_read(APIC_ESR);
-					if(cfg&4)		/* Send accept error */
-						printk("Processor refused startup request.\n");
+			}
+
+			/*
+			 *	We currently assume an integrated
+			 *	APIC only, so STARTUP IPIs must be
+			 *	sent as well.
+			 */
+
+			if (send_status && !accept_status)
+			{
+				SMP_PRINTK(("Sending first STARTUP.\n"));
+			
+				/*
+				 *	First STARTUP IPI
+				 */
+
+				cfg=apic_read(APIC_ICR2);
+				cfg&=0x00FFFFFF;
+				apic_write(APIC_ICR2, cfg|SET_APIC_DEST_FIELD(i));			/* Target chip     	*/
+				cfg=apic_read(APIC_ICR);
+				cfg&=~0xCDFFF	;							/* Clear bits 		*/
+				cfg|=APIC_DEST_FIELD|APIC_DEST_DM_STARTUP|(((unsigned long)stack)>>12);	/* Boot on the stack 	*/		
+				apic_write(APIC_ICR, cfg);						/* Kick the second 	*/
+
+				timeout = 0;
+				do {
+					udelay(1000);
+					if ((send_status = !(apic_read(APIC_ICR) & 0x00001000)) )
+						break;
+				} while (timeout++ < 1000);
+
+				if (send_status) {
+					udelay(1000000);
+					apic_write(APIC_ESR, 0);
+					accept_status = (apic_read(APIC_ESR) & 0xEF);
 				}
-				if(cpu_callin_map[0]&(1<<i))
-					break;				/* It has booted */
-				udelay(100);				/* Wait 5s total for a response */
 			}
-			if(cpu_callin_map[0]&(1<<i))
-				cpucount++;
-			else
+
+			if (send_status && !accept_status)
 			{
+				SMP_PRINTK(("Sending second STARTUP.\n"));
+			
 				/*
-				 *	At this point we should set up a BIOS warm start and try
-				 *	a RESTART IPI. The 486+82489 MP pair don't support STARTUP IPI's
+				 *	Second STARTUP IPI
 				 */
-				if(*((unsigned char *)8192)==0xA5)
-					printk("Stuck ??\n");
+
+				cfg=apic_read(APIC_ICR2);
+				cfg&=0x00FFFFFF;
+				apic_write(APIC_ICR2, cfg|SET_APIC_DEST_FIELD(i));			/* Target chip     	*/
+				cfg=apic_read(APIC_ICR);
+				cfg&=~0xCDFFF	;							/* Clear bits 		*/
+				cfg|=APIC_DEST_FIELD|APIC_DEST_DM_STARTUP|(((unsigned long)stack)>>12);	/* Boot on the stack 	*/		
+				apic_write(APIC_ICR, cfg);						/* Kick the second 	*/
+
+				timeout = 0;
+				do {
+					udelay(1000);
+					if ((send_status = !(apic_read(APIC_ICR) & 0x00001000)))
+						break;
+				} while (timeout++ < 1000);
+
+				if (send_status) {
+					udelay(1000000);
+					apic_write(APIC_ESR, 0);
+					accept_status = (apic_read(APIC_ESR) & 0xEF);
+				}
+			}
+
+			if (!send_status)		/* APIC never delivered?? */
+				printk("APIC never delivered???\n");
+			else if (accept_status)		/* Send accept error */
+				printk("APIC delivery error (%lx).\n", accept_status);
+			else
+			{
+				for(timeout=0;timeout<50000;timeout++)
+				{
+					if(cpu_callin_map[0]&(1<<i))
+						break;				/* It has booted */
+					udelay(100);				/* Wait 5s total for a response */
+				}
+				if(cpu_callin_map[0]&(1<<i))
+				{
+					cpucount++;
+					/* number CPUs logically, starting from 1 (BSP is 0) */
+					cpu_number_map[i] = cpucount;
+				}
 				else
-					printk("Not responding.\n");
-				cpu_present_map&=~(1<<i);
+				{
+					if(*((volatile unsigned char *)8192)==0xA5)
+						printk("Stuck ??\n");
+					else
+						printk("Not responding val=(%lx).\n", *((unsigned long *) stack));
+					cpu_present_map&=~(1<<i);
+					cpu_number_map[i] = -1;
+				}
 			}
+
+			/* mark "stuck" area as not stuck */
+			*((volatile unsigned long *)8192) = 0;
 		}
+		else if (i == boot_cpu_id)
+		{
+			cpu_number_map[i] = 0;
+		}
+		else
+		{
+			cpu_number_map[i] = -1;
+		}
+
 	}
 	/*
 	 *	Allow the user to impress friends.
diff -u --recursive --new-file v1.3.64/linux/drivers/block/floppy.c linux/drivers/block/floppy.c
--- v1.3.64/linux/drivers/block/floppy.c	Fri Feb 16 11:34:04 1996
+++ linux/drivers/block/floppy.c	Sat Feb 17 08:07:02 1996
@@ -207,6 +207,7 @@
 static inline int DRIVE(kdev_t x) {
 	return (MINOR(x)&0x03) | ((MINOR(x)&0x80) >> 5);
 }
+#define ITYPE(x) (((x)>>2) & 0x1f)
 #define TOMINOR(x) ((x & 3) | ((x & 4) << 5))
 #define UNIT(x) ((x) & 0x03)		/* drive on fdc */
 #define FDC(x) (((x) & 0x04) >> 2)  /* fdc of drive */
@@ -3021,7 +3022,7 @@
 }
 
 static inline int set_geometry(unsigned int cmd, struct floppy_struct *g,
-			       int drive, int type, int device)
+			       int drive, int type, kdev_t device)
 {
 	int cnt;
 
@@ -3038,7 +3039,7 @@
 			return -EPERM;
 		LOCK_FDC(drive,1);
 		for (cnt = 0; cnt < N_DRIVE; cnt++){
-			if (TYPE(drive_state[cnt].fd_device) == type &&
+			if (ITYPE(drive_state[cnt].fd_device) == type &&
 			    drive_state[cnt].fd_ref)
 				set_bit(drive, &fake_change);
 		}
@@ -3049,7 +3050,7 @@
 				floppy_type[type].size>>1;
 		process_fd_request();
 		for (cnt = 0; cnt < N_DRIVE; cnt++){
-			if (TYPE(drive_state[cnt].fd_device) == type &&
+			if (ITYPE(drive_state[cnt].fd_device) == type &&
 			    drive_state[cnt].fd_ref)
 				check_disk_change(
 					MKDEV(FLOPPY_MAJOR,
@@ -3842,8 +3843,8 @@
 	}
 
 	for (i=0; i<256; i++)
-		if (TYPE(i))
-			floppy_sizes[i] = floppy_type[TYPE(i)].size >> 1;
+		if (ITYPE(i))
+			floppy_sizes[i] = floppy_type[ITYPE(i)].size >> 1;
 		else
 			floppy_sizes[i] = MAX_DISK_SIZE;
 
diff -u --recursive --new-file v1.3.64/linux/drivers/block/ide-cd.c linux/drivers/block/ide-cd.c
--- v1.3.64/linux/drivers/block/ide-cd.c	Wed Feb 14 14:37:08 1996
+++ linux/drivers/block/ide-cd.c	Sat Feb 17 09:19:39 1996
@@ -114,6 +114,10 @@
 #include <asm/irq.h>
 #include <asm/io.h>
 #include <asm/byteorder.h>
+#include <asm/segment.h>
+#ifdef __alpha__
+# include <asm/unaligned.h>
+#endif
 
 #include "ide.h"
 
@@ -192,19 +196,19 @@
    They generally do not change after initialization, unless we learn
    more about the drive from stuff failing. */
 struct ide_cd_config_flags {
-  unsigned drq_interrupt : 1; /* Device sends an interrupt when ready
+  __u8 drq_interrupt : 1; /* Device sends an interrupt when ready
                                  for a packet command. */
-  unsigned no_doorlock   : 1; /* Drive cannot lock the door. */
+  __u8 no_doorlock   : 1; /* Drive cannot lock the door. */
 #if ! STANDARD_ATAPI
-  unsigned no_playaudio12: 1; /* The PLAYAUDIO12 command is not supported. */
+  __u8 no_playaudio12: 1; /* The PLAYAUDIO12 command is not supported. */
  
-  unsigned no_lba_toc    : 1; /* Drive cannot return TOC info in LBA format. */
-  unsigned playmsf_uses_bcd : 1; /* Drive uses BCD in PLAYAUDIO_MSF. */
-  unsigned old_readcd    : 1; /* Drive uses old READ CD opcode. */
-  unsigned vertos_lossage: 1; /* Drive is a Vertos 300,
+  __u8 no_lba_toc    : 1; /* Drive cannot return TOC info in LBA format. */
+  __u8 playmsf_uses_bcd : 1; /* Drive uses BCD in PLAYAUDIO_MSF. */
+  __u8 old_readcd    : 1; /* Drive uses old READ CD opcode. */
+  __u8 vertos_lossage: 1; /* Drive is a Vertos 300,
 				 and likes to speak BCD. */
 #endif  /* not STANDARD_ATAPI */
-  unsigned reserved : 1;
+  __u8 reserved : 1;
 };
 #define CDROM_CONFIG_FLAGS(drive) ((struct ide_cd_config_flags *)&((drive)->bios_sect))
 
@@ -212,11 +216,11 @@
 /* State flags.  These give information about the current state of the
    drive, and will change during normal operation. */
 struct ide_cd_state_flags {
-  unsigned media_changed : 1; /* Driver has noticed a media change. */
-  unsigned toc_valid     : 1; /* Saved TOC information is current. */
-  unsigned door_locked   : 1; /* We think that the drive door is locked. */
-  unsigned eject_on_close: 1; /* Drive should eject when device is closed. */
-  unsigned reserved : 4;
+  __u8 media_changed : 1; /* Driver has noticed a media change. */
+  __u8 toc_valid     : 1; /* Saved TOC information is current. */
+  __u8 door_locked   : 1; /* We think that the drive door is locked. */
+  __u8 eject_on_close: 1; /* Drive should eject when device is closed. */
+  __u8 reserved : 4;
 };
 #define CDROM_STATE_FLAGS(drive)  ((struct ide_cd_state_flags *)&((drive)->bios_head))
 
@@ -1162,7 +1166,11 @@
   pc.c[0] = READ_10;
   pc.c[7] = (nframes >> 8);
   pc.c[8] = (nframes & 0xff);
+#ifdef __alpha__
+  stl_u (htonl (frame), (unsigned int *) &pc.c[2]);
+#else
   *(int *)(&pc.c[2]) = htonl (frame);
+#endif
 
   /* Send the command to the drive and return. */
   (void) cdrom_transfer_packet_command (drive, pc.c, sizeof (pc.c),
@@ -1909,8 +1917,13 @@
   pc.sense_data = reqbuf;
 
   pc.c[0] = SCMD_PLAYAUDIO12;
+#ifdef __alpha__
+  stq_u(((long) htonl (lba_end - lba_start) << 32) | htonl(lba_start),
+	(unsigned long *) &pc.c[2]);
+#else
   *(int *)(&pc.c[2]) = htonl (lba_start);
   *(int *)(&pc.c[6]) = htonl (lba_end - lba_start);
+#endif
 
   return cdrom_queue_packet_command (drive, &pc);
 }
@@ -2081,7 +2094,11 @@
     pc.c[0] = READ_CD;
 
   pc.c[1] = (format << 2);
+#ifdef __alpha__
+  stl_u(htonl (lba), (unsigned int *) &pc.c[2]);
+#else
   *(int *)(&pc.c[2]) = htonl (lba);
+#endif
   pc.c[8] = 1;  /* one block */
   pc.c[9] = 0x10;
 
diff -u --recursive --new-file v1.3.64/linux/drivers/block/ll_rw_blk.c linux/drivers/block/ll_rw_blk.c
--- v1.3.64/linux/drivers/block/ll_rw_blk.c	Fri Feb 16 11:34:05 1996
+++ linux/drivers/block/ll_rw_blk.c	Sat Feb 17 08:07:02 1996
@@ -491,8 +491,9 @@
 	/* Verify requested block sizes.  */
 	for (i = 0; i < nr; i++) {
 		if (bh[i] && bh[i]->b_size != correct_size) {
-			printk(
-			"ll_rw_block: only %d-char blocks implemented (%lu)\n",
+			printk("ll_rw_block: device %s: "
+			       "only %d-char blocks implemented (%lu)\n",
+			       kdevname(bh[0]->b_dev),
 			       correct_size, bh[i]->b_size);
 			goto sorry;
 		}
diff -u --recursive --new-file v1.3.64/linux/drivers/block/rd.c linux/drivers/block/rd.c
--- v1.3.64/linux/drivers/block/rd.c	Fri Feb 16 11:34:05 1996
+++ linux/drivers/block/rd.c	Sat Feb 17 08:07:02 1996
@@ -258,7 +258,7 @@
  * 	gzip
  */
 int
-identify_ramdisk_image(int device, struct file *fp, int start_block)
+identify_ramdisk_image(kdev_t device, struct file *fp, int start_block)
 {
 	const int size = 512;
 	struct minix_super_block *minixsb;
@@ -355,7 +355,7 @@
 	struct inode inode, out_inode;
 	struct file infile, outfile;
 	unsigned short fs;
-	int device, ram_device;
+	kdev_t device, ram_device;
 	int nblocks, i;
 	char *buf;
 	unsigned short rotate = 0;
@@ -365,7 +365,7 @@
 		return;
 	
 	device = ROOT_DEV;
-	ram_device = (MAJOR_NR << 8);
+	ram_device = MKDEV(MAJOR_NR, 0);
 
 	if (MAJOR(device) != FLOPPY_MAJOR) return;
 
@@ -440,7 +440,7 @@
 
 successful_load:
 	invalidate_buffers(ROOT_DEV);
-	ROOT_DEV = (MAJOR_NR << 8);
+	ROOT_DEV = MKDEV(MAJOR_NR,0);
 
 done:
 	if (infile.f_op->release)
diff -u --recursive --new-file v1.3.64/linux/drivers/cdrom/mcd.c linux/drivers/cdrom/mcd.c
--- v1.3.64/linux/drivers/cdrom/mcd.c	Mon Nov 27 12:48:29 1995
+++ linux/drivers/cdrom/mcd.c	Sat Feb 17 08:07:02 1996
@@ -1611,10 +1611,7 @@
 }
 
 void cleanup_module(void)
-{ if (MOD_IN_USE)
-     { printk("mcd module in use - can't remove it.\n");
-       return;    
-     }
+{
   if ((unregister_blkdev(MAJOR_NR, "mcd") == -EINVAL))
      { printk("What's that: can't unregister mcd\n");
        return;    
diff -u --recursive --new-file v1.3.64/linux/drivers/cdrom/sbpcd.c linux/drivers/cdrom/sbpcd.c
--- v1.3.64/linux/drivers/cdrom/sbpcd.c	Wed Feb  7 15:11:22 1996
+++ linux/drivers/cdrom/sbpcd.c	Sat Feb 17 08:07:02 1996
@@ -5374,11 +5374,6 @@
 {
 	int j;
 	
-	if (MOD_IN_USE)
-	{
-		msg(DBG_INF, "%s module in use - can't remove it.\n", major_name);
-		return;
-	}
 	if ((unregister_blkdev(MAJOR_NR, major_name) == -EINVAL))
 	{
 		msg(DBG_INF, "What's that: can't unregister %s.\n", major_name);
diff -u --recursive --new-file v1.3.64/linux/drivers/char/Config.in linux/drivers/char/Config.in
--- v1.3.64/linux/drivers/char/Config.in	Wed Feb  7 15:11:23 1996
+++ linux/drivers/char/Config.in	Fri Feb 16 08:04:58 1996
@@ -23,10 +23,11 @@
 if [ "$CONFIG_QIC02_TAPE" = "y" ]; then
   bool 'Do you want runtime configuration for QIC-02' CONFIG_QIC02_DYNCONF
   if [ "$CONFIG_QIC02_DYNCONF" != "y" ]; then
-    comment '>>> Edit configuration parameters in ./include/linux/tpqic02.h!'
+    comment 'Edit configuration parameters in ./include/linux/tpqic02.h!'
   else
-    comment '>>> Setting runtime QIC-02 configuration is done with qic02conf'
-    comment '>>> Which is available from ftp://ftp.funet.fi/pub/OS/Linux/BETA/QIC-02/'
+    comment 'Setting runtime QIC-02 configuration is done with qic02conf'
+    comment 'from the tpqic02-support package.  It is available at'
+    comment 'ftp://titus.cfw.com/pub/Linux/util/'
 fi
 fi
 bool 'Advanced Power Management BIOS support' CONFIG_APM
diff -u --recursive --new-file v1.3.64/linux/drivers/char/console.c linux/drivers/char/console.c
--- v1.3.64/linux/drivers/char/console.c	Sun Feb 11 15:32:44 1996
+++ linux/drivers/char/console.c	Sat Feb 17 10:41:55 1996
@@ -132,6 +132,7 @@
 static void set_origin(int currcons);
 static void blank_screen(void);
 static void unblank_screen(void);
+extern void change_console(unsigned int);
 extern void poke_blanked_console(void);
 static void gotoxy(int currcons, int new_x, int new_y);
 static void save_cur(int currcons);
@@ -177,6 +178,8 @@
 
        unsigned short *vc_scrbuf[MAX_NR_CONSOLES];
 
+/* used by kbd_bh - set by keyboard_interrupt */
+       int do_poke_blanked_console = 0;
        int console_blanked = 0;
 static int blankinterval = 10*60*HZ;
 static int vesa_off_interval = 0;
@@ -1947,6 +1950,32 @@
 }
 
 /*
+ * This is the console switching bottom half handler.
+ *
+ * Doing console switching in a bottom half handler allows
+ * us to do the switches asynchronously (needed when we want
+ * to switch due to a keyboard interrupt), while still giving
+ * us the option to easily disable it to avoid races when we
+ * need to write to the console.
+ */
+static void console_bh(void * unused)
+{
+	if (want_console >= 0) {
+		if (want_console != fg_console) {
+			change_console(want_console);
+			/* we only changed when the console had already
+			   been allocated - a new console is not created
+			   in an interrupt routine */
+		}
+		want_console = -1;
+	}
+	if (do_poke_blanked_console) { /* do not unblank for a LED change */
+		do_poke_blanked_console = 0;
+		poke_blanked_console();
+	}
+}
+
+/*
  *  unsigned long con_init(unsigned long);
  *
  * This routine initializes console interrupts, and does nothing
@@ -1995,7 +2024,6 @@
 	video_page = ORIG_VIDEO_PAGE; 			/* never used */
 	__scrollback_mode = 0 ;
 
-
 	timer_table[BLANK_TIMER].fn = blank_screen;
 	timer_table[BLANK_TIMER].expires = 0;
 	if (blankinterval) {
@@ -2072,6 +2100,9 @@
 	 */
 	if (video_type != VIDEO_TYPE_TGAC)
 		register_console(console_print);
+
+	bh_base[CONSOLE_BH].routine = console_bh;
+	enable_bh(CONSOLE_BH);
 
 	return kmem_start;
 }
diff -u --recursive --new-file v1.3.64/linux/drivers/char/cyclades.c linux/drivers/char/cyclades.c
--- v1.3.64/linux/drivers/char/cyclades.c	Fri Nov 17 08:42:25 1995
+++ linux/drivers/char/cyclades.c	Sat Feb 17 08:07:02 1996
@@ -1310,7 +1310,7 @@
      */
     save_flags(flags); cli();
 	if (info->xmit_buf){
-            unsigned long temp;
+            unsigned char * temp;
             temp = info->xmit_buf;
             info->xmit_buf = 0;
 	    free_page((unsigned long) temp);
diff -u --recursive --new-file v1.3.64/linux/drivers/char/kbd_kern.h linux/drivers/char/kbd_kern.h
--- v1.3.64/linux/drivers/char/kbd_kern.h	Tue Oct 10 18:46:33 1995
+++ linux/drivers/char/kbd_kern.h	Sat Feb 17 10:29:28 1996
@@ -67,6 +67,20 @@
 extern unsigned char getledstate(void);
 extern void setledstate(struct kbd_struct *kbd, unsigned int led);
 
+extern int do_poke_blanked_console;
+
+extern inline void show_console(void)
+{
+	do_poke_blanked_console = 1;
+	mark_bh(CONSOLE_BH);
+}
+
+extern inline void set_console(int nr)
+{
+	want_console = nr;
+	mark_bh(CONSOLE_BH);
+}
+
 extern inline void set_leds(void)
 {
 	mark_bh(KEYBOARD_BH);
diff -u --recursive --new-file v1.3.64/linux/drivers/char/keyboard.c linux/drivers/char/keyboard.c
--- v1.3.64/linux/drivers/char/keyboard.c	Tue Jan 23 21:15:40 1996
+++ linux/drivers/char/keyboard.c	Sat Feb 17 10:25:03 1996
@@ -83,7 +83,6 @@
 extern void poke_blanked_console(void);
 extern void ctrl_alt_del(void);
 extern void reset_vc(unsigned int new_console);
-extern void change_console(unsigned int new_console);
 extern void scrollback(int);
 extern void scrollfront(int);
 
@@ -101,8 +100,6 @@
 #define BITS_PER_LONG (8*sizeof(unsigned long))
 static unsigned long key_down[256/BITS_PER_LONG] = { 0, };
 
-extern int last_console;
-static int want_console = -1;
 static int dead_key_next = 0;
 /* 
  * In order to retrieve the shift_state (for the mouse server), either
@@ -122,8 +119,6 @@
 static volatile unsigned char reply_expected = 0;
 static volatile unsigned char acknowledge = 0;
 static volatile unsigned char resend = 0;
-/* used by kbd_bh - set by keyboard_interrupt */
-static volatile unsigned char do_poke_blanked_console = 0;
 
 extern void compute_shiftstate(void);
 
@@ -678,7 +673,7 @@
 static void lastcons(void)
 {
 	/* switch to the last used console, ChN */
-	want_console = last_console;
+	set_console(last_console);
 }
 
 static void decr_console(void)
@@ -691,7 +686,7 @@
 		if (vc_cons_allocated(i))
 			break;
 	}
-	want_console = i;
+	set_console(i);
 }
 
 static void incr_console(void)
@@ -704,7 +699,7 @@
 		if (vc_cons_allocated(i))
 			break;
 	}
-	want_console = i;
+	set_console(i);
 }
 
 static void send_intr(void)
@@ -853,7 +848,7 @@
 {
 	if (up_flag)
 		return;
-	want_console = value;
+	set_console(value);
 }
 
 static void do_fn(unsigned char value, char up_flag)
@@ -1165,19 +1160,6 @@
 		ledstate = leds;
 		if (!send_data(0xed) || !send_data(leds))
 			send_data(0xf4);	/* re-enable kbd if any errors */
-	}
-	if (want_console >= 0) {
-		if (want_console != fg_console) {
-			change_console(want_console);
-			/* we only changed when the console had already
-			   been allocated - a new console is not created
-			   in an interrupt routine */
-		}
-		want_console = -1;
-	}
-	if (do_poke_blanked_console) { /* do not unblank for a LED change */
-		do_poke_blanked_console = 0;
-		poke_blanked_console();
 	}
 }
 
diff -u --recursive --new-file v1.3.64/linux/drivers/char/scc.c linux/drivers/char/scc.c
--- v1.3.64/linux/drivers/char/scc.c	Thu Dec 21 08:53:31 1995
+++ linux/drivers/char/scc.c	Fri Feb 16 08:17:29 1996
@@ -2286,7 +2286,7 @@
 		
 		restore_flags(flags);
 			
-		put_user_long(result,(unsigned int *) arg);
+		put_user(result,(unsigned int *) arg);
 		return 0;
 	case TIOCMBIS:
 	case TIOCMBIC:
@@ -2301,7 +2301,7 @@
 			scc->wreg[R5] &= ~RTS;
 			break;
 		case TIOCMSET:
-			value = get_user_long((unsigned int *) arg);
+			value = get_user((unsigned int *) arg);
 			
 			if(value & TIOCM_DTR)
 				scc->wreg[R5] |= DTR;
diff -u --recursive --new-file v1.3.64/linux/drivers/char/tpqic02.c linux/drivers/char/tpqic02.c
--- v1.3.64/linux/drivers/char/tpqic02.c	Wed Feb  7 15:11:24 1996
+++ linux/drivers/char/tpqic02.c	Fri Feb 16 08:17:05 1996
@@ -2587,7 +2587,7 @@
 			return -EPERM;
 		error = verify_area(VERIFY_READ, (int *) ioarg, sizeof(int));
 		if (error) return error;
-		c = get_user_long((int *) ioarg);
+		c = get_user((int *) ioarg);
 		if (c==0) {
 			QIC02_TAPE_DEBUG = 0;
 			return 0;
@@ -2619,7 +2619,7 @@
 		stp = (char *) &qic02_tape_dynconf;
 		argp = (char *) ioarg;
 		for (i=0; i<sizeof(qic02_tape_dynconf); i++) 
-			put_user_byte(*stp++, argp++);
+			put_user(*stp++, argp++);
 		return 0;
 
 	} else if (c == (MTIOCSETCONFIG & IOCCMD_MASK)) {
@@ -2646,7 +2646,7 @@
 		stp = (char *) &qic02_tape_dynconf;
 		argp = (char *) ioarg;
 		for (i=0; i<sizeof(qic02_tape_dynconf); i++)
-			*stp++ = get_user_byte(argp++);
+			*stp++ = get_user(argp++);
 		if (status_zombie==NO)
 			qic02_release_resources();	/* and go zombie */
 		if (update_ifc_masks(qic02_tape_dynconf.ifc_type))
@@ -2678,7 +2678,7 @@
 		stp = (char *) &operation;
 		argp = (char *) ioarg;
 		for (i=0; i<sizeof(operation); i++)
-			*stp++ = get_user_byte(argp++);
+			*stp++ = get_user(argp++);
 
 		/* ---note: mt_count is signed, negative seeks must be
 		 * ---	    translated to seeks in opposite direction!
@@ -2740,7 +2740,7 @@
 		stp = (char *) &ioctl_status;
 		argp = (char *) ioarg;
 		for (i=0; i<sizeof(ioctl_status); i++) 
-			put_user_byte(*stp++, argp++);
+			put_user(*stp++, argp++);
 		return 0;
 
 
@@ -2773,7 +2773,7 @@
 		stp = (char *) &ioctl_tell;
 		argp = (char *) ioarg;
 		for (i=0; i<sizeof(ioctl_tell); i++) 
-			put_user_byte(*stp++, argp++);
+			put_user(*stp++, argp++);
 		return 0;
 
 	} else
diff -u --recursive --new-file v1.3.64/linux/drivers/char/tty_io.c linux/drivers/char/tty_io.c
--- v1.3.64/linux/drivers/char/tty_io.c	Tue Jan 23 21:15:40 1996
+++ linux/drivers/char/tty_io.c	Sat Feb 17 10:39:00 1996
@@ -95,12 +95,14 @@
 /*
  * fg_console is the current virtual console,
  * last_console is the last used one,
+ * want_console is the console we want to switch to,
  * kmsg_redirect is the console for kernel messages,
  * redirect is the pseudo-tty that console output
  * is redirected to if asked by TIOCCONS.
  */
 int fg_console = 0;
 int last_console = 0;
+int want_console = -1;
 int kmsg_redirect = 0;
 struct tty_struct * redirect = NULL;
 struct wait_queue * keypress_wait = NULL;
diff -u --recursive --new-file v1.3.64/linux/drivers/char/vt.c linux/drivers/char/vt.c
--- v1.3.64/linux/drivers/char/vt.c	Wed Feb 14 14:37:10 1996
+++ linux/drivers/char/vt.c	Sat Feb 17 10:19:07 1996
@@ -50,12 +50,13 @@
 
 struct vt_struct *vt_cons[MAX_NR_CONSOLES];
 
+#ifndef __alpha__
 asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on);
+#endif
 
 extern int getkeycode(unsigned int scancode);
 extern int setkeycode(unsigned int scancode, unsigned int keycode);
 extern void compute_shiftstate(void);
-extern void change_console(unsigned int new_console);
 extern void complete_change_console(unsigned int new_console);
 extern int vt_waitactive(void);
 extern void do_blank_screen(int nopowersave);
@@ -249,6 +250,11 @@
 			put_user(KB_101, (char *) arg);
 		return i;
 
+#ifndef __alpha__
+		/*
+		 * These cannot be implemented on any machine that implements
+		 * ioperm() in user level (such as Alpha PCs).
+		 */
 	case KDADDIO:
 	case KDDELIO:
 		/*
@@ -263,6 +269,7 @@
 	case KDDISABIO:
 		return sys_ioperm(GPFIRST, GPNUM,
 				  (cmd == KDENABIO)) ? -ENXIO : 0;
+#endif
 
 	case KDSETMODE:
 		/*
@@ -774,7 +781,7 @@
 		i = vc_allocate(arg);
 		if (i)
 			return i;
-		change_console(arg);
+		set_console(arg);
 		return 0;
 
 	/*
@@ -832,7 +839,14 @@
 				i = vc_allocate(newvt);
 				if (i)
 					return i;
+				/*
+				 * When we actually do the console switch,
+				 * make sure we are atomic with respect to
+				 * other console switches..
+				 */
+				start_bh_atomic();
 				complete_change_console(newvt);
+				end_bh_atomic();
 			}
 		}
 
diff -u --recursive --new-file v1.3.64/linux/drivers/net/depca.c linux/drivers/net/depca.c
--- v1.3.64/linux/drivers/net/depca.c	Tue Jan  2 16:46:24 1996
+++ linux/drivers/net/depca.c	Sat Feb 17 09:19:39 1996
@@ -1645,19 +1645,19 @@
     printk("\nDescriptor buffers:\nRX: ");
     for (i=0;i<lp->rxRingMask;i++){
       if (i < 3) {
-	printk("0x%8.8x  ", readl(&lp->rx_ring[i].base));
+	printk("0x%8.8x  ", (u32) readl(&lp->rx_ring[i].base));
       }
     }
-    printk("...0x%8.8x\n", readl(&lp->rx_ring[i].base));
+    printk("...0x%8.8x\n", (u32) readl(&lp->rx_ring[i].base));
     printk("TX: ");
     for (i=0;i<lp->txRingMask;i++){
       if (i < 3) {
-	printk("0x%8.8x  ", readl(&lp->tx_ring[i].base));
+	printk("0x%8.8x  ", (u32) readl(&lp->tx_ring[i].base));
       }
     }
-    printk("...0x%8.8x\n", readl(&lp->tx_ring[i].base));
+    printk("...0x%8.8x\n", (u32) readl(&lp->tx_ring[i].base));
     printk("Initialisation block at 0x%8.8lx\n",lp->sh_mem);
-    printk("\tmode: 0x%4.4x\n",readw(&p->mode));
+    printk("\tmode: 0x%4.4x\n", (u16) readw(&p->mode));
     printk("\tphysical address: ");
     for (i=0;i<ETH_ALEN-1;i++){
       printk("%2.2x:",(u_char)readb(&p->phys_addr[i]));
@@ -1668,8 +1668,8 @@
       printk("%2.2x:",(u_char)readb(&p->mcast_table[i]));
     }
     printk("%2.2x\n",(u_char)readb(&p->mcast_table[i]));
-    printk("\trx_ring at: 0x%8.8x\n",readl(&p->rx_ring));
-    printk("\ttx_ring at: 0x%8.8x\n",readl(&p->tx_ring));
+    printk("\trx_ring at: 0x%8.8x\n", (u32) readl(&p->rx_ring));
+    printk("\ttx_ring at: 0x%8.8x\n", (u32) readl(&p->tx_ring));
     printk("dma_buffs: 0x%8.8lx\n",lp->dma_buffs);
     printk("Ring size:\nRX: %d  Log2(rxRingMask): 0x%8.8x\n", 
 	   (int)lp->rxRingMask + 1, 
diff -u --recursive --new-file v1.3.64/linux/drivers/pci/pci.c linux/drivers/pci/pci.c
--- v1.3.64/linux/drivers/pci/pci.c	Wed Feb  7 15:11:27 1996
+++ linux/drivers/pci/pci.c	Fri Feb 16 14:40:20 1996
@@ -42,6 +42,7 @@
  */
 struct pci_dev_info dev_info[] = {
 	DEVICE( COMPAQ,		COMPAQ_1280,	"QVision 1280/p"),
+	DEVICE( COMPAQ,		COMPAQ_THUNDER,	"ThunderLAN"),
 	DEVICE( NCR,		NCR_53C810,	"53c810"),
 	DEVICE( NCR,		NCR_53C820,	"53c820"),
 	DEVICE( NCR,		NCR_53C825,	"53c825"),
@@ -52,6 +53,8 @@
 	DEVICE( ATI,		ATI_210888GX,   "210888GX"),
 	DEVICE( VLSI,		VLSI_82C592,	"82C592-FC1"),
 	DEVICE( VLSI,		VLSI_82C593,	"82C593-FC1"),
+	DEVICE( VLSI,		VLSI_82C594,	"82C594-AFC2"),
+	DEVICE( VLSI,		VLSI_82C597,	"82C597-AFC2"),
 	DEVICE( ADL,		ADL_2301,	"2301"),
 	DEVICE( NS,		NS_87410,	"87410"),
 	DEVICE( TSENG,		TSENG_W32P_2,	"ET4000W32P"),
@@ -74,6 +77,7 @@
 	DEVICE( CIRRUS,		CIRRUS_6729,	"CL 6729"),
 	DEVICE( CIRRUS,		CIRRUS_7542,	"CL 7542"),
 	DEVICE( CIRRUS,		CIRRUS_7543,	"CL 7543"),
+	DEVICE( IBM,		IBM_82G2675,	"82G2675"),
 	DEVICE( WD,		WD_7197,	"WD 7197"),
 	DEVICE( AMD,		AMD_LANCE,	"79C970"),
 	DEVICE( AMD,		AMD_SCSI,	"53C974"),
@@ -97,6 +101,7 @@
 	DEVICE( HP,		HP_J2585A,	"J2585A"),
 	DEVICE( PCTECH,		PCTECH_RZ1000,  "RZ1000 (buggy)"),
 	DEVICE( DPT,		DPT,		"SmartCache/Raid"),
+	DEVICE( OPTI,		OPTI_92C178,	"92C178"),
 	DEVICE( OPTI,		OPTI_82C557,	"82C557"),
 	DEVICE( OPTI,		OPTI_82C558,	"82C558"),
 	DEVICE( OPTI,		OPTI_82C621,	"82C621"),
@@ -104,6 +109,7 @@
 	DEVICE( BUSLOGIC,	BUSLOGIC_946C_2,"BT-946C"),
 	DEVICE( BUSLOGIC,	BUSLOGIC_946C,	"BT-946C"),
 	DEVICE( BUSLOGIC,	BUSLOGIC_930,	"BT-930"),
+	DEVICE( OAK,		OAK_OTI107,	"OTI107"),
 	DEVICE( PROMISE,	PROMISE_5300,	"DC5030"),
 	DEVICE( N9,		N9_I128,	"Imagine 128"),
 	DEVICE( N9,		N9_I128_2,	"Imagine 128v2"),
@@ -117,6 +123,7 @@
 	DEVICE( UMC,		UMC_UM8886N,	"UM8886N"),
 	DEVICE( UMC,		UMC_UM8891N,	"UM8891N"),
 	DEVICE( X,		X_AGX016,	"ITT AGX016"),
+	DEVICE( NEXGEN,		NEXGEN_82C501,	"82C501"),
 	DEVICE( QLOGIC,		QLOGIC_ISP1020,	"ISP1020"),
 	DEVICE( QLOGIC,		QLOGIC_ISP1022,	"ISP1022"),
 	DEVICE( LEADTEK,	LEADTEK_805,	"S3 805"),
@@ -126,7 +133,9 @@
 	DEVICE( VISION,		VISION_QD8500,	"QD-8500"),
 	DEVICE( VISION,		VISION_QD8580,	"QD-8580"),
 	DEVICE( SIERRA,		SIERRA_STB,	"STB Horizon 64"),
+	DEVICE( ACC,		ACC_2056,	"2056"),
 	DEVICE( WINBOND,	WINBOND_83769,	"W83769F"),
+	DEVICE( WINBOND,	WINBOND_82C105,	"SL82C105"),
 	DEVICE( 3COM,		3COM_3C590,	"3C590 10bT"),
 	DEVICE( 3COM,		3COM_3C595TX,	"3C595 100bTX"),
 	DEVICE( 3COM,		3COM_3C595T4,	"3C595 100bT4"),
@@ -136,6 +145,8 @@
 	DEVICE( AL,		AL_M1451,	"M1451"),
 	DEVICE( AL,		AL_M1461,	"M1461"),
 	DEVICE( AL,		AL_M1489,	"M1489"),
+	DEVICE( AL,		AL_M1511,	"M1511"),
+	DEVICE( AL,		AL_M1513,	"M1513"),
 	DEVICE( AL,		AL_M4803,	"M4803"),
 	DEVICE( ASP,		ASP_ABP940,	"ABP940"),
 	DEVICE( IMS,		IMS_8849,	"8849"),
@@ -157,6 +168,7 @@
 	DEVICE( ALLIANCE,	ALLIANCE_PROVIDEO, "Provideo"),
 	DEVICE( MUTECH,		MUTECH_MV1000,	"MV-1000"),
 	DEVICE( ZEITNET,	ZEITNET_1221,	"1221"),
+	DEVICE( ZEITNET,	ZEITNET_1225,	"1225"),
 	DEVICE( SPECIALIX,	SPECIALIX_XIO,	"XIO/SIO host"),
 	DEVICE( SPECIALIX,	SPECIALIX_RIO,	"RIO host"),
 	DEVICE( CYCLADES,	CYCLADES_Y,	"Cyclome-Y"),
@@ -417,6 +429,7 @@
 	      case PCI_VENDOR_ID_OPTI:		return "OPTI";
 	      case PCI_VENDOR_ID_SGS:		return "SGS Thomson";
 	      case PCI_VENDOR_ID_BUSLOGIC:	return "BusLogic";
+	      case PCI_VENDOR_ID_OAK: 		return "OAK";
 	      case PCI_VENDOR_ID_PROMISE:	return "Promise Technology";
 	      case PCI_VENDOR_ID_N9:		return "Number Nine";
 	      case PCI_VENDOR_ID_UMC:		return "UMC";
diff -u --recursive --new-file v1.3.64/linux/drivers/scsi/53c7,8xx.c linux/drivers/scsi/53c7,8xx.c
--- v1.3.64/linux/drivers/scsi/53c7,8xx.c	Sat Jan  6 19:10:39 1996
+++ linux/drivers/scsi/53c7,8xx.c	Sat Feb 17 09:19:41 1996
@@ -946,6 +946,8 @@
     for (host->this_id = 0; tmp != 1; tmp >>=1, ++host->this_id);
 #else
     host->this_id = NCR53c7x0_read8(SCID_REG) & 15;
+    if (host->this_id == 0)
+	host->this_id = 7;	/* sanitize hostid---0 doesn't make sense */
     hostdata->this_id_mask = 1 << host->this_id;
 #endif
 
@@ -1879,7 +1881,7 @@
 	}
 
 	if (failed) {
-	    printk ("scsi%d : DSP = 0x%p (script at 0x%px, start at 0x%x)\n",
+	    printk ("scsi%d : DSP = 0x%p (script at 0x%p, start at 0x%x)\n",
 		host->host_no, bus_to_virt(NCR53c7x0_read32(DSP_REG)),
 		hostdata->script, start);
 	    printk ("scsi%d : DSPS = 0x%x\n", host->host_no,
@@ -5343,10 +5345,9 @@
      * to use vverify()?
      */
 
-    if ((unsigned long) insn < PAGE_SIZE || 
-	(unsigned long) insn > (high_memory - 8) || 
+    if (MAP_NR(insn) < 1 || MAP_NR(insn + 8) > MAP_NR(high_memory) || 
 	((((dcmd = (insn[0] >> 24) & 0xff) & DCMD_TYPE_MMI) == DCMD_TYPE_MMI) &&
-	(unsigned long) insn > (high_memory - 12))) {
+	MAP_NR(insn + 12) > MAP_NR(high_memory))) {
 	size = 0;
 	sprintf (buf, "%s%p: address out of range\n",
 	    prefix, insn);
diff -u --recursive --new-file v1.3.64/linux/drivers/scsi/scsi.c linux/drivers/scsi/scsi.c
--- v1.3.64/linux/drivers/scsi/scsi.c	Wed Feb  7 15:11:28 1996
+++ linux/drivers/scsi/scsi.c	Sat Feb 17 08:07:01 1996
@@ -563,7 +563,8 @@
          (status_byte (SCpnt->result) & CHECK_CONDITION)) &&
         ((SCpnt->sense_buffer[0] & 0x70) >> 4) == 7) {
       if (((SCpnt->sense_buffer[2] & 0xf) != NOT_READY) &&
-          ((SCpnt->sense_buffer[2] & 0xf) != UNIT_ATTENTION))
+          ((SCpnt->sense_buffer[2] & 0xf) != UNIT_ATTENTION) &&
+          ((SCpnt->sense_buffer[2] & 0xf) != ILLEGAL_REQUEST))
         return 1;
     }
     else
diff -u --recursive --new-file v1.3.64/linux/drivers/scsi/sr.c linux/drivers/scsi/sr.c
--- v1.3.64/linux/drivers/scsi/sr.c	Sat Dec 30 15:50:54 1995
+++ linux/drivers/scsi/sr.c	Sat Feb 17 08:07:03 1996
@@ -1150,10 +1150,6 @@
 
 void cleanup_module( void) 
 {
-    if (MOD_IN_USE) {
-	printk(KERN_INFO __FILE__ ": module is in use, remove rejected\n");
-	return;
-    }
     scsi_unregister_module(MODULE_SCSI_DEV, &sr_template);
     unregister_blkdev(SCSI_CDROM_MAJOR, "sr");
     sr_registered--;
diff -u --recursive --new-file v1.3.64/linux/drivers/sound/Makefile linux/drivers/sound/Makefile
--- v1.3.64/linux/drivers/sound/Makefile	Wed Feb 14 14:37:13 1996
+++ linux/drivers/sound/Makefile	Sat Feb 17 09:19:41 1996
@@ -76,9 +76,9 @@
 	@echo
 	@echo
 	@echo
-	@echo NOTE! Object file dependencies may not be up to date. Run
-	@echo make again if kernel/driver doesn't link properly. Restarting
-	@echo it now may save some time.
+	@echo "NOTE! Object file dependencies may not be up to date. Run"
+	@echo "make again if kernel/driver doesn't link properly. Restarting"
+	@echo "it now may save some time."
 	@echo
 	@echo
 
@@ -135,7 +135,7 @@
 	$(LD) -r -o sound.o $(FIXEDOBJS) sound.a
 
 modules: local.h sound.o
-	ln -fs `pwd`/sound.o /usr/src/linux/modules/sound.o
+	ln -fs `pwd`/sound.o $(TOPDIR)/modules/sound.o
 
 
 #
diff -u --recursive --new-file v1.3.64/linux/drivers/sound/audio.c linux/drivers/sound/audio.c
--- v1.3.64/linux/drivers/sound/audio.c	Wed Feb 14 14:37:13 1996
+++ linux/drivers/sound/audio.c	Sat Feb 17 09:19:41 1996
@@ -51,7 +51,7 @@
 static int      local_conversion[MAX_AUDIO_DEV];
 
 static int
-set_format (int dev, int fmt)
+set_format (int dev, long fmt)
 {
   if (fmt != AFMT_QUERY)
     {
@@ -67,7 +67,7 @@
 	else
 	  fmt = AFMT_U8;	/* This is always supported */
 
-      audio_format[dev] = DMAbuf_ioctl (dev, SNDCTL_DSP_SETFMT, (caddr_t) fmt, 1);
+      audio_format[dev] = DMAbuf_ioctl (dev, SNDCTL_DSP_SETFMT, (caddr_t) (long) fmt, 1);
     }
 
   if (local_conversion[dev])	/* This shadows the HW format */
@@ -80,7 +80,7 @@
 audio_open (int dev, struct fileinfo *file)
 {
   int             ret;
-  int             bits;
+  long            bits;
   int             dev_type = dev & 0x0f;
   int             mode = file->mode & O_ACCMODE;
 
diff -u --recursive --new-file v1.3.64/linux/drivers/sound/sb16_dsp.c linux/drivers/sound/sb16_dsp.c
--- v1.3.64/linux/drivers/sound/sb16_dsp.c	Wed Feb 14 14:37:15 1996
+++ linux/drivers/sound/sb16_dsp.c	Sat Feb 17 09:19:41 1996
@@ -157,7 +157,7 @@
     {
     case SOUND_PCM_WRITE_RATE:
       if (local)
-	return dsp_set_speed ((int) arg);
+	return dsp_set_speed ((long) arg);
       return snd_ioctl_return ((int *) arg, dsp_set_speed (get_fs_long ((long *) arg)));
 
     case SOUND_PCM_READ_RATE:
@@ -167,12 +167,12 @@
 
     case SNDCTL_DSP_STEREO:
       if (local)
-	return dsp_set_stereo ((int) arg);
+	return dsp_set_stereo ((long) arg);
       return snd_ioctl_return ((int *) arg, dsp_set_stereo (get_fs_long ((long *) arg)));
 
     case SOUND_PCM_WRITE_CHANNELS:
       if (local)
-	return dsp_set_stereo ((int) arg - 1) + 1;
+	return dsp_set_stereo ((long) arg - 1) + 1;
       return snd_ioctl_return ((int *) arg, dsp_set_stereo (get_fs_long ((long *) arg) - 1) + 1);
 
     case SOUND_PCM_READ_CHANNELS:
@@ -182,7 +182,7 @@
 
     case SNDCTL_DSP_SETFMT:
       if (local)
-	return dsp_set_bits ((int) arg);
+	return dsp_set_bits ((long) arg);
       return snd_ioctl_return ((int *) arg, dsp_set_bits (get_fs_long ((long *) arg)));
 
     case SOUND_PCM_READ_BITS:
diff -u --recursive --new-file v1.3.64/linux/drivers/sound/sb_dsp.c linux/drivers/sound/sb_dsp.c
--- v1.3.64/linux/drivers/sound/sb_dsp.c	Wed Feb 14 14:37:15 1996
+++ linux/drivers/sound/sb_dsp.c	Sat Feb 17 09:19:41 1996
@@ -923,7 +923,7 @@
     {
     case SOUND_PCM_WRITE_RATE:
       if (local)
-	return dsp_speed ((int) arg);
+	return dsp_speed ((long) arg);
       return snd_ioctl_return ((int *) arg, dsp_speed (get_fs_long ((long *) arg)));
       break;
 
@@ -935,7 +935,7 @@
 
     case SOUND_PCM_WRITE_CHANNELS:
       if (local)
-	return dsp_set_stereo ((int) arg - 1) + 1;
+	return dsp_set_stereo ((long) arg - 1) + 1;
       return snd_ioctl_return ((int *) arg, dsp_set_stereo (get_fs_long ((long *) arg) - 1) + 1);
       break;
 
@@ -947,7 +947,7 @@
 
     case SNDCTL_DSP_STEREO:
       if (local)
-	return dsp_set_stereo ((int) arg);
+	return dsp_set_stereo ((long) arg);
       return snd_ioctl_return ((int *) arg, dsp_set_stereo (get_fs_long ((long *) arg)));
       break;
 
@@ -956,7 +956,7 @@
        */
     case SNDCTL_DSP_SETFMT:
       if (local)
-	return dsp_set_bits ((int) arg);
+	return dsp_set_bits ((long) arg);
       return snd_ioctl_return ((int *) arg, dsp_set_bits (get_fs_long ((long *) arg)));
       break;
 
diff -u --recursive --new-file v1.3.64/linux/fs/buffer.c linux/fs/buffer.c
--- v1.3.64/linux/fs/buffer.c	Fri Feb 16 11:34:09 1996
+++ linux/fs/buffer.c	Sat Feb 17 09:19:41 1996
@@ -506,7 +506,7 @@
 	if (size > PAGE_SIZE)
 		size = 0;
 
-	switch(size) {
+	switch (size) {
 		default: panic("Invalid blocksize passed to set_blocksize");
 	        case 512: case 1024: case 2048: case 4096: case 8192: ;
 	}
diff -u --recursive --new-file v1.3.64/linux/fs/nfs/file.c linux/fs/nfs/file.c
--- v1.3.64/linux/fs/nfs/file.c	Tue Dec 26 04:45:38 1995
+++ linux/fs/nfs/file.c	Sat Feb 17 09:19:41 1996
@@ -121,7 +121,7 @@
 		if ((cache[i].inode_num == inode->i_ino)
 			&& (cache[i].file_pos <= pos)
 			&& (cache[i].file_pos + cache[i].len >= pos + count)
-			&& (abs(jiffies - cache[i].time) < EXPIRE_CACHE))
+			&& (jiffies - cache[i].time < EXPIRE_CACHE))
 			break;
 	if (i < READ_CACHE_SIZE) {
 		++cache[i].in_use;
diff -u --recursive --new-file v1.3.64/linux/fs/nfs/nfsroot.c linux/fs/nfs/nfsroot.c
--- v1.3.64/linux/fs/nfs/nfsroot.c	Tue Jan 23 21:15:51 1996
+++ linux/fs/nfs/nfsroot.c	Sat Feb 17 09:19:41 1996
@@ -289,10 +289,8 @@
 	struct device *dev;
 	int num = 0;
 
-#ifdef NFSROOT_DEBUG
+	/* always print this message so user knows what's going on... */
 	printk(KERN_NOTICE "NFS: Sending RARP request...\n");
-#endif
-
 	for (openp = open_base; openp != NULL; openp = openp->next) {
 		dev = openp->dev;
 		if (!(dev->flags & IFF_NOARP)) {
diff -u --recursive --new-file v1.3.64/linux/fs/open.c linux/fs/open.c
--- v1.3.64/linux/fs/open.c	Wed Feb  7 15:11:34 1996
+++ linux/fs/open.c	Sat Feb 17 09:19:41 1996
@@ -131,6 +131,15 @@
 	return do_truncate(inode, length);
 }
 
+#ifndef __alpha__
+
+/*
+ * sys_utime() can be implemented in user-level using sys_utimes().
+ * Is this for backwards compatibility?  If so, why not move it
+ * into the appropriate arch directory (for those architectures that
+ * need it).
+ */
+
 /* If times==NULL, set access and modification to current time,
  * must be owner or have write permission.
  * Else, update from *times, must be owner or super user.
@@ -170,6 +179,8 @@
 	return error;
 }
 
+#endif
+
 /* If times==NULL, set access and modification to current time,
  * must be owner or have write permission.
  * Else, update from *times, must be owner or super user.
@@ -540,10 +551,18 @@
 	return error;
 }
 
+#ifndef __alpha__
+
+/*
+ * For backward compatibility?  Maybe this should be moved
+ * into arch/i386 instead?
+ */
 asmlinkage int sys_creat(const char * pathname, int mode)
 {
 	return sys_open(pathname, O_CREAT | O_WRONLY | O_TRUNC, mode);
 }
+
+#endif
 
 int close_fp(struct file *filp)
 {
diff -u --recursive --new-file v1.3.64/linux/fs/stat.c linux/fs/stat.c
--- v1.3.64/linux/fs/stat.c	Mon Sep 18 14:54:08 1995
+++ linux/fs/stat.c	Sat Feb 17 09:19:41 1996
@@ -14,6 +14,12 @@
 
 #include <asm/segment.h>
 
+#ifndef __alpha__
+
+/*
+ * For backward compatibility?  Maybe this should be moved
+ * into arch/i386 instead?
+ */
 static void cp_old_stat(struct inode * inode, struct old_stat * statbuf)
 {
 	struct old_stat tmp;
@@ -36,6 +42,8 @@
 	memcpy_tofs(statbuf,&tmp,sizeof(tmp));
 }
 
+#endif
+
 static void cp_new_stat(struct inode * inode, struct new_stat * statbuf)
 {
 	struct new_stat tmp;
@@ -94,6 +102,11 @@
 	memcpy_tofs(statbuf,&tmp,sizeof(tmp));
 }
 
+#ifndef __alpha__
+/*
+ * For backward compatibility?  Maybe this should be moved
+ * into arch/i386 instead?
+ */
 asmlinkage int sys_stat(char * filename, struct old_stat * statbuf)
 {
 	struct inode * inode;
@@ -109,6 +122,7 @@
 	iput(inode);
 	return 0;
 }
+#endif
 
 asmlinkage int sys_newstat(char * filename, struct new_stat * statbuf)
 {
@@ -126,6 +140,12 @@
 	return 0;
 }
 
+#ifndef __alpha__
+
+/*
+ * For backward compatibility?  Maybe this should be moved
+ * into arch/i386 instead?
+ */
 asmlinkage int sys_lstat(char * filename, struct old_stat * statbuf)
 {
 	struct inode * inode;
@@ -142,6 +162,8 @@
 	return 0;
 }
 
+#endif
+
 asmlinkage int sys_newlstat(char * filename, struct new_stat * statbuf)
 {
 	struct inode * inode;
@@ -158,6 +180,12 @@
 	return 0;
 }
 
+#ifndef __alpha__
+
+/*
+ * For backward compatibility?  Maybe this should be moved
+ * into arch/i386 instead?
+ */
 asmlinkage int sys_fstat(unsigned int fd, struct old_stat * statbuf)
 {
 	struct file * f;
@@ -172,6 +200,8 @@
 	cp_old_stat(inode,statbuf);
 	return 0;
 }
+
+#endif
 
 asmlinkage int sys_newfstat(unsigned int fd, struct new_stat * statbuf)
 {
diff -u --recursive --new-file v1.3.64/linux/include/asm-alpha/apecs.h linux/include/asm-alpha/apecs.h
--- v1.3.64/linux/include/asm-alpha/apecs.h	Tue Dec 26 04:45:40 1995
+++ linux/include/asm-alpha/apecs.h	Sat Feb 17 09:19:42 1996
@@ -74,63 +74,63 @@
  * These are used to program memory timing,
  *  configure memory and initialise the B-Cache.
  */
-#define APECS_IOC_GCR		        (IDENT_ADDR + 0x180000000UL)
-#define APECS_IOC_EDSR		        (IDENT_ADDR + 0x180000040UL)
-#define APECS_IOC_TAR  		        (IDENT_ADDR + 0x180000060UL)
-#define APECS_IOC_ELAR		        (IDENT_ADDR + 0x180000080UL)
-#define APECS_IOC_EHAR  		(IDENT_ADDR + 0x1800000a0UL)
-#define APECS_IOC_SFT_RST		(IDENT_ADDR + 0x1800000c0UL)
-#define APECS_IOC_LDxLAR 		(IDENT_ADDR + 0x1800000e0UL)
-#define APECS_IOC_LDxHAR 		(IDENT_ADDR + 0x180000100UL)
-#define APECS_IOC_GTR    		(IDENT_ADDR + 0x180000200UL)
-#define APECS_IOC_RTR    		(IDENT_ADDR + 0x180000220UL)
-#define APECS_IOC_VFPR   		(IDENT_ADDR + 0x180000240UL)
-#define APECS_IOC_PDLDR  		(IDENT_ADDR + 0x180000260UL)
-#define APECS_IOC_PDhDR  		(IDENT_ADDR + 0x180000280UL)
+#define APECS_MEM_GCR		        (IDENT_ADDR + 0x180000000UL)
+#define APECS_MEM_EDSR		        (IDENT_ADDR + 0x180000040UL)
+#define APECS_MEM_TAR  		        (IDENT_ADDR + 0x180000060UL)
+#define APECS_MEM_ELAR		        (IDENT_ADDR + 0x180000080UL)
+#define APECS_MEM_EHAR  		(IDENT_ADDR + 0x1800000a0UL)
+#define APECS_MEM_SFT_RST		(IDENT_ADDR + 0x1800000c0UL)
+#define APECS_MEM_LDxLAR 		(IDENT_ADDR + 0x1800000e0UL)
+#define APECS_MEM_LDxHAR 		(IDENT_ADDR + 0x180000100UL)
+#define APECS_MEM_GTR    		(IDENT_ADDR + 0x180000200UL)
+#define APECS_MEM_RTR    		(IDENT_ADDR + 0x180000220UL)
+#define APECS_MEM_VFPR   		(IDENT_ADDR + 0x180000240UL)
+#define APECS_MEM_PDLDR  		(IDENT_ADDR + 0x180000260UL)
+#define APECS_MEM_PDhDR  		(IDENT_ADDR + 0x180000280UL)
 
 /* Bank x Base Address Register */
-#define APECS_IOC_B0BAR  		(IDENT_ADDR + 0x180000800UL)
-#define APECS_IOC_B1BAR  		(IDENT_ADDR + 0x180000820UL)
-#define APECS_IOC_B2BAR  		(IDENT_ADDR + 0x180000840UL)
-#define APECS_IOC_B3BAR  		(IDENT_ADDR + 0x180000860UL)
-#define APECS_IOC_B4BAR  		(IDENT_ADDR + 0x180000880UL)
-#define APECS_IOC_B5BAR  		(IDENT_ADDR + 0x1800008A0UL)
-#define APECS_IOC_B6BAR  		(IDENT_ADDR + 0x1800008C0UL)
-#define APECS_IOC_B7BAR  		(IDENT_ADDR + 0x1800008E0UL)
-#define APECS_IOC_B8BAR  		(IDENT_ADDR + 0x180000900UL)
+#define APECS_MEM_B0BAR  		(IDENT_ADDR + 0x180000800UL)
+#define APECS_MEM_B1BAR  		(IDENT_ADDR + 0x180000820UL)
+#define APECS_MEM_B2BAR  		(IDENT_ADDR + 0x180000840UL)
+#define APECS_MEM_B3BAR  		(IDENT_ADDR + 0x180000860UL)
+#define APECS_MEM_B4BAR  		(IDENT_ADDR + 0x180000880UL)
+#define APECS_MEM_B5BAR  		(IDENT_ADDR + 0x1800008A0UL)
+#define APECS_MEM_B6BAR  		(IDENT_ADDR + 0x1800008C0UL)
+#define APECS_MEM_B7BAR  		(IDENT_ADDR + 0x1800008E0UL)
+#define APECS_MEM_B8BAR  		(IDENT_ADDR + 0x180000900UL)
 
 /* Bank x Configuration Register */
-#define APECS_IOC_B0BCR  		(IDENT_ADDR + 0x180000A00UL)
-#define APECS_IOC_B1BCR  		(IDENT_ADDR + 0x180000A20UL)
-#define APECS_IOC_B2BCR  		(IDENT_ADDR + 0x180000A40UL)
-#define APECS_IOC_B3BCR  		(IDENT_ADDR + 0x180000A60UL)
-#define APECS_IOC_B4BCR  		(IDENT_ADDR + 0x180000A80UL)
-#define APECS_IOC_B5BCR  		(IDENT_ADDR + 0x180000AA0UL)
-#define APECS_IOC_B6BCR  		(IDENT_ADDR + 0x180000AC0UL)
-#define APECS_IOC_B7BCR  		(IDENT_ADDR + 0x180000AE0UL)
-#define APECS_IOC_B8BCR  		(IDENT_ADDR + 0x180000B00UL)
+#define APECS_MEM_B0BCR  		(IDENT_ADDR + 0x180000A00UL)
+#define APECS_MEM_B1BCR  		(IDENT_ADDR + 0x180000A20UL)
+#define APECS_MEM_B2BCR  		(IDENT_ADDR + 0x180000A40UL)
+#define APECS_MEM_B3BCR  		(IDENT_ADDR + 0x180000A60UL)
+#define APECS_MEM_B4BCR  		(IDENT_ADDR + 0x180000A80UL)
+#define APECS_MEM_B5BCR  		(IDENT_ADDR + 0x180000AA0UL)
+#define APECS_MEM_B6BCR  		(IDENT_ADDR + 0x180000AC0UL)
+#define APECS_MEM_B7BCR  		(IDENT_ADDR + 0x180000AE0UL)
+#define APECS_MEM_B8BCR  		(IDENT_ADDR + 0x180000B00UL)
 
 /* Bank x Timing Register A */
-#define APECS_IOC_B0TRA  		(IDENT_ADDR + 0x180000C00UL)
-#define APECS_IOC_B1TRA  		(IDENT_ADDR + 0x180000C20UL)
-#define APECS_IOC_B2TRA  		(IDENT_ADDR + 0x180000C40UL)
-#define APECS_IOC_B3TRA  		(IDENT_ADDR + 0x180000C60UL)
-#define APECS_IOC_B4TRA  		(IDENT_ADDR + 0x180000C80UL)
-#define APECS_IOC_B5TRA  		(IDENT_ADDR + 0x180000CA0UL)
-#define APECS_IOC_B6TRA  		(IDENT_ADDR + 0x180000CC0UL)
-#define APECS_IOC_B7TRA  		(IDENT_ADDR + 0x180000CE0UL)
-#define APECS_IOC_B8TRA  		(IDENT_ADDR + 0x180000D00UL)
+#define APECS_MEM_B0TRA  		(IDENT_ADDR + 0x180000C00UL)
+#define APECS_MEM_B1TRA  		(IDENT_ADDR + 0x180000C20UL)
+#define APECS_MEM_B2TRA  		(IDENT_ADDR + 0x180000C40UL)
+#define APECS_MEM_B3TRA  		(IDENT_ADDR + 0x180000C60UL)
+#define APECS_MEM_B4TRA  		(IDENT_ADDR + 0x180000C80UL)
+#define APECS_MEM_B5TRA  		(IDENT_ADDR + 0x180000CA0UL)
+#define APECS_MEM_B6TRA  		(IDENT_ADDR + 0x180000CC0UL)
+#define APECS_MEM_B7TRA  		(IDENT_ADDR + 0x180000CE0UL)
+#define APECS_MEM_B8TRA  		(IDENT_ADDR + 0x180000D00UL)
 
 /* Bank x Timing Register B */
-#define APECS_IOC_B0TRB                 (IDENT_ADDR + 0x180000E00UL)
-#define APECS_IOC_B1TRB  		(IDENT_ADDR + 0x180000E20UL)
-#define APECS_IOC_B2TRB  		(IDENT_ADDR + 0x180000E40UL)
-#define APECS_IOC_B3TRB  		(IDENT_ADDR + 0x180000E60UL)
-#define APECS_IOC_B4TRB  		(IDENT_ADDR + 0x180000E80UL)
-#define APECS_IOC_B5TRB  		(IDENT_ADDR + 0x180000EA0UL)
-#define APECS_IOC_B6TRB  		(IDENT_ADDR + 0x180000EC0UL)
-#define APECS_IOC_B7TRB  		(IDENT_ADDR + 0x180000EE0UL)
-#define APECS_IOC_B8TRB  		(IDENT_ADDR + 0x180000F00UL)
+#define APECS_MEM_B0TRB                 (IDENT_ADDR + 0x180000E00UL)
+#define APECS_MEM_B1TRB  		(IDENT_ADDR + 0x180000E20UL)
+#define APECS_MEM_B2TRB  		(IDENT_ADDR + 0x180000E40UL)
+#define APECS_MEM_B3TRB  		(IDENT_ADDR + 0x180000E60UL)
+#define APECS_MEM_B4TRB  		(IDENT_ADDR + 0x180000E80UL)
+#define APECS_MEM_B5TRB  		(IDENT_ADDR + 0x180000EA0UL)
+#define APECS_MEM_B6TRB  		(IDENT_ADDR + 0x180000EC0UL)
+#define APECS_MEM_B7TRB  		(IDENT_ADDR + 0x180000EE0UL)
+#define APECS_MEM_B8TRB  		(IDENT_ADDR + 0x180000F00UL)
 
 
 /*
diff -u --recursive --new-file v1.3.64/linux/include/asm-alpha/ioctl.h linux/include/asm-alpha/ioctl.h
--- v1.3.64/linux/include/asm-alpha/ioctl.h	Sun Oct 29 11:38:49 1995
+++ linux/include/asm-alpha/ioctl.h	Sat Feb 17 09:19:42 1996
@@ -36,11 +36,12 @@
 #define _IOC_READ	2U
 #define _IOC_WRITE	4U
 
-#define _IOC(dir,type,nr,size) \
-	(((dir)  << _IOC_DIRSHIFT) | \
-	 ((type) << _IOC_TYPESHIFT) | \
-	 ((nr)   << _IOC_NRSHIFT) | \
-	 ((size) << _IOC_SIZESHIFT))
+#define _IOC(dir,type,nr,size)			\
+	((__u32)				\
+	 (((dir)  << _IOC_DIRSHIFT) |		\
+	  ((type) << _IOC_TYPESHIFT) |		\
+	  ((nr)   << _IOC_NRSHIFT) |		\
+	  ((size) << _IOC_SIZESHIFT)))
 
 /* used to create numbers */
 #define _IO(type,nr)		_IOC(_IOC_NONE,(type),(nr),0)
diff -u --recursive --new-file v1.3.64/linux/include/asm-alpha/termios.h linux/include/asm-alpha/termios.h
--- v1.3.64/linux/include/asm-alpha/termios.h	Sun Dec 17 11:43:22 1995
+++ linux/include/asm-alpha/termios.h	Sat Feb 17 09:19:42 1996
@@ -241,7 +241,7 @@
 #define XTABS	01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */
 
 /* c_cflag bit meaning */
-#define CBAUD	0000377
+#define CBAUD	0000017
 #define  B0	0000000		/* hang up */
 #define  B50	0000001
 #define  B75	0000002
diff -u --recursive --new-file v1.3.64/linux/include/asm-alpha/unistd.h linux/include/asm-alpha/unistd.h
--- v1.3.64/linux/include/asm-alpha/unistd.h	Tue Dec 26 04:45:41 1995
+++ linux/include/asm-alpha/unistd.h	Sat Feb 17 09:19:42 1996
@@ -1,13 +1,6 @@
 #ifndef _ALPHA_UNISTD_H
 #define _ALPHA_UNISTD_H
 
-/*
- * ".long 131" is "PAL_callsys"..
- *
- * Duh, the alpha gcc compiler doesn't allow us to specify regs
- * yet. I'll have to see about this later..
- */
-
 #define __NR_exit		  1
 #define __NR_fork		  2
 #define __NR_read		  3
@@ -36,6 +29,7 @@
 #define __NR_open		 45
 #define __NR_getxgid		 47
 #define __NR_acct		 51
+#define __NR_sigpending		 52
 #define __NR_ioctl		 54
 #define __NR_symlink		 57
 #define __NR_readlink		 58
@@ -46,6 +40,7 @@
 #define __NR_getpagesize	 64
 #define __NR_stat		 67
 #define __NR_lstat		 68
+#define __NR_mmap		 71	/* OSF/1 mmap is superset of Linux */
 #define __NR_munmap		 73
 #define __NR_mprotect		 74
 #define __NR_madvise		 75
@@ -89,6 +84,7 @@
 #define __NR_rename		128
 #define __NR_truncate		129
 #define __NR_ftruncate		130
+#define __NR_flock		131
 #define __NR_setgid		132
 #define __NR_sendto		133
 #define __NR_shutdown		134
@@ -103,6 +99,7 @@
 #define __NR_quotactl		148
 #define __NR_getsockname	150
 #define __NR_sigaction		156
+#define __NR_setdomainname	166
 #define __NR_msgctl		200
 #define __NR_msgget		201
 #define __NR_msgrcv		202
@@ -114,10 +111,12 @@
 #define __NR_shmdt		211
 #define __NR_shmget		212
 
+#define __NR_msync		217
+
+#define __NR_getpgid		233
 #define __NR_getsid		234
 
-#define __NR_getsysinfo		256
-#define __NR_setsysinfo		257
+#define __NR_sysfs		254
 
 /*
  * Linux-specific system calls begin at 300
@@ -140,9 +139,36 @@
 #define __NR_munlock		315
 #define __NR_mlockall		316
 #define __NR_munlockall		317
+#define __NR_sysinfo		318
+#define __NR_sysctl		319
+#define __NR_idle		320
+#define __NR_umount		321
+#define __NR_swapon		322
+#define __NR_times		323
+#define __NR_personality	324
+#define __NR_setfsuid		325
+#define __NR_setfsgid		326
+#define __NR_ustat		327
+#define __NR_statfs		328
+#define __NR_fstatfs		329
+#define __NR_sched_setparam		330
+#define __NR_sched_getparam		331
+#define __NR_sched_setscheduler		332
+#define __NR_sched_getscheduler		333
+#define __NR_sched_yield		334
+#define __NR_sched_get_priority_max	335
+#define __NR_sched_get_priority_min	336
+#define __NR_sched_rr_get_interval	337
+#define __NR_afs_syscall		338
+#define __NR_uname			339
 
 #ifdef __LIBRARY__
 
+/*
+ * Duh, the alpha gcc compiler doesn't allow us to specify regs
+ * yet. I'll have to see about this later..
+ */
+
 /* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
 #define _syscall0(type,name) \
 type name(void) \
@@ -274,10 +300,10 @@
 	return sys_sync();
 }
 
-extern int sys_waitpid(int, int *, int);
+extern int sys_wait4(int, int *, int, struct rusage *);
 static inline pid_t waitpid(int pid, int * wait_stat, int flags)
 {
-	return sys_waitpid(pid,wait_stat,flags);
+	return sys_wait4(pid, wait_stat, flags, NULL);
 }
 
 static inline pid_t wait(int * wait_stat)
diff -u --recursive --new-file v1.3.64/linux/include/asm-i386/segment.h linux/include/asm-i386/segment.h
--- v1.3.64/linux/include/asm-i386/segment.h	Tue Oct 10 18:46:38 1995
+++ linux/include/asm-i386/segment.h	Fri Feb 16 08:23:32 1996
@@ -80,52 +80,6 @@
 	}
 }
 
-/*
- * These are deprecated..
- */
-
-static inline unsigned char get_user_byte(const char * addr)
-{
-	return __get_user(addr,1);
-}
-
-#define get_fs_byte(addr) get_user_byte((char *)(addr))
-
-static inline unsigned short get_user_word(const short *addr)
-{
-	return __get_user(addr, 2);
-}
-
-#define get_fs_word(addr) get_user_word((short *)(addr))
-
-static inline unsigned long get_user_long(const int *addr)
-{
-	return __get_user(addr, 4);
-}
-
-#define get_fs_long(addr) get_user_long((int *)(addr))
-
-static inline void put_user_byte(char val,char *addr)
-{
-	__put_user(val, addr, 1);
-}
-
-#define put_fs_byte(x,addr) put_user_byte((x),(char *)(addr))
-
-static inline void put_user_word(short val,short * addr)
-{
-	__put_user(val, addr, 2);
-}
-
-#define put_fs_word(x,addr) put_user_word((x),(short *)(addr))
-
-static inline void put_user_long(unsigned long val,int * addr)
-{
-	__put_user(val, addr, 4);
-}
-
-#define put_fs_long(x,addr) put_user_long((x),(int *)(addr))
-
 static inline void __generic_memcpy_tofs(void * to, const void * from, unsigned long n)
 {
     __asm__ volatile
@@ -305,6 +259,54 @@
 (__builtin_constant_p(n) ? \
  __constant_memcpy_tofs((to),(from),(n)) : \
  __generic_memcpy_tofs((to),(from),(n)))
+
+/*
+ * These are deprecated..
+ *
+ * Use "put_user()" and "get_user()" with the proper pointer types instead.
+ */
+
+#define get_fs_byte(addr) __get_user((const unsigned char *)(addr),1)
+#define get_fs_word(addr) __get_user((const unsigned short *)(addr),2)
+#define get_fs_long(addr) __get_user((const unsigned int *)(addr),4)
+
+#define put_fs_byte(x,addr) __put_user((x),(unsigned char *)(addr),1)
+#define put_fs_word(x,addr) __put_user((x),(unsigned short *)(addr),2)
+#define put_fs_long(x,addr) __put_user((x),(unsigned int *)(addr),4)
+
+#ifdef WE_REALLY_WANT_TO_USE_A_BROKEN_INTERFACE
+
+static inline unsigned short get_user_word(const short *addr)
+{
+	return __get_user(addr, 2);
+}
+
+static inline unsigned char get_user_byte(const char * addr)
+{
+	return __get_user(addr,1);
+}
+
+static inline unsigned long get_user_long(const int *addr)
+{
+	return __get_user(addr, 4);
+}
+
+static inline void put_user_byte(char val,char *addr)
+{
+	__put_user(val, addr, 1);
+}
+
+static inline void put_user_word(short val,short * addr)
+{
+	__put_user(val, addr, 2);
+}
+
+static inline void put_user_long(unsigned long val,int * addr)
+{
+	__put_user(val, addr, 4);
+}
+
+#endif
 
 /*
  * Someone who knows GNU asm better than I should double check the following.
diff -u --recursive --new-file v1.3.64/linux/include/linux/netdevice.h linux/include/linux/netdevice.h
--- v1.3.64/linux/include/linux/netdevice.h	Wed Feb  7 15:11:38 1996
+++ linux/include/linux/netdevice.h	Sat Feb 17 10:50:20 1996
@@ -63,11 +63,11 @@
 struct hh_cache
 {
 	struct hh_cache *hh_next;
-	unsigned long	hh_refcnt;	/* number of users */
 	void		*hh_arp;	/* Opaque pointer, used by
 					 * any address resolution module,
 					 * not only ARP.
 					 */
+	unsigned int	hh_refcnt;	/* number of users */
 	unsigned short  hh_type;	/* protocol identifier, f.e ETH_P_IP */
 	char		hh_uptodate;	/* hh_data is valid */
 	char		hh_data[16];    /* cached hardware header */
diff -u --recursive --new-file v1.3.64/linux/include/linux/nfs_fs.h linux/include/linux/nfs_fs.h
--- v1.3.64/linux/include/linux/nfs_fs.h	Tue Jan 23 21:15:53 1996
+++ linux/include/linux/nfs_fs.h	Sat Feb 17 09:19:42 1996
@@ -17,7 +17,7 @@
 /*
  * The readdir cache size controls how many directory entries are cached.
  * Its size is limited by the number of nfs_entry structures that can fit
- * in one 4096-byte page, currently 256.
+ * in one page, currently, the limit is 256 when using 4KB pages.
  */
 
 #define NFS_READDIR_CACHE_SIZE		64
@@ -26,8 +26,7 @@
 #define NFS_DEF_FILE_IO_BUFFER_SIZE	1024
 
 /*
- * The upper limit on timeouts for the exponential backoff algorithm
- * in tenths of a second.
+ * The upper limit on timeouts for the exponential backoff algorithm.
  */
 
 #define NFS_MAX_RPC_TIMEOUT		(6*HZ)
diff -u --recursive --new-file v1.3.64/linux/include/linux/pci.h linux/include/linux/pci.h
--- v1.3.64/linux/include/linux/pci.h	Wed Feb  7 15:11:38 1996
+++ linux/include/linux/pci.h	Fri Feb 16 14:40:25 1996
@@ -217,6 +217,7 @@
  */
 #define PCI_VENDOR_ID_COMPAQ		0x0e11
 #define PCI_DEVICE_ID_COMPAQ_1280	0x3033
+#define PCI_DEVICE_ID_COMPAQ_THUNDER	0xf130
 
 #define PCI_VENDOR_ID_NCR		0x1000
 #define PCI_DEVICE_ID_NCR_53C810	0x0001
@@ -233,6 +234,8 @@
 #define PCI_VENDOR_ID_VLSI		0x1004
 #define PCI_DEVICE_ID_VLSI_82C592	0x0005
 #define PCI_DEVICE_ID_VLSI_82C593	0x0006
+#define PCI_DEVICE_ID_VLSI_82C594	0x0007
+#define PCI_DEVICE_ID_VLSI_82C597	0x0009
 
 #define PCI_VENDOR_ID_ADL		0x1005
 #define PCI_DEVICE_ID_ADL_2301		0x2301
@@ -269,6 +272,7 @@
 #define PCI_DEVICE_ID_CIRRUS_7543	0x1202
 
 #define PCI_VENDOR_ID_IBM		0x1014
+#define PCI_DEVICE_ID_IBM_82G2675	0x001d
 
 #define PCI_VENDOR_ID_WD		0x101c
 #define PCI_DEVICE_ID_WD_7197		0x3296
@@ -316,6 +320,7 @@
 #define PCI_DEVICE_ID_DPT               0xa400  
 
 #define PCI_VENDOR_ID_OPTI		0x1045
+#define PCI_DEVICE_ID_OPTI_92C178	0xc178
 #define PCI_DEVICE_ID_OPTI_82C557	0xc557
 #define PCI_DEVICE_ID_OPTI_82C558	0xc558
 #define PCI_DEVICE_ID_OPTI_82C621	0xc621
@@ -328,10 +333,13 @@
 #define PCI_DEVICE_ID_BUSLOGIC_946C	0x1040
 #define PCI_DEVICE_ID_BUSLOGIC_930	0x8130
 
+#define PCI_VENDOR_ID_OAK		0x104e
+#define PCI_DEVICE_ID_OAK_OTI107	0x0107
+
 #define PCI_VENDOR_ID_PROMISE		0x105a
 #define PCI_DEVICE_ID_PROMISE_5300	0x5300
 
-#define PCI_VENDOR_ID_N9		0x105D
+#define PCI_VENDOR_ID_N9		0x105d
 #define PCI_DEVICE_ID_N9_I128		0x2309
 #define PCI_DEVICE_ID_N9_I128_2		0x2339
 
@@ -350,6 +358,7 @@
 #define PCI_DEVICE_ID_X_AGX016		0x0001
 
 #define PCI_VENDOR_ID_NEXGEN		0x1074
+#define PCI_DEVICE_ID_NEXGEN_82C501	0x4e78
 
 #define PCI_VENDOR_ID_QLOGIC		0x1077
 #define PCI_DEVICE_ID_QLOGIC_ISP1020	0x1020
@@ -377,9 +386,11 @@
 #define PCI_DEVICE_ID_SIERRA_STB	0x0000
 
 #define PCI_VENDOR_ID_ACC		0x10aa
+#define PCI_DEVICE_ID_ACC_2056		0x0000
 
 #define PCI_VENDOR_ID_WINBOND		0x10ad
 #define PCI_DEVICE_ID_WINBOND_83769	0x0001
+#define PCI_DEVICE_ID_WINBOND_82C105	0x0105
 
 #define PCI_VENDOR_ID_3COM		0x10b7
 #define PCI_DEVICE_ID_3COM_3C590	0x5900
@@ -393,6 +404,8 @@
 #define PCI_DEVICE_ID_AL_M1451		0x1451
 #define PCI_DEVICE_ID_AL_M1461		0x1461
 #define PCI_DEVICE_ID_AL_M1489		0x1489
+#define PCI_DEVICE_ID_AL_M1511		0x1511
+#define PCI_DEVICE_ID_AL_M1513		0x1513
 #define PCI_DEVICE_ID_AL_M4803		0x5215
 
 #define PCI_VENDOR_ID_ASP		0x10cd
@@ -446,6 +459,7 @@
 
 #define PCI_VENDOR_ID_ZEITNET		0x1193
 #define PCI_DEVICE_ID_ZEITNET_1221	0x0001
+#define PCI_DEVICE_ID_ZEITNET_1225	0x0002
 
 #define PCI_VENDOR_ID_SPECIALIX		0x11cb
 #define PCI_DEVICE_ID_SPECIALIX_XIO	0x4000
diff -u --recursive --new-file v1.3.64/linux/include/linux/skbuff.h linux/include/linux/skbuff.h
--- v1.3.64/linux/include/linux/skbuff.h	Wed Feb 14 14:37:18 1996
+++ linux/include/linux/skbuff.h	Sat Feb 17 10:50:20 1996
@@ -360,7 +360,8 @@
 	skb->next = NULL;
 	skb->prev = NULL;
 	skb->list = NULL;
-	(next->prev = prev)->next = next;
+	next->prev = prev;
+	prev->next = next;
 }
 
 /*
@@ -444,7 +445,7 @@
 extern int			datagram_select(struct sock *sk, int sel_type, select_table *wait);
 extern void			skb_copy_datagram(struct sk_buff *from, int offset, char *to,int size);
 extern void			skb_copy_datagram_iovec(struct sk_buff *from, int offset, struct iovec *to,int size);
-extern void			skb_free_datagram(struct sk_buff *skb);
+extern void			skb_free_datagram(struct sock * sk, struct sk_buff *skb);
 
 #endif	/* __KERNEL__ */
 #endif	/* _LINUX_SKBUFF_H */
diff -u --recursive --new-file v1.3.64/linux/include/linux/symtab_begin.h linux/include/linux/symtab_begin.h
--- v1.3.64/linux/include/linux/symtab_begin.h	Thu Nov  9 11:23:54 1995
+++ linux/include/linux/symtab_begin.h	Sat Feb 17 09:19:42 1996
@@ -17,6 +17,11 @@
 #else /* !MODVERSIONS */
 # define X(sym) { (void *) & sym, SYMBOL_NAME_STR(sym)}
 #endif /* MODVERSIONS */
+/*
+ * Some symbols always need to be unversioned.  This includes
+ * compiler generated calls to functions.
+ */
+#define XNOVERS(sym) { (void *) & sym, SYMBOL_NAME_STR(sym)}
 
 #define EMPTY {0,0}
 	0, 0, 0, {
diff -u --recursive --new-file v1.3.64/linux/include/linux/tty.h linux/include/linux/tty.h
--- v1.3.64/linux/include/linux/tty.h	Mon Dec 11 15:42:06 1995
+++ linux/include/linux/tty.h	Sat Feb 17 10:05:38 1996
@@ -269,7 +269,8 @@
 extern struct termios tty_std_termios;
 extern struct tty_struct * redirect;
 extern struct tty_ldisc ldiscs[];
-extern int fg_console;
+extern int fg_console, last_console, want_console;
+
 extern int kmsg_redirect;
 extern struct wait_queue * keypress_wait;
 
diff -u --recursive --new-file v1.3.64/linux/include/net/route.h linux/include/net/route.h
--- v1.3.64/linux/include/net/route.h	Tue Jan 23 21:15:54 1996
+++ linux/include/net/route.h	Sat Feb 17 10:50:20 1996
@@ -66,8 +66,54 @@
 /*
  * Semaphores.
  */
+#if defined(__alpha__)
 
-#ifdef __i386__
+static __inline__ void ATOMIC_INCR(unsigned int * addr)
+{
+	unsigned tmp;
+
+	__asm__ __volatile__(
+		"1:\n\
+		 ldl_l %1,%2\n\
+		 addl  %1,1,%1\n\
+		 stl_c %1,%0\n\
+		 beq   %1,1b\n"
+		: "m=" (*addr), "r=&" (tmp)
+		: "m"(*addr));
+}
+
+static __inline__ void ATOMIC_DECR(unsigned int * addr)
+{
+	unsigned tmp;
+
+	__asm__ __volatile__(
+		"1:\n\
+		 ldl_l %1,%2\n\
+		 subl  %1,1,%1\n\
+		 stl_c %1,%0\n\
+		 beq   %1,1b\n"
+		: "m=" (*addr), "r=&" (tmp)
+		: "m"(*addr));
+}
+
+static __inline__ int ATOMIC_DECR_AND_CHECK (unsigned int * addr)
+{
+	unsigned tmp;
+	int result;
+
+	__asm__ __volatile__(
+		"1:\n\
+		 ldl_l %1,%3\n\
+		 subl  %1,1,%1\n\
+		 mov   %1,%2\n\
+		 stl_c %1,%0\n\
+		 beq   %1,1b\n"
+		: "m=" (*addr), "r=&" (tmp), "r=&"(result)
+		: "m"(*addr));
+	return result;
+}
+
+#elif defined(__i386__)
 #include <asm/bitops.h>
 
 extern __inline__ void ATOMIC_INCR(void * addr)
@@ -101,20 +147,20 @@
 
 #else
 
-static __inline__ void ATOMIC_INCR(void * addr)
+static __inline__ void ATOMIC_INCR(unsigned int * addr)
 {
-	(*(__volatile__ unsigned long*)addr)++;
+	(*(__volatile__ unsigned int*)addr)++;
 }
 
-static __inline__ void ATOMIC_DECR(void * addr)
+static __inline__ void ATOMIC_DECR(unsigned int * addr)
 {
-	(*(__volatile__ unsigned long*)addr)--;
+	(*(__volatile__ unsigned int*)addr)--;
 }
 
-static __inline__ int ATOMIC_DECR_AND_CHECK (void * addr)
+static __inline__ int ATOMIC_DECR_AND_CHECK (unsigned int * addr)
 {
 	ATOMIC_DECR(addr);
-	return *(volatile unsigned long*)addr;
+	return *(volatile unsigned int*)addr;
 }
 
 #endif
@@ -127,8 +173,8 @@
 	__u32			rt_dst;
 	__u32			rt_src;
 	__u32			rt_gateway;
-	unsigned long		rt_refcnt;
-	unsigned long		rt_use;
+	unsigned		rt_refcnt;
+	unsigned		rt_use;
 	unsigned long		rt_window;
 	unsigned long		rt_lastuse;
 	struct hh_cache		*rt_hh;
diff -u --recursive --new-file v1.3.64/linux/include/net/sock.h linux/include/net/sock.h
--- v1.3.64/linux/include/net/sock.h	Wed Feb  7 15:11:39 1996
+++ linux/include/net/sock.h	Sat Feb 17 10:50:20 1996
@@ -107,13 +107,12 @@
 	__u32			fin_seq;
 	__u32			urg_seq;
 	__u32			urg_data;
-
+	int			users;			/* user count */
   /*
    *	Not all are volatile, but some are, so we
    * 	might as well say they all are.
    */
-	volatile char          	inuse,
-				dead,
+	volatile char		dead,
 				urginline,
 				intr,
 				blog,
@@ -343,12 +342,54 @@
 #define RCV_SHUTDOWN	1
 #define SEND_SHUTDOWN	2
 
+/*
+ * Used by processes to "lock" a socket state, so that
+ * interrupts and bottom half handlers won't change it
+ * from under us. It essentially blocks any incoming
+ * packets, so that we won't get any new data or any
+ * packets that change the state of the socket.
+ *
+ * Note the 'barrier()' calls: gcc may not move a lock
+ * "downwards" or a unlock "upwards" when optimizing.
+ */
+extern void __release_sock(struct sock *sk);
+
+static inline void lock_sock(struct sock *sk)
+{
+#if 1
+/* debugging code: the test isn't even 100% correct, but it can catch bugs */
+/* Note that a double lock is ok in theory - it's just _usually_ a bug */
+	if (sk->users) {
+		__label__ here;
+		printk("double lock on socket at %p\n", &&here);
+here:
+	}
+#endif
+	sk->users++;
+	barrier();
+}
+
+static inline void release_sock(struct sock *sk)
+{
+	barrier();
+#if 1
+/* debugging code: remove me when ok */
+	if (sk->users == 0) {
+		__label__ here;
+		sk->users = 1;
+		printk("trying to unlock unlocked socket at %p\n", &&here);
+here:
+	}
+#endif
+	if (!--sk->users)
+		__release_sock(sk);
+}
+
 
 extern void			destroy_sock(struct sock *sk);
 extern unsigned short		get_new_socknum(struct proto *,
 						unsigned short);
 extern void			put_sock(unsigned short, struct sock *); 
-extern void			release_sock(struct sock *sk);
 extern struct sock		*get_sock(struct proto *, unsigned short,
 					  unsigned long, unsigned short,
 					  unsigned long);
diff -u --recursive --new-file v1.3.64/linux/kernel/exit.c linux/kernel/exit.c
--- v1.3.64/linux/kernel/exit.c	Sun Jan 14 16:30:15 1996
+++ linux/kernel/exit.c	Sat Feb 17 09:19:43 1996
@@ -639,6 +639,8 @@
 	return retval;
 }
 
+#ifndef __alpha__
+
 /*
  * sys_waitpid() remains for compatibility. waitpid() should be
  * implemented by calling sys_wait4() from libc.a.
@@ -647,3 +649,5 @@
 {
 	return sys_wait4(pid, stat_addr, options, NULL);
 }
+
+#endif
diff -u --recursive --new-file v1.3.64/linux/kernel/ksyms.c linux/kernel/ksyms.c
--- v1.3.64/linux/kernel/ksyms.c	Fri Feb 16 11:34:11 1996
+++ linux/kernel/ksyms.c	Sat Feb 17 09:19:43 1996
@@ -97,7 +97,7 @@
 #if	defined(CONFIG_ULTRA)	||	defined(CONFIG_WD80x3)		|| \
 	defined(CONFIG_EL2)	||	defined(CONFIG_NE2000)		|| \
 	defined(CONFIG_E2100)	||	defined(CONFIG_HPLAN_PLUS)	|| \
-	defined(CONFIG_HPLAN)	||	defined(CONFIG_AC3200)		
+	defined(CONFIG_HPLAN)	||	defined(CONFIG_AC3200)
 #include "../drivers/net/8390.h"
 #endif
 
diff -u --recursive --new-file v1.3.64/linux/kernel/sched.c linux/kernel/sched.c
--- v1.3.64/linux/kernel/sched.c	Wed Feb 14 14:37:19 1996
+++ linux/kernel/sched.c	Sat Feb 17 09:19:43 1996
@@ -361,6 +361,12 @@
 	}
 }
 
+#ifndef __alpha__
+
+/*
+ * For backwards compatibility?  This can be done in libc so Alpha
+ * and all newer ports shouldn't need it.
+ */
 asmlinkage int sys_pause(void)
 {
 	current->state = TASK_INTERRUPTIBLE;
@@ -368,6 +374,8 @@
 	return -ERESTARTNOHAND;
 }
 
+#endif
+
 /*
  * wake_up doesn't wake up stopped processes - they have to be awakened
  * with signals or similar.
@@ -881,6 +889,12 @@
 	sti();
 }
 
+#ifndef __alpha__
+
+/*
+ * For backwards compatibility?  This can be done in libc so Alpha
+ * and all newer ports shouldn't need it.
+ */
 asmlinkage unsigned int sys_alarm(unsigned int seconds)
 {
 	struct itimerval it_new, it_old;
@@ -898,6 +912,10 @@
 	return oldalarm;
 }
 
+/*
+ * The Alpha uses getxpid, getxuid, and getxgid instead.  Maybe this
+ * should be moved into arch/i386 instead?
+ */
 asmlinkage int sys_getpid(void)
 {
 	return current->pid;
@@ -928,6 +946,11 @@
 	return current->egid;
 }
 
+/*
+ * This has been replaced by sys_setpriority.  Maybe it should be
+ * moved into the arch depedent tree for those ports that require
+ * it for backward compatibility?
+ */
 asmlinkage int sys_nice(int increment)
 {
 	unsigned long newprio;
@@ -961,6 +984,8 @@
 	current->priority = newprio;
 	return 0;
 }
+
+#endif
 
 static struct task_struct *find_process_by_pid(pid_t pid) {
 	struct task_struct *p, *q;
diff -u --recursive --new-file v1.3.64/linux/kernel/signal.c linux/kernel/signal.c
--- v1.3.64/linux/kernel/signal.c	Fri Nov 17 08:42:29 1995
+++ linux/kernel/signal.c	Sat Feb 17 09:19:43 1996
@@ -19,6 +19,13 @@
 
 #define _BLOCKABLE (~(_S(SIGKILL) | _S(SIGSTOP)))
 
+#ifndef __alpha__
+
+/*
+ * This call isn't used by all ports, in particular, the Alpha
+ * uses osf_sigprocmask instead.  Maybe it should be moved into
+ * arch-dependent dir?
+ */
 asmlinkage int sys_sigprocmask(int how, sigset_t *set, sigset_t *oset)
 {
 	sigset_t new_set, old_set = current->blocked;
@@ -52,6 +59,9 @@
 	return 0;
 }
 
+/*
+ * For backwards compatibility?  Functionality superseded by sigprocmask.
+ */
 asmlinkage int sys_sgetmask(void)
 {
 	return current->blocked;
@@ -65,6 +75,8 @@
 	return old;
 }
 
+#endif
+
 asmlinkage int sys_sigpending(sigset_t *set)
 {
 	int error;
@@ -109,6 +121,10 @@
 	}	
 }
 
+#ifndef __alpha__
+/*
+ * For backwards compatibility?  Functionality superseded by sigaction.
+ */
 asmlinkage unsigned long sys_signal(int signum, __sighandler_t handler)
 {
 	int err;
@@ -131,6 +147,7 @@
 	check_pending(signum);
 	return (unsigned long) handler;
 }
+#endif
 
 asmlinkage int sys_sigaction(int signum, const struct sigaction * action,
 	struct sigaction * oldaction)
diff -u --recursive --new-file v1.3.64/linux/kernel/sys.c linux/kernel/sys.c
--- v1.3.64/linux/kernel/sys.c	Sun Jan 14 16:30:15 1996
+++ linux/kernel/sys.c	Sat Feb 17 09:19:43 1996
@@ -121,6 +121,14 @@
 	return max_prio;
 }
 
+#ifndef __alpha__
+
+/*
+ * Why do these exist?  Binary compatibility with some other standard?
+ * If so, maybe they should be moved into the appropriate arch
+ * directory.
+ */
+
 asmlinkage int sys_profil(void)
 {
 	return -ENOSYS;
@@ -151,6 +159,8 @@
 	return -ENOSYS;
 }
 
+#endif
+
 extern void hard_reset_now(void);
 extern asmlinkage sys_kill(int, int);
 
@@ -268,6 +278,14 @@
 	return -ENOSYS;
 }
 
+#ifndef __alpha__
+
+/*
+ * Why do these exist?  Binary compatibility with some other standard?
+ * If so, maybe they should be moved into the appropriate arch
+ * directory.
+ */
+
 asmlinkage int sys_phys(void)
 {
 	return -ENOSYS;
@@ -293,6 +311,8 @@
 	return -ENOSYS;
 }
 
+#endif
+
 /*
  * Unprivileged users may change the real uid to the effective uid
  * or vice versa.  (BSD-style)
@@ -645,6 +665,12 @@
 	return error;
 }
 
+#ifndef __alpha__
+
+/*
+ * Move these to arch dependent dir since they are for
+ * backward compatiblity only?
+ */
 asmlinkage int sys_uname(struct old_utsname * name)
 {
 	int error;
@@ -686,6 +712,8 @@
 	put_user(0,name->machine+__OLD_UTS_LEN);
 	return 0;
 }
+
+#endif
 
 asmlinkage int sys_sethostname(char *name, int len)
 {
diff -u --recursive --new-file v1.3.64/linux/kernel/time.c linux/kernel/time.c
--- v1.3.64/linux/kernel/time.c	Wed Oct  4 14:14:34 1995
+++ linux/kernel/time.c	Sat Feb 17 09:19:43 1996
@@ -34,6 +34,14 @@
  */
 struct timezone sys_tz = { 0, 0};
 
+#ifndef __alpha__
+
+/*
+ * sys_time() can be implemented in user-level using
+ * sys_gettimeofday().  Is this for backwards compatibility?  If so,
+ * why not move it into the appropriate arch directory (for those
+ * architectures that need it).
+ */
 asmlinkage int sys_time(int * tloc)
 {
 	int i;
@@ -48,6 +56,12 @@
 	return i;
 }
 
+/*
+ * sys_stime() can be implemented in user-level using
+ * sys_settimeofday().  Is this for backwards compatibility?  If so,
+ * why not move it into the appropriate arch directory (for those
+ * architectures that need it).
+ */
 asmlinkage int sys_stime(int * tptr)
 {
 	int error, value;
@@ -67,6 +81,8 @@
 	sti();
 	return 0;
 }
+
+#endif
 
 asmlinkage int sys_gettimeofday(struct timeval *tv, struct timezone *tz)
 {
diff -u --recursive --new-file v1.3.64/linux/net/appletalk/ddp.c linux/net/appletalk/ddp.c
--- v1.3.64/linux/net/appletalk/ddp.c	Fri Feb  9 17:53:10 1996
+++ linux/net/appletalk/ddp.c	Fri Feb 16 10:20:26 1996
@@ -1100,7 +1100,7 @@
 	sk->pair=NULL;
 	sk->wmem_alloc=0;
 	sk->rmem_alloc=0;
-	sk->inuse=0;
+	sk->users=0;
 	sk->proc=0;
 	sk->priority=1;
 	sk->shutdown=0;
@@ -1740,7 +1740,7 @@
 		sat->sat_addr.s_node=ddp->deh_snode;
 		sat->sat_addr.s_net=ddp->deh_snet;
 	}
-	skb_free_datagram(skb);
+	skb_free_datagram(sk, skb);
 	return(copied);
 }		
 
diff -u --recursive --new-file v1.3.64/linux/net/ax25/af_ax25.c linux/net/ax25/af_ax25.c
--- v1.3.64/linux/net/ax25/af_ax25.c	Wed Feb  7 15:11:41 1996
+++ linux/net/ax25/af_ax25.c	Fri Feb 16 10:20:07 1996
@@ -947,7 +947,7 @@
 	sk->sndbuf        = SK_WMEM_MAX;
 	sk->wmem_alloc    = 0;
 	sk->rmem_alloc    = 0;
-	sk->inuse         = 0;
+	sk->users         = 0;
 	sk->debug         = 0;
 	sk->destroy       = 0;
 	sk->prot          = NULL;	/* So we use default free mechanisms */
@@ -1020,7 +1020,7 @@
 	sk->sndbuf      = osk->sndbuf;
 	sk->wmem_alloc  = 0;
 	sk->rmem_alloc  = 0;
-	sk->inuse       = 0;
+	sk->users       = 0;
 	sk->ack_backlog = 0;
 	sk->destroy     = 0;
 	sk->prot        = NULL;	/* So we use default free mechanisms */
@@ -1988,7 +1988,7 @@
 		}
 	}
 
-	skb_free_datagram(skb);
+	skb_free_datagram(sk, skb);
 
 	return copied;
 }		
diff -u --recursive --new-file v1.3.64/linux/net/ax25/ax25_subr.c linux/net/ax25/ax25_subr.c
--- v1.3.64/linux/net/ax25/ax25_subr.c	Wed Feb  7 15:11:41 1996
+++ linux/net/ax25/ax25_subr.c	Sat Feb 17 08:07:01 1996
@@ -4,7 +4,7 @@
  *	This is ALPHA test software. This code may break your machine, randomly fail to work with new 
  *	releases, misbehave and/or generally screw up. It might even work. 
  *
- *	This code REQUIRES 1.2.1 or higher/ NET3.029
+ *	This code REQUIRES 1.3.61 or higher/ NET3.029
  *
  *	This module:
  *		This module is free software; you can redistribute it and/or
@@ -27,6 +27,8 @@
  *					it up from ax25_frames_acked().
  *			Joerg(DL1BKE)	DAMA needs KISS Fullduplex ON/OFF.
  *					Thus we have ax25_kiss_cmd() now... ;-)
+ *			Dave Brown(N2RJT)
+ *					Killed a silly bug in the DAMA code.
  */
 
 #include <linux/config.h>
@@ -345,11 +347,14 @@
 		}
 	}
 		
-	if (dama != NULL) *dama = ~(buf[13] & DAMA_FLAG);
+	if (dama != NULL) 
+		*dama = !(buf[13] & DAMA_FLAG);
 		
 	/* Copy to, from */
-	if (dest != NULL) memcpy(dest, buf + 0, AX25_ADDR_LEN);
-	if (src != NULL)  memcpy(src,  buf + 7, AX25_ADDR_LEN);
+	if (dest != NULL) 
+		memcpy(dest, buf + 0, AX25_ADDR_LEN);
+	if (src != NULL)  
+		memcpy(src,  buf + 7, AX25_ADDR_LEN);
 	buf += 2 * AX25_ADDR_LEN;
 	len -= 2 * AX25_ADDR_LEN;
 	digi->lastrepeat = -1;
diff -u --recursive --new-file v1.3.64/linux/net/core/datagram.c linux/net/core/datagram.c
--- v1.3.64/linux/net/core/datagram.c	Mon Dec 11 15:42:10 1995
+++ linux/net/core/datagram.c	Fri Feb 16 10:21:36 1996
@@ -42,106 +42,100 @@
 
 
 /*
+ * Wait for a packet..
+ *
+ * Interrupts off so that no packet arrives before we begin sleeping.
+ * Otherwise we might miss our wake up
+ */
+static inline void wait_for_packet(struct sock * sk)
+{
+	unsigned long flags;
+
+	release_sock(sk);
+	save_flags(flags);
+	cli();
+	if (skb_peek(&sk->receive_queue) == NULL)
+		interruptible_sleep_on(sk->sleep);
+	restore_flags(flags);
+	lock_sock(sk);
+}
+
+
+/*
  *	Get a datagram skbuff, understands the peeking, nonblocking wakeups and possible
  *	races. This replaces identical code in packet,raw and udp, as well as the IPX
  *	AX.25 and Appletalk. It also finally fixes the long standing peek and read
  *	race for datagram sockets. If you alter this routine remember it must be
  *	re-entrant.
+ *
+ *	This function will lock the socket if a skb is returned, so the caller
+ *	needs to unlock the socket in that case (usually by calling skb_free_datagram)
  */
 
 struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, int noblock, int *err)
 {
+	int error;
 	struct sk_buff *skb;
-	unsigned long intflags;
 
-	/* Socket is inuse - so the timer doesn't attack it */
-	save_flags(intflags);
+	lock_sock(sk);
 restart:
-	sk->inuse = 1;
 	while(skb_peek(&sk->receive_queue) == NULL)	/* No data */
 	{
-		/* If we are shutdown then no more data is going to appear. We are done */
+		/* Socket errors? */
+		error = sock_error(sk);
+		if (error)
+			goto no_packet;
+
+		/* Socket shut down? */
 		if (sk->shutdown & RCV_SHUTDOWN)
-		{
-			release_sock(sk);
-			*err=0;
-			return NULL;
-		}
-
-		if(sk->err)
-		{
-			release_sock(sk);
-			*err=sock_error(sk);
-			restore_flags(intflags);
-			return NULL;
-		}
+			goto no_packet;
 
 		/* Sequenced packets can come disconnected. If so we report the problem */
+		error = -ENOTCONN;
 		if(sk->type==SOCK_SEQPACKET && sk->state!=TCP_ESTABLISHED)
-		{
-			release_sock(sk);
-			*err=-ENOTCONN;
-			return NULL;
-		}
+			goto no_packet;
 
 		/* User doesn't want to wait */
+		error = -EAGAIN;
 		if (noblock)
-		{
-			release_sock(sk);
-			*err=-EAGAIN;
-			return NULL;
-		}
-		release_sock(sk);
+			goto no_packet;
 
-		/* Interrupts off so that no packet arrives before we begin sleeping.
-		   Otherwise we might miss our wake up */
-		cli();
-		if (skb_peek(&sk->receive_queue) == NULL)
-		{
-			interruptible_sleep_on(sk->sleep);
-			/* Signals may need a restart of the syscall */
-			if (current->signal & ~current->blocked)
-			{
-				restore_flags(intflags);;
-				*err=-ERESTARTSYS;
-				return(NULL);
-			}
-			if(sk->err != 0)	/* Error while waiting for packet
-						   eg an icmp sent earlier by the
-						   peer has finally turned up now */
-			{
-				*err = sock_error(sk);
-				restore_flags(intflags);
-				return NULL;
-			}
-		}
-		sk->inuse = 1;
-		restore_flags(intflags);
-	  }
-	  /* Again only user level code calls this function, so nothing interrupt level
-	     will suddenly eat the receive_queue */
-	  if (!(flags & MSG_PEEK))
-	  {
-		skb=skb_dequeue(&sk->receive_queue);
-		if(skb!=NULL)
-			skb->users++;
-		else
-			goto restart;	/* Avoid race if someone beats us to the data */
+		/* handle signals */
+		error = -ERESTARTSYS;
+		if (current->signal & ~current->blocked)
+			goto no_packet;
+
+		wait_for_packet(sk);
 	  }
-	  else
-	  {
+
+	/* Again only user level code calls this function, so nothing interrupt level
+	   will suddenly eat the receive_queue */
+	if (flags & MSG_PEEK)
+	{
+		unsigned long flags;
+		save_flags(flags);
 		cli();
 		skb=skb_peek(&sk->receive_queue);
 		if(skb!=NULL)
 			skb->users++;
-		restore_flags(intflags);
-		if(skb==NULL)	/* shouldn't happen but .. */
-			*err=-EAGAIN;
-	  }
-	  return skb;
+		restore_flags(flags);
+		if(skb==NULL)		/* shouldn't happen but .. */
+			goto restart;
+		return skb;
+	}
+	skb = skb_dequeue(&sk->receive_queue);
+	if (!skb)	/* Avoid race if someone beats us to the data */
+		goto restart;
+	skb->users++;
+	return skb;
+
+no_packet:
+	release_sock(sk);
+	*err = error;
+	return NULL;
 }
 
-void skb_free_datagram(struct sk_buff *skb)
+void skb_free_datagram(struct sock * sk, struct sk_buff *skb)
 {
 	unsigned long flags;
 
@@ -157,6 +151,7 @@
 	if(!skb->next && !skb->prev)	/* Been dequeued by someone - ie it's read */
 		kfree_skb(skb,FREE_READ);
 	restore_flags(flags);
+	release_sock(sk);
 }
 
 /*
diff -u --recursive --new-file v1.3.64/linux/net/core/sock.c linux/net/core/sock.c
--- v1.3.64/linux/net/core/sock.c	Wed Feb 14 14:37:20 1996
+++ linux/net/core/sock.c	Fri Feb 16 10:40:26 1996
@@ -3,7 +3,7 @@
  *		operating system.  INET is implemented using the  BSD Socket
  *		interface as the means of communication with the user level.
  *
- *		Generic socket support routines. Memory allocators, sk->inuse/release
+ *		Generic socket support routines. Memory allocators, socket lock/release
  *		handler for protocols to use and generic option handler.
  *
  *
@@ -449,8 +449,6 @@
 	struct sk_buff *skb;
 	int err;
 
-	sk->inuse=1;
-		
 	do
 	{
 		if(sk->err!=0)
@@ -542,38 +540,35 @@
 }
 
 
-void release_sock(struct sock *sk)
+void __release_sock(struct sock *sk)
 {
 #ifdef CONFIG_INET
 	struct sk_buff *skb;
-#endif
-
-	/*
-	 * First, mark it not in use: this ensures that we will not
-	 * get any new backlog packets..
-	 */
-	sk->inuse = 0;
 
-#ifdef CONFIG_INET
 	if (!sk->prot)
 		return;
 		
 	/*
 	 *	This is only ever called from a user process context, hence
-	 *	(until fine grained SMP) its safe. sk->inuse must be volatile
+	 *	(until fine grained SMP) its safe. sk->users must be volatile
 	 *	so the compiler doesn't do anything unfortunate with it.
+	 *
+	 *	The "barrier()" stuff takes care of that. Note that the rcv
+	 *	function may not sleep, so "users" is not going to change there.
 	 */
 
 	/* See if we have any packets built up. */
 	while ((skb = __skb_dequeue(&sk->back_log)) != NULL) 
 	{
-		sk->inuse = 1;		/* Very important.. */
+		barrier();
+		sk->users = 1;
 		if (sk->prot->rcv) 
 			sk->prot->rcv(skb, skb->dev, (struct options*)skb->proto_priv,
 				 skb->saddr, skb->len, skb->daddr, 1,
 				/* Only used for/by raw sockets. */
 				(struct inet_protocol *)sk->pair); 
-		sk->inuse = 0;
+		sk->users = 0;
+		barrier();
 	}
 	if (sk->dead && sk->state == TCP_CLOSE) 
 	{
diff -u --recursive --new-file v1.3.64/linux/net/ethernet/eth.c linux/net/ethernet/eth.c
--- v1.3.64/linux/net/ethernet/eth.c	Fri Nov 17 08:42:33 1995
+++ linux/net/ethernet/eth.c	Sat Feb 17 08:07:01 1996
@@ -264,6 +264,9 @@
  
 void eth_copy_and_sum(struct sk_buff *dest, unsigned char *src, int length, int base)
 {
+#ifdef CONFIG_IP_ROUTER
+	memcpy(dest->data,src,length);
+#else
 	struct ethhdr *eth;
 	struct iphdr *iph;
 	int ip_length;
@@ -292,4 +295,5 @@
 
 	dest->csum=csum_partial_copy(src+sizeof(struct iphdr)+ETH_HLEN,dest->data+sizeof(struct iphdr)+ETH_HLEN,length,base);
 	dest->ip_summed=1;
+#endif	
 }
diff -u --recursive --new-file v1.3.64/linux/net/ipv4/Config.in linux/net/ipv4/Config.in
--- v1.3.64/linux/net/ipv4/Config.in	Wed Dec 13 09:02:47 1995
+++ linux/net/ipv4/Config.in	Sat Feb 17 08:07:01 1996
@@ -8,6 +8,7 @@
 fi
 bool 'IP: accounting' CONFIG_IP_ACCT
 if [ "$CONFIG_IP_FORWARD" = "y" ]; then
+  bool 'IP: optimize as router not host' CONFIG_IP_ROUTER
   tristate 'IP: tunneling' CONFIG_NET_IPIP
   if [ "$CONFIG_IP_FIREWALL" = "y" ]; then
     bool 'IP: firewall packet logging' CONFIG_IP_FIREWALL_VERBOSE
diff -u --recursive --new-file v1.3.64/linux/net/ipv4/af_inet.c linux/net/ipv4/af_inet.c
--- v1.3.64/linux/net/ipv4/af_inet.c	Fri Feb 16 11:34:11 1996
+++ linux/net/ipv4/af_inet.c	Fri Feb 16 10:41:57 1996
@@ -291,7 +291,7 @@
 {
 	struct sk_buff *skb;
 
-  	sk->inuse = 1;			/* just to be safe. */
+	lock_sock(sk);			/* just to be safe. */
 
   	remove_sock(sk);
   
@@ -425,7 +425,7 @@
 		/* actually it can if an ack has just been sent. */
 		sk->destroy = 1;
 		sk->ack_backlog = 0;
-		sk->inuse = 0;
+		release_sock(sk);
 		reset_timer(sk, TIME_DESTROY, SOCK_DESTROY_TIME);
   	}
 }
@@ -816,7 +816,7 @@
 		sti();
 		sk->dead = 1;
 	}
-	sk->inuse = 1;
+	lock_sock(sk);
 
 	/* This will destroy it. */
 	sock->data = NULL;
diff -u --recursive --new-file v1.3.64/linux/net/ipv4/arp.c linux/net/ipv4/arp.c
--- v1.3.64/linux/net/ipv4/arp.c	Wed Feb  7 15:11:42 1996
+++ linux/net/ipv4/arp.c	Sat Feb 17 10:41:14 1996
@@ -180,8 +180,8 @@
 #define ARP_CONFIRM_INTERVAL	(300*HZ)
 #define ARP_CONFIRM_TIMEOUT	ARP_RES_TIME
 
-static unsigned long arp_lock;
-static unsigned long arp_bh_mask;
+static unsigned int arp_lock;
+static unsigned int arp_bh_mask;
 
 #define ARP_BH_BACKLOG	1
 
diff -u --recursive --new-file v1.3.64/linux/net/ipv4/ip_fw.c linux/net/ipv4/ip_fw.c
--- v1.3.64/linux/net/ipv4/ip_fw.c	Fri Feb  9 17:53:11 1996
+++ linux/net/ipv4/ip_fw.c	Sat Feb 17 08:11:12 1996
@@ -487,9 +487,11 @@
 		tosxor=f->fw_tosxor;
 	}
 	else
+	{
 		tosand=0xFF;
 		tosxor=0x00;
-
+	}
+	
 	if(opt != 1) 
 	{
 		if(policy&IP_FW_F_ACCEPT)
@@ -895,7 +897,7 @@
  		}
  		else ms->timer.expires = jiffies+MASQUERADE_EXPIRE_TCP;
  
- 		tcp_send_check(th,iph->saddr,iph->daddr,size,skb->sk);
+ 		tcp_send_check(th,iph->saddr,iph->daddr,size,skb);
  	}
  	add_timer(&ms->timer);
  	ip_send_check(iph);
@@ -914,12 +916,12 @@
   *	this function.
   */
 
-int ip_fw_demasquerade(struct sk_buff *skb_ptr)
+int ip_fw_demasquerade(struct sk_buff *skb)
 {
- 	struct iphdr	*iph = skb_ptr->h.iph;
+ 	struct iphdr	*iph = skb->h.iph;
  	unsigned short	*portptr;
  	struct ip_masq	*ms;
- 	struct tcphdr   *th = (struct tcphdr *)(skb_ptr->h.raw+(iph->ihl<<2));
+ 	struct tcphdr   *th = (struct tcphdr *)(skb->h.raw+(iph->ihl<<2));
  
  	if (iph->protocol!=IPPROTO_UDP && iph->protocol!=IPPROTO_TCP)
  		return 0;
@@ -954,7 +956,7 @@
  		    portptr[1]==ms->mport)
  		{
  		
- 			int size = skb_ptr->len - ((unsigned char *)portptr - skb_ptr->h.raw);
+ 			int size = skb->len - ((unsigned char *)portptr - skb->h.raw);
  			iph->daddr = ms->src;
  			portptr[1] = ms->sport;
  			
@@ -1000,7 +1002,7 @@
 #endif
 					}
 				}
- 				tcp_send_check((struct tcphdr *)portptr,iph->saddr,iph->daddr,size,skb_ptr->sk);
+ 				tcp_send_check((struct tcphdr *)portptr,iph->saddr,iph->daddr,size,skb);
  			}
  			ip_send_check(iph);
 #ifdef DEBUG_MASQ
diff -u --recursive --new-file v1.3.64/linux/net/ipv4/packet.c linux/net/ipv4/packet.c
--- v1.3.64/linux/net/ipv4/packet.c	Wed Feb  7 15:11:43 1996
+++ linux/net/ipv4/packet.c	Fri Feb 16 13:41:21 1996
@@ -104,7 +104,6 @@
 	{
 		skb->sk = NULL;
 		kfree_skb(skb, FREE_READ);
-		release_sock(sk);		
 		return 0;
 	}
 	/*
@@ -211,7 +210,7 @@
 	 *	Stop more data and kill the socket off.
 	 */
 
-	sk->inuse = 1;
+	lock_sock(sk);
 	sk->state = TCP_CLOSE;
 
 	/*
@@ -444,13 +443,8 @@
 	 *	races and re-entrancy issues from us.
 	 */
 
-	skb_free_datagram(skb);
+	skb_free_datagram(sk, skb);
 
-	/*
-	 *	We are done.
-	 */
-	 
-	release_sock(sk);
 	return(copied);
 }
 
diff -u --recursive --new-file v1.3.64/linux/net/ipv4/raw.c linux/net/ipv4/raw.c
--- v1.3.64/linux/net/ipv4/raw.c	Wed Feb  7 15:11:43 1996
+++ linux/net/ipv4/raw.c	Fri Feb 16 13:23:54 1996
@@ -148,8 +148,7 @@
 	}
 
 	ip_statistics.IpInDelivers++;
-	release_sock(sk);
-	return(0);
+	return 0;
 }
 
 /*
@@ -342,8 +341,7 @@
 		sin->sin_family = AF_INET;
 		sin->sin_addr.s_addr = skb->daddr;
 	}
-	skb_free_datagram(skb);
-	release_sock(sk);
+	skb_free_datagram(sk, skb);
 	return (copied);
 }
 
diff -u --recursive --new-file v1.3.64/linux/net/ipv4/route.c linux/net/ipv4/route.c
--- v1.3.64/linux/net/ipv4/route.c	Wed Feb  7 15:11:43 1996
+++ linux/net/ipv4/route.c	Sat Feb 17 09:19:43 1996
@@ -924,7 +924,7 @@
 				continue;
 			}
 					
-			sprintf(temp, "%s\t%08lX\t%08lX\t%02X\t%ld\t%lu\t%d\t%08lX\t%d\t%lu\t%u\t%ld\t%1d",
+			sprintf(temp, "%s\t%08lX\t%08lX\t%02X\t%d\t%u\t%d\t%08lX\t%d\t%lu\t%u\t%d\t%1d",
 				r->rt_dev->name, (unsigned long)r->rt_dst, (unsigned long)r->rt_gateway,
 				r->rt_flags, r->rt_refcnt, r->rt_use, 0,
 				(unsigned long)r->rt_src, (int)r->rt_mtu, r->rt_window, (int)r->rt_irtt, r->rt_hh ? r->rt_hh->hh_refcnt : -1, r->rt_hh ? r->rt_hh->hh_uptodate : 0);
diff -u --recursive --new-file v1.3.64/linux/net/ipv4/tcp.c linux/net/ipv4/tcp.c
--- v1.3.64/linux/net/ipv4/tcp.c	Wed Feb 14 14:37:20 1996
+++ linux/net/ipv4/tcp.c	Fri Feb 16 12:45:00 1996
@@ -432,7 +432,7 @@
 
 /*
  *	Find someone to 'accept'. Must be called with
- *	sk->inuse=1 or cli()
+ *	the socket locked or with interrupts disabled
  */ 
 
 static struct sk_buff *tcp_find_established(struct sock *s)
@@ -676,7 +676,7 @@
 	if (sel_type == SEL_IN) {
 		int retval;
 
-		sk->inuse = 1;
+		lock_sock(sk);
 		retval = (tcp_find_established(sk) != NULL);
 		release_sock(sk);
 		if (!retval)
@@ -690,7 +690,7 @@
 /*
  *	Wait for a TCP event.
  *
- *	Note that we don't need to set "sk->inuse", as the upper select layers
+ *	Note that we don't need to lock the socket, as the upper select layers
  *	take care of normal races (between the test and the event) and we don't
  *	go look at any of the socket buffers directly.
  */
@@ -759,7 +759,7 @@
 			if (sk->state == TCP_LISTEN) 
 				return(-EINVAL);
 
-			sk->inuse = 1;
+			lock_sock(sk);
 			amount = tcp_readable(sk);
 			release_sock(sk);
 			err=verify_area(VERIFY_WRITE,(void *)arg, sizeof(int));
@@ -851,11 +851,45 @@
 }
 
 /*
+ *	Wait for a socket to get into the connected state
+ */
+static void wait_for_tcp_connect(struct sock * sk)
+{
+	release_sock(sk);
+	cli();			
+	if (sk->state != TCP_ESTABLISHED && sk->state != TCP_CLOSE_WAIT && sk->err == 0) 
+    	{
+		interruptible_sleep_on(sk->sleep);	
+	}
+	sti();
+	lock_sock(sk);
+}
+
+/*
+ *	Wait for more memory for a socket
+ */
+static void wait_for_tcp_memory(struct sock * sk)
+{
+	release_sock(sk);
+	cli();
+	if (sk->wmem_alloc*2 > sk->sndbuf &&
+	    (sk->state == TCP_ESTABLISHED||sk->state == TCP_CLOSE_WAIT)
+		&& sk->err == 0) 
+	{
+		sk->socket->flags &= ~SO_NOSPACE;
+		interruptible_sleep_on(sk->sleep);
+	}
+	sti();
+	lock_sock(sk);
+}
+
+
+/*
  *	This routine copies from a user buffer into a socket,
  *	and starts the transmit system.
  */
 
-static int tcp_sendmsg(struct sock *sk, struct msghdr *msg,
+static int do_tcp_sendmsg(struct sock *sk, struct msghdr *msg,
 	  int len, int nonblock, int flags)
 {
 	int copied = 0;
@@ -870,27 +904,6 @@
 	unsigned char *from;
 	
 	/*
-	 *	Do sanity checking for sendmsg/sendto/send
-	 */
-	 
-	if (flags & ~(MSG_OOB|MSG_DONTROUTE))
-		return -EINVAL;
-	if (msg->msg_name)
-	{
-		struct sockaddr_in *addr=(struct sockaddr_in *)msg->msg_name;
-		if(sk->state == TCP_CLOSE)
-			return -ENOTCONN;
-		if (msg->msg_namelen < sizeof(*addr))
-			return -EINVAL;
-		if (addr->sin_family && addr->sin_family != AF_INET) 
-			return -EINVAL;
-		if (addr->sin_port != sk->dummy_th.dest) 
-			return -EISCONN;
-		if (addr->sin_addr.s_addr != sk->daddr) 
-			return -EISCONN;
-	}
-	
-	/*
 	 *	Ok commence sending
 	 */
 	
@@ -898,87 +911,54 @@
 	{
 		seglen=msg->msg_iov[iovct].iov_len;
 		from=msg->msg_iov[iovct++].iov_base;
-		sk->inuse=1;
 		prot = sk->prot;
 		while(seglen > 0) 
 		{
+			/*
+			 * Stop on errors
+			 */
 			if (sk->err) 
-			{			/* Stop on an error */
-				release_sock(sk);
+			{
 				if (copied) 
-					return(copied);
+					return copied;
 				return sock_error(sk);
 			}
 
 			/*
-			 *	First thing we do is make sure that we are established. 
+			 *	Make sure that we are established. 
 			 */
-	
 			if (sk->shutdown & SEND_SHUTDOWN) 
 			{
-				release_sock(sk);
-				sk->err = EPIPE;
-				if (copied) 
-					return(copied);
-				sk->err = 0;
-				return(-EPIPE);
+				if (copied)
+					return copied;
+				return -EPIPE;
 			}
 
 			/* 
 			 *	Wait for a connection to finish.
 			 */
-		
-			while(sk->state != TCP_ESTABLISHED && sk->state != TCP_CLOSE_WAIT) 
+			while (sk->state != TCP_ESTABLISHED && sk->state != TCP_CLOSE_WAIT) 
 			{
+				if (copied)
+					return copied;
+
 				if (sk->err) 
-				{
-					release_sock(sk);
-					if (copied) 
-						return(copied);
 					return sock_error(sk);
-				}		
 	
-				if (sk->state != TCP_SYN_SENT && sk->state != TCP_SYN_RECV) 
+				if (sk->state != TCP_SYN_SENT && sk->state != TCP_SYN_RECV)
 				{
-					release_sock(sk);
-					if (copied) 
-						return(copied);
-	
-					if (sk->err) 
-						return sock_error(sk);
-
-					if (sk->keepopen) 
-					{
+					if (sk->keepopen)
 						send_sig(SIGPIPE, current, 0);
-					}
-					return(-EPIPE);
+					return -EPIPE;
 				}
 	
-				if (nonblock || copied) 
-				{
-					release_sock(sk);
-					if (copied) 
-						return(copied);
-					return(-EAGAIN);
-				}
+				if (nonblock)
+					return -EAGAIN;
+
+				if (current->signal & ~current->blocked)
+					return -ERESTARTSYS;
 	
-				release_sock(sk);
-				cli();
-			
-				if (sk->state != TCP_ESTABLISHED &&
-			    		sk->state != TCP_CLOSE_WAIT && sk->err == 0) 
-			    	{
-					interruptible_sleep_on(sk->sleep);	
-					if (current->signal & ~current->blocked)
-					{
-						sti();
-						if (copied) 
-							return(copied);
-						return(-ERESTARTSYS);
-					}
-				}
-				sk->inuse = 1;
-				sti();
+				wait_for_tcp_connect(sk);
 			}
 	
 		/*
@@ -1071,34 +1051,12 @@
 			send_tmp = NULL;
 			if (copy < sk->mss && !(flags & MSG_OOB) && sk->packets_out) 
 			{
-#if EXTRA_RELEASE
-/*
- * we don't really need to release even if we sleep: our packets
- * will be backlogged for us, and that's just fine.
- */
-				/*
-				 *	We will release the socket in case we sleep here. 
-				 */
-				release_sock(sk);
-				/*
-				 *	NB: following must be mtu, because mss can be increased.
-				 *	mss is always <= mtu 
-				 */
-#endif
 				skb = sock_wmalloc(sk, sk->mtu + 128 + prot->max_header + 15, 0, GFP_KERNEL);
-				sk->inuse = 1;
 				send_tmp = skb;
 			} 
 			else 
 			{
-#if EXTRA_RELEASE
-				/*
-				 *	We will release the socket in case we sleep here. 
-				 */
-				release_sock(sk);
-#endif
 				skb = sock_wmalloc(sk, copy + prot->max_header + 15 , 0, GFP_KERNEL);
-  				sk->inuse = 1;
 			}
 	
 			/*
@@ -1110,30 +1068,19 @@
 				sk->socket->flags |= SO_NOSPACE;
 				if (nonblock) 
 				{
-					release_sock(sk);
 					if (copied) 
-						return(copied);
-					return(-EAGAIN);
+						return copied;
+					return -EAGAIN;
 				}
 
-				release_sock(sk);
-				cli();
-				if (sk->wmem_alloc*2 > sk->sndbuf &&
-				    (sk->state == TCP_ESTABLISHED||sk->state == TCP_CLOSE_WAIT)
-					&& sk->err == 0) 
+				if (current->signal & ~current->blocked)
 				{
-					sk->socket->flags &= ~SO_NOSPACE;
-					interruptible_sleep_on(sk->sleep);
-					if (current->signal & ~current->blocked) 
-					{
-						sti();
-						if (copied) 
-							return(copied);
-						return(-ERESTARTSYS);
-					}
+					if (copied)
+						return copied;
+					return -ERESTARTSYS;
 				}
-				sk->inuse = 1;
-				sti();
+
+				wait_for_tcp_memory(sk);
 				continue;
 			}
 
@@ -1151,7 +1098,6 @@
 			if (tmp < 0 ) 
 			{
 				sock_wfree(sk, skb);
-				release_sock(sk);
 				if (copied) 
 					return(copied);
 				return(tmp);
@@ -1165,7 +1111,6 @@
 			if (tmp < 0) 
 			{
 				sock_wfree(sk, skb);
-				release_sock(sk);
 				if (copied) 
 					return(copied);
 				return(tmp);
@@ -1197,26 +1142,63 @@
 	}
 	sk->err = 0;
 
+	return copied;
+}
+
+
+static int tcp_sendmsg(struct sock *sk, struct msghdr *msg,
+	  int len, int nonblock, int flags)
+{
+	int retval = -EINVAL;
+
+	/*
+	 *	Do sanity checking for sendmsg/sendto/send
+	 */
+	 
+	if (flags & ~(MSG_OOB|MSG_DONTROUTE))
+		goto out;
+	if (msg->msg_name) {
+		struct sockaddr_in *addr=(struct sockaddr_in *)msg->msg_name;
+
+		if (msg->msg_namelen < sizeof(*addr))
+			goto out;
+		if (addr->sin_family && addr->sin_family != AF_INET) 
+			goto out;
+		retval = -ENOTCONN;
+		if(sk->state == TCP_CLOSE)
+			goto out;
+		retval = -EISCONN;
+		if (addr->sin_port != sk->dummy_th.dest) 
+			goto out;
+		if (addr->sin_addr.s_addr != sk->daddr) 
+			goto out;
+	}
+
+	lock_sock(sk);
+	retval = do_tcp_sendmsg(sk, msg, len, nonblock, flags);
+
 /*
  *	Nagle's rule. Turn Nagle off with TCP_NODELAY for highly
  *	interactive fast network servers. It's meant to be on and
  *	it really improves the throughput though not the echo time
  *	on my slow slip link - Alan
+ *
+ *	If not nagling we can send on the before case too..
  */
 
-/*
- *	Avoid possible race on send_tmp - c/o Johannes Stille 
- */
- 
-	if(sk->partial && ((!sk->packets_out) 
-     /* If not nagling we can send on the before case too.. */
-	      || (sk->nonagle && before(sk->write_seq , sk->window_seq))
-      	))
-  		tcp_send_partial(sk);
+	if (sk->partial) {
+		if (!sk->packets_out ||
+		    (sk->nonagle && before(sk->write_seq , sk->window_seq))) {
+	  		tcp_send_partial(sk);
+	  	}
+	}
 
 	release_sock(sk);
-	return(copied);
+
+out:
+	return retval;
 }
+	
 
 /*
  *	Send an ack if one is backlogged at this point. Ought to merge
@@ -1327,7 +1309,7 @@
 		sk->done = 1;
 		return 0;
 	}
-	sk->inuse = 1;
+	lock_sock(sk);
 	if (sk->urg_data & URG_VALID) 
 	{
 		char c = sk->urg_data;
@@ -1360,8 +1342,8 @@
 
 /*
  *	Release a skb if it is no longer needed. This routine
- *	must be called with interrupts disabled or "sk->inuse = 1"
- *	so that the sk_buff queue operation is ok.
+ *	must be called with interrupts disabled or with the
+ *	socket locked so that the sk_buff queue operation is ok.
  */
  
 static inline void tcp_eat_skb(struct sock *sk, struct sk_buff * skb)
@@ -1385,7 +1367,7 @@
 	unsigned long rspace;
 
 	/*
-	 * NOTE! 'sk->inuse' must be set, so that we don't get
+	 * NOTE! The socket must be locked, so that we don't get
 	 * a messed-up receive queue.
 	 */
 	while ((skb=skb_peek(&sk->receive_queue)) != NULL) {
@@ -1482,7 +1464,7 @@
 		seq = &peek_seq;
 
 	add_wait_queue(sk->sleep, &wait);
-	sk->inuse = 1;
+	lock_sock(sk);
 	while (len > 0) 
 	{
 		struct sk_buff * skb;
@@ -1558,7 +1540,7 @@
 		sk->socket->flags |= SO_WAITDATA;
 		schedule();
 		sk->socket->flags &= ~SO_WAITDATA;
-		sk->inuse = 1;
+		lock_sock(sk);
 
 		if (current->signal & ~current->blocked) 
 		{
@@ -1775,7 +1757,7 @@
 	{
 		return;
 	}
-	sk->inuse = 1;
+	lock_sock(sk);
 
 	/*
 	 * flag that the sender has shutdown
@@ -1794,7 +1776,7 @@
 	 *	FIN if needed
 	 */
 	 
-	if(tcp_close_state(sk,0))
+	if (tcp_close_state(sk,0))
 		tcp_send_fin(sk);
 		
 	release_sock(sk);
@@ -1807,7 +1789,7 @@
 	 * and then put it into the queue to be sent.
 	 */
 	
-	sk->inuse = 1;
+	lock_sock(sk);
 	
 	tcp_cache_zap();
 	if(sk->state == TCP_LISTEN)
@@ -1888,7 +1870,7 @@
 
 	/* Avoid the race. */
 	cli();
-	sk->inuse = 1;
+	lock_sock(sk);
 
 	while((skb = tcp_dequeue_established(sk)) == NULL) 
 	{
@@ -1908,7 +1890,7 @@
 			sk->err = ERESTARTSYS;
 			return(NULL);
 		}
-		sk->inuse = 1;
+		lock_sock(sk);
   	}
 	sti();
 
@@ -1968,7 +1950,7 @@
 	if ((atype=ip_chk_addr(usin->sin_addr.s_addr)) == IS_BROADCAST || atype==IS_MULTICAST) 
 		return -ENETUNREACH;
   
-	sk->inuse = 1;
+	lock_sock(sk);
 	sk->daddr = usin->sin_addr.s_addr;
 	sk->write_seq = tcp_init_seq();
 	sk->window_seq = sk->write_seq;
@@ -1982,7 +1964,7 @@
 	{
 		return(-ENOMEM);
 	}
-	sk->inuse = 1;
+	lock_sock(sk);
 	buff->sk = sk;
 	buff->free = 0;
 	buff->localroute = sk->localroute;
diff -u --recursive --new-file v1.3.64/linux/net/ipv4/tcp_input.c linux/net/ipv4/tcp_input.c
--- v1.3.64/linux/net/ipv4/tcp_input.c	Wed Feb 14 14:37:20 1996
+++ linux/net/ipv4/tcp_input.c	Sat Feb 17 10:40:15 1996
@@ -233,7 +233,6 @@
 	if (!sk->dead) 
 		sk->state_change(sk);
 	kfree_skb(skb, FREE_READ);
-	release_sock(sk);
 	return(0);
 }
 
@@ -1309,7 +1308,7 @@
 			 *	Optimisation: Duplicate frame or extension of previous frame from
 			 *	same sequence point (lost ack case).
 			 *	The frame contains duplicate data or replaces a previous frame
-			 *	discard the previous frame (safe as sk->inuse is set) and put
+			 *	discard the previous frame (safe as sk->users is set) and put
 			 *	the new one in its place.
 			 */
 			 
@@ -1624,17 +1623,13 @@
 		skb->free = 1;
 		skb->saddr = daddr;
 		skb->daddr = saddr;
-	
+
 		/* We may need to add it to the backlog here. */
-		cli();
-		if (sk->inuse) 
+		if (sk->users) 
 		{
 			skb_queue_tail(&sk->back_log, skb);
-			sti();
 			return(0);
 		}
-		sk->inuse = 1;
-		sti();
 	}
 
 	/*
@@ -1696,7 +1691,6 @@
 			if(th->rst || !th->syn || th->ack || ip_chk_addr(daddr)!=IS_MYADDR)
 			{
 				kfree_skb(skb, FREE_READ);
-				release_sock(sk);
 				return 0;
 			}
 		
@@ -1717,7 +1711,6 @@
 			 *	Now TTCP is starting to use we ought to queue this data.
 			 */
 			 
-			release_sock(sk);
 			return 0;
 		}
 	
@@ -1729,7 +1722,6 @@
 		if (sk->state == TCP_SYN_RECV && th->syn && skb->seq+1 == sk->acked_seq)
 		{
 			kfree_skb(skb, FREE_READ);
-			release_sock(sk);
 			return 0;
 		}
 		
@@ -1753,7 +1745,6 @@
 					tcp_send_reset(daddr, saddr, th,
 						sk->prot, opt,dev,sk->ip_tos,sk->ip_ttl);
 					kfree_skb(skb, FREE_READ);
-					release_sock(sk);
 					return(0);
 				}
 				if(th->rst)
@@ -1766,7 +1757,6 @@
                                         tcp_send_reset(daddr, saddr, th,
                                                 sk->prot, opt,dev,sk->ip_tos,sk->ip_ttl);
 					kfree_skb(skb, FREE_READ);
-					release_sock(sk);
 					return 0;
 				}
 				/*
@@ -1816,7 +1806,6 @@
 				}		
 				/* Discard junk segment */
 				kfree_skb(skb, FREE_READ);
-				release_sock(sk);
 				return 0;
 			}
 			/*
@@ -1829,6 +1818,11 @@
 	 *	BSD has a funny hack with TIME_WAIT and fast reuse of a port. There is
 	 *	a more complex suggestion for fixing these reuse issues in RFC1644
 	 *	but not yet ready for general use. Also see RFC1379.
+	 *
+	 *	Note the funny way we go back to the top of this function for
+	 *	this case ("goto try_next_socket").  That also takes care of
+	 *	checking "sk->users" for the new socket as well as doing all
+	 *	the normal tests on the packet.
 	 */
 	
 #define BSD_TIME_WAIT
@@ -1845,15 +1839,13 @@
 			sk->err=ECONNRESET;
 			tcp_set_state(sk, TCP_CLOSE);
 			sk->shutdown = SHUTDOWN_MASK;
-			release_sock(sk);
 			sk=get_sock(&tcp_prot, th->dest, saddr, th->source, daddr);
+			/* this is not really correct: we should check sk->users */
 			if (sk && sk->state==TCP_LISTEN)
 			{
-				sk->inuse=1;
 				skb->sk = sk;
 				sk->rmem_alloc += skb->truesize;
 				tcp_conn_request(sk, skb, daddr, saddr,opt, dev,seq+128000);
-				release_sock(sk);
 				return 0;
 			}
 			kfree_skb(skb, FREE_READ);
@@ -1868,11 +1860,10 @@
 	 *	I have time to test it hard and look at what gcc outputs 
 	 */
 	
-	if (!tcp_sequence(sk, skb->seq, skb->end_seq))
+	if (!tcp_sequence(sk, skb->seq, skb->end_seq-th->syn))
 	{
 		bad_tcp_sequence(sk, th, len, opt, saddr, dev);
 		kfree_skb(skb, FREE_READ);
-		release_sock(sk);
 		return 0;
 	}
 
@@ -1907,7 +1898,6 @@
 			tcp_send_reset(daddr, saddr, th,sk->prot, opt, dev,sk->ip_tos,sk->ip_ttl);
 		}
 		kfree_skb(skb, FREE_READ);
-		release_sock(sk);
 		return 0;
 	}
 	
@@ -1922,7 +1912,6 @@
 	if (sk->rmem_alloc  >= sk->rcvbuf) 
 	{
 		kfree_skb(skb, FREE_READ);
-		release_sock(sk);
 		return(0);
 	}
 
@@ -1944,7 +1933,6 @@
 	 *	And done
 	 */	
 	
-	release_sock(sk);
 	return 0;
 
 no_tcp_socket:
diff -u --recursive --new-file v1.3.64/linux/net/ipv4/tcp_output.c linux/net/ipv4/tcp_output.c
--- v1.3.64/linux/net/ipv4/tcp_output.c	Fri Feb 16 11:34:12 1996
+++ linux/net/ipv4/tcp_output.c	Fri Feb 16 14:52:57 1996
@@ -574,10 +574,7 @@
 	struct device *dev=NULL;
 	int tmp;
 		
-	release_sock(sk); /* in case the malloc sleeps. */
-	
 	buff = sock_wmalloc(sk, MAX_RESET_SIZE,1 , GFP_KERNEL);
-	sk->inuse = 1;
 
 	if (buff == NULL)
 	{
@@ -676,7 +673,6 @@
 		newsk->dead = 1;
 		newsk->state = TCP_CLOSE;
 		/* And this will destroy it */
-		release_sock(newsk);
 		kfree_skb(skb, FREE_READ);
 		tcp_statistics.TcpAttemptFails++;
 		return;
@@ -703,7 +699,6 @@
 		kfree_skb(buff,FREE_WRITE);
 		newsk->dead = 1;
 		newsk->state = TCP_CLOSE;
-		release_sock(newsk);
 		skb->sk = sk;
 		kfree_skb(skb, FREE_READ);
 		tcp_statistics.TcpAttemptFails++;
@@ -750,7 +745,6 @@
 	
 	skb_queue_tail(&sk->receive_queue,skb);
 	sk->ack_backlog++;
-	release_sock(newsk);
 	tcp_statistics.TcpOutSegs++;
 }
 
diff -u --recursive --new-file v1.3.64/linux/net/ipv4/tcp_timer.c linux/net/ipv4/tcp_timer.c
--- v1.3.64/linux/net/ipv4/tcp_timer.c	Wed Feb 14 14:37:20 1996
+++ linux/net/ipv4/tcp_timer.c	Fri Feb 16 13:07:44 1996
@@ -139,7 +139,6 @@
 		tcp_statistics.TcpAttemptFails++;	/* Is this right ??? - FIXME - */
 		tcp_set_state(sk,TCP_CLOSE);
 		/* Don't FIN, we got nothing back */
-		release_sock(sk);
 		return 0;
 	}
 	/*
@@ -167,7 +166,6 @@
 			 *	Clean up time.
 			 */
 			tcp_set_state(sk, TCP_CLOSE);
-			release_sock(sk);
 			return 0;
 		}
 	}
@@ -175,6 +173,49 @@
 }
 
 /*
+ *	It could be we got here because we needed to send an ack,
+ *	so we need to check for that and not just normal retransmit.
+ */
+static void tcp_time_write_timeout(struct sock * sk)
+{
+	struct sk_buff *skb;
+	unsigned long flags;
+
+	save_flags(flags);
+	cli();
+	skb = sk->send_head;
+	if (!skb) {
+		if (sk->ack_backlog)
+			tcp_read_wakeup(sk);
+		restore_flags(flags);
+		return;
+	} 
+
+	/*
+	 *	Kicked by a delayed ack. Reset timer
+	 *	correctly now
+	 */
+	if (jiffies < skb->when + sk->rto) 
+	{
+		if (sk->ack_backlog)
+			tcp_read_wakeup(sk);
+		tcp_reset_xmit_timer (sk, TIME_WRITE, skb->when + sk->rto - jiffies);
+		restore_flags(flags);
+		return;
+	}
+
+	restore_flags(flags);
+	/*
+	 *	Retransmission
+	 */
+	sk->retransmits++;
+	sk->prot->retransmits++;
+	sk->prot->retransmit (sk, 0);
+	tcp_write_timeout(sk);
+}
+
+
+/*
  *	The TCP retransmit timer. This lacks a few small details.
  *
  *	1. 	An initial rtt timeout on the probe0 should cause what we can
@@ -200,20 +241,14 @@
 	 *	Only process if socket is not in use
 	 */
 
-	cli();
-	if (sk->inuse || in_bh) 
+	if (sk->users) 
 	{
 		/* Try again in 1 second */
 		sk->retransmit_timer.expires = jiffies+HZ;
 		add_timer(&sk->retransmit_timer);
-		sti();
 		return;
 	}
 
-	sk->inuse = 1;
-	sti();
-
-
 	if (sk->ack_backlog && !sk->dead) 
 		sk->data_ready(sk,0);
 
@@ -221,72 +256,34 @@
 
 	switch (why) 
 	{
-		/* Window probing */
-		case TIME_PROBE0:
-			tcp_send_probe0(sk);
-			tcp_write_timeout(sk);
-			break;
-		/* Retransmitting */
-		case TIME_WRITE:
-			/* It could be we got here because we needed to send an ack.
-			 * So we need to check for that.
-			 */
-		{
-			struct sk_buff *skb;
-			unsigned long flags;
-
-			save_flags(flags);
-			cli();
-			skb = sk->send_head;
-			if (!skb) 
-			{
-				if (sk->ack_backlog)
-					tcp_read_wakeup(sk);
-				restore_flags(flags);
-			} 
-			else 
-			{
-				/*
-				 *	Kicked by a delayed ack. Reset timer
-				 *	correctly now
-				 */
-				if (jiffies < skb->when + sk->rto) 
-				{
-					if (sk->ack_backlog)
-						tcp_read_wakeup(sk);
-					tcp_reset_xmit_timer (sk, TIME_WRITE, skb->when + sk->rto - jiffies);
-					restore_flags(flags);
-					break;
-				}
-				restore_flags(flags);
-				/*
-				 *	Retransmission
-				 */
-				sk->retransmits++;
-				sk->prot->retransmits++;
-				sk->prot->retransmit (sk, 0);
-				tcp_write_timeout(sk);
-			}
-			break;
-		}
-		/* Sending Keepalives */
-		case TIME_KEEPOPEN:
-			/* 
-			 * this reset_timer() call is a hack, this is not
-			 * how KEEPOPEN is supposed to work.
-			 */
-			tcp_reset_xmit_timer (sk, TIME_KEEPOPEN, TCP_TIMEOUT_LEN);
-
-			/* Send something to keep the connection open. */
-			if (sk->prot->write_wakeup)
-				  sk->prot->write_wakeup (sk);
-			sk->retransmits++;
-			sk->prot->retransmits++;
-			tcp_write_timeout(sk);
-			break;
-		default:
-			printk ("rexmit_timer: timer expired - reason unknown\n");
-			break;
+	/* Window probing */
+	case TIME_PROBE0:
+		tcp_send_probe0(sk);
+		tcp_write_timeout(sk);
+		break;
+
+	/* Retransmitting */
+	case TIME_WRITE:
+		tcp_time_write_timeout(sk);
+		break;
+
+	/* Sending Keepalives */
+	case TIME_KEEPOPEN:
+		/* 
+		 * this reset_timer() call is a hack, this is not
+		 * how KEEPOPEN is supposed to work.
+		 */
+		tcp_reset_xmit_timer (sk, TIME_KEEPOPEN, TCP_TIMEOUT_LEN);
+		/* Send something to keep the connection open. */
+		if (sk->prot->write_wakeup)
+			  sk->prot->write_wakeup (sk);
+		sk->retransmits++;
+		sk->prot->retransmits++;
+		tcp_write_timeout(sk);
+		break;
+
+	default:
+		printk ("rexmit_timer: timer expired - reason unknown\n");
+		break;
 	}
-	release_sock(sk);
 }
diff -u --recursive --new-file v1.3.64/linux/net/ipv4/timer.c linux/net/ipv4/timer.c
--- v1.3.64/linux/net/ipv4/timer.c	Sun Feb 11 15:32:49 1996
+++ linux/net/ipv4/timer.c	Fri Feb 16 11:24:18 1996
@@ -92,8 +92,7 @@
 	 * only process if socket is not in use
 	 */
 
-	cli();
-	if (sk->inuse || in_bh) 
+	if (sk->users)
 	{
 		sk->timer.expires = jiffies+10;
 		add_timer(&sk->timer);
@@ -101,9 +100,6 @@
 		return;
 	}
 
-	sk->inuse = 1;
-	sti();
-
 	/* Always see if we need to send an ack. */
 
 	if (sk->ack_backlog && !sk->zapped) 
@@ -121,7 +117,6 @@
 			if (! sk->dead || sk->state != TCP_CLOSE) 
 			{
 				printk ("non dead socket in time_done\n");
-				release_sock (sk);
 				break;
 			}
 			destroy_sock (sk);
@@ -137,10 +132,10 @@
 				sk->wmem_alloc++;	/* So it DOESN'T go away */
 				destroy_sock (sk);
 				sk->wmem_alloc--;	/* Might now have hit 0 - fall through and do it again if so */
-				sk->inuse = 0;	/* This will be ok, the destroy won't totally work */
+				sk->users = 0;	/* This will be ok, the destroy won't totally work */
 			}
 			if(sk->wmem_alloc==0 && sk->rmem_alloc==0)
-				destroy_sock(sk);	/* Socket gone, DON'T update sk->inuse! */
+				destroy_sock(sk);	/* Socket gone, DON'T update sk->users! */
 			break;
 
 		case TIME_CLOSE:
@@ -151,12 +146,10 @@
 				sk->state_change(sk);
 			sk->shutdown = SHUTDOWN_MASK;
 			reset_timer (sk, TIME_DESTROY, TCP_DONE_TIME);
-			release_sock (sk);
 			break;
 
 		default:
 			printk ("net_timer: timer expired - reason %d is unknown\n", why);
-			release_sock (sk);
 			break;
 	}
 }
diff -u --recursive --new-file v1.3.64/linux/net/ipv4/udp.c linux/net/ipv4/udp.c
--- v1.3.64/linux/net/ipv4/udp.c	Fri Feb  9 17:53:11 1996
+++ linux/net/ipv4/udp.c	Fri Feb 16 13:39:38 1996
@@ -392,7 +392,7 @@
   	if(!sk->broadcast && ip_chk_addr(usin->sin_addr.s_addr)==IS_BROADCAST)
 	    	return -EACCES;			/* Must turn broadcast on first */
 
-	sk->inuse = 1;
+	lock_sock(sk);
 
 	/* Send the packet. */
 	tmp = udp_send(sk, usin, from, len, flags, saddr, noblock);
@@ -539,8 +539,7 @@
 		sin->sin_addr.s_addr = skb->daddr;
   	}
   
-  	skb_free_datagram(skb);
-  	release_sock(sk);
+  	skb_free_datagram(sk, skb);
   	return(copied);
 }
 
@@ -576,14 +575,13 @@
 
 static void udp_close(struct sock *sk, int timeout)
 {
-	sk->inuse = 1;
+	lock_sock(sk);
 	sk->state = TCP_CLOSE;
 	if(uh_cache_sk==sk)
 		udp_cache_zap();
+	release_sock(sk);
 	if (sk->dead) 
 		destroy_sock(sk);
-	else
-		release_sock(sk);
 }
 
 
@@ -746,11 +744,9 @@
 		ip_statistics.IpInDelivers--;
 		skb->sk = NULL;
 		kfree_skb(skb, FREE_WRITE);
-		release_sock(sk);
 		return(0);
 	}
   	udp_statistics.UdpInDatagrams++;
-	release_sock(sk);
 	return(0);
 }
 
diff -u --recursive --new-file v1.3.64/linux/net/ipx/af_ipx.c linux/net/ipx/af_ipx.c
--- v1.3.64/linux/net/ipx/af_ipx.c	Fri Feb  9 17:53:11 1996
+++ linux/net/ipx/af_ipx.c	Fri Feb 16 14:41:41 1996
@@ -1032,6 +1032,7 @@
 			ipxif=ipxitf_find_using_phys(dev, ipx_map_frame_type(sipx->sipx_type));
 			if(ipxif==NULL)
 				return -EADDRNOTAVAIL;
+			sipx->sipx_family=AF_IPX;
 			sipx->sipx_network=ipxif->if_netnum;
 			memcpy(sipx->sipx_node, ipxif->if_node, sizeof(sipx->sipx_node));
 			memcpy_tofs(arg,&ifr,sizeof(ifr));
@@ -1601,7 +1602,7 @@
 	sk->sndbuf=SK_WMEM_MAX;
 	sk->wmem_alloc=0;
 	sk->rmem_alloc=0;
-	sk->inuse=0;
+	sk->users=0;
 	sk->shutdown=0;
 	sk->prot=NULL;	/* So we use default free mechanisms */
 	sk->err=0;
@@ -2050,7 +2051,7 @@
 		sipx->sipx_network=ipx->ipx_source.net;
 		sipx->sipx_type = ipx->ipx_type;
 	}
-	skb_free_datagram(skb);
+	skb_free_datagram(sk, skb);
 	return(truesize);
 }		
 
diff -u --recursive --new-file v1.3.64/linux/net/netrom/af_netrom.c linux/net/netrom/af_netrom.c
--- v1.3.64/linux/net/netrom/af_netrom.c	Wed Feb  7 15:11:44 1996
+++ linux/net/netrom/af_netrom.c	Fri Feb 16 10:51:39 1996
@@ -440,7 +440,7 @@
 	sk->sndbuf        = SK_WMEM_MAX;
 	sk->wmem_alloc    = 0;
 	sk->rmem_alloc    = 0;
-	sk->inuse         = 0;
+	sk->users         = 0;
 	sk->debug         = 0;
 	sk->destroy       = 0;
 	sk->prot          = NULL;	/* So we use default free mechanisms */
@@ -541,7 +541,7 @@
 	sk->sndbuf      = osk->sndbuf;
 	sk->wmem_alloc  = 0;
 	sk->rmem_alloc  = 0;
-	sk->inuse       = 0;
+	sk->users       = 0;
 	sk->ack_backlog = 0;
 	sk->destroy     = 0;
 	sk->prot        = NULL;	/* So we use default free mechanisms */
@@ -1156,10 +1156,10 @@
 		*addr_len = sizeof(*sax);
 	}
 
-	skb_free_datagram(skb);
+	skb_free_datagram(sk, skb);
 
 	return copied;
-}		
+}
 
 static int nr_shutdown(struct socket *sk, int how)
 {
diff -u --recursive --new-file v1.3.64/linux/net/unix/af_unix.c linux/net/unix/af_unix.c
--- v1.3.64/linux/net/unix/af_unix.c	Wed Feb 14 14:37:20 1996
+++ linux/net/unix/af_unix.c	Fri Feb 16 10:51:51 1996
@@ -313,7 +313,7 @@
 	sk->rcvbuf=SK_RMEM_MAX;
 	sk->sndbuf=SK_WMEM_MAX;
 	sk->allocation=GFP_KERNEL;
-	sk->inuse=0;
+	sk->users=0;
 	sk->bsdism=0;
 	sk->debug=0;
 	sk->prot=NULL;
@@ -728,7 +728,7 @@
 		if(msg->msg_accrightslen == sizeof(int)) {
 			int fd;
 
-			fd = get_user_long(msg->msg_accrights);
+			fd = get_user((int *) msg->msg_accrights);
 			filp = file_from_fd(fd);
 			if(!filp)
 				return -EBADF;
@@ -873,7 +873,7 @@
 		current->files->fd[slot] = filp;
 		FD_CLR(slot, &current->files->close_on_exec);
 		/* need verify area here? */
-		put_user_long(slot, uaddr);
+		put_user(slot, uaddr);
 		return 0;
 	} 
 	return -EMFILE;
diff -u --recursive --new-file v1.3.64/linux/scripts/Configure linux/scripts/Configure
--- v1.3.64/linux/scripts/Configure	Wed Feb 14 14:37:21 1996
+++ linux/scripts/Configure	Sat Feb 17 08:32:34 1996
@@ -9,6 +9,15 @@
 #
 # Please send comments / questions / bug fixes to raymondc@microsoft.com.
 #
+#              ***** IMPORTANT COMPATABILITY NOTE ****
+# If configuration changes are made which might adversely effect 
+# Menuconfig or xconfig, please notify the respective authors so that 
+# those utilities can be updated in parallel.
+#
+# Menuconfig:  <roadcapw@cfw.com>
+# xconfig:     <apenwarr@foxnet.net>  <eric@aib.com>
+#              ****************************************
+#
 # Each line in the config file is a command.
 #
 # 050793 - use IFS='@' to get around a bug in a pre-version of bash-1.13
@@ -27,6 +36,9 @@
 #
 # 010296 Aaron Ucko (ucko@vax1.rockhurst.edu) - fix int and hex to accept
 # arbitrary ranges
+#
+# 150296 Dick Streefland (dicks@tasking.nl) - report new configuration
+# items and ask for a value even when doing a "make oldconfig"
 
 #
 # Make sure we're really running bash.
@@ -88,14 +100,15 @@
 #
 # readln reads a line into $ans.
 #
-#	readln prompt default
+#	readln prompt default oldval
 #
 function readln () {
-	if [ "$DEFAULT" = "-d" ]; then
+	if [ "$DEFAULT" = "-d" -a -n "$3" ]; then
 		echo "$1"
 		ans=$2
 	else
 		echo -n "$1"
+		[ -z "$3" ] && echo -n "(NEW) "
 		IFS='@' read ans </dev/tty || exit 1
 		[ -z "$ans" ] && ans=$2
 	fi
@@ -143,7 +156,8 @@
 #	bool question define
 #
 function bool () {
-	def=$(eval echo "\${$2:-'n'}")
+	old=$(eval echo "\${$2}")
+	def=${old:-'n'}
 	case "$def" in
 	 "y" | "m") defprompt="Y/n/?"
 	      def="y"
@@ -152,7 +166,7 @@
 	      ;;
 	esac
 	while :; do
-	  readln "$1 ($2) [$defprompt] " "$def"
+	  readln "$1 ($2) [$defprompt] " "$def" "$old"
 	  case "$ans" in
 	    [yY] | [yY]es ) define_bool "$2" "y"
 			    break;;
@@ -173,7 +187,8 @@
 	if [ "$CONFIG_MODULES" != "y" ]; then
 	  bool "$1" "$2"
 	else 
-	  def=$(eval echo "\${$2:-'n'}")
+	  old=$(eval echo "\${$2}")
+	  def=${old:-'n'}
 	  case "$def" in
 	   "y") defprompt="Y/m/n/?"
 		;;
@@ -183,7 +198,7 @@
 		;;
 	  esac
 	  while :; do
-	    readln "$1 ($2) [$defprompt] " "$def"
+	    readln "$1 ($2) [$defprompt] " "$def" "$old"
 	    case "$ans" in
 	      [yY] | [yY]es ) define_bool "$2" "y"
 			      break ;;
@@ -199,17 +214,18 @@
 }
 
 #
-# dep_tristate processes a tristate argument
+# dep_tristate processes a tristate argument that depends upon
+# another option.  If the option we depend upon is a module,
+# then the only allowable options are M or N.  If Y, then
+# this is a normal tristate.  This is used in cases where modules
+# are nested, and one module requires the presence of something
+# else in the kernel.
 #
-#	tristate question define default that depends upon
-#	another option.  If the option we depend upon is a module,
-#	then the only allowable options are M or N.  If Y, then
-#	this is a normal tristate.  This is used in cases where modules
-#	are nested, and one module requires the presence of something
-#	else in the kernel.
+#	tristate question define default
 #
 function dep_tristate () {
-	def=$(eval echo "\${$2:-'n'}")
+	old=$(eval echo "\${$2}")
+	def=${old:-'n'}
 	if [ "$3" = "n" ]; then
 		define_bool "$2" "n"
 	elif [ "$3" = "y" ]; then
@@ -224,7 +240,7 @@
 		      ;;
 		esac
 		while :; do
-		  readln "$1 ($2) [$defprompt] " "$def"
+		  readln "$1 ($2) [$defprompt] " "$def" "$old"
 		  case "$ans" in
 		      [nN] | [nN]o )  define_bool "$2" "n"
 				      break ;;
@@ -263,9 +279,10 @@
 #	int question define default
 #
 function int () {
-	def=$(eval echo "\${$2:-$3}")
+	old=$(eval echo "\${$2}")
+	def=${old:-$3}
 	while :; do
-	  readln "$1 ($2) [$def] " "$def"
+	  readln "$1 ($2) [$def] " "$def" "$old"
 	  if expr "$ans" : '0$\|-?[1-9][0-9]*$' > /dev/null; then
 	    define_int "$2" "$ans"
 	    break
@@ -291,10 +308,11 @@
 #	hex question define default
 #
 function hex () {
-	def=$(eval echo "\${$2:-$3}")
+	old=$(eval echo "\${$2}")
+	def=${old:-$3}
 	def=${def#*[x,X]}
 	while :; do
-	  readln "$1 ($2) [$def] " "$def"
+	  readln "$1 ($2) [$def] " "$def" "$old"
 	  ans=${ans#*[x,X]}
 	 if expr "$ans" : '[0-9a-fA-F]+$' > /dev/null; then
 	   define_hex "$2" "$ans"
@@ -322,7 +340,8 @@
 function choice () {
 	question="$1"
 	choices="$2"
-	def="$3"
+	old=
+	def=$3
 
 	# determine default answer:
 	names=""
@@ -335,6 +354,7 @@
 			names="$1"
 		fi
 		if [ "$(eval echo \"\${$2}\")" = "y" ]; then
+			old=$1
 			def=$1
 		fi
 		shift; shift
@@ -343,7 +363,7 @@
 	val=""
 	while [ -z "$val" ]; do
 		ambg=n
-		readln "$question ($names) [$def] " "$def"
+		readln "$question ($names) [$def] " "$def" "$old"
 		ans=$(echo $ans | tr a-z A-Z)
 		set -- $choices
 		while [ -n "$1" ]; do
diff -u --recursive --new-file v1.3.64/linux/scripts/Menuconfig linux/scripts/Menuconfig
--- v1.3.64/linux/scripts/Menuconfig	Wed Feb  7 15:11:44 1996
+++ linux/scripts/Menuconfig	Sat Feb 17 08:07:03 1996
@@ -5,8 +5,8 @@
 # It was inspired by a desire to not have to hit <enter> 9 million times
 # or startup the X server just to change a single kernel parameter.  
 #
-# This script attempts to parses the configuration files, which are
-# scattered throughout the kernel source tree, and create a temporary
+# This script attempts to parse the configuration files, which are
+# scattered throughout the kernel source tree, and creates a temporary
 # set of mini scripts which are in turn used to create nested menus and
 # radiolists.
 #
@@ -23,6 +23,15 @@
 #
 #----------------------------------------------------------------------------
 
+
+#
+# Change this to TRUE if you prefer all kernel options listed
+# in a single menu rather than the standard menu hierarchy.
+#
+# Don't forget to remove linux/.menuconfig.in
+#
+single_menu_mode=
+
 #
 # Make sure we're really running bash.
 #
@@ -88,11 +97,8 @@
 # Additional comments are currently semi-supported
 #
 function comment () {
-	if [ "$comments_ok" ]
-	then
-		$DIALOG --backtitle "$backtitle" --msgbox "$*" 7 70
-		comments_ok=
-	fi
+	comment_ctr=$[ comment_ctr + 1 ]
+	echo -ne "': $comment_ctr' '--- $1' " >>submenu
 }
 
 #
@@ -153,7 +159,6 @@
 			
 		help "$1" "$4"
 	done
-	comments_ok=TRUE
 }
 
 #
@@ -192,7 +197,6 @@
 			
 		help "$1" "$4"
 	done
-	comments_ok=TRUE
 }
 
 #
@@ -244,7 +248,6 @@
 			
 		help "$1" "$5"
 	done
-	comments_ok=TRUE
 }
 
 #
@@ -296,29 +299,24 @@
 			15 55 "$4" 2>dialog.out
 		then
 			answer="`cat dialog.out`"
+			answer="${answer:-$3}"
 
-			case "$answer" in
-			[1-9] |\
-			[1-9][0-9] |\
-			[1-9][0-9][0-9] |\
-			[1-9][0-9][0-9][0-9] |\
-			[1-9][0-9][0-9][0-9][0-9])\
+			if expr $answer : '0$\|-?[1-9][0-9]*$' >/dev/null
+			then
 				eval $2="$answer"
-				;;
-			*)	eval $2="$3"
+			else
+				eval $2="$3"
 				echo -en "\007"
 				${DIALOG} --backtitle "$backtitle" \
 					--infobox "You have made an invalid entry." 3 43
 				sleep 2
-				;;
-			esac
+			fi
 
 			break
 		fi
 
 		help "$1" "$2"
 	done
-	comments_ok=TRUE
 }
 
 
@@ -326,7 +324,7 @@
 # Create a function which will call our local int function.
 # 
 function hex () {
-	eval $2=\${$2:-"$3"} x=\${$2#*[x,X]}
+	eval $2=\${$2:-"$3"} x=\${$2##*[x,X]}
 
 	echo -ne "'$2' '($x) $1' " >>submenu
 
@@ -345,29 +343,25 @@
 			15 55 "$4" 2>dialog.out
 		then
 			answer="`cat dialog.out`"
-			answer="${answer#*[x,X]}"
+			answer="${answer:-$3}"
+			answer="${answer##*[x,X]}"
 
-			case "$answer" in
-			[0-9,a-f,A-F] |\
-			[0-9,a-f,A-F][0-9,a-f,A-F] |\
-			[0-9,a-f,A-F][0-9,a-f,A-F][0-9,a-f,A-F] |\
-			[0-9,a-f,A-F][0-9,a-f,A-F][0-9,a-f,A-F][0-9,a-f,A-F])\
+			if expr $answer : '[0-9a-fA-F]+$' >/dev/null
+			then
 				eval $2="$answer"
-				;;
-			*)	eval $2="$3"
+			else
+				eval $2="$3"
 				echo -en "\007"
 				${DIALOG} --backtitle "$backtitle" \
 					--infobox "You have made an invalid entry." 3 43
 				sleep 2
-				;;
-			esac
+			fi
 
 			break
 		fi
 
 		help "$1" "$2"
 	done
-	comments_ok=TRUE
 }
 
 #
@@ -464,7 +458,6 @@
 		
 		shift ; shift
 	done
-	comments_ok=TRUE
 }
 
 
@@ -476,14 +469,14 @@
 # function is recursive.
 #
 function parse_config_files () {
+	if [ "_$single_menu_mode" = "_TRUE" ]
+	then
+		parse_single_menu $1
+		return
+	fi
+
 	while read command args
 	do
-		if [ "$command" != "comment" -a "$in_a_comment" ]
-		then
-			in_a_comment=
-			echo >>$submenu
-		fi
-
 		case $command in
 
 		#
@@ -508,13 +501,8 @@
 
 				submenu=$x
 				echo menu_name $args >$submenu
-
-			elif [ "$in_a_comment" ]
-			then
-				echo -n $args >> $submenu
 			else
-				in_a_comment=TRUE
-				echo -n comment $args >> $submenu
+				echo comment $args >> $submenu
 			fi
 			;;
 	
@@ -544,6 +532,39 @@
 }
 
 #
+# Parses configuration files into a single menu structure.
+#
+function parse_single_menu () {
+
+	while read command args
+	do
+		case $command in
+
+		mainmenu_option | \
+		endmenu)
+			: ;;
+
+		mainmenu_name)
+			echo menu_name "'Main Menu'" > submenu0
+			;;
+
+		\$MAKE) echo "yuck1 'Configure (You must do this!)' '$args'"\
+				>>$submenu
+			;;
+
+		source)
+			parse_single_menu "$args"
+			;;
+
+		'#'|'')  : ;;
+
+		*)	echo $command $args >> $submenu
+			;;
+		esac
+	done < $1
+}
+
+#
 # This is the menu tree's bootstrap.
 #
 # Executes a mini script to create a set of functions, one per configuration
@@ -551,10 +572,10 @@
 # call other mini scripts.
 #
 function activate_menu () {
-	comments_ok=
 
 	while true
 	do
+		comment_ctr=0
 		$1 "$default"		#Create the radiolists and dialog cmd
 		. radiolists		#Read in the dialog functions.
 
@@ -622,8 +643,8 @@
 
 	function hex () {
 		eval x=\${$2:-"$3"}
-		echo "$2=$x" 			>>$CONFIG
-		echo "#define $2 0x${x#*[x,X]}"	>>$CONFIG_H
+		echo "$2=$x" 			 >>$CONFIG
+		echo "#define $2 0x${x##*[x,X]}" >>$CONFIG_H
 	}
 
 	function define_bool () {
@@ -784,8 +805,6 @@
 DIALOG="./scripts/lxdialog/lxdialog"
 
 comment_is_option=
-in_a_comment=
-comments_ok=
 menu_no=0
 submenu=submenu0
 kernel_version="${VERSION}.${PATCHLEVEL}.${SUBLEVEL}"
diff -u --recursive --new-file v1.3.64/linux/scripts/README.Menuconfig linux/scripts/README.Menuconfig
--- v1.3.64/linux/scripts/README.Menuconfig	Wed Feb  7 15:11:44 1996
+++ linux/scripts/README.Menuconfig	Fri Feb 16 08:04:58 1996
@@ -104,3 +104,10 @@
          header files.
 
 
+*** IMPORTANT, OPTIONAL ALTERNATE PERSONALITY AVAILABLE ***
+***                                                     ***
+If you prefer to have all of the kernel options listed in a single menu, 
+rather than the default multimenu hierarchy, you may edit the Menuconfig 
+script and change the line "single_menu_mode="  to "single_menu_mode=TRUE".  
+Don't forget to remove linux/.menuconfig.in afterwards.
+
diff -u --recursive --new-file v1.3.64/linux/scripts/lxdialog/menubox.c linux/scripts/lxdialog/menubox.c
--- v1.3.64/linux/scripts/lxdialog/menubox.c	Wed Feb  7 15:11:46 1996
+++ linux/scripts/lxdialog/menubox.c	Fri Feb 16 08:04:58 1996
@@ -27,9 +27,9 @@
  * Print menu item
  */
 static void
-print_item (WINDOW * win, const char *item, int choice, int selected)
+print_item (WINDOW * win, const char *item, int choice, int selected, int hotkey)
 {
-    int j, i;
+    int i, j;
 
     j = first_alpha(item);
 
@@ -40,8 +40,10 @@
 	waddch (win, ' ');
     wattrset (win, selected ? item_selected_attr : item_attr);
     mvwaddstr (win, choice, item_x, (char *)item);
-    wattrset (win, selected ? tag_key_selected_attr : tag_key_attr);
-    mvwaddch(win, choice, item_x+j, item[j]);
+    if (hotkey) {
+    	wattrset (win, selected ? tag_key_selected_attr : tag_key_attr);
+    	mvwaddch(win, choice, item_x+j, item[j]);
+    }
 }
 
 /*
@@ -174,8 +176,10 @@
     }
 
     /* Print the menu */
-    for (i=0; i < max_choice; i++)
-	print_item (menu, items[(first_item + i) * 2 + 1], i, i == choice);
+    for (i=0; i < max_choice; i++) {
+	print_item (menu, items[(first_item + i) * 2 + 1], i, i == choice,
+                    (items[(first_item + i)*2][0] != ':'));
+    }
 
     wnoutrefresh (menu);
 
@@ -209,14 +213,15 @@
 
 			if (menu_height > 1) {
 			    /* De-highlight current first item */
-			    print_item (menu, items[scroll * 2 + 1],
-					0, FALSE);
+			    print_item (menu, items[scroll*2+1], 0, FALSE,
+                                        (items[scroll*2][0] != ':'));
 			    scrollok (menu, TRUE);
 			    wscrl (menu, -1);
 			    scrollok (menu, FALSE);
 			}
 			scroll--;
-			print_item (menu, items[scroll * 2 + 1], 0, TRUE);
+			print_item (menu, items[scroll * 2 + 1], 0, TRUE,
+                                   (items[scroll*2][0] != ':'));
 			wnoutrefresh (menu);
 
     			print_arrows(dialog, choice, item_no, scroll,
@@ -235,15 +240,17 @@
 			if (menu_height > 1) {
 			    /* De-highlight current last item */
 			    print_item (menu, items[(scroll + max_choice - 1)
-					   * 2 + 1], max_choice - 1, FALSE);
+					   * 2 + 1], max_choice - 1, FALSE,
+                                           (items[(scroll+max_choice-1)*2][0] != ':'));
 			    scrollok (menu, TRUE);
 			    scroll (menu);
 			    scrollok (menu, FALSE);
 			}
 			scroll++;
-			print_item (menu, 
-				    items[(scroll + max_choice - 1) * 2 + 1],
-				    max_choice - 1, TRUE);
+			print_item (menu, items[(scroll+max_choice-1)*2+1],
+				    max_choice-1, TRUE,
+                                    (items[(scroll+max_choice-1)*2][0] != ':'));
+
 			wnoutrefresh (menu);
 
     			print_arrows(dialog, choice, item_no, scroll,
@@ -259,13 +266,13 @@
 	    if (i != choice) {
 		/* De-highlight current item */
 		getyx (dialog, cur_y, cur_x);	/* Save cursor position */
-		print_item (menu, items[(scroll + choice) * 2 + 1],
-				choice, FALSE);
+		print_item (menu, items[(scroll+choice)*2+1], choice, FALSE,
+                                (items[(scroll+choice)*2][0] != ':'));
 
 		/* Highlight new item */
 		choice = i;
-		print_item (menu, items[(scroll + choice) * 2 + 1],
-				choice, TRUE);
+		print_item (menu, items[(scroll+choice)*2+1], choice, TRUE,
+                                (items[(scroll+choice)*2][0] != ':'));
 		wnoutrefresh (menu);
 		wmove (dialog, cur_y, cur_x);
 		wrefresh (dialog);
