## Automatically generated incremental diff
## From:   linux-2.4.4-pre7
## To:     linux-2.4.4-pre8
## Robot:  $Id: make-incremental-diff,v 1.8 2001/12/04 06:05:04 hpa Exp $

diff -urN linux-2.4.4-pre7/Makefile linux/Makefile
--- linux-2.4.4-pre7/Makefile	Mon Dec  3 22:37:20 2001
+++ linux/Makefile	Mon Dec  3 22:37:50 2001
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 4
-EXTRAVERSION =-pre7
+EXTRAVERSION =-pre8
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
diff -urN linux-2.4.4-pre7/arch/s390/mm/init.c linux/arch/s390/mm/init.c
--- linux-2.4.4-pre7/arch/s390/mm/init.c	Mon Dec  3 22:37:21 2001
+++ linux/arch/s390/mm/init.c	Mon Dec  3 22:37:51 2001
@@ -35,8 +35,6 @@
 #include <asm/pgalloc.h>
 #include <asm/dma.h>
 #include <asm/lowcore.h>
-#include <asm/tlb.h>
-
 
 static unsigned long totalram_pages;
 
diff -urN linux-2.4.4-pre7/arch/s390x/kernel/linux32.c linux/arch/s390x/kernel/linux32.c
--- linux-2.4.4-pre7/arch/s390x/kernel/linux32.c	Mon Mar 19 12:35:11 2001
+++ linux/arch/s390x/kernel/linux32.c	Mon Dec  3 22:37:51 2001
@@ -914,7 +914,7 @@
 {
 	int cmds = cmd >> SUBCMDSHIFT;
 	int err;
-	struct mem_dqblk d;
+	struct dqblk d;
 	mm_segment_t old_fs;
 	char *spec;
 	
diff -urN linux-2.4.4-pre7/arch/s390x/mm/fault.c linux/arch/s390x/mm/fault.c
--- linux-2.4.4-pre7/arch/s390x/mm/fault.c	Mon Dec  3 22:37:21 2001
+++ linux/arch/s390x/mm/fault.c	Mon Mar 19 12:35:11 2001
@@ -33,34 +33,6 @@
 
 extern void die(const char *,struct pt_regs *,long);
 
-extern spinlock_t timerlist_lock;
-
-/*
- * Unlock any spinlocks which will prevent us from getting the
- * message out
- */
-void bust_spinlocks(int yes)
-{
-        spin_lock_init(&timerlist_lock);
-        if (yes) {
-                oops_in_progress = 1;
-#ifdef CONFIG_SMP
-                atomic_set(&global_irq_lock,0);
-#endif
-        } else {
-                int loglevel_save = console_loglevel;
-                oops_in_progress = 0;
-                /*
-                 * OK, the message is on the console.  Now we call printk()
-                 * without oops_in_progress set so that printk will give klogd
-                 * a poke.  Hold onto your hats...
-                 */
-                console_loglevel = 15;          /* NMI oopser may have shut the console up */
-                printk(" ");
-                console_loglevel = loglevel_save;
-        }
-}
-
 /*
  * This routine handles page faults.  It determines the address,
  * and the problem, and then passes it off to one of the appropriate
diff -urN linux-2.4.4-pre7/arch/s390x/mm/init.c linux/arch/s390x/mm/init.c
--- linux-2.4.4-pre7/arch/s390x/mm/init.c	Mon Dec  3 22:37:21 2001
+++ linux/arch/s390x/mm/init.c	Mon Dec  3 22:37:51 2001
@@ -35,8 +35,6 @@
 #include <asm/pgalloc.h>
 #include <asm/dma.h>
 #include <asm/lowcore.h>
- 
-mmu_gather_t mmu_gathers[NR_CPUS];
 
 static unsigned long totalram_pages;
 
diff -urN linux-2.4.4-pre7/arch/sparc/kernel/head.S linux/arch/sparc/kernel/head.S
--- linux-2.4.4-pre7/arch/sparc/kernel/head.S	Mon May 22 09:50:53 2000
+++ linux/arch/sparc/kernel/head.S	Mon Dec  3 22:37:51 2001
@@ -2,7 +2,7 @@
  * head.S: The initial boot code for the Sparc port of Linux.
  *
  * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
- * Copyright (C) 1995,1999 Pete Zaitcev   (zaitcev@metabyte.com)
+ * Copyright (C) 1995,1999 Pete Zaitcev   (zaitcev@yahoo.com)
  * Copyright (C) 1996 Miguel de Icaza (miguel@nuclecu.unam.mx)
  * Copyright (C) 1997 Jakub Jelinek   (jj@sunsite.mff.cuni.cz)
  * Copyright (C) 1997 Michael A. Griffith (grif@acm.org)
diff -urN linux-2.4.4-pre7/arch/sparc/kernel/irq.c linux/arch/sparc/kernel/irq.c
--- linux-2.4.4-pre7/arch/sparc/kernel/irq.c	Mon Dec  3 22:37:21 2001
+++ linux/arch/sparc/kernel/irq.c	Mon Dec  3 22:37:51 2001
@@ -6,7 +6,7 @@
  *
  *  Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
  *  Copyright (C) 1995 Miguel de Icaza (miguel@nuclecu.unam.mx)
- *  Copyright (C) 1995 Pete A. Zaitcev (zaitcev@metabyte.com)
+ *  Copyright (C) 1995 Pete A. Zaitcev (zaitcev@yahoo.com)
  *  Copyright (C) 1996 Dave Redman (djhr@tadpole.co.uk)
  *  Copyright (C) 1998-2000 Anton Blanchard (anton@samba.org)
  */
diff -urN linux-2.4.4-pre7/arch/sparc/kernel/sun4c_irq.c linux/arch/sparc/kernel/sun4c_irq.c
--- linux-2.4.4-pre7/arch/sparc/kernel/sun4c_irq.c	Fri Feb  9 11:29:44 2001
+++ linux/arch/sparc/kernel/sun4c_irq.c	Mon Dec  3 22:37:51 2001
@@ -5,7 +5,7 @@
  *
  *  Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
  *  Copyright (C) 1995 Miguel de Icaza (miguel@nuclecu.unam.mx)
- *  Copyright (C) 1995 Pete A. Zaitcev (zaitcev@ipmce.su)
+ *  Copyright (C) 1995 Pete A. Zaitcev (zaitcev@yahoo.com)
  *  Copyright (C) 1996 Dave Redman (djhr@tadpole.co.uk)
  */
 
diff -urN linux-2.4.4-pre7/arch/sparc/kernel/sun4m_irq.c linux/arch/sparc/kernel/sun4m_irq.c
--- linux-2.4.4-pre7/arch/sparc/kernel/sun4m_irq.c	Fri Feb  9 11:29:44 2001
+++ linux/arch/sparc/kernel/sun4m_irq.c	Mon Dec  3 22:37:51 2001
@@ -5,7 +5,7 @@
  *
  *  Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
  *  Copyright (C) 1995 Miguel de Icaza (miguel@nuclecu.unam.mx)
- *  Copyright (C) 1995 Pete A. Zaitcev (zaitcev@ipmce.su)
+ *  Copyright (C) 1995 Pete A. Zaitcev (zaitcev@yahoo.com)
  *  Copyright (C) 1996 Dave Redman (djhr@tadpole.co.uk)
  */
 
diff -urN linux-2.4.4-pre7/arch/sparc/kernel/sys_sunos.c linux/arch/sparc/kernel/sys_sunos.c
--- linux-2.4.4-pre7/arch/sparc/kernel/sys_sunos.c	Sun Mar 25 18:14:21 2001
+++ linux/arch/sparc/kernel/sys_sunos.c	Mon Dec  3 22:37:51 2001
@@ -620,8 +620,6 @@
 };
 
 
-extern dev_t get_unnamed_dev(void);
-extern void put_unnamed_dev(dev_t);
 extern asmlinkage int sys_connect(int fd, struct sockaddr *uservaddr, int addrlen);
 extern asmlinkage int sys_socket(int family, int type, int protocol);
 extern asmlinkage int sys_bind(int fd, struct sockaddr *umyaddr, int addrlen);
@@ -749,7 +747,7 @@
 asmlinkage int
 sunos_mount(char *type, char *dir, int flags, void *data)
 {
-	int linux_flags = MS_MGC_MSK; /* new semantics */
+	int linux_flags = 0;
 	int ret = -EINVAL;
 	char *dev_fname = 0;
 	char *dir_page, *type_page;
diff -urN linux-2.4.4-pre7/arch/sparc/prom/console.c linux/arch/sparc/prom/console.c
--- linux-2.4.4-pre7/arch/sparc/prom/console.c	Mon Aug 28 21:20:03 2000
+++ linux/arch/sparc/prom/console.c	Mon Dec  3 22:37:51 2001
@@ -3,7 +3,7 @@
  *            to/from the current console device using the PROM.
  *
  * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
- * Copyright (C) 1998 Pete Zaitcev <zaitcev@metabyte.com>
+ * Copyright (C) 1998 Pete Zaitcev <zaitcev@yahoo.com>
  */
 
 #include <linux/types.h>
diff -urN linux-2.4.4-pre7/arch/sparc64/defconfig linux/arch/sparc64/defconfig
--- linux-2.4.4-pre7/arch/sparc64/defconfig	Mon Dec  3 22:37:21 2001
+++ linux/arch/sparc64/defconfig	Mon Dec  3 22:37:51 2001
@@ -23,7 +23,7 @@
 CONFIG_SMP=y
 CONFIG_SPARC64=y
 CONFIG_HAVE_DEC_LOCK=y
-# CONFIG_RWSEM_GENERIC_SPINLOCK=n
+# CONFIG_RWSEM_GENERIC_SPINLOCK is not set
 CONFIG_RWSEM_XCHGADD_ALGORITHM=y
 # CONFIG_ISA is not set
 # CONFIG_EISA is not set
@@ -255,7 +255,7 @@
 # CONFIG_IDEDMA_NEW_DRIVE_LISTINGS is not set
 # CONFIG_BLK_DEV_AEC62XX is not set
 # CONFIG_AEC62XX_TUNING is not set
-# CONFIG_BLK_DEV_ALI15X3 is not set
+CONFIG_BLK_DEV_ALI15X3=y
 # CONFIG_WDC_ALI15X3 is not set
 # CONFIG_BLK_DEV_AMD7409 is not set
 # CONFIG_AMD7409_OVERRIDE is not set
@@ -550,7 +550,7 @@
 # USB support
 #
 CONFIG_USB=y
-CONFIG_USB_DEBUG=y
+# CONFIG_USB_DEBUG is not set
 
 #
 # Miscellaneous USB options
diff -urN linux-2.4.4-pre7/arch/sparc64/kernel/auxio.c linux/arch/sparc64/kernel/auxio.c
--- linux-2.4.4-pre7/arch/sparc64/kernel/auxio.c	Sun Mar 25 18:14:21 2001
+++ linux/arch/sparc64/kernel/auxio.c	Mon Dec  3 22:37:51 2001
@@ -57,12 +57,8 @@
 			return;
 		}
 #endif
-		if (central_bus || this_is_starfire || (tlb_type == cheetah)) {
-			auxio_register = 0UL;
-			return;
-		}
-		prom_printf("Cannot find auxio node, cannot continue...\n");
-		prom_halt();
+		auxio_register = 0UL;
+		return;
 	}
 
 	/* Map the register both read and write */
diff -urN linux-2.4.4-pre7/arch/sparc64/kernel/check_asm.sh linux/arch/sparc64/kernel/check_asm.sh
--- linux-2.4.4-pre7/arch/sparc64/kernel/check_asm.sh	Wed Aug 23 09:30:13 2000
+++ linux/arch/sparc64/kernel/check_asm.sh	Mon Dec  3 22:37:51 2001
@@ -11,7 +11,7 @@
     echo "	sizeof(struct $2_struct)," >> $4
   ;;
   -ints)
-    sed -n -e '/check_asm_data:/,/\.size/p' <$2 | sed -e 's/check_asm_data://' -e 's/\.size.*//' -e 's/\.long[ 	]\([0-9]*\)/\1,/' >>$3
+    sed -n -e '/check_asm_data:/,/\.size/p' <$2 | sed -e 's/check_asm_data://' -e 's/\.size.*//' -e 's/\.long[		]\([0-9]*\)/\1,/' | grep -v '\.ident' >>$3
   ;;
   *)
     exit 1
diff -urN linux-2.4.4-pre7/arch/sparc64/kernel/devices.c linux/arch/sparc64/kernel/devices.c
--- linux-2.4.4-pre7/arch/sparc64/kernel/devices.c	Sun Mar 25 18:14:21 2001
+++ linux/arch/sparc64/kernel/devices.c	Mon Dec  3 22:37:51 2001
@@ -77,6 +77,15 @@
 	
 	prom_cpu_nodes[0] = prom_node_cpu;
 
+#ifndef CONFIG_SMP
+	{
+		extern unsigned long up_clock_tick;
+		up_clock_tick = prom_getintdefault(prom_node_cpu,
+						   "clock-frequency",
+						   0);
+	}
+#endif
+
 	central_probe();
 
 	cpu_probe();
diff -urN linux-2.4.4-pre7/arch/sparc64/kernel/ebus.c linux/arch/sparc64/kernel/ebus.c
--- linux-2.4.4-pre7/arch/sparc64/kernel/ebus.c	Sun Mar 25 18:14:21 2001
+++ linux/arch/sparc64/kernel/ebus.c	Mon Dec  3 22:37:51 2001
@@ -1,4 +1,4 @@
-/* $Id: ebus.c,v 1.60 2001/03/15 02:11:09 davem Exp $
+/* $Id: ebus.c,v 1.61 2001/04/24 05:13:25 davem Exp $
  * ebus.c: PCI to EBus bridge device.
  *
  * Copyright (C) 1997  Eddie C. Dost  (ecd@skynet.be)
@@ -192,6 +192,11 @@
 	printk(" [%s", dev->prom_name);
 
 	len = prom_getproperty(node, "reg", (void *)regs, sizeof(regs));
+	if (len == -1) {
+		dev->num_addrs = 0;
+		goto probe_interrupts;
+	}
+
 	if (len % sizeof(struct linux_prom_registers)) {
 		prom_printf("UGH: proplen for %s was %d, need multiple of %d\n",
 			    dev->prom_name, len,
@@ -216,6 +221,7 @@
 				 &dev->resource[i]);
 	}
 
+probe_interrupts:
 	len = prom_getproperty(node, "interrupts", (char *)&irqs, sizeof(irqs));
 	if ((len == -1) || (len == 0)) {
 		dev->num_irqs = 0;
diff -urN linux-2.4.4-pre7/arch/sparc64/kernel/irq.c linux/arch/sparc64/kernel/irq.c
--- linux-2.4.4-pre7/arch/sparc64/kernel/irq.c	Sun Mar 25 18:14:21 2001
+++ linux/arch/sparc64/kernel/irq.c	Mon Dec  3 22:37:51 2001
@@ -1,4 +1,4 @@
-/* $Id: irq.c,v 1.99 2001/03/22 02:19:23 davem Exp $
+/* $Id: irq.c,v 1.100 2001/04/24 01:09:12 davem Exp $
  * irq.c: UltraSparc IRQ handling/init/registry.
  *
  * Copyright (C) 1997  David S. Miller  (davem@caip.rutgers.edu)
@@ -1011,16 +1011,16 @@
 	 * purposes.  Also workaround BB_ERRATA_1 by doing a dummy
 	 * read back of %tick after writing it.
 	 */
-	__asm__ __volatile__("
-		sethi	%%hi(0x80000000), %%g1
-		ba,pt	%%xcc, 1f
-		 sllx	%%g1, 32, %%g1
-		.align	64
-	1:	rd	%%tick, %%g2
-		add	%%g2, 6, %%g2
-		andn	%%g2, %%g1, %%g2
-		wrpr	%%g2, 0, %%tick
-		rdpr	%%tick, %%g0"
+	__asm__ __volatile__(
+	"	sethi	%%hi(0x80000000), %%g1\n"
+	"	ba,pt	%%xcc, 1f\n"
+	"	 sllx	%%g1, 32, %%g1\n"
+	"	.align	64\n"
+	"1:	rd	%%tick, %%g2\n"
+	"	add	%%g2, 6, %%g2\n"
+	"	andn	%%g2, %%g1, %%g2\n"
+	"	wrpr	%%g2, 0, %%tick\n"
+	"	rdpr	%%tick, %%g0"
 	: /* no outputs */
 	: /* no inputs */
 	: "g1", "g2");
@@ -1035,32 +1035,32 @@
 	 * read back from %tick_cmpr right after writing to it. -DaveM
 	 */
 	if (!SPARC64_USE_STICK) {
-	__asm__ __volatile__("
-		rd	%%tick, %%g1
-		ba,pt	%%xcc, 1f
-		 add	%%g1, %0, %%g1
-		.align	64
-	1:	wr	%%g1, 0x0, %%tick_cmpr
-		rd	%%tick_cmpr, %%g0"
+	__asm__ __volatile__(
+	"	rd	%%tick, %%g1\n"
+	"	ba,pt	%%xcc, 1f\n"
+	"	 add	%%g1, %0, %%g1\n"
+	"	.align	64\n"
+	"1:	wr	%%g1, 0x0, %%tick_cmpr\n"
+	"	rd	%%tick_cmpr, %%g0"
 	: /* no outputs */
 	: "r" (timer_tick_offset)
 	: "g1");
 	} else {
 	/* Let the user get at STICK too. */
-	__asm__ __volatile__("
-		sethi	%%hi(0x80000000), %%g1
-		sllx	%%g1, 32, %%g1
-		rd	%%asr24, %%g2
-		andn	%%g2, %%g1, %%g2
-		wr	%%g2, 0, %%asr24"
+	__asm__ __volatile__(
+	"	sethi	%%hi(0x80000000), %%g1\n"
+	"	sllx	%%g1, 32, %%g1\n"
+	"	rd	%%asr24, %%g2\n"
+	"	andn	%%g2, %%g1, %%g2\n"
+	"	wr	%%g2, 0, %%asr24"
 	: /* no outputs */
 	: /* no inputs */
 	: "g1", "g2");
 
-	__asm__ __volatile__("
-		rd	%%asr24, %%g1
-		add	%%g1, %0, %%g1
-		wr	%%g1, 0x0, %%asr25"
+	__asm__ __volatile__(
+	"	rd	%%asr24, %%g1\n"
+	"	add	%%g1, %0, %%g1\n"
+	"	wr	%%g1, 0x0, %%asr25"
 	: /* no outputs */
 	: "r" (timer_tick_offset)
 	: "g1");
@@ -1170,13 +1170,13 @@
 	prom_timers->limit1 = 0;
 
 	/* Wheee, eat the interrupt packet too... */
-	__asm__ __volatile__("
-	mov	0x40, %%g2
-	ldxa	[%%g0] %0, %%g1
-	ldxa	[%%g2] %1, %%g1
-	stxa	%%g0, [%%g0] %0
-	membar	#Sync
-"	: /* no outputs */
+	__asm__ __volatile__(
+"	mov	0x40, %%g2\n"
+"	ldxa	[%%g0] %0, %%g1\n"
+"	ldxa	[%%g2] %1, %%g1\n"
+"	stxa	%%g0, [%%g0] %0\n"
+"	membar	#Sync\n"
+	: /* no outputs */
 	: "i" (ASI_INTR_RECEIVE), "i" (ASI_INTR_R)
 	: "g1", "g2");
 }
diff -urN linux-2.4.4-pre7/arch/sparc64/kernel/pci_sabre.c linux/arch/sparc64/kernel/pci_sabre.c
--- linux-2.4.4-pre7/arch/sparc64/kernel/pci_sabre.c	Mon Dec  3 22:37:21 2001
+++ linux/arch/sparc64/kernel/pci_sabre.c	Mon Dec  3 22:37:51 2001
@@ -1,4 +1,4 @@
-/* $Id: pci_sabre.c,v 1.26 2001/04/17 01:19:23 davem Exp $
+/* $Id: pci_sabre.c,v 1.27 2001/04/24 05:14:12 davem Exp $
  * pci_sabre.c: Sabre specific PCI controller support.
  *
  * Copyright (C) 1997, 1998, 1999 David S. Miller (davem@caipfs.rutgers.edu)
@@ -215,6 +215,8 @@
 	 ((unsigned long)(DEVFN) << 8)  |	\
 	 ((unsigned long)(REG)))
 
+static int apb_present;
+
 static void *sabre_pci_config_mkaddr(struct pci_pbm_info *pbm,
 				     unsigned char bus,
 				     unsigned int devfn,
@@ -229,6 +231,9 @@
 
 static int sabre_out_of_range(unsigned char devfn)
 {
+	if (!apb_present)
+		return 0;
+
 	return (((PCI_SLOT(devfn) == 0) && (PCI_FUNC(devfn) > 0)) ||
 		((PCI_SLOT(devfn) == 1) && (PCI_FUNC(devfn) > 1)) ||
 		(PCI_SLOT(devfn) > 1));
@@ -238,6 +243,9 @@
 				unsigned char bus,
 				unsigned char devfn)
 {
+	if (!apb_present)
+		return 0;
+
 	return ((pbm->parent == 0) ||
 		((pbm == &pbm->parent->pbm_B) &&
 		 (bus == pbm->pci_first_busno) &&
@@ -1108,7 +1116,9 @@
 {
 	static int once = 0;
 	struct pci_bus *sabre_bus;
+	struct pci_pbm_info *pbm;
 	struct list_head *walk;
+	int sabres_scanned;
 
 	/* The APB bridge speaks to the Sabre host PCI bridge
 	 * at 66Mhz, but the front side of APB runs at 33Mhz
@@ -1138,10 +1148,11 @@
 				 &p->pbm_A);
 	apb_init(p, sabre_bus);
 
+	sabres_scanned = 0;
+
 	walk = &sabre_bus->children;
 	for (walk = walk->next; walk != &sabre_bus->children; walk = walk->next) {
 		struct pci_bus *pbus = pci_bus_b(walk);
-		struct pci_pbm_info *pbm;
 
 		if (pbus->number == p->pbm_A.pci_first_busno) {
 			pbm = &p->pbm_A;
@@ -1150,6 +1161,8 @@
 		} else
 			continue;
 
+		sabres_scanned++;
+
 		pbus->sysdata = pbm;
 		pbm->pci_bus = pbus;
 		pci_fill_in_pbm_cookies(pbus, pbm, pbm->prom_node);
@@ -1160,6 +1173,19 @@
 		pci_setup_busmastering(pbm, pbus);
 	}
 
+	if (!sabres_scanned) {
+		/* Hummingbird, no APBs. */
+		pbm = &p->pbm_A;
+		sabre_bus->sysdata = pbm;
+		pbm->pci_bus = sabre_bus;
+		pci_fill_in_pbm_cookies(sabre_bus, pbm, pbm->prom_node);
+		pci_record_assignments(pbm, sabre_bus);
+		pci_assign_unassigned(pbm, sabre_bus);
+		pci_fixup_irq(pbm, sabre_bus);
+		pci_determine_66mhz_disposition(pbm, sabre_bus);
+		pci_setup_busmastering(pbm, sabre_bus);
+	}
+
 	sabre_register_error_handlers(p);
 }
 
@@ -1302,15 +1328,16 @@
 	}
 }
 
-static void __init sabre_pbm_init(struct pci_controller_info *p, int sabre_node)
+static void __init sabre_pbm_init(struct pci_controller_info *p, int sabre_node, u32 dma_begin)
 {
+	struct pci_pbm_info *pbm;
 	char namebuf[128];
 	u32 busrange[2];
-	int node;
+	int node, simbas_found;
 
+	simbas_found = 0;
 	node = prom_getchild(sabre_node);
 	while ((node = prom_searchsiblings(node, "pci")) != 0) {
-		struct pci_pbm_info *pbm;
 		int err;
 
 		err = prom_getproperty(node, "model", namebuf, sizeof(namebuf));
@@ -1324,6 +1351,7 @@
 			prom_halt();
 		}
 
+		simbas_found++;
 		if (busrange[0] == 1)
 			pbm = &p->pbm_B;
 		else
@@ -1372,6 +1400,70 @@
 		if (!node)
 			break;
 	}
+	if (simbas_found == 0) {
+		int err;
+
+		/* No APBs underneath, probably this is a hummingbird
+		 * system.
+		 */
+		pbm = &p->pbm_A;
+		pbm->parent = p;
+		pbm->prom_node = sabre_node;
+		pbm->pci_first_busno = p->pci_first_busno;
+		pbm->pci_last_busno = p->pci_last_busno;
+		for (err = pbm->pci_first_busno;
+		     err <= pbm->pci_last_busno;
+		     err++)
+			pci_bus2pbm[err] = pbm;
+
+		prom_getstring(sabre_node, "name", pbm->prom_name, sizeof(pbm->prom_name));
+		err = prom_getproperty(sabre_node, "ranges",
+				       (char *) pbm->pbm_ranges,
+				       sizeof(pbm->pbm_ranges));
+		if (err != -1)
+			pbm->num_pbm_ranges =
+				(err / sizeof(struct linux_prom_pci_ranges));
+		else
+			pbm->num_pbm_ranges = 0;
+
+		err = prom_getproperty(sabre_node, "interrupt-map",
+				       (char *) pbm->pbm_intmap,
+				       sizeof(pbm->pbm_intmap));
+
+		if (err != -1) {
+			pbm->num_pbm_intmap = (err / sizeof(struct linux_prom_pci_intmap));
+			err = prom_getproperty(sabre_node, "interrupt-map-mask",
+					       (char *)&pbm->pbm_intmask,
+					       sizeof(pbm->pbm_intmask));
+			if (err == -1) {
+				prom_printf("Hummingbird: Fatal error, no interrupt-map-mask.\n");
+				prom_halt();
+			}
+		} else {
+			pbm->num_pbm_intmap = 0;
+			memset(&pbm->pbm_intmask, 0, sizeof(pbm->pbm_intmask));
+		}
+
+		/* Hack up top-level resources. */
+		pbm->io_space.start = p->controller_regs + SABRE_IOSPACE;
+		pbm->io_space.end   = pbm->io_space.start + (1UL << 16) - 1UL;
+		pbm->io_space.flags = IORESOURCE_IO;
+
+		pbm->mem_space.start = p->controller_regs + SABRE_MEMSPACE;
+		pbm->mem_space.end   = pbm->mem_space.start + (unsigned long)dma_begin - 1UL;
+		pbm->mem_space.flags = IORESOURCE_MEM;
+
+		if (request_resource(&ioport_resource, &pbm->io_space) < 0) {
+			prom_printf("Cannot register Hummingbird's IO space.\n");
+			prom_halt();
+		}
+		if (request_resource(&iomem_resource, &pbm->mem_space) < 0) {
+			prom_printf("Cannot register Hummingbird's MEM space.\n");
+			prom_halt();
+		}
+	} else {
+		apb_present = 1;
+	}
 }
 
 void __init sabre_init(int pnode)
@@ -1499,5 +1591,5 @@
 	/*
 	 * Look for APB underneath.
 	 */
-	sabre_pbm_init(p, pnode);
+	sabre_pbm_init(p, pnode, vdma[0]);
 }
diff -urN linux-2.4.4-pre7/arch/sparc64/kernel/setup.c linux/arch/sparc64/kernel/setup.c
--- linux-2.4.4-pre7/arch/sparc64/kernel/setup.c	Sun Mar 25 18:14:21 2001
+++ linux/arch/sparc64/kernel/setup.c	Mon Dec  3 22:37:51 2001
@@ -1,4 +1,4 @@
-/*  $Id: setup.c,v 1.63 2001/03/09 22:04:25 davem Exp $
+/*  $Id: setup.c,v 1.64 2001/04/24 21:10:05 davem Exp $
  *  linux/arch/sparc64/kernel/setup.c
  *
  *  Copyright (C) 1995,1996  David S. Miller (davem@caip.rutgers.edu)
@@ -578,6 +578,10 @@
 extern int smp_bogo(char *);
 extern int mmu_info(char *);
 
+#ifndef CONFIG_SMP
+unsigned long up_clock_tick;
+#endif
+
 int get_cpuinfo(char *buffer)
 {
 	int cpuid=smp_processor_id();
@@ -592,7 +596,8 @@
 	    "ncpus probed\t: %d\n"
 	    "ncpus active\t: %d\n"
 #ifndef CONFIG_SMP
-            "BogoMips\t: %lu.%02lu\n"
+            "Cpu0Bogo\t: %lu.%02lu\n"
+	    "Cpu0ClkTck\t: %016lx\n"
 #endif
 	    ,
             sparc_cpu_type[cpuid],
@@ -600,7 +605,8 @@
             prom_rev, prom_prev >> 16, (prom_prev >> 8) & 0xff, prom_prev & 0xff,
 	    linux_num_cpus, smp_num_cpus
 #ifndef CONFIG_SMP
-            , loops_per_jiffy/(500000/HZ), (loops_per_jiffy/(5000/HZ)) % 100
+	    , loops_per_jiffy/(500000/HZ), (loops_per_jiffy/(5000/HZ)) % 100,
+	    up_clock_tick
 #endif
 	    );
 #ifdef CONFIG_SMP
diff -urN linux-2.4.4-pre7/arch/sparc64/kernel/signal32.c linux/arch/sparc64/kernel/signal32.c
--- linux-2.4.4-pre7/arch/sparc64/kernel/signal32.c	Sun Mar 25 18:14:21 2001
+++ linux/arch/sparc64/kernel/signal32.c	Mon Dec  3 22:37:51 2001
@@ -1,4 +1,4 @@
-/*  $Id: signal32.c,v 1.69 2001/03/21 11:46:20 davem Exp $
+/*  $Id: signal32.c,v 1.70 2001/04/24 01:09:12 davem Exp $
  *  arch/sparc64/kernel/signal32.c
  *
  *  Copyright (C) 1991, 1992  Linus Torvalds
@@ -786,9 +786,9 @@
 		if(pte_present(*ptep)) {
 			unsigned long page = (unsigned long) page_address(pte_page(*ptep));
 
-			__asm__ __volatile__("
-			membar	#StoreStore
-			flush	%0 + %1"
+			__asm__ __volatile__(
+			"	membar	#StoreStore\n"
+			"	flush	%0 + %1"
 			: : "r" (page), "r" (address & (PAGE_SIZE - 1))
 			: "memory");
 		}
@@ -1235,9 +1235,9 @@
 		if(pte_present(*ptep)) {
 			unsigned long page = (unsigned long) page_address(pte_page(*ptep));
 
-			__asm__ __volatile__("
-			membar	#StoreStore
-			flush	%0 + %1"
+			__asm__ __volatile__(
+			"	membar	#StoreStore\n"
+			"	flush	%0 + %1"
 			: : "r" (page), "r" (address & (PAGE_SIZE - 1))
 			: "memory");
 		}
diff -urN linux-2.4.4-pre7/arch/sparc64/kernel/smp.c linux/arch/sparc64/kernel/smp.c
--- linux-2.4.4-pre7/arch/sparc64/kernel/smp.c	Mon Dec  3 22:37:21 2001
+++ linux/arch/sparc64/kernel/smp.c	Mon Dec  3 22:37:51 2001
@@ -78,19 +78,28 @@
 	for (i = 0; i < NR_CPUS; i++)
 		if (cpu_present_map & (1UL << i))
 			len += sprintf(buf + len,
-				       "Cpu%dBogo\t: %lu.%02lu\n",
+				       "Cpu%dBogo\t: %lu.%02lu\n"
+				       "Cpu%dClkTck\t: %016lx\n",
 				       i, cpu_data[i].udelay_val / (500000/HZ),
-				       (cpu_data[i].udelay_val / (5000/HZ)) % 100);
+				       (cpu_data[i].udelay_val / (5000/HZ)) % 100,
+				       i, cpu_data[i].clock_tick);
 	return len;
 }
 
 void __init smp_store_cpu_info(int id)
 {
-	int i;
+	int i, no;
 
 	/* multiplier and counter set by
 	   smp_setup_percpu_timer()  */
 	cpu_data[id].udelay_val			= loops_per_jiffy;
+
+	for (no = 0; no < linux_num_cpus; no++)
+		if (linux_cpus[no].mid == id)
+			break;
+
+	cpu_data[id].clock_tick = prom_getintdefault(linux_cpus[no].prom_node,
+						     "clock-frequency", 0);
 
 	cpu_data[id].pgcache_size		= 0;
 	cpu_data[id].pte_cache[0]		= NULL;
diff -urN linux-2.4.4-pre7/arch/sparc64/kernel/sys_sunos32.c linux/arch/sparc64/kernel/sys_sunos32.c
--- linux-2.4.4-pre7/arch/sparc64/kernel/sys_sunos32.c	Sun Mar 25 18:14:21 2001
+++ linux/arch/sparc64/kernel/sys_sunos32.c	Mon Dec  3 22:37:51 2001
@@ -584,8 +584,6 @@
 	char       *netname;   /* server's netname */
 };
 
-extern dev_t get_unnamed_dev(void);
-extern void put_unnamed_dev(dev_t);
 extern asmlinkage int sys_mount(char *, char *, char *, unsigned long, void *);
 extern asmlinkage int sys_connect(int fd, struct sockaddr *uservaddr, int addrlen);
 extern asmlinkage int sys_socket(int family, int type, int protocol);
@@ -717,7 +715,7 @@
 asmlinkage int
 sunos_mount(char *type, char *dir, int flags, void *data)
 {
-	int linux_flags = MS_MGC_MSK; /* new semantics */
+	int linux_flags = 0;
 	int ret = -EINVAL;
 	char *dev_fname = 0;
 	char *dir_page, *type_page;
diff -urN linux-2.4.4-pre7/arch/sparc64/kernel/time.c linux/arch/sparc64/kernel/time.c
--- linux-2.4.4-pre7/arch/sparc64/kernel/time.c	Sun Mar 25 18:14:21 2001
+++ linux/arch/sparc64/kernel/time.c	Mon Dec  3 22:37:51 2001
@@ -1,4 +1,4 @@
-/* $Id: time.c,v 1.36 2001/03/15 08:51:24 anton Exp $
+/* $Id: time.c,v 1.37 2001/04/24 01:09:12 davem Exp $
  * time.c: UltraSparc timer and TOD clock support.
  *
  * Copyright (C) 1997 David S. Miller (davem@caip.rutgers.edu)
@@ -145,23 +145,23 @@
 		 * taking any chances.
 		 */
 		if (!SPARC64_USE_STICK) {
-		__asm__ __volatile__("
-			rd	%%tick_cmpr, %0
-			ba,pt	%%xcc, 1f
-			 add	%0, %2, %0
-			.align	64
-		     1: wr	%0, 0, %%tick_cmpr
-		        rd	%%tick_cmpr, %%g0
-			rd	%%tick, %1
-			mov	%1, %1"
+		__asm__ __volatile__(
+		"	rd	%%tick_cmpr, %0\n"
+		"	ba,pt	%%xcc, 1f\n"
+		"	 add	%0, %2, %0\n"
+		"	.align	64\n"
+		"1: 	wr	%0, 0, %%tick_cmpr\n"
+		"	rd	%%tick_cmpr, %%g0\n"
+		"	rd	%%tick, %1\n"
+		"	mov	%1, %1"
 			: "=&r" (timer_tick_compare), "=r" (ticks)
 			: "r" (timer_tick_offset));
 		} else {
-		__asm__ __volatile__("
-			rd	%%asr25, %0
-			add	%0, %2, %0
-			wr	%0, 0, %%asr25
-			rd	%%asr24, %1"
+		__asm__ __volatile__(
+		"	rd	%%asr25, %0\n"
+		"	add	%0, %2, %0\n"
+		"	wr	%0, 0, %%asr25\n"
+		"	rd	%%asr24, %1"
 			: "=&r" (timer_tick_compare), "=r" (ticks)
 			: "r" (timer_tick_offset));
 		}
@@ -188,15 +188,15 @@
 	 * Only keep timer_tick_offset uptodate, but don't set TICK_CMPR.
 	 */
 	if (!SPARC64_USE_STICK) {
-	__asm__ __volatile__("
-		rd	%%tick_cmpr, %0
-		add	%0, %1, %0"
+	__asm__ __volatile__(
+	"	rd	%%tick_cmpr, %0\n"
+	"	add	%0, %1, %0"
 		: "=&r" (timer_tick_compare)
 		: "r" (timer_tick_offset));
 	} else {
-	__asm__ __volatile__("
-		rd	%%asr25, %0
-		add	%0, %1, %0"
+	__asm__ __volatile__(
+	"	rd	%%asr25, %0\n"
+	"	add	%0, %1, %0"
 		: "=&r" (timer_tick_compare)
 		: "r" (timer_tick_offset));
 	}
@@ -578,11 +578,10 @@
 	unsigned long ticks;
 
 	if (!SPARC64_USE_STICK) {
-	__asm__ __volatile__("
-		rd	%%tick, %%g1
-		add	%1, %%g1, %0
-		sub	%0, %2, %0
-"
+	__asm__ __volatile__(
+	"	rd	%%tick, %%g1\n"
+	"	add	%1, %%g1, %0\n"
+	"	sub	%0, %2, %0\n"
 		: "=r" (ticks)
 		: "r" (timer_tick_offset), "r" (timer_tick_compare)
 		: "g1", "g2");
diff -urN linux-2.4.4-pre7/arch/sparc64/lib/debuglocks.c linux/arch/sparc64/lib/debuglocks.c
--- linux-2.4.4-pre7/arch/sparc64/lib/debuglocks.c	Mon May 22 09:50:54 2000
+++ linux/arch/sparc64/lib/debuglocks.c	Mon Dec  3 22:37:51 2001
@@ -1,4 +1,4 @@
-/* $Id: debuglocks.c,v 1.5 2000/05/09 17:40:14 davem Exp $
+/* $Id: debuglocks.c,v 1.6 2001/04/24 01:09:12 davem Exp $
  * debuglocks.c: Debugging versions of SMP locking primitives.
  *
  * Copyright (C) 1998 David S. Miller (davem@redhat.com)
@@ -123,14 +123,14 @@
 		membar("#LoadLoad");
 	}
 	/* Try once to increment the counter.  */
-	__asm__ __volatile__("
-	ldx		[%0], %%g5
-	brlz,a,pn	%%g5, 2f
-	 mov		1, %0
-	add		%%g5, 1, %%g7
-	casx		[%0], %%g5, %%g7
-	sub		%%g5, %%g7, %0
-2:"	: "=r" (val)
+	__asm__ __volatile__(
+"	ldx		[%0], %%g5\n"
+"	brlz,a,pn	%%g5, 2f\n"
+"	 mov		1, %0\n"
+"	add		%%g5, 1, %%g7\n"
+"	casx		[%0], %%g5, %%g7\n"
+"	sub		%%g5, %%g7, %0\n"
+"2:"	: "=r" (val)
 	: "0" (&(rw->lock))
 	: "g5", "g7", "memory");
 	membar("#StoreLoad | #StoreStore");
@@ -151,13 +151,13 @@
 	rw->reader_pc[cpu] = 0;
 runlock_again:
 	/* Spin trying to decrement the counter using casx.  */
-	__asm__ __volatile__("
-	ldx	[%0], %%g5
-	sub	%%g5, 1, %%g7
-	casx	[%0], %%g5, %%g7
-	membar	#StoreLoad | #StoreStore
-	sub	%%g5, %%g7, %0
-"	: "=r" (val)
+	__asm__ __volatile__(
+"	ldx	[%0], %%g5\n"
+"	sub	%%g5, 1, %%g7\n"
+"	casx	[%0], %%g5, %%g7\n"
+"	membar	#StoreLoad | #StoreStore\n"
+"	sub	%%g5, %%g7, %0\n"
+	: "=r" (val)
 	: "0" (&(rw->lock))
 	: "g5", "g7", "memory");
 	if (val) {
@@ -187,18 +187,18 @@
 	}
 
 	/* Try to acuire the write bit.  */
-	__asm__ __volatile__("
-	mov	1, %%g3
-	sllx	%%g3, 63, %%g3
-	ldx	[%0], %%g5
-	brlz,pn	%%g5, 1f
-	 or	%%g5, %%g3, %%g7
-	casx	[%0], %%g5, %%g7
-	membar	#StoreLoad | #StoreStore
-	ba,pt	%%xcc, 2f
-	 sub	%%g5, %%g7, %0
-1:	mov	1, %0
-2:"	: "=r" (val)
+	__asm__ __volatile__(
+"	mov	1, %%g3\n"
+"	sllx	%%g3, 63, %%g3\n"
+"	ldx	[%0], %%g5\n"
+"	brlz,pn	%%g5, 1f\n"
+"	 or	%%g5, %%g3, %%g7\n"
+"	casx	[%0], %%g5, %%g7\n"
+"	membar	#StoreLoad | #StoreStore\n"
+"	ba,pt	%%xcc, 2f\n"
+"	 sub	%%g5, %%g7, %0\n"
+"1:	mov	1, %0\n"
+"2:"	: "=r" (val)
 	: "0" (&(rw->lock))
 	: "g3", "g5", "g7", "memory");
 	if (val) {
@@ -217,15 +217,15 @@
 			show_write(str, rw, caller);
 			stuck = INIT_STUCK;
 		}
-		__asm__ __volatile__("
-		mov	1, %%g3
-		sllx	%%g3, 63, %%g3
-1:		ldx	[%0], %%g5
-		andn	%%g5, %%g3, %%g7
-		casx	[%0], %%g5, %%g7
-		cmp	%%g5, %%g7
-		bne,pn	%%xcc, 1b
-		 membar	#StoreLoad | #StoreStore"
+		__asm__ __volatile__(
+"		mov	1, %%g3\n"
+"		sllx	%%g3, 63, %%g3\n"
+"1:		ldx	[%0], %%g5\n"
+"		andn	%%g5, %%g3, %%g7\n"
+"		casx	[%0], %%g5, %%g7\n"
+"		cmp	%%g5, %%g7\n"
+"		bne,pn	%%xcc, 1b\n"
+"		 membar	#StoreLoad | #StoreStore"
 		: /* no outputs */
 		: "r" (&(rw->lock))
 		: "g3", "g5", "g7", "cc", "memory");
@@ -255,15 +255,15 @@
 	rw->writer_pc = 0;
 	rw->writer_cpu = NO_PROC_ID;
 wlock_again:
-	__asm__ __volatile__("
-	mov	1, %%g3
-	sllx	%%g3, 63, %%g3
-	ldx	[%0], %%g5
-	andn	%%g5, %%g3, %%g7
-	casx	[%0], %%g5, %%g7
-	membar	#StoreLoad | #StoreStore
-	sub	%%g5, %%g7, %0
-"	: "=r" (val)
+	__asm__ __volatile__(
+"	mov	1, %%g3\n"
+"	sllx	%%g3, 63, %%g3\n"
+"	ldx	[%0], %%g5\n"
+"	andn	%%g5, %%g3, %%g7\n"
+"	casx	[%0], %%g5, %%g7\n"
+"	membar	#StoreLoad | #StoreStore\n"
+"	sub	%%g5, %%g7, %0\n"
+	: "=r" (val)
 	: "0" (&(rw->lock))
 	: "g3", "g5", "g7", "memory");
 	if (val) {
diff -urN linux-2.4.4-pre7/arch/sparc64/mm/init.c linux/arch/sparc64/mm/init.c
--- linux-2.4.4-pre7/arch/sparc64/mm/init.c	Mon Dec  3 22:37:21 2001
+++ linux/arch/sparc64/mm/init.c	Mon Dec  3 22:37:51 2001
@@ -1,4 +1,4 @@
-/*  $Id: init.c,v 1.174 2001/03/30 07:10:42 davem Exp $
+/*  $Id: init.c,v 1.175 2001/04/24 01:09:12 davem Exp $
  *  arch/sparc64/mm/init.c
  *
  *  Copyright (C) 1996-1999 David S. Miller (davem@caip.rutgers.edu)
@@ -1149,56 +1149,56 @@
 	pt |= _PAGE_CP | _PAGE_CV | _PAGE_P | _PAGE_L | _PAGE_W;
 	__save_and_cli(flags);
 	if (tlb_type == spitfire) {
-		__asm__ __volatile__("
-		stxa	%1, [%0] %3
-		stxa	%2, [%5] %4
-		membar	#Sync
-		flush	%%g6
-		nop
-		nop
-		nop"
+		__asm__ __volatile__(
+	"	stxa	%1, [%0] %3\n"
+	"	stxa	%2, [%5] %4\n"
+	"	membar	#Sync\n"
+	"	flush	%%g6\n"
+	"	nop\n"
+	"	nop\n"
+	"	nop\n"
 		: /* No outputs */
 		: "r" (TLB_TAG_ACCESS), "r" (alias_base), "r" (pt),
 		  "i" (ASI_DMMU), "i" (ASI_DTLB_DATA_ACCESS), "r" (61 << 3)
 		: "memory");
 		if (((unsigned long)&_end) >= KERNBASE + 0x340000) {
 			second_alias_page = alias_base + 0x400000;
-			__asm__ __volatile__("
-			stxa	%1, [%0] %3
-			stxa	%2, [%5] %4
-			membar	#Sync
-			flush	%%g6
-			nop
-			nop
-			nop"
+			__asm__ __volatile__(
+		"	stxa	%1, [%0] %3\n"
+		"	stxa	%2, [%5] %4\n"
+		"	membar	#Sync\n"
+		"	flush	%%g6\n"
+		"	nop\n"
+		"	nop\n"
+		"	nop\n"
 			: /* No outputs */
 			: "r" (TLB_TAG_ACCESS), "r" (second_alias_page), "r" (pt + 0x400000),
 			  "i" (ASI_DMMU), "i" (ASI_DTLB_DATA_ACCESS), "r" (60 << 3)
 			: "memory");
 		}
 	} else if (tlb_type == cheetah) {
-		__asm__ __volatile__("
-		stxa	%1, [%0] %3
-		stxa	%2, [%5] %4
-		membar	#Sync
-		flush	%%g6
-		nop
-		nop
-		nop"
+		__asm__ __volatile__(
+	"	stxa	%1, [%0] %3\n"
+	"	stxa	%2, [%5] %4\n"
+	"	membar	#Sync\n"
+	"	flush	%%g6\n"
+	"	nop\n"
+	"	nop\n"
+	"	nop\n"
 		: /* No outputs */
 		: "r" (TLB_TAG_ACCESS), "r" (alias_base), "r" (pt),
 		  "i" (ASI_DMMU), "i" (ASI_DTLB_DATA_ACCESS), "r" ((0<<16) | (13<<3))
 		: "memory");
 		if (((unsigned long)&_end) >= KERNBASE + 0x340000) {
 			second_alias_page = alias_base + 0x400000;
-			__asm__ __volatile__("
-			stxa	%1, [%0] %3
-			stxa	%2, [%5] %4
-			membar	#Sync
-			flush	%%g6
-			nop
-			nop
-			nop"
+			__asm__ __volatile__(
+		"	stxa	%1, [%0] %3\n"
+		"	stxa	%2, [%5] %4\n"
+		"	membar	#Sync\n"
+		"	flush	%%g6\n"
+		"	nop\n"
+		"	nop\n"
+		"	nop\n"
 			: /* No outputs */
 			: "r" (TLB_TAG_ACCESS), "r" (second_alias_page), "r" (pt + 0x400000),
 			  "i" (ASI_DMMU), "i" (ASI_DTLB_DATA_ACCESS), "r" ((0<<16) | (12<<3))
diff -urN linux-2.4.4-pre7/arch/sparc64/prom/p1275.c linux/arch/sparc64/prom/p1275.c
--- linux-2.4.4-pre7/arch/sparc64/prom/p1275.c	Mon Dec 20 22:05:52 1999
+++ linux/arch/sparc64/prom/p1275.c	Mon Dec  3 22:37:51 2001
@@ -1,4 +1,4 @@
-/* $Id: p1275.c,v 1.20 1999/11/23 23:47:56 davem Exp $
+/* $Id: p1275.c,v 1.21 2001/04/24 01:09:12 davem Exp $
  * p1275.c: Sun IEEE 1275 PROM low level interface routines
  *
  * Copyright (C) 1996,1997 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
@@ -29,222 +29,222 @@
 
 void prom_cif_interface (void)
 {
-	__asm__ __volatile__ ("
-	mov	%0, %%o0
-	ldx	[%%o0 + 0x010], %%o1	! prom_cif_stack
-	save	%%o1, -0x190, %%sp
-	ldx	[%%i0 + 0x008], %%l2	! prom_cif_handler
-	rdpr	%%pstate, %%l4
-	wrpr	%%g0, 0x15, %%pstate	! save alternate globals
-	stx	%%g1, [%%sp + 2047 + 0x0b0]
-	stx	%%g2, [%%sp + 2047 + 0x0b8]
-	stx	%%g3, [%%sp + 2047 + 0x0c0]
-	stx	%%g4, [%%sp + 2047 + 0x0c8]
-	stx	%%g5, [%%sp + 2047 + 0x0d0]
-	stx	%%g6, [%%sp + 2047 + 0x0d8]
-	stx	%%g7, [%%sp + 2047 + 0x0e0]
-	wrpr	%%g0, 0x814, %%pstate	! save interrupt globals
-	stx	%%g1, [%%sp + 2047 + 0x0e8]
-	stx	%%g2, [%%sp + 2047 + 0x0f0]
-	stx	%%g3, [%%sp + 2047 + 0x0f8]
-	stx	%%g4, [%%sp + 2047 + 0x100]
-	stx	%%g5, [%%sp + 2047 + 0x108]
-	stx	%%g6, [%%sp + 2047 + 0x110]
-	stx	%%g7, [%%sp + 2047 + 0x118]
-	wrpr	%%g0, 0x14, %%pstate	! save normal globals
-	stx	%%g1, [%%sp + 2047 + 0x120]
-	stx	%%g2, [%%sp + 2047 + 0x128]
-	stx	%%g3, [%%sp + 2047 + 0x130]
-	stx	%%g4, [%%sp + 2047 + 0x138]
-	stx	%%g5, [%%sp + 2047 + 0x140]
-	stx	%%g6, [%%sp + 2047 + 0x148]
-	stx	%%g7, [%%sp + 2047 + 0x150]
-	wrpr	%%g0, 0x414, %%pstate	! save mmu globals
-	stx	%%g1, [%%sp + 2047 + 0x158]
-	stx	%%g2, [%%sp + 2047 + 0x160]
-	stx	%%g3, [%%sp + 2047 + 0x168]
-	stx	%%g4, [%%sp + 2047 + 0x170]
-	stx	%%g5, [%%sp + 2047 + 0x178]
-	stx	%%g6, [%%sp + 2047 + 0x180]
-	stx	%%g7, [%%sp + 2047 + 0x188]
-	mov	%%g1, %%l0		! also save to locals, so we can handle
-	mov	%%g2, %%l1		! tlb faults later on, when accessing
-	mov	%%g3, %%l3		! the stack.
-	mov	%%g7, %%l5
-	wrpr	%%l4, %1, %%pstate	! turn off interrupts
-	call	%%l2
-	 add	%%i0, 0x018, %%o0	! prom_args
-	wrpr	%%g0, 0x414, %%pstate	! restore mmu globals
-	mov	%%l0, %%g1
-	mov	%%l1, %%g2
-	mov	%%l3, %%g3
-	mov	%%l5, %%g7
-	wrpr	%%g0, 0x14, %%pstate	! restore normal globals
-	ldx	[%%sp + 2047 + 0x120], %%g1
-	ldx	[%%sp + 2047 + 0x128], %%g2
-	ldx	[%%sp + 2047 + 0x130], %%g3
-	ldx	[%%sp + 2047 + 0x138], %%g4
-	ldx	[%%sp + 2047 + 0x140], %%g5
-	ldx	[%%sp + 2047 + 0x148], %%g6
-	ldx	[%%sp + 2047 + 0x150], %%g7
-	wrpr	%%g0, 0x814, %%pstate	! restore interrupt globals
-	ldx	[%%sp + 2047 + 0x0e8], %%g1
-	ldx	[%%sp + 2047 + 0x0f0], %%g2
-	ldx	[%%sp + 2047 + 0x0f8], %%g3
-	ldx	[%%sp + 2047 + 0x100], %%g4
-	ldx	[%%sp + 2047 + 0x108], %%g5
-	ldx	[%%sp + 2047 + 0x110], %%g6
-	ldx	[%%sp + 2047 + 0x118], %%g7
-	wrpr	%%g0, 0x15, %%pstate	! restore alternate globals
-	ldx	[%%sp + 2047 + 0x0b0], %%g1
-	ldx	[%%sp + 2047 + 0x0b8], %%g2
-	ldx	[%%sp + 2047 + 0x0c0], %%g3
-	ldx	[%%sp + 2047 + 0x0c8], %%g4
-	ldx	[%%sp + 2047 + 0x0d0], %%g5
-	ldx	[%%sp + 2047 + 0x0d8], %%g6
-	ldx	[%%sp + 2047 + 0x0e0], %%g7
-	wrpr	%%l4, 0, %%pstate	! restore original pstate
-	ret
-	 restore
-	" : : "r" (&p1275buf), "i" (PSTATE_IE));
+	__asm__ __volatile__ (
+"	mov	%0, %%o0\n"
+"	ldx	[%%o0 + 0x010], %%o1	! prom_cif_stack\n"
+"	save	%%o1, -0x190, %%sp\n"
+"	ldx	[%%i0 + 0x008], %%l2	! prom_cif_handler\n"
+"	rdpr	%%pstate, %%l4\n"
+"	wrpr	%%g0, 0x15, %%pstate	! save alternate globals\n"
+"	stx	%%g1, [%%sp + 2047 + 0x0b0]\n"
+"	stx	%%g2, [%%sp + 2047 + 0x0b8]\n"
+"	stx	%%g3, [%%sp + 2047 + 0x0c0]\n"
+"	stx	%%g4, [%%sp + 2047 + 0x0c8]\n"
+"	stx	%%g5, [%%sp + 2047 + 0x0d0]\n"
+"	stx	%%g6, [%%sp + 2047 + 0x0d8]\n"
+"	stx	%%g7, [%%sp + 2047 + 0x0e0]\n"
+"	wrpr	%%g0, 0x814, %%pstate	! save interrupt globals\n"
+"	stx	%%g1, [%%sp + 2047 + 0x0e8]\n"
+"	stx	%%g2, [%%sp + 2047 + 0x0f0]\n"
+"	stx	%%g3, [%%sp + 2047 + 0x0f8]\n"
+"	stx	%%g4, [%%sp + 2047 + 0x100]\n"
+"	stx	%%g5, [%%sp + 2047 + 0x108]\n"
+"	stx	%%g6, [%%sp + 2047 + 0x110]\n"
+"	stx	%%g7, [%%sp + 2047 + 0x118]\n"
+"	wrpr	%%g0, 0x14, %%pstate	! save normal globals\n"
+"	stx	%%g1, [%%sp + 2047 + 0x120]\n"
+"	stx	%%g2, [%%sp + 2047 + 0x128]\n"
+"	stx	%%g3, [%%sp + 2047 + 0x130]\n"
+"	stx	%%g4, [%%sp + 2047 + 0x138]\n"
+"	stx	%%g5, [%%sp + 2047 + 0x140]\n"
+"	stx	%%g6, [%%sp + 2047 + 0x148]\n"
+"	stx	%%g7, [%%sp + 2047 + 0x150]\n"
+"	wrpr	%%g0, 0x414, %%pstate	! save mmu globals\n"
+"	stx	%%g1, [%%sp + 2047 + 0x158]\n"
+"	stx	%%g2, [%%sp + 2047 + 0x160]\n"
+"	stx	%%g3, [%%sp + 2047 + 0x168]\n"
+"	stx	%%g4, [%%sp + 2047 + 0x170]\n"
+"	stx	%%g5, [%%sp + 2047 + 0x178]\n"
+"	stx	%%g6, [%%sp + 2047 + 0x180]\n"
+"	stx	%%g7, [%%sp + 2047 + 0x188]\n"
+"	mov	%%g1, %%l0		! also save to locals, so we can handle\n"
+"	mov	%%g2, %%l1		! tlb faults later on, when accessing\n"
+"	mov	%%g3, %%l3		! the stack.\n"
+"	mov	%%g7, %%l5\n"
+"	wrpr	%%l4, %1, %%pstate	! turn off interrupts\n"
+"	call	%%l2\n"
+"	 add	%%i0, 0x018, %%o0	! prom_args\n"
+"	wrpr	%%g0, 0x414, %%pstate	! restore mmu globals\n"
+"	mov	%%l0, %%g1\n"
+"	mov	%%l1, %%g2\n"
+"	mov	%%l3, %%g3\n"
+"	mov	%%l5, %%g7\n"
+"	wrpr	%%g0, 0x14, %%pstate	! restore normal globals\n"
+"	ldx	[%%sp + 2047 + 0x120], %%g1\n"
+"	ldx	[%%sp + 2047 + 0x128], %%g2\n"
+"	ldx	[%%sp + 2047 + 0x130], %%g3\n"
+"	ldx	[%%sp + 2047 + 0x138], %%g4\n"
+"	ldx	[%%sp + 2047 + 0x140], %%g5\n"
+"	ldx	[%%sp + 2047 + 0x148], %%g6\n"
+"	ldx	[%%sp + 2047 + 0x150], %%g7\n"
+"	wrpr	%%g0, 0x814, %%pstate	! restore interrupt globals\n"
+"	ldx	[%%sp + 2047 + 0x0e8], %%g1\n"
+"	ldx	[%%sp + 2047 + 0x0f0], %%g2\n"
+"	ldx	[%%sp + 2047 + 0x0f8], %%g3\n"
+"	ldx	[%%sp + 2047 + 0x100], %%g4\n"
+"	ldx	[%%sp + 2047 + 0x108], %%g5\n"
+"	ldx	[%%sp + 2047 + 0x110], %%g6\n"
+"	ldx	[%%sp + 2047 + 0x118], %%g7\n"
+"	wrpr	%%g0, 0x15, %%pstate	! restore alternate globals\n"
+"	ldx	[%%sp + 2047 + 0x0b0], %%g1\n"
+"	ldx	[%%sp + 2047 + 0x0b8], %%g2\n"
+"	ldx	[%%sp + 2047 + 0x0c0], %%g3\n"
+"	ldx	[%%sp + 2047 + 0x0c8], %%g4\n"
+"	ldx	[%%sp + 2047 + 0x0d0], %%g5\n"
+"	ldx	[%%sp + 2047 + 0x0d8], %%g6\n"
+"	ldx	[%%sp + 2047 + 0x0e0], %%g7\n"
+"	wrpr	%%l4, 0, %%pstate	! restore original pstate\n"
+"	ret\n"
+"	 restore\n"
+"	" : : "r" (&p1275buf), "i" (PSTATE_IE));
 }
 
 void prom_cif_callback(void)
 {
-	__asm__ __volatile__ ("
-	mov	%0, %%o1
-	save	%%sp, -0x270, %%sp
-	rdpr	%%pstate, %%l4
-	wrpr	%%g0, 0x15, %%pstate	! save PROM alternate globals
-	stx	%%g1, [%%sp + 2047 + 0x0b0]
-	stx	%%g2, [%%sp + 2047 + 0x0b8]
-	stx	%%g3, [%%sp + 2047 + 0x0c0]
-	stx	%%g4, [%%sp + 2047 + 0x0c8]
-	stx	%%g5, [%%sp + 2047 + 0x0d0]
-	stx	%%g6, [%%sp + 2047 + 0x0d8]
-	stx	%%g7, [%%sp + 2047 + 0x0e0]
-					! restore Linux alternate globals
-	ldx	[%%sp + 2047 + 0x190], %%g1
-	ldx	[%%sp + 2047 + 0x198], %%g2
-	ldx	[%%sp + 2047 + 0x1a0], %%g3
-	ldx	[%%sp + 2047 + 0x1a8], %%g4
-	ldx	[%%sp + 2047 + 0x1b0], %%g5
-	ldx	[%%sp + 2047 + 0x1b8], %%g6
-	ldx	[%%sp + 2047 + 0x1c0], %%g7
-	wrpr	%%g0, 0x814, %%pstate	! save PROM interrupt globals
-	stx	%%g1, [%%sp + 2047 + 0x0e8]
-	stx	%%g2, [%%sp + 2047 + 0x0f0]
-	stx	%%g3, [%%sp + 2047 + 0x0f8]
-	stx	%%g4, [%%sp + 2047 + 0x100]
-	stx	%%g5, [%%sp + 2047 + 0x108]
-	stx	%%g6, [%%sp + 2047 + 0x110]
-	stx	%%g7, [%%sp + 2047 + 0x118]
-					! restore Linux interrupt globals
-	ldx	[%%sp + 2047 + 0x1c8], %%g1
-	ldx	[%%sp + 2047 + 0x1d0], %%g2
-	ldx	[%%sp + 2047 + 0x1d8], %%g3
-	ldx	[%%sp + 2047 + 0x1e0], %%g4
-	ldx	[%%sp + 2047 + 0x1e8], %%g5
-	ldx	[%%sp + 2047 + 0x1f0], %%g6
-	ldx	[%%sp + 2047 + 0x1f8], %%g7
-	wrpr	%%g0, 0x14, %%pstate	! save PROM normal globals
-	stx	%%g1, [%%sp + 2047 + 0x120]
-	stx	%%g2, [%%sp + 2047 + 0x128]
-	stx	%%g3, [%%sp + 2047 + 0x130]
-	stx	%%g4, [%%sp + 2047 + 0x138]
-	stx	%%g5, [%%sp + 2047 + 0x140]
-	stx	%%g6, [%%sp + 2047 + 0x148]
-	stx	%%g7, [%%sp + 2047 + 0x150]
-					! restore Linux normal globals
-	ldx	[%%sp + 2047 + 0x200], %%g1
-	ldx	[%%sp + 2047 + 0x208], %%g2
-	ldx	[%%sp + 2047 + 0x210], %%g3
-	ldx	[%%sp + 2047 + 0x218], %%g4
-	ldx	[%%sp + 2047 + 0x220], %%g5
-	ldx	[%%sp + 2047 + 0x228], %%g6
-	ldx	[%%sp + 2047 + 0x230], %%g7
-	wrpr	%%g0, 0x414, %%pstate	! save PROM mmu globals
-	stx	%%g1, [%%sp + 2047 + 0x158]
-	stx	%%g2, [%%sp + 2047 + 0x160]
-	stx	%%g3, [%%sp + 2047 + 0x168]
-	stx	%%g4, [%%sp + 2047 + 0x170]
-	stx	%%g5, [%%sp + 2047 + 0x178]
-	stx	%%g6, [%%sp + 2047 + 0x180]
-	stx	%%g7, [%%sp + 2047 + 0x188]
-					! restore Linux mmu globals
-	ldx	[%%sp + 2047 + 0x238], %%o0
-	ldx	[%%sp + 2047 + 0x240], %%o1
-	ldx	[%%sp + 2047 + 0x248], %%l2
-	ldx	[%%sp + 2047 + 0x250], %%l3
-	ldx	[%%sp + 2047 + 0x258], %%l5
-	ldx	[%%sp + 2047 + 0x260], %%l6
-	ldx	[%%sp + 2047 + 0x268], %%l7
-					! switch to Linux tba
-	sethi	%%hi(sparc64_ttable_tl0), %%l1
-	rdpr	%%tba, %%l0		! save PROM tba
-	mov	%%o0, %%g1
-	mov	%%o1, %%g2
-	mov	%%l2, %%g3
-	mov	%%l3, %%g4
-	mov	%%l5, %%g5
-	mov	%%l6, %%g6
-	mov	%%l7, %%g7
-	wrpr	%%l1, %%tba		! install Linux tba
-	wrpr	%%l4, 0, %%pstate	! restore PSTATE
-	call	prom_world
-	 mov	%%g0, %%o0
-	ldx	[%%i1 + 0x000], %%l2
-	call	%%l2
-	 mov	%%i0, %%o0
-	mov	%%o0, %%l1
-	call	prom_world
-	 or	%%g0, 1, %%o0
-	wrpr	%%g0, 0x14, %%pstate	! interrupts off
-					! restore PROM mmu globals
-	ldx	[%%sp + 2047 + 0x158], %%o0
-	ldx	[%%sp + 2047 + 0x160], %%o1
-	ldx	[%%sp + 2047 + 0x168], %%l2
-	ldx	[%%sp + 2047 + 0x170], %%l3
-	ldx	[%%sp + 2047 + 0x178], %%l5
-	ldx	[%%sp + 2047 + 0x180], %%l6
-	ldx	[%%sp + 2047 + 0x188], %%l7
-	wrpr	%%g0, 0x414, %%pstate	! restore PROM mmu globals
-	mov	%%o0, %%g1
-	mov	%%o1, %%g2
-	mov	%%l2, %%g3
-	mov	%%l3, %%g4
-	mov	%%l5, %%g5
-	mov	%%l6, %%g6
-	mov	%%l7, %%g7
-	wrpr	%%l0, %%tba		! restore PROM tba
-	wrpr	%%g0, 0x14, %%pstate	! restore PROM normal globals
-	ldx	[%%sp + 2047 + 0x120], %%g1
-	ldx	[%%sp + 2047 + 0x128], %%g2
-	ldx	[%%sp + 2047 + 0x130], %%g3
-	ldx	[%%sp + 2047 + 0x138], %%g4
-	ldx	[%%sp + 2047 + 0x140], %%g5
-	ldx	[%%sp + 2047 + 0x148], %%g6
-	ldx	[%%sp + 2047 + 0x150], %%g7
-	wrpr	%%g0, 0x814, %%pstate	! restore PROM interrupt globals
-	ldx	[%%sp + 2047 + 0x0e8], %%g1
-	ldx	[%%sp + 2047 + 0x0f0], %%g2
-	ldx	[%%sp + 2047 + 0x0f8], %%g3
-	ldx	[%%sp + 2047 + 0x100], %%g4
-	ldx	[%%sp + 2047 + 0x108], %%g5
-	ldx	[%%sp + 2047 + 0x110], %%g6
-	ldx	[%%sp + 2047 + 0x118], %%g7
-	wrpr	%%g0, 0x15, %%pstate	! restore PROM alternate globals
-	ldx	[%%sp + 2047 + 0x0b0], %%g1
-	ldx	[%%sp + 2047 + 0x0b8], %%g2
-	ldx	[%%sp + 2047 + 0x0c0], %%g3
-	ldx	[%%sp + 2047 + 0x0c8], %%g4
-	ldx	[%%sp + 2047 + 0x0d0], %%g5
-	ldx	[%%sp + 2047 + 0x0d8], %%g6
-	ldx	[%%sp + 2047 + 0x0e0], %%g7
-	wrpr	%%l4, 0, %%pstate
-	ret
-	 restore %%l1, 0, %%o0
-	" : : "r" (&p1275buf), "i" (PSTATE_PRIV));
+	__asm__ __volatile__ (
+"	mov	%0, %%o1\n"
+"	save	%%sp, -0x270, %%sp\n"
+"	rdpr	%%pstate, %%l4\n"
+"	wrpr	%%g0, 0x15, %%pstate	! save PROM alternate globals\n"
+"	stx	%%g1, [%%sp + 2047 + 0x0b0]\n"
+"	stx	%%g2, [%%sp + 2047 + 0x0b8]\n"
+"	stx	%%g3, [%%sp + 2047 + 0x0c0]\n"
+"	stx	%%g4, [%%sp + 2047 + 0x0c8]\n"
+"	stx	%%g5, [%%sp + 2047 + 0x0d0]\n"
+"	stx	%%g6, [%%sp + 2047 + 0x0d8]\n"
+"	stx	%%g7, [%%sp + 2047 + 0x0e0]\n"
+"					! restore Linux alternate globals\n"
+"	ldx	[%%sp + 2047 + 0x190], %%g1\n"
+"	ldx	[%%sp + 2047 + 0x198], %%g2\n"
+"	ldx	[%%sp + 2047 + 0x1a0], %%g3\n"
+"	ldx	[%%sp + 2047 + 0x1a8], %%g4\n"
+"	ldx	[%%sp + 2047 + 0x1b0], %%g5\n"
+"	ldx	[%%sp + 2047 + 0x1b8], %%g6\n"
+"	ldx	[%%sp + 2047 + 0x1c0], %%g7\n"
+"	wrpr	%%g0, 0x814, %%pstate	! save PROM interrupt globals\n"
+"	stx	%%g1, [%%sp + 2047 + 0x0e8]\n"
+"	stx	%%g2, [%%sp + 2047 + 0x0f0]\n"
+"	stx	%%g3, [%%sp + 2047 + 0x0f8]\n"
+"	stx	%%g4, [%%sp + 2047 + 0x100]\n"
+"	stx	%%g5, [%%sp + 2047 + 0x108]\n"
+"	stx	%%g6, [%%sp + 2047 + 0x110]\n"
+"	stx	%%g7, [%%sp + 2047 + 0x118]\n"
+"					! restore Linux interrupt globals\n"
+"	ldx	[%%sp + 2047 + 0x1c8], %%g1\n"
+"	ldx	[%%sp + 2047 + 0x1d0], %%g2\n"
+"	ldx	[%%sp + 2047 + 0x1d8], %%g3\n"
+"	ldx	[%%sp + 2047 + 0x1e0], %%g4\n"
+"	ldx	[%%sp + 2047 + 0x1e8], %%g5\n"
+"	ldx	[%%sp + 2047 + 0x1f0], %%g6\n"
+"	ldx	[%%sp + 2047 + 0x1f8], %%g7\n"
+"	wrpr	%%g0, 0x14, %%pstate	! save PROM normal globals\n"
+"	stx	%%g1, [%%sp + 2047 + 0x120]\n"
+"	stx	%%g2, [%%sp + 2047 + 0x128]\n"
+"	stx	%%g3, [%%sp + 2047 + 0x130]\n"
+"	stx	%%g4, [%%sp + 2047 + 0x138]\n"
+"	stx	%%g5, [%%sp + 2047 + 0x140]\n"
+"	stx	%%g6, [%%sp + 2047 + 0x148]\n"
+"	stx	%%g7, [%%sp + 2047 + 0x150]\n"
+"					! restore Linux normal globals\n"
+"	ldx	[%%sp + 2047 + 0x200], %%g1\n"
+"	ldx	[%%sp + 2047 + 0x208], %%g2\n"
+"	ldx	[%%sp + 2047 + 0x210], %%g3\n"
+"	ldx	[%%sp + 2047 + 0x218], %%g4\n"
+"	ldx	[%%sp + 2047 + 0x220], %%g5\n"
+"	ldx	[%%sp + 2047 + 0x228], %%g6\n"
+"	ldx	[%%sp + 2047 + 0x230], %%g7\n"
+"	wrpr	%%g0, 0x414, %%pstate	! save PROM mmu globals\n"
+"	stx	%%g1, [%%sp + 2047 + 0x158]\n"
+"	stx	%%g2, [%%sp + 2047 + 0x160]\n"
+"	stx	%%g3, [%%sp + 2047 + 0x168]\n"
+"	stx	%%g4, [%%sp + 2047 + 0x170]\n"
+"	stx	%%g5, [%%sp + 2047 + 0x178]\n"
+"	stx	%%g6, [%%sp + 2047 + 0x180]\n"
+"	stx	%%g7, [%%sp + 2047 + 0x188]\n"
+"					! restore Linux mmu globals\n"
+"	ldx	[%%sp + 2047 + 0x238], %%o0\n"
+"	ldx	[%%sp + 2047 + 0x240], %%o1\n"
+"	ldx	[%%sp + 2047 + 0x248], %%l2\n"
+"	ldx	[%%sp + 2047 + 0x250], %%l3\n"
+"	ldx	[%%sp + 2047 + 0x258], %%l5\n"
+"	ldx	[%%sp + 2047 + 0x260], %%l6\n"
+"	ldx	[%%sp + 2047 + 0x268], %%l7\n"
+"					! switch to Linux tba\n"
+"	sethi	%%hi(sparc64_ttable_tl0), %%l1\n"
+"	rdpr	%%tba, %%l0		! save PROM tba\n"
+"	mov	%%o0, %%g1\n"
+"	mov	%%o1, %%g2\n"
+"	mov	%%l2, %%g3\n"
+"	mov	%%l3, %%g4\n"
+"	mov	%%l5, %%g5\n"
+"	mov	%%l6, %%g6\n"
+"	mov	%%l7, %%g7\n"
+"	wrpr	%%l1, %%tba		! install Linux tba\n"
+"	wrpr	%%l4, 0, %%pstate	! restore PSTATE\n"
+"	call	prom_world\n"
+"	 mov	%%g0, %%o0\n"
+"	ldx	[%%i1 + 0x000], %%l2\n"
+"	call	%%l2\n"
+"	 mov	%%i0, %%o0\n"
+"	mov	%%o0, %%l1\n"
+"	call	prom_world\n"
+"	 or	%%g0, 1, %%o0\n"
+"	wrpr	%%g0, 0x14, %%pstate	! interrupts off\n"
+"					! restore PROM mmu globals\n"
+"	ldx	[%%sp + 2047 + 0x158], %%o0\n"
+"	ldx	[%%sp + 2047 + 0x160], %%o1\n"
+"	ldx	[%%sp + 2047 + 0x168], %%l2\n"
+"	ldx	[%%sp + 2047 + 0x170], %%l3\n"
+"	ldx	[%%sp + 2047 + 0x178], %%l5\n"
+"	ldx	[%%sp + 2047 + 0x180], %%l6\n"
+"	ldx	[%%sp + 2047 + 0x188], %%l7\n"
+"	wrpr	%%g0, 0x414, %%pstate	! restore PROM mmu globals\n"
+"	mov	%%o0, %%g1\n"
+"	mov	%%o1, %%g2\n"
+"	mov	%%l2, %%g3\n"
+"	mov	%%l3, %%g4\n"
+"	mov	%%l5, %%g5\n"
+"	mov	%%l6, %%g6\n"
+"	mov	%%l7, %%g7\n"
+"	wrpr	%%l0, %%tba		! restore PROM tba\n"
+"	wrpr	%%g0, 0x14, %%pstate	! restore PROM normal globals\n"
+"	ldx	[%%sp + 2047 + 0x120], %%g1\n"
+"	ldx	[%%sp + 2047 + 0x128], %%g2\n"
+"	ldx	[%%sp + 2047 + 0x130], %%g3\n"
+"	ldx	[%%sp + 2047 + 0x138], %%g4\n"
+"	ldx	[%%sp + 2047 + 0x140], %%g5\n"
+"	ldx	[%%sp + 2047 + 0x148], %%g6\n"
+"	ldx	[%%sp + 2047 + 0x150], %%g7\n"
+"	wrpr	%%g0, 0x814, %%pstate	! restore PROM interrupt globals\n"
+"	ldx	[%%sp + 2047 + 0x0e8], %%g1\n"
+"	ldx	[%%sp + 2047 + 0x0f0], %%g2\n"
+"	ldx	[%%sp + 2047 + 0x0f8], %%g3\n"
+"	ldx	[%%sp + 2047 + 0x100], %%g4\n"
+"	ldx	[%%sp + 2047 + 0x108], %%g5\n"
+"	ldx	[%%sp + 2047 + 0x110], %%g6\n"
+"	ldx	[%%sp + 2047 + 0x118], %%g7\n"
+"	wrpr	%%g0, 0x15, %%pstate	! restore PROM alternate globals\n"
+"	ldx	[%%sp + 2047 + 0x0b0], %%g1\n"
+"	ldx	[%%sp + 2047 + 0x0b8], %%g2\n"
+"	ldx	[%%sp + 2047 + 0x0c0], %%g3\n"
+"	ldx	[%%sp + 2047 + 0x0c8], %%g4\n"
+"	ldx	[%%sp + 2047 + 0x0d0], %%g5\n"
+"	ldx	[%%sp + 2047 + 0x0d8], %%g6\n"
+"	ldx	[%%sp + 2047 + 0x0e0], %%g7\n"
+"	wrpr	%%l4, 0, %%pstate\n"
+"	ret\n"
+"	 restore %%l1, 0, %%o0\n"
+"	" : : "r" (&p1275buf), "i" (PSTATE_PRIV));
 }
 
 /* We need some SMP protection here.  But be careful as
diff -urN linux-2.4.4-pre7/drivers/char/Makefile linux/drivers/char/Makefile
--- linux-2.4.4-pre7/drivers/char/Makefile	Mon Dec  3 22:37:21 2001
+++ linux/drivers/char/Makefile	Mon Dec  3 22:37:51 2001
@@ -41,6 +41,13 @@
   SERIAL   =
 endif
 
+ifeq ($(ARCH),s390x)
+  KEYMAP   =
+  KEYBD    =
+  CONSOLE  =
+  SERIAL   =
+endif
+
 ifeq ($(ARCH),m68k)
    ifdef CONFIG_AMIGA
       KEYBD = amikeyb.o
diff -urN linux-2.4.4-pre7/drivers/char/tty_io.c linux/drivers/char/tty_io.c
--- linux-2.4.4-pre7/drivers/char/tty_io.c	Thu Mar 22 09:20:45 2001
+++ linux/drivers/char/tty_io.c	Mon Dec  3 22:37:52 2001
@@ -149,7 +149,11 @@
 extern void console_8xx_init(void);
 extern int rs_8xx_init(void);
 extern void hwc_console_init(void);
+extern void hwc_tty_init(void);
 extern void con3215_init(void);
+extern void tty3215_init(void);
+extern void tub3270_con_init(void);
+extern void tub3270_initfunc(void);
 extern void rs285_console_init(void);
 extern void sa1100_rs_console_init(void);
 extern void sgi_serial_console_init(void);
@@ -2199,6 +2203,9 @@
 #ifdef CONFIG_3215
         con3215_init();
 #endif
+#ifdef CONFIG_3270_CONSOLE
+	tub3270_con_init();
+#endif
 #ifdef CONFIG_HWC
         hwc_console_init();
 #endif
@@ -2342,5 +2349,14 @@
 #endif	
 #ifdef CONFIG_VT
 	vcs_init();
+#endif
+#ifdef CONFIG_3270
+	tub3270_initfunc();
+#endif
+#ifdef CONFIG_3215
+	tty3215_init();
+#endif
+#ifdef CONFIG_HWC
+	hwc_tty_init();
 #endif
 }
diff -urN linux-2.4.4-pre7/drivers/ide/alim15x3.c linux/drivers/ide/alim15x3.c
--- linux-2.4.4-pre7/drivers/ide/alim15x3.c	Tue Nov  7 11:02:24 2000
+++ linux/drivers/ide/alim15x3.c	Mon Dec  3 22:37:52 2001
@@ -644,6 +644,7 @@
 	byte irq_routing_table[] = { -1,  9, 3, 10, 4,  5, 7,  6,
 				      1, 11, 0, 12, 0, 14, 0, 15 };
 
+#ifndef CONFIG_SPARC64
 	hwif->irq = hwif->channel ? 15 : 14;
 
 	if (isa_dev) {
@@ -672,6 +673,7 @@
 			hwif->irq = irq_routing_table[inmir];
 		}
 	}
+#endif /* CONFIG_SPARC64 */
 
 	hwif->tuneproc = &ali15x3_tune_drive;
 	hwif->drives[0].autotune = 1;
diff -urN linux-2.4.4-pre7/drivers/net/sunbmac.c linux/drivers/net/sunbmac.c
--- linux-2.4.4-pre7/drivers/net/sunbmac.c	Mon Dec  3 22:37:22 2001
+++ linux/drivers/net/sunbmac.c	Mon Dec  3 22:37:52 2001
@@ -1,4 +1,4 @@
-/* $Id: sunbmac.c,v 1.25 2001/02/18 08:10:21 davem Exp $
+/* $Id: sunbmac.c,v 1.27 2001/04/23 03:57:48 davem Exp $
  * sunbmac.c: Driver for Sparc BigMAC 100baseT ethernet adapters.
  *
  * Copyright (C) 1997, 1998, 1999 David S. Miller (davem@redhat.com)
diff -urN linux-2.4.4-pre7/drivers/net/sungem.c linux/drivers/net/sungem.c
--- linux-2.4.4-pre7/drivers/net/sungem.c	Mon Dec  3 22:37:22 2001
+++ linux/drivers/net/sungem.c	Mon Dec  3 22:37:52 2001
@@ -1,4 +1,4 @@
-/* $Id: sungem.c,v 1.12 2001/04/17 07:20:20 davem Exp $
+/* $Id: sungem.c,v 1.13 2001/04/20 08:16:28 davem Exp $
  * sungem.c: Sun GEM ethernet driver.
  *
  * Copyright (C) 2000, 2001 David S. Miller (davem@redhat.com)
@@ -36,6 +36,11 @@
 #include <asm/pbm.h>
 #endif
 
+#ifdef __powerpc__
+#include <asm/pci-bridge.h>
+#include <asm/prom.h>
+#endif
+
 #include "sungem.h"
 
 static char version[] __devinitdata =
@@ -64,11 +69,8 @@
 	 */
 	{ PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_RIO_GEM,
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
-#if 0
-	/* Need to figure this one out. */
-	{ PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_PPC_GEM,
+	{ PCI_VENDOR_ID_APPLE, PCI_DEVICE_ID_APPLE_UNI_N_GMAC,
 	  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0UL },
-#endif
 	{0, }
 };
 
@@ -188,13 +190,13 @@
 		return 0;
 
 	if (txmac_stat & MAC_TXSTAT_URUN) {
-		printk("%s: TX MAC xmit underrun.\n",
+		printk(KERN_ERR "%s: TX MAC xmit underrun.\n",
 		       dev->name);
 		gp->net_stats.tx_fifo_errors++;
 	}
 
 	if (txmac_stat & MAC_TXSTAT_MPE) {
-		printk("%s: TX MAC max packet size error.\n",
+		printk(KERN_ERR "%s: TX MAC max packet size error.\n",
 		       dev->name);
 		gp->net_stats.tx_errors++;
 	}
@@ -226,7 +228,7 @@
 	u32 rxmac_stat = readl(gp->regs + MAC_RXSTAT);
 
 	if (rxmac_stat & MAC_RXSTAT_OFLW) {
-		printk("%s: RX MAC fifo overflow.\n",
+		printk(KERN_ERR "%s: RX MAC fifo overflow.\n",
 		       dev->name);
 		gp->net_stats.rx_over_errors++;
 		gp->net_stats.rx_fifo_errors++;
@@ -281,7 +283,8 @@
 {
 	u32 pci_estat = readl(gp->regs + GREG_PCIESTAT);
 
-	if (gp->pdev->device == PCI_DEVICE_ID_SUN_GEM) {
+	if (gp->pdev->vendor == PCI_VENDOR_ID_SUN &&
+	    gp->pdev->device == PCI_DEVICE_ID_SUN_GEM) {
 		printk(KERN_ERR "%s: PCI error [%04x] ",
 		       dev->name, pci_estat);
 
@@ -1030,7 +1033,8 @@
 
 static void gem_init_phy(struct gem *gp)
 {
-	if (gp->pdev->device == PCI_DEVICE_ID_SUN_GEM) {
+	if (gp->pdev->vendor == PCI_VENDOR_ID_SUN &&
+	    gp->pdev->device == PCI_DEVICE_ID_SUN_GEM) {
 		u32 val;
 
 		/* Init datapath mode register. */
@@ -1171,7 +1175,8 @@
 	unsigned char *e = &gp->dev->dev_addr[0];
 	u32 rxcfg;
 
-	if (gp->pdev->device == PCI_DEVICE_ID_SUN_GEM)
+	if (gp->pdev->vendor == PCI_VENDOR_ID_SUN &&
+	    gp->pdev->device == PCI_DEVICE_ID_SUN_GEM)
 		writel(0x1bf0, gp->regs + MAC_SNDPAUSE);
 
 	writel(0x00, gp->regs + MAC_IPG0);
@@ -1471,14 +1476,10 @@
 	struct pci_dev *pdev = gp->pdev;
 	u32 mif_cfg = readl(gp->regs + MIF_CFG);
 
-	if (pdev->device == PCI_DEVICE_ID_SUN_RIO_GEM
-#if 0
-	    || pdev->device == PCI_DEVICE_ID_SUN_PPC_GEM
-#endif
-		) {
+	if (pdev->vendor == PCI_VENDOR_ID_SUN &&
+	    pdev->device == PCI_DEVICE_ID_SUN_RIO_GEM) {
 		/* One of the MII PHYs _must_ be present
-		 * as these chip versions have no gigabit
-		 * PHY.
+		 * as this chip has no gigabit PHY.
 		 */
 		if ((mif_cfg & (MIF_CFG_MDI0 | MIF_CFG_MDI1)) == 0) {
 			printk(KERN_ERR PFX "RIO GEM lacks MII phy, mif_cfg[%08x]\n",
@@ -1523,19 +1524,21 @@
 	gp->tx_fifo_sz = readl(gp->regs + TXDMA_FSZ) * 64;
 	gp->rx_fifo_sz = readl(gp->regs + RXDMA_FSZ) * 64;
 
-	if (pdev->device == PCI_DEVICE_ID_SUN_GEM) {
-		if (gp->tx_fifo_sz != (9 * 1024) ||
-		    gp->rx_fifo_sz != (20 * 1024)) {
-			printk(KERN_ERR PFX "GEM has bogus fifo sizes tx(%d) rx(%d)\n",
-			       gp->tx_fifo_sz, gp->rx_fifo_sz);
-			return -1;
-		}
-	} else {
-		if (gp->tx_fifo_sz != (2 * 1024) ||
-		    gp->rx_fifo_sz != (2 * 1024)) {
-			printk(KERN_ERR PFX "RIO GEM has bogus fifo sizes tx(%d) rx(%d)\n",
-			       gp->tx_fifo_sz, gp->rx_fifo_sz);
-			return -1;
+	if (pdev->vendor == PCI_VENDOR_ID_SUN) {
+		if (pdev->device == PCI_DEVICE_ID_SUN_GEM) {
+			if (gp->tx_fifo_sz != (9 * 1024) ||
+			    gp->rx_fifo_sz != (20 * 1024)) {
+				printk(KERN_ERR PFX "GEM has bogus fifo sizes tx(%d) rx(%d)\n",
+				       gp->tx_fifo_sz, gp->rx_fifo_sz);
+				return -1;
+			}
+		} else {
+			if (gp->tx_fifo_sz != (2 * 1024) ||
+			    gp->rx_fifo_sz != (2 * 1024)) {
+				printk(KERN_ERR PFX "RIO GEM has bogus fifo sizes tx(%d) rx(%d)\n",
+				       gp->tx_fifo_sz, gp->rx_fifo_sz);
+				return -1;
+			}
 		}
 	}
 
@@ -1569,7 +1572,7 @@
 	return 0;
 }
 
-static void __devinit gem_get_device_address(struct gem *gp)
+static int __devinit gem_get_device_address(struct gem *gp)
 {
 	struct net_device *dev = gp->dev;
 	struct pci_dev *pdev = gp->pdev;
@@ -1589,6 +1592,20 @@
 	if (node == -1)
 		memcpy(dev->dev_addr, idprom->id_ethaddr, 6);
 #endif
+#ifdef __powerpc__
+	struct device_node *gem_node;
+	unsigned char *addr;
+
+	gem_node = pci_device_to_OF_node(pdev);
+	addr = get_property(gem_node, "local-mac-address", NULL);
+	if (addr == NULL) {
+		printk("\n");
+		printk(KERN_ERR "%s: can't get mac-address\n", dev->name);
+		return -1;
+	}
+	memcpy(dev->dev_addr, addr, MAX_ADDR_LEN);
+#endif
+	return 0;
 }
 
 static int __devinit gem_init_one(struct pci_dev *pdev,
@@ -1603,6 +1620,9 @@
 	if (gem_version_printed++ == 0)
 		printk(KERN_INFO "%s", version);
 
+	pci_enable_device(pdev);
+	pci_set_master(pdev);
+
 	gemreg_base = pci_resource_start(pdev, 0);
 	gemreg_len = pci_resource_len(pdev, 0);
 
@@ -1669,7 +1689,8 @@
 	printk(KERN_INFO "%s: Sun GEM (PCI) 10/100/1000BaseT Ethernet ",
 	       dev->name);
 
-	gem_get_device_address(gp);
+	if (gem_get_device_address(gp))
+		goto err_out_iounmap;
 
 	for (i = 0; i < 6; i++)
 		printk("%2.2x%c", dev->dev_addr[i],
diff -urN linux-2.4.4-pre7/drivers/net/sunhme.c linux/drivers/net/sunhme.c
--- linux-2.4.4-pre7/drivers/net/sunhme.c	Mon Dec  3 22:37:22 2001
+++ linux/drivers/net/sunhme.c	Mon Dec  3 22:37:52 2001
@@ -1,4 +1,4 @@
-/* $Id: sunhme.c,v 1.116 2001/04/17 07:20:52 davem Exp $
+/* $Id: sunhme.c,v 1.117 2001/04/19 22:32:41 davem Exp $
  * sunhme.c: Sparc HME/BigMac 10/100baseT half/full duplex auto switching,
  *           auto carrier detecting ethernet driver.  Also known as the
  *           "Happy Meal Ethernet" found on SunSwift SBUS cards.
diff -urN linux-2.4.4-pre7/drivers/net/sunlance.c linux/drivers/net/sunlance.c
--- linux-2.4.4-pre7/drivers/net/sunlance.c	Mon Dec  3 22:37:22 2001
+++ linux/drivers/net/sunlance.c	Mon Dec  3 22:37:52 2001
@@ -1,4 +1,4 @@
-/* $Id: sunlance.c,v 1.107 2001/02/18 08:10:21 davem Exp $
+/* $Id: sunlance.c,v 1.108 2001/04/19 22:32:41 davem Exp $
  * lance.c: Linux/Sparc/Lance driver
  *
  *	Written 1995, 1996 by Miguel de Icaza
diff -urN linux-2.4.4-pre7/drivers/net/sunqe.c linux/drivers/net/sunqe.c
--- linux-2.4.4-pre7/drivers/net/sunqe.c	Mon Dec  3 22:37:22 2001
+++ linux/drivers/net/sunqe.c	Mon Dec  3 22:37:52 2001
@@ -1,4 +1,4 @@
-/* $Id: sunqe.c,v 1.50 2001/02/18 08:10:21 davem Exp $
+/* $Id: sunqe.c,v 1.51 2001/04/19 22:32:42 davem Exp $
  * sunqe.c: Sparc QuadEthernet 10baseT SBUS card driver.
  *          Once again I am out to prove that every ethernet
  *          controller out there can be most efficiently programmed
diff -urN linux-2.4.4-pre7/drivers/sbus/char/su.c linux/drivers/sbus/char/su.c
--- linux-2.4.4-pre7/drivers/sbus/char/su.c	Mon Dec  3 22:37:23 2001
+++ linux/drivers/sbus/char/su.c	Mon Dec  3 22:37:53 2001
@@ -2,7 +2,7 @@
  * su.c: Small serial driver for keyboard/mouse interface on sparc32/PCI
  *
  * Copyright (C) 1997  Eddie C. Dost  (ecd@skynet.be)
- * Copyright (C) 1998-1999  Pete Zaitcev   (zaitcev@metabyte.com)
+ * Copyright (C) 1998-1999  Pete Zaitcev   (zaitcev@yahoo.com)
  *
  * This is mainly a variation of drivers/char/serial.c,
  * credits go to authors mentioned therein.
diff -urN linux-2.4.4-pre7/drivers/sbus/char/zs.c linux/drivers/sbus/char/zs.c
--- linux-2.4.4-pre7/drivers/sbus/char/zs.c	Mon Dec  3 22:37:23 2001
+++ linux/drivers/sbus/char/zs.c	Mon Dec  3 22:37:53 2001
@@ -3,7 +3,7 @@
  *
  * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
  * Copyright (C) 1996 Eddie C. Dost   (ecd@skynet.be)
- * Fixes by Pete A. Zaitcev <zaitcev@metabyte.com>.
+ * Fixes by Pete A. Zaitcev <zaitcev@yahoo.com>.
  */
 
 #include <linux/errno.h>
diff -urN linux-2.4.4-pre7/drivers/sound/ymfpci.c linux/drivers/sound/ymfpci.c
--- linux-2.4.4-pre7/drivers/sound/ymfpci.c	Mon Dec  3 22:37:24 2001
+++ linux/drivers/sound/ymfpci.c	Mon Dec  3 22:37:54 2001
@@ -6,7 +6,7 @@
  *
  *  This code is a result of high-speed collision
  *  between ymfpci.c of ALSA and cs46xx.c of Linux.
- *  -- Pete Zaitcev <zaitcev@metabyte.com>; 2000/09/18
+ *  -- Pete Zaitcev <zaitcev@yahoo.com>; 2000/09/18
  *
  *   This program is free software; you can redistribute it and/or modify
  *   it under the terms of the GNU General Public License as published by
diff -urN linux-2.4.4-pre7/drivers/usb/hid.c linux/drivers/usb/hid.c
--- linux-2.4.4-pre7/drivers/usb/hid.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/usb/hid.c	Mon Dec  3 22:37:54 2001
@@ -698,7 +698,7 @@
 static __inline__ __u32 s32ton(__s32 value, unsigned n)
 {
 	__s32 a = value >> (n - 1);
-	if (a && a != -1) return value > 0 ? 1 << (n - 1) : (1 << n) - 1;
+	if (a && a != -1) return value < 0 ? 1 << (n - 1) : (1 << (n - 1)) - 1;
 	return value & ((1 << n) - 1);
 }
 
@@ -1016,9 +1016,15 @@
 	__s32 max = field->logical_maximum;
 	__s32 value[count]; /* WARNING: gcc specific */
    
-	for (n = 0; n < count; n++)
+	for (n = 0; n < count; n++) {
 			value[n] = min < 0 ? snto32(extract(data, offset + n * size, size), size) : 
 						    extract(data, offset + n * size, size);
+			/* Handle the ErrorRollOver code (1) by simply ignoring this report */
+			if (!(field->flags & HID_MAIN_ITEM_VARIABLE)
+			    && value[n] >= min && value[n] <= max
+			    && field->usage[value[n] - min].hid == HID_UP_KEYBOARD + 1)
+				return;
+	}
 
 	for (n = 0; n < count; n++) {
 
@@ -1231,7 +1237,7 @@
 
 static int hid_submit_out(struct hid_device *hid)
 {
-	hid->urbout.transfer_buffer_length = hid->out[hid->outtail].dr.length;
+	hid->urbout.transfer_buffer_length = le16_to_cpup(&hid->out[hid->outtail].dr.length);
 	hid->urbout.transfer_buffer = hid->out[hid->outtail].buffer;
 	hid->urbout.setup_packet = (void *) &(hid->out[hid->outtail].dr);
 	hid->urbout.dev = hid->dev;
@@ -1271,8 +1277,8 @@
 	hid_set_field(field, offset, value);
 	hid_output_report(field->report, hid->out[hid->outhead].buffer);
 
-	hid->out[hid->outhead].dr.value = 0x200 | field->report->id;
-	hid->out[hid->outhead].dr.length = ((field->report->size - 1) >> 3) + 1;
+	hid->out[hid->outhead].dr.value = cpu_to_le16(0x200 | field->report->id);
+	hid->out[hid->outhead].dr.length = cpu_to_le16((field->report->size + 7) >> 3);
 
 	hid->outhead = (hid->outhead + 1) & (HID_CONTROL_FIFO_SIZE - 1);
 
@@ -1445,7 +1451,7 @@
 	for (n = 0; n < HID_CONTROL_FIFO_SIZE; n++) {
 		hid->out[n].dr.requesttype = USB_TYPE_CLASS | USB_RECIP_INTERFACE;
 		hid->out[n].dr.request = USB_REQ_SET_REPORT;
-		hid->out[n].dr.index = hid->ifnum;
+		hid->out[n].dr.index = cpu_to_le16(hid->ifnum);
 	}
 
 	hid->input.name = hid->name;
diff -urN linux-2.4.4-pre7/drivers/video/sbusfb.c linux/drivers/video/sbusfb.c
--- linux-2.4.4-pre7/drivers/video/sbusfb.c	Mon Dec  3 22:37:24 2001
+++ linux/drivers/video/sbusfb.c	Mon Dec  3 22:37:54 2001
@@ -9,7 +9,7 @@
  *
  *  and SPARC console subsystem
  *
- *      Copyright (C) 1995 Peter Zaitcev (zaitcev@lab.ipmce.su)
+ *      Copyright (C) 1995 Peter Zaitcev (zaitcev@yahoo.com)
  *      Copyright (C) 1995-1997 David S. Miller (davem@caip.rutgers.edu)
  *      Copyright (C) 1995-1996 Miguel de Icaza (miguel@nuclecu.unam.mx)
  *      Copyright (C) 1996 Dave Redman (djhr@tadpole.co.uk)
diff -urN linux-2.4.4-pre7/drivers/video/sun3fb.c linux/drivers/video/sun3fb.c
--- linux-2.4.4-pre7/drivers/video/sun3fb.c	Fri Feb  9 11:30:23 2001
+++ linux/drivers/video/sun3fb.c	Mon Dec  3 22:37:54 2001
@@ -13,7 +13,7 @@
  *
  *  and SPARC console subsystem
  *
- *      Copyright (C) 1995 Peter Zaitcev (zaitcev@lab.ipmce.su)
+ *      Copyright (C) 1995 Peter Zaitcev (zaitcev@yahoo.com)
  *      Copyright (C) 1995-1997 David S. Miller (davem@caip.rutgers.edu)
  *      Copyright (C) 1995-1996 Miguel de Icaza (miguel@nuclecu.unam.mx)
  *      Copyright (C) 1996 Dave Redman (djhr@tadpole.co.uk)
diff -urN linux-2.4.4-pre7/fs/affs/amigaffs.c linux/fs/affs/amigaffs.c
--- linux-2.4.4-pre7/fs/affs/amigaffs.c	Mon Dec  3 22:37:24 2001
+++ linux/fs/affs/amigaffs.c	Mon Dec  3 22:37:54 2001
@@ -137,7 +137,7 @@
 	next = head->next;
 	while (next != head) {
 		dentry = list_entry(next, struct dentry, d_alias);
-		if (entry_ino == (u32)dentry->d_fsdata) {
+		if (entry_ino == (u32)(long)dentry->d_fsdata) {
 			dentry->d_fsdata = data;
 			break;
 		}
@@ -165,7 +165,7 @@
 	if (!bh)
 		goto done;
 
-	link_ino = (u32)dentry->d_fsdata;
+	link_ino = (u32)(long)dentry->d_fsdata;
 	if (inode->i_ino == link_ino) {
 		/* we can't remove the head of the link, as its blocknr is still used as ino,
 		 * so we remove the block of the first link instead.
diff -urN linux-2.4.4-pre7/fs/affs/dir.c linux/fs/affs/dir.c
--- linux-2.4.4-pre7/fs/affs/dir.c	Mon Dec  3 22:37:24 2001
+++ linux/fs/affs/dir.c	Mon Dec  3 22:37:54 2001
@@ -101,7 +101,7 @@
 	/* If the directory hasn't changed since the last call to readdir(),
 	 * we can jump directly to where we left off.
 	 */
-	ino = (u32)filp->private_data;
+	ino = (u32)(long)filp->private_data;
 	if (ino && filp->f_version == inode->i_version) {
 		pr_debug("AFFS: readdir() left off=%d\n", ino);
 		goto inside;
@@ -151,7 +151,7 @@
 readdir_done:
 	filp->f_pos = f_pos;
 	filp->f_version = inode->i_version;
-	filp->private_data = (void *)ino;
+	filp->private_data = (void *)(long)ino;
 	res = stored;
 
 readdir_out:
diff -urN linux-2.4.4-pre7/fs/dcache.c linux/fs/dcache.c
--- linux-2.4.4-pre7/fs/dcache.c	Mon Dec  3 22:37:24 2001
+++ linux/fs/dcache.c	Mon Dec  3 22:37:54 2001
@@ -139,10 +139,6 @@
 		goto kill_it;
 	list_add(&dentry->d_lru, &dentry_unused);
 	dentry_stat.nr_unused++;
-	/*
-	 * Update the timestamp
-	 */
-	dentry->d_reftime = jiffies;
 	spin_unlock(&dcache_lock);
 	return;
 
@@ -337,8 +333,8 @@
 		dentry = list_entry(tmp, struct dentry, d_lru);
 
 		/* If the dentry was recently referenced, don't free it. */
-		if (dentry->d_flags & DCACHE_REFERENCED) {
-			dentry->d_flags &= ~DCACHE_REFERENCED;
+		if (dentry->d_vfs_flags & DCACHE_REFERENCED) {
+			dentry->d_vfs_flags &= ~DCACHE_REFERENCED;
 			list_add(&dentry->d_lru, &dentry_unused);
 			continue;
 		}
@@ -610,6 +606,7 @@
 	str[name->len] = 0;
 
 	atomic_set(&dentry->d_count, 1);
+	dentry->d_vfs_flags = 0;
 	dentry->d_flags = 0;
 	dentry->d_inode = NULL;
 	dentry->d_parent = NULL;
@@ -733,7 +730,7 @@
 				continue;
 		}
 		__dget_locked(dentry);
-		dentry->d_flags |= DCACHE_REFERENCED;
+		dentry->d_vfs_flags |= DCACHE_REFERENCED;
 		spin_unlock(&dcache_lock);
 		return dentry;
 	}
diff -urN linux-2.4.4-pre7/fs/exec.c linux/fs/exec.c
--- linux-2.4.4-pre7/fs/exec.c	Thu Mar 22 09:26:18 2001
+++ linux/fs/exec.c	Mon Dec  3 22:37:54 2001
@@ -786,6 +786,9 @@
 	    }
 	}
 #endif
+	/* kernel module loader fixup */
+	/* so we don't try to load run modprobe in kernel space. */
+	set_fs(USER_DS);
 	for (try=0; try<2; try++) {
 		read_lock(&binfmt_lock);
 		for (fmt = formats ; fmt ; fmt = fmt->next) {
diff -urN linux-2.4.4-pre7/fs/ext2/inode.c linux/fs/ext2/inode.c
--- linux-2.4.4-pre7/fs/ext2/inode.c	Mon Dec  3 22:37:24 2001
+++ linux/fs/ext2/inode.c	Mon Dec  3 22:37:54 2001
@@ -397,13 +397,13 @@
 		 * the pointer to new one, then send parent to disk.
 		 */
 		bh = getblk(inode->i_dev, parent, blocksize);
-		if (!buffer_uptodate(bh))
-			wait_on_buffer(bh);
+		lock_buffer(bh);
 		memset(bh->b_data, 0, blocksize);
 		branch[n].bh = bh;
 		branch[n].p = (u32*) bh->b_data + offsets[n];
 		*branch[n].p = branch[n].key;
 		mark_buffer_uptodate(bh, 1);
+		unlock_buffer(bh);
 		mark_buffer_dirty_inode(bh, inode);
 		if (IS_SYNC(inode) || inode->u.ext2_i.i_osync) {
 			ll_rw_block (WRITE, 1, &bh);
@@ -587,10 +587,10 @@
 		struct buffer_head *bh;
 		bh = getblk(dummy.b_dev, dummy.b_blocknr, inode->i_sb->s_blocksize);
 		if (buffer_new(&dummy)) {
-			if (!buffer_uptodate(bh))
-				wait_on_buffer(bh);
+			lock_buffer(bh);
 			memset(bh->b_data, 0, inode->i_sb->s_blocksize);
 			mark_buffer_uptodate(bh, 1);
+			unlock_buffer(bh);
 			mark_buffer_dirty_inode(bh, inode);
 		}
 		return bh;
diff -urN linux-2.4.4-pre7/fs/reiserfs/file.c linux/fs/reiserfs/file.c
--- linux-2.4.4-pre7/fs/reiserfs/file.c	Mon Jan 15 13:23:01 2001
+++ linux/fs/reiserfs/file.c	Mon Dec  3 22:37:54 2001
@@ -106,6 +106,24 @@
   return ( n_err < 0 ) ? -EIO : 0;
 }
 
+static int reiserfs_setattr(struct dentry *dentry, struct iattr *attr) {
+    struct inode *inode = dentry->d_inode ;
+    int error ;
+    if (attr->ia_valid & ATTR_SIZE) {
+	/* version 2 items will be caught by the s_maxbytes check
+	** done for us in vmtruncate
+	*/
+        if (inode_items_version(inode) == ITEM_VERSION_1 && 
+	    attr->ia_size > MAX_NON_LFS)
+            return -EFBIG ;
+    }
+
+    error = inode_change_ok(inode, attr) ;
+    if (!error)
+        inode_setattr(inode, attr) ;
+
+    return error ;
+}
 
 struct file_operations reiserfs_file_operations = {
     read:	generic_file_read,
@@ -119,6 +137,7 @@
 
 struct  inode_operations reiserfs_file_inode_operations = {
     truncate:	reiserfs_vfs_truncate_file,
+    setattr:    reiserfs_setattr,
 };
 
 
diff -urN linux-2.4.4-pre7/fs/reiserfs/inode.c linux/fs/reiserfs/inode.c
--- linux-2.4.4-pre7/fs/reiserfs/inode.c	Mon Mar 26 10:54:03 2001
+++ linux/fs/reiserfs/inode.c	Mon Dec  3 22:37:54 2001
@@ -374,9 +374,11 @@
     ** sure we need to.  But, this means the item might move if
     ** kmap schedules
     */
-    p = (char *)kmap(bh_result->b_page) ;
-    if (fs_changed (fs_gen, inode->i_sb) && item_moved (&tmp_ih, &path)) {
-        goto research;
+    if (!p) {
+	p = (char *)kmap(bh_result->b_page) ;
+	if (fs_changed (fs_gen, inode->i_sb) && item_moved (&tmp_ih, &path)) {
+	    goto research;
+	}
     }
     p += offset ;
     memset (p, 0, inode->i_sb->s_blocksize);
@@ -420,14 +422,15 @@
 	ih = get_ih (&path);
     } while (1);
 
+    flush_dcache_page(bh_result->b_page) ;
+    kunmap(bh_result->b_page) ;
+
 finished:
     pathrelse (&path);
     bh_result->b_blocknr = 0 ;
     bh_result->b_dev = inode->i_dev;
     mark_buffer_uptodate (bh_result, 1);
     bh_result->b_state |= (1UL << BH_Mapped);
-    flush_dcache_page(bh_result->b_page) ;
-    kunmap(bh_result->b_page) ;
     return 0;
 }
 
diff -urN linux-2.4.4-pre7/fs/reiserfs/super.c linux/fs/reiserfs/super.c
--- linux-2.4.4-pre7/fs/reiserfs/super.c	Fri Mar  2 11:12:12 2001
+++ linux/fs/reiserfs/super.c	Mon Dec  3 22:37:54 2001
@@ -492,7 +492,11 @@
     SB_BUFFER_WITH_SB (s) = bh;
     SB_DISK_SUPER_BLOCK (s) = rs;
     s->s_op = &reiserfs_sops;
-    s->s_maxbytes = 0xFFFFFFFF;	/* 4Gig */
+
+    /* new format is limited by the 32 bit wide i_blocks field, want to
+    ** be one full block below that.
+    */
+    s->s_maxbytes = (512LL << 32) - s->s_blocksize ;
     return 0;
 }
 
diff -urN linux-2.4.4-pre7/fs/reiserfs/tail_conversion.c linux/fs/reiserfs/tail_conversion.c
--- linux-2.4.4-pre7/fs/reiserfs/tail_conversion.c	Wed Feb 28 19:21:58 2001
+++ linux/fs/reiserfs/tail_conversion.c	Mon Dec  3 22:37:54 2001
@@ -150,11 +150,11 @@
       BUG() ;
     }
     mark_buffer_clean(bh) ;
-    wait_on_buffer(bh) ;
-    // clear_bit(BH_Uptodate, &bh->b_state) ;
+    lock_buffer(bh) ;
     clear_bit(BH_Mapped, &bh->b_state) ;
     clear_bit(BH_Req, &bh->b_state) ;
     clear_bit(BH_New, &bh->b_state) ;
+    unlock_buffer(bh) ;
   }
 }
 
diff -urN linux-2.4.4-pre7/fs/super.c linux/fs/super.c
--- linux-2.4.4-pre7/fs/super.c	Mon Dec  3 22:37:24 2001
+++ linux/fs/super.c	Mon Dec  3 22:37:55 2001
@@ -1284,16 +1284,12 @@
 }
 
 /*
- * Flags is a 16-bit value that allows up to 16 non-fs dependent flags to
+ * Flags is a 32-bit value that allows up to 32 non-fs dependent flags to
  * be given to the mount() call (ie: read-only, no-dev, no-suid etc).
  *
  * data is a (void *) that can point to any structure up to
  * PAGE_SIZE-1 bytes, which can contain arbitrary fs-dependent
  * information (or be NULL).
- *
- * NOTE! As pre-0.97 versions of mount() didn't use this setup, the
- * flags used to have a special 16-bit magic number in the high word:
- * 0xC0ED. If this magic number is present, the high word is discarded.
  */
 long do_mount(char * dev_name, char * dir_name, char *type_page,
 		  unsigned long flags, void *data_page)
@@ -1304,10 +1300,6 @@
 	struct super_block *sb;
 	int retval = 0;
 
-	/* Discard magic */
-	if ((flags & MS_MGC_MSK) == MS_MGC_VAL)
-		flags &= ~MS_MGC_MSK;
- 
 	/* Basic sanity checks */
 
 	if (!dir_name || !*dir_name || !memchr(dir_name, 0, PAGE_SIZE))
@@ -1331,12 +1323,6 @@
 
 	if (!type_page || !memchr(type_page, 0, PAGE_SIZE))
 		return -EINVAL;
-
-#if 0	/* Can be deleted again. Introduced in patch-2.3.99-pre6 */
-	/* loopback mount? This is special - requires fewer capabilities */
-	if (strcmp(type_page, "bind")==0)
-		return do_loopback(dev_name, dir_name);
-#endif
 
 	/* for the rest we _really_ need capabilities... */
 	if (!capable(CAP_SYS_ADMIN))
diff -urN linux-2.4.4-pre7/include/asm-sparc/pgalloc.h linux/include/asm-sparc/pgalloc.h
--- linux-2.4.4-pre7/include/asm-sparc/pgalloc.h	Mon Dec  3 22:37:25 2001
+++ linux/include/asm-sparc/pgalloc.h	Mon Dec  3 22:37:55 2001
@@ -1,4 +1,4 @@
-/* $Id: pgalloc.h,v 1.11 2000/10/16 14:32:49 anton Exp $ */
+/* $Id: pgalloc.h,v 1.12 2001/04/26 02:36:35 davem Exp $ */
 #ifndef _SPARC_PGALLOC_H
 #define _SPARC_PGALLOC_H
 
diff -urN linux-2.4.4-pre7/include/asm-sparc64/a.out.h linux/include/asm-sparc64/a.out.h
--- linux-2.4.4-pre7/include/asm-sparc64/a.out.h	Fri Aug  6 11:58:00 1999
+++ linux/include/asm-sparc64/a.out.h	Mon Dec  3 22:37:55 2001
@@ -1,4 +1,4 @@
-/* $Id: a.out.h,v 1.6 1999/08/04 07:04:21 jj Exp $ */
+/* $Id: a.out.h,v 1.7 2001/04/24 01:09:12 davem Exp $ */
 #ifndef __SPARC64_A_OUT_H__
 #define __SPARC64_A_OUT_H__
 
@@ -21,7 +21,7 @@
 	unsigned int a_drsize;
 };
 
-#endif __ASSEMBLY__
+#endif /* !__ASSEMBLY__ */
 
 /* Where in the file does the text information begin? */
 #define N_TXTOFF(x)     (N_MAGIC(x) == ZMAGIC ? 0 : sizeof (struct exec))
diff -urN linux-2.4.4-pre7/include/asm-sparc64/bitops.h linux/include/asm-sparc64/bitops.h
--- linux-2.4.4-pre7/include/asm-sparc64/bitops.h	Mon Dec  3 22:37:25 2001
+++ linux/include/asm-sparc64/bitops.h	Mon Dec  3 22:37:55 2001
@@ -1,4 +1,4 @@
-/* $Id: bitops.h,v 1.32 2001/04/14 01:12:16 davem Exp $
+/* $Id: bitops.h,v 1.33 2001/04/24 01:09:12 davem Exp $
  * bitops.h: Bit string operations on the V9.
  *
  * Copyright 1996, 1997 David S. Miller (davem@caip.rutgers.edu)
@@ -42,12 +42,12 @@
 	unsigned long result;
 
 #ifdef ULTRA_HAS_POPULATION_COUNT	/* Thanks for nothing Sun... */
-	__asm__ __volatile__("
-	brz,pn	%0, 1f
-	 neg	%0, %%g1
-	xnor	%0, %%g1, %%g2
-	popc	%%g2, %0
-1:	" : "=&r" (result)
+	__asm__ __volatile__(
+"	brz,pn	%0, 1f\n"
+"	 neg	%0, %%g1\n"
+"	xnor	%0, %%g1, %%g2\n"
+"	popc	%%g2, %0\n"
+"1:	" : "=&r" (result)
 	  : "0" (word)
 	  : "g1", "g2");
 #else
diff -urN linux-2.4.4-pre7/include/asm-sparc64/checksum.h linux/include/asm-sparc64/checksum.h
--- linux-2.4.4-pre7/include/asm-sparc64/checksum.h	Mon Jan 31 23:41:14 2000
+++ linux/include/asm-sparc64/checksum.h	Mon Dec  3 22:37:55 2001
@@ -1,4 +1,4 @@
-/* $Id: checksum.h,v 1.16 2000/01/31 01:26:54 davem Exp $ */
+/* $Id: checksum.h,v 1.17 2001/04/24 01:09:12 davem Exp $ */
 #ifndef __SPARC64_CHECKSUM_H
 #define __SPARC64_CHECKSUM_H
 
@@ -86,32 +86,32 @@
 	 *       because GCC can legitimately use the same register for
 	 *       both operands.
 	 */
-	__asm__ __volatile__("
-	sub		%2, 4, %%g7		! IEU0
-	lduw		[%1 + 0x00], %0		! Load	Group
-	lduw		[%1 + 0x04], %%g2	! Load	Group
-	lduw		[%1 + 0x08], %%g3	! Load	Group
-	addcc		%%g2, %0, %0		! IEU1	1 Load Bubble + Group
-	lduw		[%1 + 0x0c], %%g2	! Load
-	addccc		%%g3, %0, %0		! Sngle	Group no Bubble
-	lduw		[%1 + 0x10], %%g3	! Load	Group
-	addccc		%%g2, %0, %0		! Sngle	Group no Bubble
-	addc		%0, %%g0, %0		! Sngle Group
-1:	addcc		%%g3, %0, %0		! IEU1	Group no Bubble
-	add		%1, 4, %1		! IEU0
-	addccc		%0, %%g0, %0		! Sngle Group no Bubble
-	subcc		%%g7, 1, %%g7		! IEU1	Group
-	be,a,pt		%%icc, 2f		! CTI
-	 sll		%0, 16, %%g2		! IEU0
-	lduw		[%1 + 0x10], %%g3	! Load	Group
-	ba,pt		%%xcc, 1b		! CTI
-	 nop					! IEU0
-2:	addcc		%0, %%g2, %%g2		! IEU1	Group
-	srl		%%g2, 16, %0		! IEU0	Group regdep	XXX Scheisse!
-	addc		%0, %%g0, %0		! Sngle	Group
-	xnor		%%g0, %0, %0		! IEU0	Group
-	srl		%0, 0, %0		! IEU0	Group		XXX Scheisse!
-"	: "=r" (sum), "=&r" (iph)
+	__asm__ __volatile__(
+"	sub		%2, 4, %%g7		! IEU0\n"
+"	lduw		[%1 + 0x00], %0		! Load	Group\n"
+"	lduw		[%1 + 0x04], %%g2	! Load	Group\n"
+"	lduw		[%1 + 0x08], %%g3	! Load	Group\n"
+"	addcc		%%g2, %0, %0		! IEU1	1 Load Bubble + Group\n"
+"	lduw		[%1 + 0x0c], %%g2	! Load\n"
+"	addccc		%%g3, %0, %0		! Sngle	Group no Bubble\n"
+"	lduw		[%1 + 0x10], %%g3	! Load	Group\n"
+"	addccc		%%g2, %0, %0		! Sngle	Group no Bubble\n"
+"	addc		%0, %%g0, %0		! Sngle Group\n"
+"1:	addcc		%%g3, %0, %0		! IEU1	Group no Bubble\n"
+"	add		%1, 4, %1		! IEU0\n"
+"	addccc		%0, %%g0, %0		! Sngle Group no Bubble\n"
+"	subcc		%%g7, 1, %%g7		! IEU1	Group\n"
+"	be,a,pt		%%icc, 2f		! CTI\n"
+"	 sll		%0, 16, %%g2		! IEU0\n"
+"	lduw		[%1 + 0x10], %%g3	! Load	Group\n"
+"	ba,pt		%%xcc, 1b		! CTI\n"
+"	 nop					! IEU0\n"
+"2:	addcc		%0, %%g2, %%g2		! IEU1	Group\n"
+"	srl		%%g2, 16, %0		! IEU0	Group regdep	XXX Scheisse!\n"
+"	addc		%0, %%g0, %0		! Sngle	Group\n"
+"	xnor		%%g0, %0, %0		! IEU0	Group\n"
+"	srl		%0, 0, %0		! IEU0	Group		XXX Scheisse!\n"
+	: "=r" (sum), "=&r" (iph)
 	: "r" (ihl), "1" (iph)
 	: "g2", "g3", "g7", "cc");
 	return sum;
@@ -122,12 +122,12 @@
 {
 	unsigned int tmp;
 
-	__asm__ __volatile__("
-	addcc		%0, %1, %1
-	srl		%1, 16, %1
-	addc		%1, %%g0, %1
-	xnor		%%g0, %1, %0
-"	: "=&r" (sum), "=r" (tmp)
+	__asm__ __volatile__(
+"	addcc		%0, %1, %1\n"
+"	srl		%1, 16, %1\n"
+"	addc		%1, %%g0, %1\n"
+"	xnor		%%g0, %1, %0\n"
+	: "=&r" (sum), "=r" (tmp)
 	: "0" (sum), "1" (sum<<16)
 	: "cc");
 	return (sum & 0xffff);
@@ -139,12 +139,12 @@
 						   unsigned short proto,
 						   unsigned int sum)
 {
-	__asm__ __volatile__("
-	addcc		%1, %0, %0
-	addccc		%2, %0, %0
-	addccc		%3, %0, %0
-	addc		%0, %%g0, %0
-"	: "=r" (sum), "=r" (saddr)
+	__asm__ __volatile__(
+"	addcc		%1, %0, %0\n"
+"	addccc		%2, %0, %0\n"
+"	addccc		%3, %0, %0\n"
+"	addc		%0, %%g0, %0\n"
+	: "=r" (sum), "=r" (saddr)
 	: "r" (daddr), "r" ((proto<<16)+len), "0" (sum), "1" (saddr)
 	: "cc");
 	return sum;
@@ -171,27 +171,27 @@
 						     unsigned short proto,
 						     unsigned int sum) 
 {
-	__asm__ __volatile__ ("
-	addcc		%3, %4, %%g7
-	addccc		%5, %%g7, %%g7
-	lduw		[%2 + 0x0c], %%g2
-	lduw		[%2 + 0x08], %%g3
-	addccc		%%g2, %%g7, %%g7
-	lduw		[%2 + 0x04], %%g2
-	addccc		%%g3, %%g7, %%g7
-	lduw		[%2 + 0x00], %%g3
-	addccc		%%g2, %%g7, %%g7
-	lduw		[%1 + 0x0c], %%g2
-	addccc		%%g3, %%g7, %%g7
-	lduw		[%1 + 0x08], %%g3
-	addccc		%%g2, %%g7, %%g7
-	lduw		[%1 + 0x04], %%g2
-	addccc		%%g3, %%g7, %%g7
-	lduw		[%1 + 0x00], %%g3
-	addccc		%%g2, %%g7, %%g7
-	addccc		%%g3, %%g7, %0
-	addc		0, %0, %0
-"	: "=&r" (sum)
+	__asm__ __volatile__ (
+"	addcc		%3, %4, %%g7\n"
+"	addccc		%5, %%g7, %%g7\n"
+"	lduw		[%2 + 0x0c], %%g2\n"
+"	lduw		[%2 + 0x08], %%g3\n"
+"	addccc		%%g2, %%g7, %%g7\n"
+"	lduw		[%2 + 0x04], %%g2\n"
+"	addccc		%%g3, %%g7, %%g7\n"
+"	lduw		[%2 + 0x00], %%g3\n"
+"	addccc		%%g2, %%g7, %%g7\n"
+"	lduw		[%1 + 0x0c], %%g2\n"
+"	addccc		%%g3, %%g7, %%g7\n"
+"	lduw		[%1 + 0x08], %%g3\n"
+"	addccc		%%g2, %%g7, %%g7\n"
+"	lduw		[%1 + 0x04], %%g2\n"
+"	addccc		%%g3, %%g7, %%g7\n"
+"	lduw		[%1 + 0x00], %%g3\n"
+"	addccc		%%g2, %%g7, %%g7\n"
+"	addccc		%%g3, %%g7, %0\n"
+"	addc		0, %0, %0\n"
+	: "=&r" (sum)
 	: "r" (saddr), "r" (daddr), "r"(htonl(len)),
 	  "r"(htonl(proto)), "r"(sum)
 	: "g2", "g3", "g7", "cc");
diff -urN linux-2.4.4-pre7/include/asm-sparc64/delay.h linux/include/asm-sparc64/delay.h
--- linux-2.4.4-pre7/include/asm-sparc64/delay.h	Thu Jan  4 12:50:17 2001
+++ linux/include/asm-sparc64/delay.h	Mon Dec  3 22:37:55 2001
@@ -1,4 +1,4 @@
-/* $Id: delay.h,v 1.11 2001/01/02 08:15:32 davem Exp $
+/* $Id: delay.h,v 1.12 2001/04/24 01:09:12 davem Exp $
  * delay.h: Linux delay routines on the V9.
  *
  * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu).
@@ -16,14 +16,14 @@
 
 extern __inline__ void __delay(unsigned long loops)
 {
-	__asm__ __volatile__("
-	b,pt	%%xcc, 1f
-	 cmp	%0, 0
-	.align	32
-1:
-	bne,pt	%%xcc, 1b
-	 subcc	%0, 1, %0
-"	: "=&r" (loops)
+	__asm__ __volatile__(
+"	b,pt	%%xcc, 1f\n"
+"	 cmp	%0, 0\n"
+"	.align	32\n"
+"1:\n"
+"	bne,pt	%%xcc, 1b\n"
+"	 subcc	%0, 1, %0\n"
+	: "=&r" (loops)
 	: "0" (loops)
 	: "cc");
 }
@@ -32,10 +32,10 @@
 {
 	usecs *= 0x00000000000010c6UL;		/* 2**32 / 1000000 */
 
-	__asm__ __volatile__("
-	mulx	%1, %2, %0
-	srlx	%0, 32, %0
-"	: "=r" (usecs)
+	__asm__ __volatile__(
+"	mulx	%1, %2, %0\n"
+"	srlx	%0, 32, %0\n"
+	: "=r" (usecs)
 	: "r" (usecs), "r" (lps));
 
 	__delay(usecs * HZ);
diff -urN linux-2.4.4-pre7/include/asm-sparc64/pgalloc.h linux/include/asm-sparc64/pgalloc.h
--- linux-2.4.4-pre7/include/asm-sparc64/pgalloc.h	Mon Dec  3 22:37:25 2001
+++ linux/include/asm-sparc64/pgalloc.h	Mon Dec  3 22:37:55 2001
@@ -1,4 +1,4 @@
-/* $Id: pgalloc.h,v 1.19 2001/03/30 07:10:48 davem Exp $ */
+/* $Id: pgalloc.h,v 1.20 2001/04/26 02:36:36 davem Exp $ */
 #ifndef _SPARC64_PGALLOC_H
 #define _SPARC64_PGALLOC_H
 
diff -urN linux-2.4.4-pre7/include/asm-sparc64/rwsem.h linux/include/asm-sparc64/rwsem.h
--- linux-2.4.4-pre7/include/asm-sparc64/rwsem.h	Mon Dec  3 22:37:25 2001
+++ linux/include/asm-sparc64/rwsem.h	Mon Dec  3 22:37:55 2001
@@ -1,4 +1,4 @@
-/* $Id: rwsem.h,v 1.2 2001/04/19 01:52:04 davem Exp $
+/* $Id: rwsem.h,v 1.4 2001/04/26 02:36:36 davem Exp $
  * rwsem.h: R/W semaphores implemented using CAS
  *
  * Written by David S. Miller (davem@redhat.com), 2001.
@@ -13,8 +13,15 @@
 
 #ifdef __KERNEL__
 
+#include <linux/list.h>
+#include <linux/spinlock.h>
+
 struct rwsem_waiter;
 
+extern struct rw_semaphore *FASTCALL(rwsem_down_read_failed(struct rw_semaphore *sem));
+extern struct rw_semaphore *FASTCALL(rwsem_down_write_failed(struct rw_semaphore *sem));
+extern struct rw_semaphore *FASTCALL(rwsem_wake(struct rw_semaphore *));
+
 struct rw_semaphore {
 	signed int count;
 #define RWSEM_UNLOCKED_VALUE		0x00000000
@@ -24,12 +31,11 @@
 #define RWSEM_ACTIVE_READ_BIAS		RWSEM_ACTIVE_BIAS
 #define RWSEM_ACTIVE_WRITE_BIAS		(RWSEM_WAITING_BIAS + RWSEM_ACTIVE_BIAS)
 	spinlock_t		wait_lock;
-	struct rwsem_waiter	*wait_front;
-	struct rwsem_waiter	**wait_back;
+	struct list_head	wait_list;
 };
 
 #define __RWSEM_INITIALIZER(name) \
-{ RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, NULL, &(name).wait_front }
+{ RWSEM_UNLOCKED_VALUE, SPIN_LOCK_UNLOCKED, LIST_HEAD_INIT((name).wait_list) }
 
 #define DECLARE_RWSEM(name) \
 	struct rw_semaphore name = __RWSEM_INITIALIZER(name)
@@ -37,7 +43,8 @@
 static inline void init_rwsem(struct rw_semaphore *sem)
 {
 	sem->count = RWSEM_UNLOCKED_VALUE;
-	init_waitqueue_head(&sem->wait);
+	spin_lock_init(&sem->wait_lock);
+	INIT_LIST_HEAD(&sem->wait_list);
 }
 
 static inline void __down_read(struct rw_semaphore *sem)
@@ -127,15 +134,14 @@
 		"save		%%sp, -160, %%sp\n\t"
 		"mov		%%g2, %%l2\n\t"
 		"mov		%%g3, %%l3\n\t"
-		" mov		%%g7, %%o0\n\t"
 		"call		%1\n\t"
-		" mov		%%g5, %%o1\n\t"
+		" mov		%%g5, %%o0\n\t"
 		"mov		%%l2, %%g2\n\t"
 		"ba,pt		%%xcc, 2b\n\t"
 		" restore	%%l3, %%g0, %%g3\n\t"
 		".previous\n\t"
 		"! ending __up_read"
-		: : "r" (sem), "i" (rwsem_up_read_wake),
+		: : "r" (sem), "i" (rwsem_wake),
 		    "i" (RWSEM_ACTIVE_MASK)
 		: "g1", "g5", "g7", "memory", "cc");
 }
@@ -146,28 +152,31 @@
 		"! beginning __up_write\n\t"
 		"sethi		%%hi(%2), %%g1\n\t"
 		"or		%%g1, %%lo(%2), %%g1\n"
-		"sub		%%g5, %%g5, %%g5\n\t"
-		"cas		[%0], %%g1, %%g5\n\t"
-		"cmp		%%g1, %%g5\n\t"
-		"bne,pn		%%icc, 1f\n\t"
+		"1:\tlduw	[%0], %%g5\n\t"
+		"sub		%%g5, %%g1, %%g7\n\t"
+		"cas		[%0], %%g5, %%g7\n\t"
+		"cmp		%%g5, %%g7\n\t"
+		"bne,pn		%%icc, 1b\n\t"
+		" sub		%%g7, %%g1, %%g7\n\t"
+		"cmp		%%g7, 0\n\t"
+		"bl,pn		%%icc, 3f\n\t"
 		" membar	#StoreStore\n"
 		"2:\n\t"
 		".subsection 2\n"
-		"3:\tmov	%0, %%g1\n\t"
+		"3:\tmov	%0, %%g5\n\t"
 		"save		%%sp, -160, %%sp\n\t"
 		"mov		%%g2, %%l2\n\t"
 		"mov		%%g3, %%l3\n\t"
-		"mov		%%g1, %%o0\n\t"
 		"call		%1\n\t"
-		" mov		%%g5, %%o1\n\t"
+		" mov		%%g5, %%o0\n\t"
 		"mov		%%l2, %%g2\n\t"
 		"ba,pt		%%xcc, 2b\n\t"
 		" restore	%%l3, %%g0, %%g3\n\t"
 		".previous\n\t"
 		"! ending __up_write"
-		: : "r" (sem), "i" (rwsem_up_write_wake),
+		: : "r" (sem), "i" (rwsem_wake),
 		    "i" (RWSEM_ACTIVE_WRITE_BIAS)
-		: "g1", "g5", "memory", "cc");
+		: "g1", "g5", "g7", "memory", "cc");
 }
 
 static inline int rwsem_atomic_update(int delta, struct rw_semaphore *sem)
diff -urN linux-2.4.4-pre7/include/asm-sparc64/semaphore.h linux/include/asm-sparc64/semaphore.h
--- linux-2.4.4-pre7/include/asm-sparc64/semaphore.h	Mon Dec  3 22:37:25 2001
+++ linux/include/asm-sparc64/semaphore.h	Mon Dec  3 22:37:55 2001
@@ -69,29 +69,29 @@
 #if WAITQUEUE_DEBUG
 	CHECK_MAGIC(sem->__magic);
 #endif
-	__asm__ __volatile__("
-	1:	lduw	[%0], %%g5
-		sub	%%g5, 1, %%g7
-		cas	[%0], %%g5, %%g7
-		cmp	%%g5, %%g7
-		bne,pn	%%icc, 1b
-		 cmp	%%g7, 1
-		bl,pn	%%icc, 3f
-		 membar	#StoreStore
-	2:
-		.subsection 2
-	3:	mov	%0, %%g5
-		save	%%sp, -160, %%sp
-		mov	%%g1, %%l1
-		mov	%%g2, %%l2
-		mov	%%g3, %%l3
-		call	%1
-		 mov	%%g5, %%o0
-		mov	%%l1, %%g1
-		mov	%%l2, %%g2
-		ba,pt	%%xcc, 2b
-		 restore %%l3, %%g0, %%g3
-		.previous\n"
+	__asm__ __volatile__(
+"	1:	lduw	[%0], %%g5\n"
+"		sub	%%g5, 1, %%g7\n"
+"		cas	[%0], %%g5, %%g7\n"
+"		cmp	%%g5, %%g7\n"
+"		bne,pn	%%icc, 1b\n"
+"		 cmp	%%g7, 1\n"
+"		bl,pn	%%icc, 3f\n"
+"		 membar	#StoreStore\n"
+"	2:\n"
+"		.subsection 2\n"
+"	3:	mov	%0, %%g5\n"
+"		save	%%sp, -160, %%sp\n"
+"		mov	%%g1, %%l1\n"
+"		mov	%%g2, %%l2\n"
+"		mov	%%g3, %%l3\n"
+"		call	%1\n"
+"		 mov	%%g5, %%o0\n"
+"		mov	%%l1, %%g1\n"
+"		mov	%%l2, %%g2\n"
+"		ba,pt	%%xcc, 2b\n"
+"		 restore %%l3, %%g0, %%g3\n"
+"		.previous\n"
 	: : "r" (sem), "i" (__down)
 	: "g5", "g7", "memory", "cc");
 }
@@ -103,30 +103,30 @@
 #if WAITQUEUE_DEBUG
 	CHECK_MAGIC(sem->__magic);
 #endif
-	__asm__ __volatile__("
-	1:	lduw	[%2], %%g5
-		sub	%%g5, 1, %%g7
-		cas	[%2], %%g5, %%g7
-		cmp	%%g5, %%g7
-		bne,pn	%%icc, 1b
-		 cmp	%%g7, 1
-		bl,pn	%%icc, 3f
-		 membar	#StoreStore
-	2:
-		.subsection 2
-	3:	mov	%2, %%g5
-		save	%%sp, -160, %%sp
-		mov	%%g1, %%l1
-		mov	%%g2, %%l2
-		mov	%%g3, %%l3
-		call	%3
-		 mov	%%g5, %%o0
-		mov	%%l1, %%g1
-		mov	%%l2, %%g2
-		mov	%%l3, %%g3
-		ba,pt	%%xcc, 2b
-		 restore %%o0, %%g0, %0
-		.previous\n"
+	__asm__ __volatile__(
+"	1:	lduw	[%2], %%g5\n"
+"		sub	%%g5, 1, %%g7\n"
+"		cas	[%2], %%g5, %%g7\n"
+"		cmp	%%g5, %%g7\n"
+"		bne,pn	%%icc, 1b\n"
+"		 cmp	%%g7, 1\n"
+"		bl,pn	%%icc, 3f\n"
+"		 membar	#StoreStore\n"
+"	2:\n"
+"		.subsection 2\n"
+"	3:	mov	%2, %%g5\n"
+"		save	%%sp, -160, %%sp\n"
+"		mov	%%g1, %%l1\n"
+"		mov	%%g2, %%l2\n"
+"		mov	%%g3, %%l3\n"
+"		call	%3\n"
+"		 mov	%%g5, %%o0\n"
+"		mov	%%l1, %%g1\n"
+"		mov	%%l2, %%g2\n"
+"		mov	%%l3, %%g3\n"
+"		ba,pt	%%xcc, 2b\n"
+"		 restore %%o0, %%g0, %0\n"
+"		.previous\n"
 	: "=r" (ret)
 	: "0" (ret), "r" (sem), "i" (__down_interruptible)
 	: "g5", "g7", "memory", "cc");
@@ -139,30 +139,30 @@
 #if WAITQUEUE_DEBUG
 	CHECK_MAGIC(sem->__magic);
 #endif
-	__asm__ __volatile__("
-	1:	lduw	[%2], %%g5
-		sub	%%g5, 1, %%g7
-		cas	[%2], %%g5, %%g7
-		cmp	%%g5, %%g7
-		bne,pn	%%icc, 1b
-		 cmp	%%g7, 1
-		bl,pn	%%icc, 3f
-		 membar	#StoreStore
-	2:
-		.subsection 2
-	3:	mov	%2, %%g5
-		save	%%sp, -160, %%sp
-		mov	%%g1, %%l1
-		mov	%%g2, %%l2
-		mov	%%g3, %%l3
-		call	%3
-		 mov	%%g5, %%o0
-		mov	%%l1, %%g1
-		mov	%%l2, %%g2
-		mov	%%l3, %%g3
-		ba,pt	%%xcc, 2b
-		 restore %%o0, %%g0, %0
-		.previous\n"
+	__asm__ __volatile__(
+"	1:	lduw	[%2], %%g5\n"
+"		sub	%%g5, 1, %%g7\n"
+"		cas	[%2], %%g5, %%g7\n"
+"		cmp	%%g5, %%g7\n"
+"		bne,pn	%%icc, 1b\n"
+"		 cmp	%%g7, 1\n"
+"		bl,pn	%%icc, 3f\n"
+"		 membar	#StoreStore\n"
+"	2:\n"
+"		.subsection 2\n"
+"	3:	mov	%2, %%g5\n"
+"		save	%%sp, -160, %%sp\n"
+"		mov	%%g1, %%l1\n"
+"		mov	%%g2, %%l2\n"
+"		mov	%%g3, %%l3\n"
+"		call	%3\n"
+"		 mov	%%g5, %%o0\n"
+"		mov	%%l1, %%g1\n"
+"		mov	%%l2, %%g2\n"
+"		mov	%%l3, %%g3\n"
+"		ba,pt	%%xcc, 2b\n"
+"		 restore %%o0, %%g0, %0\n"
+"		.previous\n"
 	: "=r" (ret)
 	: "0" (ret), "r" (sem), "i" (__down_trylock)
 	: "g5", "g7", "memory", "cc");
@@ -174,30 +174,30 @@
 #if WAITQUEUE_DEBUG
 	CHECK_MAGIC(sem->__magic);
 #endif
-	__asm__ __volatile__("
-		membar	#StoreLoad | #LoadLoad
-	1:	lduw	[%0], %%g5
-		add	%%g5, 1, %%g7
-		cas	[%0], %%g5, %%g7
-		cmp	%%g5, %%g7
-		bne,pn	%%icc, 1b
-		 addcc	%%g7, 1, %%g0
-		ble,pn	%%icc, 3f
-		 nop
-	2:
-		.subsection 2
-	3:	mov	%0, %%g5
-		save	%%sp, -160, %%sp
-		mov	%%g1, %%l1
-		mov	%%g2, %%l2
-		mov	%%g3, %%l3
-		call	%1
-		 mov	%%g5, %%o0
-		mov	%%l1, %%g1
-		mov	%%l2, %%g2
-		ba,pt	%%xcc, 2b
-		 restore %%l3, %%g0, %%g3
-		.previous\n"
+	__asm__ __volatile__(
+"		membar	#StoreLoad | #LoadLoad\n"
+"	1:	lduw	[%0], %%g5\n"
+"		add	%%g5, 1, %%g7\n"
+"		cas	[%0], %%g5, %%g7\n"
+"		cmp	%%g5, %%g7\n"
+"		bne,pn	%%icc, 1b\n"
+"		 addcc	%%g7, 1, %%g0\n"
+"		ble,pn	%%icc, 3f\n"
+"		 nop\n"
+"	2:\n"
+"		.subsection 2\n"
+"	3:	mov	%0, %%g5\n"
+"		save	%%sp, -160, %%sp\n"
+"		mov	%%g1, %%l1\n"
+"		mov	%%g2, %%l2\n"
+"		mov	%%g3, %%l3\n"
+"		call	%1\n"
+"		 mov	%%g5, %%o0\n"
+"		mov	%%l1, %%g1\n"
+"		mov	%%l2, %%g2\n"
+"		ba,pt	%%xcc, 2b\n"
+"		 restore %%l3, %%g0, %%g3\n"
+"		.previous\n"
 	: : "r" (sem), "i" (__up)
 	: "g5", "g7", "memory", "cc");
 }
diff -urN linux-2.4.4-pre7/include/asm-sparc64/smp.h linux/include/asm-sparc64/smp.h
--- linux-2.4.4-pre7/include/asm-sparc64/smp.h	Sun Mar 25 18:14:21 2001
+++ linux/include/asm-sparc64/smp.h	Mon Dec  3 22:37:55 2001
@@ -40,7 +40,7 @@
 	unsigned int	multiplier;
 	unsigned int	counter;
 	unsigned int	idle_volume;
-	unsigned int	__pad[2];
+	unsigned long	clock_tick;	/* %tick's per second */
 	unsigned long	udelay_val;
 
 	/* Dcache line 2 */
diff -urN linux-2.4.4-pre7/include/asm-sparc64/spinlock.h linux/include/asm-sparc64/spinlock.h
--- linux-2.4.4-pre7/include/asm-sparc64/spinlock.h	Mon Aug 14 13:09:08 2000
+++ linux/include/asm-sparc64/spinlock.h	Mon Dec  3 22:37:55 2001
@@ -40,17 +40,17 @@
 
 extern __inline__ void spin_lock(spinlock_t *lock)
 {
-	__asm__ __volatile__("
-1:	ldstub		[%0], %%g7
-	brnz,pn		%%g7, 2f
-	 membar		#StoreLoad | #StoreStore
-	.subsection	2
-2:	ldub		[%0], %%g7
-	brnz,pt		%%g7, 2b
-	 membar		#LoadLoad
-	b,a,pt		%%xcc, 1b
-	.previous
-"	: /* no outputs */
+	__asm__ __volatile__(
+"1:	ldstub		[%0], %%g7\n"
+"	brnz,pn		%%g7, 2f\n"
+"	 membar		#StoreLoad | #StoreStore\n"
+"	.subsection	2\n"
+"2:	ldub		[%0], %%g7\n"
+"	brnz,pt		%%g7, 2b\n"
+"	 membar		#LoadLoad\n"
+"	b,a,pt		%%xcc, 1b\n"
+"	.previous\n"
+	: /* no outputs */
 	: "r" (lock)
 	: "g7", "memory");
 }
diff -urN linux-2.4.4-pre7/include/asm-sparc64/system.h linux/include/asm-sparc64/system.h
--- linux-2.4.4-pre7/include/asm-sparc64/system.h	Tue Oct  3 09:24:41 2000
+++ linux/include/asm-sparc64/system.h	Mon Dec  3 22:37:55 2001
@@ -1,4 +1,4 @@
-/* $Id: system.h,v 1.62 2000/09/23 02:09:21 davem Exp $ */
+/* $Id: system.h,v 1.63 2001/04/24 01:09:12 davem Exp $ */
 #ifndef __SPARC64_SYSTEM_H
 #define __SPARC64_SYSTEM_H
 
@@ -216,15 +216,15 @@
 
 extern __inline__ unsigned long xchg32(__volatile__ unsigned int *m, unsigned int val)
 {
-	__asm__ __volatile__("
-	mov		%0, %%g5
-1:	lduw		[%2], %%g7
-	cas		[%2], %%g7, %0
-	cmp		%%g7, %0
-	bne,a,pn	%%icc, 1b
-	 mov		%%g5, %0
-	membar		#StoreLoad | #StoreStore
-"	: "=&r" (val)
+	__asm__ __volatile__(
+"	mov		%0, %%g5\n"
+"1:	lduw		[%2], %%g7\n"
+"	cas		[%2], %%g7, %0\n"
+"	cmp		%%g7, %0\n"
+"	bne,a,pn	%%icc, 1b\n"
+"	 mov		%%g5, %0\n"
+"	membar		#StoreLoad | #StoreStore\n"
+	: "=&r" (val)
 	: "0" (val), "r" (m)
 	: "g5", "g7", "cc", "memory");
 	return val;
@@ -232,15 +232,15 @@
 
 extern __inline__ unsigned long xchg64(__volatile__ unsigned long *m, unsigned long val)
 {
-	__asm__ __volatile__("
-	mov		%0, %%g5
-1:	ldx		[%2], %%g7
-	casx		[%2], %%g7, %0
-	cmp		%%g7, %0
-	bne,a,pn	%%xcc, 1b
-	 mov		%%g5, %0
-	membar		#StoreLoad | #StoreStore
-"	: "=&r" (val)
+	__asm__ __volatile__(
+"	mov		%0, %%g5\n"
+"1:	ldx		[%2], %%g7\n"
+"	casx		[%2], %%g7, %0\n"
+"	cmp		%%g7, %0\n"
+"	bne,a,pn	%%xcc, 1b\n"
+"	 mov		%%g5, %0\n"
+"	membar		#StoreLoad | #StoreStore\n"
+	: "=&r" (val)
 	: "0" (val), "r" (m)
 	: "g5", "g7", "cc", "memory");
 	return val;
diff -urN linux-2.4.4-pre7/include/asm-sparc64/visasm.h linux/include/asm-sparc64/visasm.h
--- linux-2.4.4-pre7/include/asm-sparc64/visasm.h	Thu Apr 22 19:24:52 1999
+++ linux/include/asm-sparc64/visasm.h	Mon Dec  3 22:37:55 2001
@@ -1,4 +1,4 @@
-/* $Id: visasm.h,v 1.4 1999/04/19 01:25:55 davem Exp $ */
+/* $Id: visasm.h,v 1.5 2001/04/24 01:09:12 davem Exp $ */
 #ifndef _SPARC64_VISASM_H
 #define _SPARC64_VISASM_H
 
@@ -45,16 +45,16 @@
 
 #ifndef __ASSEMBLY__	
 extern __inline__ void save_and_clear_fpu(void) {
-	__asm__ __volatile__ ("
-		rd %%fprs, %%o5
-		andcc %%o5, %0, %%g0
-		be,pt %%icc, 299f
-		 sethi %%hi(298f), %%g7
-		ba VISenter	! Note. This cannot be bp, as it may be too far from VISenter.
-		 or %%g7, %%lo(298f), %%g7
-	298:	wr %%g0, 0, %%fprs
-	299:
-		" : : "i" (FPRS_FEF|FPRS_DU) :
+	__asm__ __volatile__ (
+"		rd %%fprs, %%o5\n"
+"		andcc %%o5, %0, %%g0\n"
+"		be,pt %%icc, 299f\n"
+"		 sethi %%hi(298f), %%g7\n"
+"		ba VISenter	! Note. This cannot be bp, as it may be too far from VISenter.\n"
+"		 or %%g7, %%lo(298f), %%g7\n"
+"	298:	wr %%g0, 0, %%fprs\n"
+"	299:\n"
+"		" : : "i" (FPRS_FEF|FPRS_DU) :
 		"o5", "g1", "g2", "g3", "g7", "cc");
 }
 #endif
diff -urN linux-2.4.4-pre7/include/linux/dcache.h linux/include/linux/dcache.h
--- linux-2.4.4-pre7/include/linux/dcache.h	Mon Mar 26 15:48:10 2001
+++ linux/include/linux/dcache.h	Mon Dec  3 22:37:55 2001
@@ -78,7 +78,7 @@
 	unsigned long d_time;		/* used by d_revalidate */
 	struct dentry_operations  *d_op;
 	struct super_block * d_sb;	/* The root of the dentry tree */
-	unsigned long d_reftime;	/* last time referenced */
+	unsigned long d_vfs_flags;
 	void * d_fsdata;		/* fs-specific data */
 	unsigned char d_iname[DNAME_INLINE_LEN]; /* small names */
 };
diff -urN linux-2.4.4-pre7/include/linux/elf.h linux/include/linux/elf.h
--- linux-2.4.4-pre7/include/linux/elf.h	Mon Mar 26 15:49:13 2001
+++ linux/include/linux/elf.h	Mon Dec  3 22:37:55 2001
@@ -74,6 +74,8 @@
 
 #define EM_X8664	62	/* AMD x86-64 */
 
+#define EM_S390		22	/* IBM S/390 */
+
 #define EM_CRIS         76      /* Axis Communications 32-bit embedded processor */
 
 /*
@@ -83,9 +85,9 @@
 #define EM_ALPHA	0x9026
 
 /*
- * This is an interim value for S390 architecture
+ * This is the old interim value for S/390 architecture
  */
-#define EM_S390         0xA390
+#define EM_S390_OLD     0xA390
 
 /* This is the info that is needed to parse the dynamic section of the file */
 #define DT_NULL		0
diff -urN linux-2.4.4-pre7/include/linux/fs.h linux/include/linux/fs.h
--- linux-2.4.4-pre7/include/linux/fs.h	Mon Dec  3 22:37:25 2001
+++ linux/include/linux/fs.h	Mon Dec  3 22:37:55 2001
@@ -121,12 +121,6 @@
 #define MS_RMT_MASK	(MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|\
 			MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME|MS_NODIRATIME)
 
-/*
- * Magic mount flag number. Has to be or-ed to the flag values.
- */
-#define MS_MGC_VAL 0xC0ED0000	/* magic flag number to indicate "new" flags */
-#define MS_MGC_MSK 0xffff0000	/* magic flag number mask */
-
 /* Inode flags - they have nothing to superblock flags now */
 
 #define S_SYNC		1	/* Writes are synced at once */
diff -urN linux-2.4.4-pre7/include/linux/string.h linux/include/linux/string.h
--- linux-2.4.4-pre7/include/linux/string.h	Mon Mar 26 15:48:11 2001
+++ linux/include/linux/string.h	Mon Dec  3 22:37:55 2001
@@ -1,6 +1,10 @@
 #ifndef _LINUX_STRING_H_
 #define _LINUX_STRING_H_
 
+/* We don't want strings.h stuff being user by user stuff by accident */
+
+#ifdef __KERNEL__
+
 #include <linux/types.h>	/* for size_t */
 #include <linux/stddef.h>	/* for NULL */
 
@@ -80,4 +84,5 @@
 }
 #endif
 
+#endif
 #endif /* _LINUX_STRING_H_ */
diff -urN linux-2.4.4-pre7/include/net/addrconf.h linux/include/net/addrconf.h
--- linux-2.4.4-pre7/include/net/addrconf.h	Mon Dec 11 13:31:47 2000
+++ linux/include/net/addrconf.h	Mon Dec  3 22:37:55 2001
@@ -78,6 +78,7 @@
 						struct in6_addr *addr);
 extern void			ipv6_mc_up(struct inet6_dev *idev);
 extern void			ipv6_mc_down(struct inet6_dev *idev);
+extern void			ipv6_mc_init_dev(struct inet6_dev *idev);
 extern void			ipv6_mc_destroy_dev(struct inet6_dev *idev);
 extern void			addrconf_dad_failure(struct inet6_ifaddr *ifp);
 
diff -urN linux-2.4.4-pre7/init/main.c linux/init/main.c
--- linux-2.4.4-pre7/init/main.c	Mon Dec  3 22:37:25 2001
+++ linux/init/main.c	Mon Dec  3 22:37:55 2001
@@ -32,6 +32,11 @@
 #include <asm/io.h>
 #include <asm/bugs.h>
 
+#if defined(CONFIG_ARCH_S390)
+#include <asm/s390mach.h>
+#include <asm/ccwcache.h>
+#endif
+
 #ifdef CONFIG_PCI
 #include <linux/pci.h>
 #endif
@@ -48,10 +53,6 @@
 #  include <asm/mtrr.h>
 #endif
 
-#ifdef CONFIG_3215_CONSOLE
-extern int con3215_activate(void);
-#endif
-
 #ifdef CONFIG_NUBUS
 #include <linux/nubus.h>
 #endif
@@ -215,17 +216,7 @@
 	{ "apblock", APBLOCK_MAJOR << 8},
 	{ "ddv", DDV_MAJOR << 8},
 	{ "jsfd",    JSFD_MAJOR << 8},
-#ifdef CONFIG_MDISK
-        { "mnda", (MDISK_MAJOR << MINORBITS)},
-        { "mndb", (MDISK_MAJOR << MINORBITS) + 1},
-        { "mndc", (MDISK_MAJOR << MINORBITS) + 2},
-        { "mndd", (MDISK_MAJOR << MINORBITS) + 3},
-        { "mnde", (MDISK_MAJOR << MINORBITS) + 4},
-        { "mndf", (MDISK_MAJOR << MINORBITS) + 5},
-        { "mndg", (MDISK_MAJOR << MINORBITS) + 6},
-        { "mndh", (MDISK_MAJOR << MINORBITS) + 7},
-#endif
-#ifdef CONFIG_DASD
+#if defined(CONFIG_ARCH_S390)
 	{ "dasda", (DASD_MAJOR << MINORBITS) },
 	{ "dasdb", (DASD_MAJOR << MINORBITS) + (1 << 2) },
 	{ "dasdc", (DASD_MAJOR << MINORBITS) + (2 << 2) },
@@ -570,9 +561,6 @@
 #endif
 	mem_init();
 	kmem_cache_sizes_init();
-#ifdef CONFIG_3215_CONSOLE
-        con3215_activate();
-#endif
 #ifdef CONFIG_PROC_FS
 	proc_root_init();
 #endif
@@ -583,6 +571,9 @@
 	vfs_caches_init(mempages);
 	buffer_init(mempages);
 	page_cache_init(mempages);
+#if defined(CONFIG_ARCH_S390)
+	ccwcache_init();
+#endif
 	kiobuf_setup();
 	signals_init();
 	bdev_init();
@@ -679,6 +670,10 @@
 	 * Ok, at this point all CPU's should be initialized, so
 	 * we can start looking into devices..
 	 */
+#if defined(CONFIG_ARCH_S390)
+	s390_init_machine_check();
+#endif
+
 #ifdef CONFIG_PCI
 	pci_init();
 #endif
diff -urN linux-2.4.4-pre7/kernel/fork.c linux/kernel/fork.c
--- linux-2.4.4-pre7/kernel/fork.c	Mon Dec  3 22:37:25 2001
+++ linux/kernel/fork.c	Mon Dec  3 22:37:55 2001
@@ -652,7 +652,7 @@
 		goto bad_fork_cleanup_sighand;
 	retval = copy_thread(0, clone_flags, stack_start, stack_size, p, regs);
 	if (retval)
-		goto bad_fork_cleanup_sighand;
+		goto bad_fork_cleanup_mm;
 	p->semundo = NULL;
 	
 	/* Our parent execution domain becomes current domain
@@ -708,6 +708,8 @@
 		down(&sem);
 	return retval;
 
+bad_fork_cleanup_mm:
+	exit_mm(p);
 bad_fork_cleanup_sighand:
 	exit_sighand(p);
 bad_fork_cleanup_fs:
diff -urN linux-2.4.4-pre7/net/ipv6/addrconf.c linux/net/ipv6/addrconf.c
--- linux-2.4.4-pre7/net/ipv6/addrconf.c	Fri Feb  9 11:34:13 2001
+++ linux/net/ipv6/addrconf.c	Mon Dec  3 22:37:56 2001
@@ -6,7 +6,7 @@
  *	Pedro Roque		<roque@di.fc.ul.pt>	
  *	Alexey Kuznetsov	<kuznet@ms2.inr.ac.ru>
  *
- *	$Id: addrconf.c,v 1.60 2001/01/01 02:38:30 davem Exp $
+ *	$Id: addrconf.c,v 1.61 2001/04/25 20:46:34 davem Exp $
  *
  *	This program is free software; you can redistribute it and/or
  *      modify it under the terms of the GNU General Public License
@@ -266,6 +266,8 @@
 		in6_dev_hold(ndev);
 		write_unlock_bh(&addrconf_lock);
 
+		ipv6_mc_init_dev(ndev);
+
 #ifdef CONFIG_SYSCTL
 		neigh_sysctl_register(dev, ndev->nd_parms, NET_IPV6, NET_IPV6_NEIGH, "ipv6");
 		addrconf_sysctl_register(ndev, &ndev->cnf);
@@ -313,7 +315,9 @@
 {
 	BUG_TRAP(ifp->if_next==NULL);
 	BUG_TRAP(ifp->lst_next==NULL);
+#ifdef NET_REFCNT_DEBUG
 	printk(KERN_DEBUG "inet6_ifa_finish_destroy\n");
+#endif
 
 	in6_dev_put(ifp->idev);
 
@@ -1415,7 +1419,7 @@
 	}
 
 	spin_lock(&ifp->lock);
-	if (ifp->probes++ <= ifp->idev->cnf.rtr_solicits) {
+	if (ifp->probes++ < ifp->idev->cnf.rtr_solicits) {
 		struct in6_addr all_routers;
 
 		addrconf_mod_timer(ifp, AC_RS,
diff -urN linux-2.4.4-pre7/net/ipv6/mcast.c linux/net/ipv6/mcast.c
--- linux-2.4.4-pre7/net/ipv6/mcast.c	Mon Dec  3 22:37:25 2001
+++ linux/net/ipv6/mcast.c	Mon Dec  3 22:37:56 2001
@@ -5,7 +5,7 @@
  *	Authors:
  *	Pedro Roque		<roque@di.fc.ul.pt>	
  *
- *	$Id: mcast.c,v 1.36 2001/03/03 01:20:10 davem Exp $
+ *	$Id: mcast.c,v 1.37 2001/04/25 20:46:34 davem Exp $
  *
  *	Based on linux/ipv4/igmp.c and linux/ipv4/ip_sockglue.c 
  *
@@ -624,7 +624,6 @@
 void ipv6_mc_down(struct inet6_dev *idev)
 {
 	struct ifmcaddr6 *i;
-	struct in6_addr maddr;
 
 	/* Withdraw multicast list */
 
@@ -632,24 +631,14 @@
 	for (i = idev->mc_list; i; i=i->next)
 		igmp6_group_dropped(i);
 	read_unlock_bh(&idev->lock);
-
-	/* Delete all-nodes address. */
-
-	ipv6_addr_all_nodes(&maddr);
-	ipv6_dev_mc_dec(idev->dev, &maddr);
 }
 
+
 /* Device going up */
 
 void ipv6_mc_up(struct inet6_dev *idev)
 {
 	struct ifmcaddr6 *i;
-	struct in6_addr maddr;
-
-	/* Add all-nodes address. */
-
-	ipv6_addr_all_nodes(&maddr);
-	ipv6_dev_mc_inc(idev->dev, &maddr);
 
 	/* Install multicast list, except for all-nodes (already installed) */
 
@@ -659,6 +648,17 @@
 	read_unlock_bh(&idev->lock);
 }
 
+/* IPv6 device initialization. */
+
+void ipv6_mc_init_dev(struct inet6_dev *idev)
+{
+	struct in6_addr maddr;
+
+	/* Add all-nodes address. */
+	ipv6_addr_all_nodes(&maddr);
+	ipv6_dev_mc_inc(idev->dev, &maddr);
+}
+
 /*
  *	Device is about to be destroyed: clean up.
  */
@@ -666,6 +666,11 @@
 void ipv6_mc_destroy_dev(struct inet6_dev *idev)
 {
 	struct ifmcaddr6 *i;
+	struct in6_addr maddr;
+
+	/* Delete all-nodes address. */
+	ipv6_addr_all_nodes(&maddr);
+	ipv6_dev_mc_dec(idev->dev, &maddr);
 
 	write_lock_bh(&idev->lock);
 	while ((i = idev->mc_list) != NULL) {
diff -urN linux-2.4.4-pre7/net/ipv6/ndisc.c linux/net/ipv6/ndisc.c
--- linux-2.4.4-pre7/net/ipv6/ndisc.c	Mon Dec  3 22:37:25 2001
+++ linux/net/ipv6/ndisc.c	Mon Dec  3 22:37:56 2001
@@ -391,9 +391,11 @@
 	struct in6_addr addr_buf;
         int len;
 	int err;
+	int send_llinfo;
 
 	len = sizeof(struct icmp6hdr) + sizeof(struct in6_addr);
-	if (dev->addr_len)
+	send_llinfo = dev->addr_len && ipv6_addr_type(saddr) != IPV6_ADDR_ANY;
+	if (send_llinfo)
 		len += NDISC_OPT_SPACE(dev->addr_len);
 
 	skb = sock_alloc_send_skb(sk, MAX_HEADER + len + dev->hard_header_len + 15,
@@ -427,7 +429,7 @@
 	/* Set the target address. */
 	ipv6_addr_copy(&msg->target, solicit);
 
-	if (dev->addr_len)
+	if (send_llinfo)
 		ndisc_fill_option((void*)&msg->opt, ND_OPT_SOURCE_LL_ADDR, dev->dev_addr, dev->addr_len);
 
 	/* checksum */
diff -urN linux-2.4.4-pre7/net/ipv6/route.c linux/net/ipv6/route.c
--- linux-2.4.4-pre7/net/ipv6/route.c	Thu Nov  9 15:57:53 2000
+++ linux/net/ipv6/route.c	Mon Dec  3 22:37:56 2001
@@ -5,7 +5,7 @@
  *	Authors:
  *	Pedro Roque		<roque@di.fc.ul.pt>	
  *
- *	$Id: route.c,v 1.49 2000/11/03 01:11:58 davem Exp $
+ *	$Id: route.c,v 1.50 2001/04/25 20:46:35 davem Exp $
  *
  *	This program is free software; you can redistribute it and/or
  *      modify it under the terms of the GNU General Public License
@@ -1394,6 +1394,7 @@
 	   caused by addrconf/ndisc.
 	*/
 	if (rt->rt6i_dev == arg->dev &&
+	    rt->u.dst.pmtu > arg->mtu &&
 	    !(rt->u.dst.mxlock&(1<<RTAX_MTU)))
 		rt->u.dst.pmtu = arg->mtu;
 	rt->u.dst.advmss = max(arg->mtu - 60, ip6_rt_min_advmss);
