## Automatically generated incremental diff
## From:   linux-2.4.22-bk14
## To:     linux-2.4.22-bk15
## Robot:  $Id: make-incremental-diff,v 1.11 2002/02/20 02:59:33 hpa Exp $

diff -urN linux-2.4.22-bk14/Makefile linux-2.4.22-bk15/Makefile
--- linux-2.4.22-bk14/Makefile	2003-09-12 02:59:11.000000000 -0700
+++ linux-2.4.22-bk15/Makefile	2003-09-12 02:59:48.000000000 -0700
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 22
-EXTRAVERSION = -bk14
+EXTRAVERSION = -bk15
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
diff -urN linux-2.4.22-bk14/arch/ppc/8260_io/uart.c linux-2.4.22-bk15/arch/ppc/8260_io/uart.c
--- linux-2.4.22-bk14/arch/ppc/8260_io/uart.c	2003-08-25 04:44:40.000000000 -0700
+++ linux-2.4.22-bk15/arch/ppc/8260_io/uart.c	2003-09-12 02:59:55.000000000 -0700
@@ -47,6 +47,10 @@
 #include <asm/cpm_8260.h>
 #include <asm/irq.h>
 
+#ifdef CONFIG_MAGIC_SYSRQ
+#include <linux/sysrq.h>
+#endif
+
 #ifdef CONFIG_SERIAL_CONSOLE
 #include <linux/console.h>
 
@@ -68,6 +72,14 @@
 static int serial_refcount;
 static int serial_console_setup(struct console *co, char *options);
 
+static void serial_console_write(struct console *c, const char *s,
+		                                unsigned count);
+static kdev_t serial_console_device(struct console *c);
+
+#if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+static unsigned long break_pressed; /* break, really ... */
+#endif
+
 /*
  * Serial driver configuration section.  Here are the various options:
  */
@@ -181,6 +193,16 @@
 	cbd_t			*tx_cur;
 } ser_info_t;
 
+static struct console sercons = {
+        name:           "ttyS",
+        write:          serial_console_write,
+        device:         serial_console_device,
+        setup:          serial_console_setup,
+        flags:          CON_PRINTBUFFER,
+        index:          CONFIG_SERIAL_CONSOLE_PORT,
+};
+
+
 static void change_speed(ser_info_t *info);
 static void rs_8xx_wait_until_sent(struct tty_struct *tty, int timeout);
 
@@ -302,7 +324,7 @@
 	mark_bh(SERIAL_BH);
 }
 
-static _INLINE_ void receive_chars(ser_info_t *info)
+static _INLINE_ void receive_chars(ser_info_t *info, struct pt_regs *regs)
 {
 	struct tty_struct *tty = info->tty;
 	unsigned char ch, *cp;
@@ -417,6 +439,19 @@
 					}
 				}
 			}
+
+#if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+			if (break_pressed && info->line == sercons.index) {
+				if (ch != 0 && time_before(jiffies,
+							break_pressed + HZ*5)) {
+					handle_sysrq(ch, regs, NULL, NULL);
+					break_pressed = 0;
+					goto ignore_char;
+				} else
+					break_pressed = 0;
+			}
+#endif
+			
 			if (tty->flip.count >= TTY_FLIPBUF_SIZE)
 				break;
 
@@ -425,6 +460,10 @@
 			tty->flip.count++;
 		}
 
+#if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+	ignore_char:
+#endif
+
 		/* This BD is ready to be used again.  Clear status.
 		 * Get next BD.
 		 */
@@ -442,7 +481,36 @@
 	queue_task(&tty->flip.tqueue, &tq_timer);
 }
 
-static _INLINE_ void transmit_chars(ser_info_t *info)
+static _INLINE_ void receive_break(ser_info_t *info, struct pt_regs *regs)
+{
+	struct tty_struct *tty = info->tty;
+
+	info->state->icount.brk++;
+
+#if defined(CONFIG_SERIAL_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ)
+	if (info->line == sercons.index) {
+		if (!break_pressed) {
+			break_pressed = jiffies;
+			return;
+		} else
+			break_pressed = 0;
+	}
+#endif
+
+	/* Check to see if there is room in the tty buffer for
+	 * the break.  If not, we exit now, losing the break.  FIXME
+	 */
+	if ((tty->flip.count + 1) >= TTY_FLIPBUF_SIZE)
+		return;
+	*(tty->flip.flag_buf_ptr++) = TTY_BREAK;
+	*(tty->flip.char_buf_ptr++) = 0;
+	tty->flip.count++;
+
+	queue_task(&tty->flip.tqueue, &tq_timer);
+}
+
+
+static _INLINE_ void transmit_chars(ser_info_t *info, struct pt_regs *regs)
 {
 
 	if (info->flags & TX_WAKEUP) {
@@ -543,19 +611,23 @@
 	if ((idx = info->state->smc_scc_num) < SCC_NUM_BASE) {
 		smcp = &immr->im_smc[idx];
 		events = smcp->smc_smce;
+		if (events & SMCM_BRKE)
+			receive_break(info, regs);
 		if (events & SMCM_RX)
-			receive_chars(info);
+			receive_chars(info, regs);
 		if (events & SMCM_TX)
-			transmit_chars(info);
+			transmit_chars(info, regs);
 		smcp->smc_smce = events;
 	}
 	else {
 		sccp = &immr->im_scc[idx - SCC_IDX_BASE];
 		events = sccp->scc_scce;
+		if (events & SMCM_BRKE)
+			receive_break(info, regs);
 		if (events & SCCM_RX)
-			receive_chars(info);
+			receive_chars(info, regs);
 		if (events & SCCM_TX)
-			transmit_chars(info);
+			transmit_chars(info, regs);
 		sccp->scc_scce = events;
 	}
 
@@ -2218,16 +2290,6 @@
 	return MKDEV(TTYAUX_MAJOR, 64 + c->index);
 }
 
-
-static struct console sercons = {
-	name:		"ttyS",
-	write:		serial_console_write,
-	device:		serial_console_device,
-	setup:		serial_console_setup,
-	flags:		CON_PRINTBUFFER,
-	index:		CONFIG_SERIAL_CONSOLE_PORT,
-};
-
 /*
  *	Register console.
  */
diff -urN linux-2.4.22-bk14/arch/ppc/boot/simple/Makefile linux-2.4.22-bk15/arch/ppc/boot/simple/Makefile
--- linux-2.4.22-bk14/arch/ppc/boot/simple/Makefile	2003-09-12 02:59:17.000000000 -0700
+++ linux-2.4.22-bk15/arch/ppc/boot/simple/Makefile	2003-09-12 02:59:55.000000000 -0700
@@ -28,11 +28,21 @@
 TFTPIMAGE			:= /tftpboot/zImage.embedded
 MISC				:= misc-embedded.o
 endif
+ifeq ($(CONFIG_IBM_OPENBIOS),y)
+ZIMAGE				:= zImage-TREE
+ZIMAGEINITRD			:= zImage.initrd-TREE
+ZNETBOOT			:= zImage.treeboot
+ZNETBOOTRD			:= zImage.initrd.treeboot
+TFTPIMAGE			:= /tftpboot/zImage.embedded
+MISC				:= misc-embedded.o
+endif
 ifeq ($(CONFIG_EBONY),y)
 ZIMAGE				:= zImage-TREE
 ZIMAGEINITRD			:= zImage.initrd-TREE
 END				:= ebony
 ENTRYPOINT			:= 0x00800000
+ZNETBOOT			:= zImage.treeboot
+ZNETBOOTRD			:= zImage.initrd.treeboot
 TFTPIMAGE			:= /tftpboot/zImage.$(END)
 EXTRA				:= misc-44x.o
 endif
@@ -41,6 +51,8 @@
 ZIMAGEINITRD			:= zImage.initrd-TREE
 END				:= ocotea
 ENTRYPOINT			:= 0x00800000
+ZNETBOOT			:= zImage.treeboot
+ZNETBOOTRD			:= zImage.initrd.treeboot
 TFTPIMAGE			:= /tftpboot/zImage.$(END)
 EXTRA				:= misc-44x.o
 endif
@@ -163,10 +175,10 @@
 	mv zvmlinux.initrd ../images/zImage.initrd.embedded
 
 zImage-PAL4: zvmlinux
-	cp zvmlinux ../images/zImage.pal4
+	mv zvmlinux ../images/zImage.pal4
 
 zImage.initrd-PAL4: zvmlinux.initrd
-	cp zvmlinux.initrd ../images/zImage.initrd.pal4
+	mv zvmlinux.initrd ../images/zImage.initrd.pal4
 
 zImage-PPLUS: zvmlinux $(MKPREP) $(MKBUGBOOT)
 	$(MKPREP) -pbp zvmlinux ../images/zImage.pplus
diff -urN linux-2.4.22-bk14/arch/ppc/kernel/head_4xx.S linux-2.4.22-bk15/arch/ppc/kernel/head_4xx.S
--- linux-2.4.22-bk14/arch/ppc/kernel/head_4xx.S	2003-08-25 04:44:40.000000000 -0700
+++ linux-2.4.22-bk15/arch/ppc/kernel/head_4xx.S	2003-09-12 02:59:55.000000000 -0700
@@ -304,6 +304,7 @@
 	 */
 	li	r22, 0x0ce2
 	andc	r21, r21, r22		/* Make sure 20, 21 are zero */
+	ori	r21, r21, _PAGE_HWEXEC	/* make it executable */
 
 	/* find the TLB index that caused the fault.  It has to be here.
 	*/
@@ -782,6 +783,7 @@
 	stw	r23, tlb_4xx_index@l(0)
 
 6:
+	ori	r21, r21, _PAGE_HWEXEC		/* make it executable */
 	tlbwe	r21, r23, TLB_DATA		/* Load TLB LO */
 
 	/* Create EPN.  This is the faulting address plus a static
diff -urN linux-2.4.22-bk14/arch/ppc/kernel/traps.c linux-2.4.22-bk15/arch/ppc/kernel/traps.c
--- linux-2.4.22-bk14/arch/ppc/kernel/traps.c	2003-09-12 02:59:18.000000000 -0700
+++ linux-2.4.22-bk15/arch/ppc/kernel/traps.c	2003-09-12 02:59:55.000000000 -0700
@@ -1,5 +1,5 @@
 /*
- *  linux/arch/ppc/kernel/traps.c
+ *  arch/ppc/kernel/traps.c
  *
  *  Copyright (C) 1995-1996  Gary Thomas (gdt@linuxppc.org)
  *
@@ -173,6 +173,10 @@
 #define REASON_PRIVILEGED	ESR_PPR
 #define REASON_TRAP		ESR_PTR
 
+/* single-step stuff */
+#define single_stepping(regs)	(current->thread.dbcr0 & DBCR0_IC)
+#define clear_single_step(regs)	(current->thread.dbcr0 &= ~DBCR0_IC)
+
 #else
 /* On non-4xx, the reason for the machine check or program
    exception is in the MSR. */
@@ -181,6 +185,9 @@
 #define REASON_ILLEGAL		0x80000
 #define REASON_PRIVILEGED	0x40000
 #define REASON_TRAP		0x20000
+
+#define single_stepping(regs)	((regs)->msr & MSR_SE)
+#define clear_single_step(regs)	((regs)->msr &= ~MSR_SE)
 #endif
 
 void
@@ -320,6 +327,22 @@
 	return retval;
 }
 
+/*
+ * After we have successfully emulated an instruction, we have to
+ * check if the instruction was being single-stepped, and if so,
+ * pretend we got a single-step exception.  This was pointed out
+ * by Kumar Gala.  -- paulus
+ */
+static void emulate_single_step(struct pt_regs *regs)
+{
+	if (single_stepping(regs)) {
+		clear_single_step(regs);
+		if (debugger_sstep(regs))
+			return;
+		_exception(SIGTRAP, regs, TRAP_TRACE, 0);
+	}
+}
+
 void
 ProgramCheckException(struct pt_regs *regs)
 {
@@ -334,8 +357,10 @@
 	 * hardware people - not sure if it can happen on any illegal
 	 * instruction or only on FP instructions, whether there is a
 	 * pattern to occurences etc. -dgibson 31/Mar/2003 */
-	if (!(reason & REASON_TRAP) && do_mathemu(regs) == 0)
+	if (!(reason & REASON_TRAP) && do_mathemu(regs) == 0) {
+		emulate_single_step(regs);
 		return;
+	}
 #endif /* CONFIG_MATH_EMULATION */
 
 	if (reason & REASON_FP) {
@@ -371,8 +396,10 @@
 
 	if (reason & REASON_PRIVILEGED) {
 		/* Try to emulate it if we should. */
-		if (emulate_instruction(regs) == 0)
+		if (emulate_instruction(regs) == 0) {
+			emulate_single_step(regs);
 			return;
+		}
 		_exception(SIGILL, regs, ILL_PRVOPC, regs->nip);
 		return;
 	}
@@ -397,6 +424,7 @@
 	fixed = fix_alignment(regs);
 	if (fixed == 1) {
 		regs->nip += 4;	/* skip over emulated instruction */
+		emulate_single_step(regs);
 		return;
 	}
 	if (fixed == -EFAULT) {
@@ -453,7 +481,8 @@
 			_exception(SIGSEGV, regs, 0, 0);
 		else
 			_exception(SIGILL, regs, ILL_ILLOPC, regs->nip);
-	}
+	} else
+		emulate_single_step(regs);
 }
 #endif /* CONFIG_8xx */
 
diff -urN linux-2.4.22-bk14/arch/ppc/mm/44x_mmu.c linux-2.4.22-bk15/arch/ppc/mm/44x_mmu.c
--- linux-2.4.22-bk14/arch/ppc/mm/44x_mmu.c	2003-09-12 02:59:18.000000000 -0700
+++ linux-2.4.22-bk15/arch/ppc/mm/44x_mmu.c	2003-09-12 02:59:55.000000000 -0700
@@ -53,6 +53,7 @@
 #include <asm/bootx.h>
 #include <asm/machdep.h>
 #include <asm/setup.h>
+#include <asm/ibm44x.h>
 
 #include "mmu_decl.h"
 #include "mem_pieces.h"
@@ -108,7 +109,7 @@
 	 * fetch past the end of system memory that would
 	 * result in a machine check exception.
 	 */
-	if (total_lowmem | (PPC44x_PIN_SIZE - 1))
+	if (total_lowmem & (PPC44x_PIN_SIZE - 1))
 		mem_pieces_remove(&phys_avail, total_lowmem - PAGE_SIZE, PAGE_SIZE, 1);
 
 	/* Determine number of entries necessary to cover lowmem */
@@ -124,6 +125,10 @@
 			unsigned int phys_addr = (PPC44x_LOW_SLOT-i) * PPC44x_PIN_SIZE;
 			ppc44x_pin_tlb(i, phys_addr+PAGE_OFFSET, phys_addr);
 		}
+
+	/* Make sure vmalloc doesn't use virtual space covered by
+	   the last pinned TLB entry. */
+	vmalloc_start = KERNELBASE + _ALIGN(total_lowmem, PPC44x_PIN_SIZE);
 }
 
 /*
diff -urN linux-2.4.22-bk14/arch/ppc/mm/init.c linux-2.4.22-bk15/arch/ppc/mm/init.c
--- linux-2.4.22-bk14/arch/ppc/mm/init.c	2003-08-25 04:44:40.000000000 -0700
+++ linux-2.4.22-bk15/arch/ppc/mm/init.c	2003-09-12 02:59:55.000000000 -0700
@@ -46,6 +46,31 @@
 #include "mem_pieces.h"
 #include "mmu_decl.h"
 
+/*
+ * Just any arbitrary offset to the start of the vmalloc VM area: the
+ * current 64MB value just means that there will be a 64MB "hole" after the
+ * physical memory until the kernel virtual memory starts.  That means that
+ * any out-of-bounds memory accesses will hopefully be caught.
+ * The vmalloc() routines leaves a hole of 4kB between each vmalloced
+ * area for the same reason. ;)
+ *
+ * We no longer map larger than phys RAM with the BATs so we don't have
+ * to worry about the VMALLOC_OFFSET causing problems.  We do have to worry
+ * about clashes between our early calls to ioremap() that start growing down
+ * from ioremap_base being run into the VM area allocations (growing upwards
+ * from VMALLOC_START).  For this reason we have ioremap_bot to check when
+ * we actually run into our mappings setup in the early boot with the VM
+ * system.  This really does become a problem for machines with good amounts
+ * of RAM.  -- Cort
+ */
+#ifdef CONFIG_PIN_TLB
+#define VMALLOC_OFFSET (0x2000000) /* 32M */
+#else
+#define VMALLOC_OFFSET (0x1000000) /* 16M */
+#endif
+
+unsigned long vmalloc_start;
+
 mmu_gather_t mmu_gathers[NR_CPUS];
 
 unsigned long total_memory;
@@ -313,6 +338,7 @@
 	total_lowmem = total_memory;
 	adjust_total_lowmem();
 	set_phys_avail(total_lowmem);
+	vmalloc_start = KERNELBASE + total_lowmem;
 
 	/* Initialize the MMU hardware */
 	if (ppc_md.progress)
@@ -459,6 +485,9 @@
 
 	totalram_pages += free_all_bootmem();
 
+	/* adjust vmalloc_start */
+	vmalloc_start = (vmalloc_start + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1);
+
 #ifdef CONFIG_BLK_DEV_INITRD
 	/* if we are booted from BootX with an initial ramdisk,
 	   make sure the ramdisk pages aren't reserved. */
diff -urN linux-2.4.22-bk14/arch/ppc/platforms/ibm440gp.h linux-2.4.22-bk15/arch/ppc/platforms/ibm440gp.h
--- linux-2.4.22-bk14/arch/ppc/platforms/ibm440gp.h	2003-09-12 02:59:18.000000000 -0700
+++ linux-2.4.22-bk15/arch/ppc/platforms/ibm440gp.h	2003-09-12 02:59:55.000000000 -0700
@@ -22,7 +22,7 @@
 
 #include <linux/config.h>
 
-#include <asm/ibm4xx.h>
+#include <asm/ibm44x.h>
 
 #define EMAC_NUMS		2
 #define UART_NUMS		2
diff -urN linux-2.4.22-bk14/drivers/sound/ymfpci.c linux-2.4.22-bk15/drivers/sound/ymfpci.c
--- linux-2.4.22-bk14/drivers/sound/ymfpci.c	2003-08-25 04:44:42.000000000 -0700
+++ linux-2.4.22-bk15/drivers/sound/ymfpci.c	2003-09-12 02:59:58.000000000 -0700
@@ -2474,7 +2474,6 @@
 	eid = ymfpci_codec_read(codec, AC97_EXTENDED_ID);
 	if (eid==0xFFFF) {
 		printk(KERN_WARNING "ymfpci: no codec attached ?\n");
-		goto out_kfree;
 	}
 
 	unit->ac97_features = eid;
@@ -2626,7 +2625,6 @@
  out_release_region:
 	release_mem_region(pci_resource_start(pcidev, 0), 0x8000);
  out_free:
-	ac97_release_codec(codec->ac97_codec[0]);
 	return -ENODEV;
 }
 
diff -urN linux-2.4.22-bk14/include/asm-ppc/cpm_8260.h linux-2.4.22-bk15/include/asm-ppc/cpm_8260.h
--- linux-2.4.22-bk14/include/asm-ppc/cpm_8260.h	2003-06-13 07:51:38.000000000 -0700
+++ linux-2.4.22-bk15/include/asm-ppc/cpm_8260.h	2003-09-12 02:59:59.000000000 -0700
@@ -195,7 +195,7 @@
 
 /* SMC uart mode register (Internal memory map).
 */
-#define	SMCMR_REN	((ushort)0x0001)
+#define SMCMR_REN	((ushort)0x0001)
 #define SMCMR_TEN	((ushort)0x0002)
 #define SMCMR_DM	((ushort)0x000c)
 #define SMCMR_SM_GCI	((ushort)0x0000)
@@ -212,10 +212,12 @@
 
 /* SMC Event and Mask register.
 */
-#define	SMCM_TXE	((unsigned char)0x10)
-#define	SMCM_BSY	((unsigned char)0x04)
-#define	SMCM_TX		((unsigned char)0x02)
-#define	SMCM_RX		((unsigned char)0x01)
+#define SMCM_BRKE       ((unsigned char)0x40)   /* When in UART Mode */
+#define SMCM_BRK        ((unsigned char)0x10)   /* When in UART Mode */
+#define SMCM_TXE	((unsigned char)0x10)
+#define SMCM_BSY	((unsigned char)0x04)
+#define SMCM_TX		((unsigned char)0x02)
+#define SMCM_RX		((unsigned char)0x01)
 
 /* Baud rate generators.
 */
@@ -314,10 +316,10 @@
 
 /* SCC Event and Mask register.
 */
-#define	SCCM_TXE	((unsigned char)0x10)
-#define	SCCM_BSY	((unsigned char)0x04)
-#define	SCCM_TX		((unsigned char)0x02)
-#define	SCCM_RX		((unsigned char)0x01)
+#define SCCM_TXE	((unsigned char)0x10)
+#define SCCM_BSY	((unsigned char)0x04)
+#define SCCM_TX		((unsigned char)0x02)
+#define SCCM_RX		((unsigned char)0x01)
 
 typedef struct scc_param {
 	ushort	scc_rbase;	/* Rx Buffer descriptor base address */
diff -urN linux-2.4.22-bk14/include/asm-ppc/highmem.h linux-2.4.22-bk15/include/asm-ppc/highmem.h
--- linux-2.4.22-bk14/include/asm-ppc/highmem.h	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.22-bk15/include/asm-ppc/highmem.h	2003-09-12 02:59:59.000000000 -0700
@@ -41,13 +41,13 @@
  * easily, subsequent pte tables have to be allocated in one physical
  * chunk of RAM.
  */
-#define PKMAP_BASE (0xfe000000UL)
-#define LAST_PKMAP 1024
+#define PKMAP_BASE	(0xfe000000UL)
+#define LAST_PKMAP	PTRS_PER_PTE
 #define LAST_PKMAP_MASK (LAST_PKMAP-1)
 #define PKMAP_NR(virt)  ((virt-PKMAP_BASE) >> PAGE_SHIFT)
 #define PKMAP_ADDR(nr)  (PKMAP_BASE + ((nr) << PAGE_SHIFT))
 
-#define KMAP_FIX_BEGIN	(0xfe400000UL)
+#define KMAP_FIX_BEGIN	(PKMAP_BASE + 0x00400000UL)
 
 extern void *kmap_high(struct page *page, int nonblock);
 extern void kunmap_high(struct page *page);
diff -urN linux-2.4.22-bk14/include/asm-ppc/pgtable.h linux-2.4.22-bk15/include/asm-ppc/pgtable.h
--- linux-2.4.22-bk14/include/asm-ppc/pgtable.h	2003-09-12 02:59:41.000000000 -0700
+++ linux-2.4.22-bk15/include/asm-ppc/pgtable.h	2003-09-12 02:59:59.000000000 -0700
@@ -109,6 +109,13 @@
 extern unsigned long va_to_phys(unsigned long address);
 extern pte_t *va_to_pte(unsigned long address);
 extern unsigned long ioremap_bot, ioremap_base;
+extern unsigned long vmalloc_start;
+
+/* Start and end of the vmalloc area. */
+#define VMALLOC_START	vmalloc_start
+#define VMALLOC_END	ioremap_bot
+#define VMALLOC_VMADDR(x) ((unsigned long)(x))
+
 #endif /* __ASSEMBLY__ */
 
 /*
@@ -196,32 +203,6 @@
 	printk("%s:%d: bad pgd %08lx.\n", __FILE__, __LINE__, pgd_val(e))
 
 /*
- * Just any arbitrary offset to the start of the vmalloc VM area: the
- * current 64MB value just means that there will be a 64MB "hole" after the
- * physical memory until the kernel virtual memory starts.  That means that
- * any out-of-bounds memory accesses will hopefully be caught.
- * The vmalloc() routines leaves a hole of 4kB between each vmalloced
- * area for the same reason. ;)
- *
- * We no longer map larger than phys RAM with the BATs so we don't have
- * to worry about the VMALLOC_OFFSET causing problems.  We do have to worry
- * about clashes between our early calls to ioremap() that start growing down
- * from ioremap_base being run into the VM area allocations (growing upwards
- * from VMALLOC_START).  For this reason we have ioremap_bot to check when
- * we actually run into our mappings setup in the early boot with the VM
- * system.  This really does become a problem for machines with good amounts
- * of RAM.  -- Cort
- */
-#define VMALLOC_OFFSET (0x1000000) /* 16M */
-#ifdef CONFIG_44x
-#define VMALLOC_START (((_ALIGN((long)high_memory, PPC44x_PIN_SIZE) + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)))
-#else
-#define VMALLOC_START ((((long)high_memory + VMALLOC_OFFSET) & ~(VMALLOC_OFFSET-1)))
-#endif
-#define VMALLOC_VMADDR(x) ((unsigned long)(x))
-#define VMALLOC_END	ioremap_bot
-
-/*
  * Bits in a linux-style PTE.  These match the bits in the
  * (hardware-defined) PowerPC PTE as closely as possible.
  */
diff -urN linux-2.4.22-bk14/include/linux/sched.h linux-2.4.22-bk15/include/linux/sched.h
--- linux-2.4.22-bk14/include/linux/sched.h	2003-06-13 07:51:39.000000000 -0700
+++ linux-2.4.22-bk15/include/linux/sched.h	2003-09-12 02:59:59.000000000 -0700
@@ -575,6 +575,7 @@
 /* per-UID process charging. */
 extern struct user_struct * alloc_uid(uid_t);
 extern void free_uid(struct user_struct *);
+extern void switch_uid(struct user_struct *);
 
 #include <asm/current.h>
 
diff -urN linux-2.4.22-bk14/kernel/kmod.c linux-2.4.22-bk15/kernel/kmod.c
--- linux-2.4.22-bk14/kernel/kmod.c	2002-08-02 17:39:46.000000000 -0700
+++ linux-2.4.22-bk15/kernel/kmod.c	2003-09-12 02:59:59.000000000 -0700
@@ -119,15 +119,7 @@
 		if (curtask->files->fd[i]) close(i);
 	}
 
-	/* Drop the "current user" thing */
-	{
-		struct user_struct *user = curtask->user;
-		curtask->user = INIT_USER;
-		atomic_inc(&INIT_USER->__count);
-		atomic_inc(&INIT_USER->processes);
-		atomic_dec(&user->processes);
-		free_uid(user);
-	}
+	switch_uid(INIT_USER);
 
 	/* Give kmod all effective privileges.. */
 	curtask->euid = curtask->fsuid = 0;
diff -urN linux-2.4.22-bk14/kernel/sched.c linux-2.4.22-bk15/kernel/sched.c
--- linux-2.4.22-bk14/kernel/sched.c	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.22-bk15/kernel/sched.c	2003-09-12 02:59:59.000000000 -0700
@@ -1312,7 +1312,7 @@
 	this_task->cap_permitted = CAP_FULL_SET;
 	this_task->keep_capabilities = 0;
 	memcpy(this_task->rlim, init_task.rlim, sizeof(*(this_task->rlim)));
-	this_task->user = INIT_USER;
+	switch_uid(INIT_USER);
 
 	spin_unlock(&runqueue_lock);
 	write_unlock_irq(&tasklist_lock);
diff -urN linux-2.4.22-bk14/kernel/sys.c linux-2.4.22-bk15/kernel/sys.c
--- linux-2.4.22-bk14/kernel/sys.c	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.22-bk15/kernel/sys.c	2003-09-12 02:59:59.000000000 -0700
@@ -511,19 +511,12 @@
 
 static int set_user(uid_t new_ruid, int dumpclear)
 {
-	struct user_struct *new_user, *old_user;
+	struct user_struct *new_user;
 
-	/* What if a process setreuid()'s and this brings the
-	 * new uid over his NPROC rlimit?  We can check this now
-	 * cheaply with the new uid cache, so if it matters
-	 * we should be checking for it.  -DaveM
-	 */
 	new_user = alloc_uid(new_ruid);
 	if (!new_user)
 		return -EAGAIN;
-	old_user = current->user;
-	atomic_dec(&old_user->processes);
-	atomic_inc(&new_user->processes);
+	switch_uid(new_user);
 
 	if(dumpclear)
 	{
@@ -531,8 +524,6 @@
 		wmb();
 	}
 	current->uid = new_ruid;
-	current->user = new_user;
-	free_uid(old_user);
 	return 0;
 }
 
diff -urN linux-2.4.22-bk14/kernel/user.c linux-2.4.22-bk15/kernel/user.c
--- linux-2.4.22-bk14/kernel/user.c	2000-11-28 22:43:39.000000000 -0800
+++ linux-2.4.22-bk15/kernel/user.c	2003-09-12 02:59:59.000000000 -0700
@@ -120,6 +120,23 @@
 	return up;
 }
 
+void switch_uid(struct user_struct *new_user)
+{
+ struct user_struct *old_user;
+
+ /* What if a process setreuid()'s and this brings the
+ * new uid over his NPROC rlimit? We can check this now
+ * cheaply with the new uid cache, so if it matters
+ * we should be checking for it. -DaveM
+ */
+ old_user = current->user;
+ atomic_inc(&new_user->__count);
+ atomic_inc(&new_user->processes);
+ atomic_dec(&old_user->processes);
+ current->user = new_user;
+ free_uid(old_user);
+}
+
 
 static int __init uid_cache_init(void)
 {
