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

diff -urN linux-2.5.68-bk2/Makefile linux-2.5.68-bk3/Makefile
--- linux-2.5.68-bk2/Makefile	2003-04-22 04:33:43.000000000 -0700
+++ linux-2.5.68-bk3/Makefile	2003-04-22 04:33:46.000000000 -0700
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 5
 SUBLEVEL = 68
-EXTRAVERSION = -bk2
+EXTRAVERSION = -bk3
 
 # *DOCUMENTATION*
 # To see a list of typical targets execute "make help"
diff -urN linux-2.5.68-bk2/arch/arm/boot/compressed/head-xscale.S linux-2.5.68-bk3/arch/arm/boot/compressed/head-xscale.S
--- linux-2.5.68-bk2/arch/arm/boot/compressed/head-xscale.S	2003-04-19 19:48:56.000000000 -0700
+++ linux-2.5.68-bk3/arch/arm/boot/compressed/head-xscale.S	2003-04-22 04:33:46.000000000 -0700
@@ -35,7 +35,7 @@
 		mcr	p15, 0, r0, c1, c0, 0
 
 #ifdef	CONFIG_ARCH_IQ80321
-		orr	pc, pc, #0xa0000000
+		orr	pc, pc, #PHYS_OFFSET	@ jump to physical memory if we are not there.
 		nop
 		mov	r7, #MACH_TYPE_IQ80321
 #endif
diff -urN linux-2.5.68-bk2/arch/arm/kernel/process.c linux-2.5.68-bk3/arch/arm/kernel/process.c
--- linux-2.5.68-bk2/arch/arm/kernel/process.c	2003-04-19 19:50:48.000000000 -0700
+++ linux-2.5.68-bk3/arch/arm/kernel/process.c	2003-04-22 04:33:46.000000000 -0700
@@ -2,7 +2,7 @@
  *  linux/arch/arm/kernel/process.c
  *
  *  Copyright (C) 1996-2000 Russell King - Converted to ARM.
- *  Origional Copyright (C) 1995  Linus Torvalds
+ *  Original Copyright (C) 1995  Linus Torvalds
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
diff -urN linux-2.5.68-bk2/arch/arm/mach-iop3xx/iop321-pci.c linux-2.5.68-bk3/arch/arm/mach-iop3xx/iop321-pci.c
--- linux-2.5.68-bk2/arch/arm/mach-iop3xx/iop321-pci.c	2003-04-19 19:50:35.000000000 -0700
+++ linux-2.5.68-bk3/arch/arm/mach-iop3xx/iop321-pci.c	2003-04-22 04:33:46.000000000 -0700
@@ -212,13 +212,13 @@
 
 	switch (nr) {
 	case 0:
-		res[0].start = IOP321_PCI_LOWER_IO + 0x6e000000;
-		res[0].end   = IOP321_PCI_LOWER_IO + 0x6e00ffff;
+		res[0].start = IOP321_PCI_IO_BASE + 0x6e000000;
+		res[0].end   = IOP321_PCI_IO_BASE + IOP321_PCI_IO_SIZE-1 + 0x6e000000;
 		res[0].name  = "PCI IO Primary";
 		res[0].flags = IORESOURCE_IO;
 
-		res[1].start = IOP321_PCI_LOWER_MEM;
-		res[1].end   = IOP321_PCI_LOWER_MEM + IOP321_PCI_WINDOW_SIZE;
+		res[1].start = IOP321_PCI_MEM_BASE;
+		res[1].end   = IOP321_PCI_MEM_BASE + IOP321_PCI_MEM_SIZE;
 		res[1].name  = "PCI Memory Primary";
 		res[1].flags = IORESOURCE_MEM;
 		break;
diff -urN linux-2.5.68-bk2/arch/arm/mach-iop3xx/iq80310-time.c linux-2.5.68-bk3/arch/arm/mach-iop3xx/iq80310-time.c
--- linux-2.5.68-bk2/arch/arm/mach-iop3xx/iq80310-time.c	2003-04-19 19:50:32.000000000 -0700
+++ linux-2.5.68-bk3/arch/arm/mach-iop3xx/iq80310-time.c	2003-04-22 04:33:46.000000000 -0700
@@ -101,7 +101,7 @@
 	 *
 	 * Since the timer interrupt is cascaded through the CPLD and
 	 * the 80312 and the demux code calls do_IRQ, the irq count is
-	 * going to be atleast 2 when we get here and this will cause the
+	 * going to be at least 2 when we get here and this will cause the
 	 * kernel to increment the system tick counter even if we're
 	 * idle. This causes it to look like there's always 100% system
 	 * time, which is not the case.  To get around it, we just decrement
diff -urN linux-2.5.68-bk2/arch/arm/mach-iop3xx/mm-321.c linux-2.5.68-bk3/arch/arm/mach-iop3xx/mm-321.c
--- linux-2.5.68-bk2/arch/arm/mach-iop3xx/mm-321.c	2003-04-19 19:49:31.000000000 -0700
+++ linux-2.5.68-bk3/arch/arm/mach-iop3xx/mm-321.c	2003-04-22 04:33:46.000000000 -0700
@@ -1,7 +1,7 @@
 /*
  * linux/arch/arm/mach-iop3xx/mm.c
  *
- * Low level memory intialization for IOP321 based systems
+ * Low level memory initialization for IOP321 based systems
  *
  * Author: Rory Bolt <rorybolt@pacbell.net>
  * Copyright (C) 2002 Rory Bolt
@@ -31,7 +31,7 @@
  /* virtual     physical      length      type */
 
  /* mem mapped registers */
- { 0xfff00000,  0xffffe000,   0x00002000,  MT_DEVICE },
+ { IOP321_VIRT_MEM_BASE,  IOP321_PHY_MEM_BASE,   0x00002000,  MT_DEVICE },
 
  /* PCI IO space */
  { 0xfe000000,  0x90000000,   0x00020000,  MT_DEVICE }
@@ -52,7 +52,7 @@
  /* virtual     physical      length        type */
 
  /* on-board devices */
- { 0xfe800000,  0xfe800000,   0x00100000,   MT_DEVICE }
+ { 0xfe800000,  IQ80321_UART1,   0x00100000,   MT_DEVICE }
 };
 
 void __init iq80321_map_io(void)
diff -urN linux-2.5.68-bk2/arch/arm/mach-pxa/generic.c linux-2.5.68-bk3/arch/arm/mach-pxa/generic.c
--- linux-2.5.68-bk2/arch/arm/mach-pxa/generic.c	2003-04-19 19:48:56.000000000 -0700
+++ linux-2.5.68-bk3/arch/arm/mach-pxa/generic.c	2003-04-22 04:33:46.000000000 -0700
@@ -13,7 +13,7 @@
  *
  * Since this file should be linked before any other machine specific file,
  * the __initcall() here will be executed first.  This serves as default
- * initialization stuff for PXA machines which can be overriden later if
+ * initialization stuff for PXA machines which can be overridden later if
  * need be.
  */
 #include <linux/config.h>
diff -urN linux-2.5.68-bk2/arch/arm/mach-pxa/sleep.S linux-2.5.68-bk3/arch/arm/mach-pxa/sleep.S
--- linux-2.5.68-bk2/arch/arm/mach-pxa/sleep.S	2003-04-19 19:50:45.000000000 -0700
+++ linux-2.5.68-bk3/arch/arm/mach-pxa/sleep.S	2003-04-22 04:33:46.000000000 -0700
@@ -95,7 +95,7 @@
  *       This is to allow sleep_save_sp to be accessed with a relative load
  *       while we can't rely on any MMU translation.  We could have put
  *       sleep_save_sp in the .text section as well, but some setups might
- *       insist on it to be truely read-only.
+ *       insist on it to be truly read-only.
  */
 
 	.data
diff -urN linux-2.5.68-bk2/arch/arm/mach-sa1100/sleep.S linux-2.5.68-bk3/arch/arm/mach-sa1100/sleep.S
--- linux-2.5.68-bk2/arch/arm/mach-sa1100/sleep.S	2003-04-19 19:50:37.000000000 -0700
+++ linux-2.5.68-bk3/arch/arm/mach-sa1100/sleep.S	2003-04-22 04:33:46.000000000 -0700
@@ -171,7 +171,7 @@
  *       This is to allow sleep_save_sp to be accessed with a relative load
  *       while we can't rely on any MMU translation.  We could have put
  *       sleep_save_sp in the .text section as well, but some setups might
- *       insist on it to be truely read-only.
+ *       insist on it to be truly read-only.
  */
 
 	.data
diff -urN linux-2.5.68-bk2/arch/arm/mm/discontig.c linux-2.5.68-bk3/arch/arm/mm/discontig.c
--- linux-2.5.68-bk2/arch/arm/mm/discontig.c	2003-04-19 19:50:44.000000000 -0700
+++ linux-2.5.68-bk3/arch/arm/mm/discontig.c	2003-04-22 04:33:46.000000000 -0700
@@ -20,7 +20,7 @@
 #endif
 
 /*
- * Our node_data structure for discontigous memory.
+ * Our node_data structure for discontiguous memory.
  */
 
 static bootmem_data_t node_bootmem_data[NR_NODES];
diff -urN linux-2.5.68-bk2/arch/i386/Kconfig linux-2.5.68-bk3/arch/i386/Kconfig
--- linux-2.5.68-bk2/arch/i386/Kconfig	2003-04-22 04:33:43.000000000 -0700
+++ linux-2.5.68-bk3/arch/i386/Kconfig	2003-04-22 04:33:46.000000000 -0700
@@ -183,7 +183,7 @@
 	  optimizations.
 
 config MPENTIUMIII
-	bool "Pentium-III/Celeron(Coppermine)"
+	bool "Pentium-III/Celeron(Coppermine)/Pentium-III Xeon"
 	help
 	  Select this for Intel chips based on the Pentium-III and
 	  Celeron-Coppermine core.  This option enables use of some
@@ -191,7 +191,7 @@
 	  extensions.
 
 config MPENTIUM4
-	bool "Pentium-4/Celeron(P4-based)"
+	bool "Pentium-4/Celeron(P4-based)/Xeon"
 	help
 	  Select this for Intel Pentium 4 chips.  This includes both
 	  the Pentium 4 and P4-based Celeron chips.  This option
diff -urN linux-2.5.68-bk2/arch/i386/kernel/irq.c linux-2.5.68-bk3/arch/i386/kernel/irq.c
--- linux-2.5.68-bk2/arch/i386/kernel/irq.c	2003-04-22 04:33:43.000000000 -0700
+++ linux-2.5.68-bk3/arch/i386/kernel/irq.c	2003-04-22 04:33:46.000000000 -0700
@@ -221,13 +221,14 @@
 	local_irq_disable();
 	if (retval != 1) {
 		static int count = 100;
-		while (count) {
+		if (count) {
 			count--;
 			printk(retval
 				? "irq event %d: bogus retval mask %x\n"
 				: "irq %d: nobody cared!\n",
 				irq, 
 				retval);
+			dump_stack();
 		}
 	}
 
diff -urN linux-2.5.68-bk2/arch/i386/kernel/module.c linux-2.5.68-bk3/arch/i386/kernel/module.c
--- linux-2.5.68-bk2/arch/i386/kernel/module.c	2003-04-19 19:49:28.000000000 -0700
+++ linux-2.5.68-bk3/arch/i386/kernel/module.c	2003-04-22 04:33:46.000000000 -0700
@@ -104,9 +104,22 @@
 	return -ENOEXEC;
 }
 
+extern void apply_alternatives(void *start, void *end); 
+
 int module_finalize(const Elf_Ehdr *hdr,
 		    const Elf_Shdr *sechdrs,
 		    struct module *me)
 {
+	Elf_Shdr *s;
+	char *secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset;
+
+	/* look for .altinstructions to patch */ 
+	for (s = sechdrs; s < sechdrs + hdr->e_shnum; s++) { 
+		void *seg; 		
+		if (strcmp(".altinstructions", secstrings + s->sh_name))
+			continue;
+		seg = (void *)s->sh_addr; 
+		apply_alternatives(seg, seg + s->sh_size); 
+	} 	
 	return 0;
 }
diff -urN linux-2.5.68-bk2/arch/i386/kernel/setup.c linux-2.5.68-bk3/arch/i386/kernel/setup.c
--- linux-2.5.68-bk2/arch/i386/kernel/setup.c	2003-04-22 04:33:43.000000000 -0700
+++ linux-2.5.68-bk3/arch/i386/kernel/setup.c	2003-04-22 04:33:46.000000000 -0700
@@ -795,6 +795,63 @@
 		pci_mem_start = low_mem_size;
 }
 
+/* Replace instructions with better alternatives for this CPU type.
+
+   This runs before SMP is initialized to avoid SMP problems with
+   self modifying code. This implies that assymetric systems where
+   APs have less capabilities than the boot processor are not handled. 
+    
+   In this case boot with "noreplacement". */ 
+void __init apply_alternatives(void *start, void *end) 
+{ 
+	struct alt_instr *a; 
+	int diff, i, k;
+
+	for (a = start; a < end; 
+	     a = (void *)ALIGN((unsigned long)(a + 1) + a->instrlen, 4)) { 
+		if (!boot_cpu_has(a->cpuid))
+			continue;
+		BUG_ON(a->replacementlen > a->instrlen); 
+		memcpy(a->instr, a->replacement, a->replacementlen); 
+		diff = a->instrlen - a->replacementlen; 
+		for (i = a->replacementlen; diff > 0; diff -= k, i += k) {
+			static const char *nops[] = {
+				0,
+				"\x90",
+#if CONFIG_MK7 || CONFIG_MK8
+				"\x66\x90",
+				"\x66\x66\x90",
+				"\x66\x66\x66\x90",
+#else
+				"\x89\xf6",
+				"\x8d\x76\x00",
+				"\x8d\x74\x26\x00",
+#endif
+			};
+			k = min_t(int, diff, ARRAY_SIZE(nops)); 
+			memcpy(a->instr + i, nops[k], k); 
+		} 
+	}
+} 
+
+static int no_replacement __initdata = 0; 
+ 
+void __init alternative_instructions(void)
+{
+	extern struct alt_instr __alt_instructions[], __alt_instructions_end[];
+	if (no_replacement) 
+		return;
+	apply_alternatives(__alt_instructions, __alt_instructions_end);
+}
+
+static int __init noreplacement_setup(char *s)
+{ 
+     no_replacement = 1; 
+     return 0; 
+} 
+
+__setup("noreplacement", noreplacement_setup); 
+
 void __init setup_arch(char **cmdline_p)
 {
 	unsigned long max_low_pfn;
diff -urN linux-2.5.68-bk2/arch/i386/vmlinux.lds.S linux-2.5.68-bk3/arch/i386/vmlinux.lds.S
--- linux-2.5.68-bk2/arch/i386/vmlinux.lds.S	2003-04-19 19:48:54.000000000 -0700
+++ linux-2.5.68-bk3/arch/i386/vmlinux.lds.S	2003-04-22 04:33:46.000000000 -0700
@@ -81,6 +81,10 @@
   __con_initcall_start = .;
   .con_initcall.init : { *(.con_initcall.init) }
   __con_initcall_end = .;
+  . = ALIGN(4);
+  __alt_instructions = .;
+  .altinstructions : { *(.altinstructions) } 
+  __alt_instructions_end = .; 
   . = ALIGN(4096);
   __initramfs_start = .;
   .init.ramfs : { *(.init.ramfs) }
diff -urN linux-2.5.68-bk2/include/asm-arm/arch-adifcc/time.h linux-2.5.68-bk3/include/asm-arm/arch-adifcc/time.h
--- linux-2.5.68-bk2/include/asm-arm/arch-adifcc/time.h	2003-04-19 19:51:18.000000000 -0700
+++ linux-2.5.68-bk3/include/asm-arm/arch-adifcc/time.h	2003-04-22 04:33:47.000000000 -0700
@@ -4,6 +4,6 @@
  */
 
 /*
- * No on board timer, implemenation @ arch/arm/kernel/xscale-time.c
+ * No on board timer, implementation @ arch/arm/kernel/xscale-time.c
  */
 
diff -urN linux-2.5.68-bk2/include/asm-arm/arch-clps711x/memory.h linux-2.5.68-bk3/include/asm-arm/arch-clps711x/memory.h
--- linux-2.5.68-bk2/include/asm-arm/arch-clps711x/memory.h	2003-04-19 19:48:49.000000000 -0700
+++ linux-2.5.68-bk3/include/asm-arm/arch-clps711x/memory.h	2003-04-22 04:33:47.000000000 -0700
@@ -95,7 +95,7 @@
  * Because of the wide memory address space between physical RAM banks on the 
  * SA1100, it's much more convenient to use Linux's NUMA support to implement
  * our memory map representation.  Assuming all memory nodes have equal access 
- * characteristics, we then have generic discontigous memory support.
+ * characteristics, we then have generic discontiguous memory support.
  *
  * Of course, all this isn't mandatory for SA1100 implementations with only
  * one used memory bank.  For those, simply undefine CONFIG_DISCONTIGMEM.
diff -urN linux-2.5.68-bk2/include/asm-arm/arch-epxa10db/ether00.h linux-2.5.68-bk3/include/asm-arm/arch-epxa10db/ether00.h
--- linux-2.5.68-bk2/include/asm-arm/arch-epxa10db/ether00.h	2003-04-19 19:50:37.000000000 -0700
+++ linux-2.5.68-bk3/include/asm-arm/arch-epxa10db/ether00.h	2003-04-22 04:33:47.000000000 -0700
@@ -55,7 +55,7 @@
 #define ETHER_ARC_SIZE         (21)
 
 /*
-*	Regsiter definitions and masks
+*	Register definitions and masks
 */
 #define ETHER_DMA_CTL(base)							(ETHER00_TYPE (base + 0x100))
 #define ETHER_DMA_CTL_DMBURST_OFST				(2)
diff -urN linux-2.5.68-bk2/include/asm-arm/arch-epxa10db/pld_conf00.h linux-2.5.68-bk3/include/asm-arm/arch-epxa10db/pld_conf00.h
--- linux-2.5.68-bk2/include/asm-arm/arch-epxa10db/pld_conf00.h	2003-04-19 19:48:49.000000000 -0700
+++ linux-2.5.68-bk3/include/asm-arm/arch-epxa10db/pld_conf00.h	2003-04-22 04:33:47.000000000 -0700
@@ -8,7 +8,7 @@
 /*
  *  
  *  This file contains the register definitions for the Excalibur
- *  Interrupnt controller INT_CTRL00.
+ *  Interrupt controller INT_CTRL00.
  *
  *  Copyright (C) 2001 Altera Corporation
  *
diff -urN linux-2.5.68-bk2/include/asm-arm/arch-integrator/bits.h linux-2.5.68-bk3/include/asm-arm/arch-integrator/bits.h
--- linux-2.5.68-bk2/include/asm-arm/arch-integrator/bits.h	2003-04-19 19:50:39.000000000 -0700
+++ linux-2.5.68-bk3/include/asm-arm/arch-integrator/bits.h	2003-04-22 04:33:47.000000000 -0700
@@ -16,7 +16,7 @@
 /* DO NOT EDIT!! - this file automatically generated
  *                 from .s file by awk -f s2h.awk
  */
-/*  Bit field defintions
+/*  Bit field definitions
  *  Copyright (C) ARM Limited 1998. All rights reserved.
  */
 
diff -urN linux-2.5.68-bk2/include/asm-arm/arch-iop3xx/iop310.h linux-2.5.68-bk3/include/asm-arm/arch-iop3xx/iop310.h
--- linux-2.5.68-bk2/include/asm-arm/arch-iop3xx/iop310.h	2003-04-19 19:49:26.000000000 -0700
+++ linux-2.5.68-bk3/include/asm-arm/arch-iop3xx/iop310.h	2003-04-22 04:33:47.000000000 -0700
@@ -1,7 +1,7 @@
 /*
  * linux/include/asm/arch-iop3xx/iop310.h
  *
- * Intel IOP310 Compainion Chip definitions
+ * Intel IOP310 Companion Chip definitions
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License version 2 as
diff -urN linux-2.5.68-bk2/include/asm-arm/arch-iop3xx/iop321.h linux-2.5.68-bk3/include/asm-arm/arch-iop3xx/iop321.h
--- linux-2.5.68-bk2/include/asm-arm/arch-iop3xx/iop321.h	2003-04-19 19:51:20.000000000 -0700
+++ linux-2.5.68-bk3/include/asm-arm/arch-iop3xx/iop321.h	2003-04-22 04:33:47.000000000 -0700
@@ -17,12 +17,10 @@
 /*
  * IOP321 I/O and Mem space regions for PCI autoconfiguration
  */
-#define	IOP321_PCI_LOWER_IO		0x90000000
-#define	IOP321_PCI_UPPER_IO		0x9000ffff
-#define IOP321_PCI_LOWER_MEM		0x80000000
-#define IOP321_PCI_UPPER_MEM		0x83ffffff
-
-#define IOP321_PCI_WINDOW_SIZE		64 * 0x100000
+#define	IOP321_PCI_IO_BASE		0x90000000
+#define	IOP321_PCI_IO_SIZE		0x00010000
+#define IOP321_PCI_MEM_BASE		0x40000000
+#define IOP321_PCI_MEM_SIZE		0x40000000
 
 /*
  * IOP321 chipset registers
diff -urN linux-2.5.68-bk2/include/asm-arm/arch-pxa/pxa-regs.h linux-2.5.68-bk3/include/asm-arm/arch-pxa/pxa-regs.h
--- linux-2.5.68-bk2/include/asm-arm/arch-pxa/pxa-regs.h	2003-04-19 19:50:06.000000000 -0700
+++ linux-2.5.68-bk3/include/asm-arm/arch-pxa/pxa-regs.h	2003-04-22 04:33:47.000000000 -0700
@@ -690,9 +690,9 @@
 #define ICSR0		__REG(0x40800014)  /* ICP Status Register 0 */
 #define ICSR1		__REG(0x40800018)  /* ICP Status Register 1 */
 
-#define ICCR0_AME       (1 << 7)           /* Adress match enable */
+#define ICCR0_AME       (1 << 7)           /* Address match enable */
 #define ICCR0_TIE       (1 << 6)           /* Transmit FIFO interrupt enable */
-#define ICCR0_RIE       (1 << 5)           /* Recieve FIFO interrupt enable */
+#define ICCR0_RIE       (1 << 5)           /* Receive FIFO interrupt enable */
 #define ICCR0_RXE       (1 << 4)           /* Receive enable */
 #define ICCR0_TXE       (1 << 3)           /* Transmit enable */
 #define ICCR0_TUS       (1 << 2)           /* Transmit FIFO underrun select */
diff -urN linux-2.5.68-bk2/include/asm-arm/arch-sa1100/graphicsclient.h linux-2.5.68-bk3/include/asm-arm/arch-sa1100/graphicsclient.h
--- linux-2.5.68-bk2/include/asm-arm/arch-sa1100/graphicsclient.h	2003-04-19 19:51:16.000000000 -0700
+++ linux-2.5.68-bk3/include/asm-arm/arch-sa1100/graphicsclient.h	2003-04-22 04:33:47.000000000 -0700
@@ -63,7 +63,7 @@
 #define _ADS_UARTC		0x10140000	/* UART C */
 #define _ADS_UARTD		0x10160000	/* UART D */
 
-/* UART controll lines GPIOs */
+/* UART control lines GPIOs */
 #define GPIO_GC_UART0_RTS       GPIO_GPIO15
 #define GPIO_GC_UART1_RTS	    GPIO_GPIO17
 #define GPIO_GC_UART2_RTS	    GPIO_GPIO19
@@ -71,7 +71,7 @@
 #define GPIO_GC_UART1_CTS       GPIO_GPIO16
 #define GPIO_GC_UART2_CTS       GPIO_GPIO17
 
-/* UART controll lines IRQs */
+/* UART control lines IRQs */
 #define IRQ_GC_UART0_CTS       IRQ_GPIO14
 #define IRQ_GC_UART1_CTS       IRQ_GPIO16
 #define IRQ_GC_UART2_CTS       IRQ_GPIO17
diff -urN linux-2.5.68-bk2/include/asm-arm/arch-sa1100/h3600_gpio.h linux-2.5.68-bk3/include/asm-arm/arch-sa1100/h3600_gpio.h
--- linux-2.5.68-bk2/include/asm-arm/arch-sa1100/h3600_gpio.h	2003-04-19 19:48:48.000000000 -0700
+++ linux-2.5.68-bk3/include/asm-arm/arch-sa1100/h3600_gpio.h	2003-04-22 04:33:47.000000000 -0700
@@ -480,7 +480,7 @@
 #define _H3800_ASIC1_GPIO_State         0x40    /* R   See masks below  (default 0)         */
 #define _H3800_ASIC1_GPIO_Reset         0x42    /* R/W See masks below  (default 0x04)      */
 #define _H3800_ASIC1_GPIO_SleepMask     0x44    /* R/W 0:don't mask, 1:mask trigger in sleep mode  */
-#define _H3800_ASIC1_GPIO_SleepDir      0x46    /* R/W direction 0:input, 1:ouput in sleep mode    */
+#define _H3800_ASIC1_GPIO_SleepDir      0x46    /* R/W direction 0:input, 1:output in sleep mode    */
 #define _H3800_ASIC1_GPIO_SleepOut      0x48    /* R/W level 0:low, 1:high in sleep mode           */
 #define _H3800_ASIC1_GPIO_Status        0x4A    /* R   Pin status                                  */
 #define _H3800_ASIC1_GPIO_BattFaultDir  0x4C    /* R/W direction 0:input, 1:output in batt_fault   */
diff -urN linux-2.5.68-bk2/include/asm-arm/arch-sa1100/memory.h linux-2.5.68-bk3/include/asm-arm/arch-sa1100/memory.h
--- linux-2.5.68-bk2/include/asm-arm/arch-sa1100/memory.h	2003-04-19 19:48:49.000000000 -0700
+++ linux-2.5.68-bk3/include/asm-arm/arch-sa1100/memory.h	2003-04-22 04:33:47.000000000 -0700
@@ -60,7 +60,7 @@
  * Because of the wide memory address space between physical RAM banks on the 
  * SA1100, it's much convenient to use Linux's NUMA support to implement our 
  * memory map representation.  Assuming all memory nodes have equal access 
- * characteristics, we then have generic discontigous memory support.
+ * characteristics, we then have generic discontiguous memory support.
  *
  * Of course, all this isn't mandatory for SA1100 implementations with only
  * one used memory bank.  For those, simply undefine CONFIG_DISCONTIGMEM.
diff -urN linux-2.5.68-bk2/include/asm-arm/arch-sa1100/uncompress.h linux-2.5.68-bk3/include/asm-arm/arch-sa1100/uncompress.h
--- linux-2.5.68-bk2/include/asm-arm/arch-sa1100/uncompress.h	2003-04-19 19:49:26.000000000 -0700
+++ linux-2.5.68-bk3/include/asm-arm/arch-sa1100/uncompress.h	2003-04-22 04:33:47.000000000 -0700
@@ -32,7 +32,7 @@
 	} while (0);
 
 	for (; *s; s++) {
-		/* wait for space in the UART's transmiter */
+		/* wait for space in the UART's transmitter */
 		while (!(UART(UTSR1) & UTSR1_TNF));
 
 		/* send the character out. */
diff -urN linux-2.5.68-bk2/include/asm-arm/dma-mapping.h linux-2.5.68-bk3/include/asm-arm/dma-mapping.h
--- linux-2.5.68-bk2/include/asm-arm/dma-mapping.h	2003-04-19 19:48:49.000000000 -0700
+++ linux-2.5.68-bk3/include/asm-arm/dma-mapping.h	2003-04-22 04:33:47.000000000 -0700
@@ -182,7 +182,7 @@
  * @dir: DMA transfer direction
  *
  * Map a set of buffers described by scatterlist in streaming
- * mode for DMA.  This is the scather-gather version of the
+ * mode for DMA.  This is the scatter-gather version of the
  * above pci_map_single interface.  Here the scatter gather list
  * elements are each tagged with the appropriate dma address
  * and length.  They are obtained via sg_dma_{address,length}(SG).
diff -urN linux-2.5.68-bk2/include/asm-arm/proc-armo/pgalloc.h linux-2.5.68-bk3/include/asm-arm/proc-armo/pgalloc.h
--- linux-2.5.68-bk2/include/asm-arm/proc-armo/pgalloc.h	2003-04-19 19:50:36.000000000 -0700
+++ linux-2.5.68-bk3/include/asm-arm/proc-armo/pgalloc.h	2003-04-22 04:33:47.000000000 -0700
@@ -37,7 +37,7 @@
 
 /*
  * We use the old 2.5.5-rmk1 hack for this.
- * This is not truely correct, but should be functional.
+ * This is not truly correct, but should be functional.
  */
 #define pte_alloc_one(mm,addr)	((struct page *)pte_alloc_one_kernel(mm,addr))
 #define pte_free(pte)		pte_free_kernel((pte_t *)pte)
diff -urN linux-2.5.68-bk2/include/asm-arm/sizes.h linux-2.5.68-bk3/include/asm-arm/sizes.h
--- linux-2.5.68-bk2/include/asm-arm/sizes.h	2003-04-19 19:51:11.000000000 -0700
+++ linux-2.5.68-bk3/include/asm-arm/sizes.h	2003-04-22 04:33:47.000000000 -0700
@@ -16,7 +16,7 @@
 /* DO NOT EDIT!! - this file automatically generated
  *                 from .s file by awk -f s2h.awk
  */
-/*  Size defintions
+/*  Size definitions
  *  Copyright (C) ARM Limited 1998. All rights reserved.
  */
 
diff -urN linux-2.5.68-bk2/include/asm-i386/bugs.h linux-2.5.68-bk3/include/asm-i386/bugs.h
--- linux-2.5.68-bk2/include/asm-i386/bugs.h	2003-04-19 19:48:52.000000000 -0700
+++ linux-2.5.68-bk3/include/asm-i386/bugs.h	2003-04-22 04:33:47.000000000 -0700
@@ -200,6 +200,8 @@
 #endif
 }
 
+extern void alternative_instructions(void);
+
 static void __init check_bugs(void)
 {
 	identify_cpu(&boot_cpu_data);
@@ -212,4 +214,5 @@
 	check_hlt();
 	check_popad();
 	system_utsname.machine[1] = '0' + (boot_cpu_data.x86 > 6 ? 6 : boot_cpu_data.x86);
+	alternative_instructions(); 
 }
diff -urN linux-2.5.68-bk2/include/asm-i386/system.h linux-2.5.68-bk3/include/asm-i386/system.h
--- linux-2.5.68-bk2/include/asm-i386/system.h	2003-04-19 19:48:48.000000000 -0700
+++ linux-2.5.68-bk3/include/asm-i386/system.h	2003-04-22 04:33:47.000000000 -0700
@@ -4,6 +4,7 @@
 #include <linux/config.h>
 #include <linux/kernel.h>
 #include <asm/segment.h>
+#include <asm/cpufeature.h>
 #include <linux/bitops.h> /* for LOCK_PREFIX */
 
 #ifdef __KERNEL__
@@ -276,6 +277,37 @@
 /* Compiling for a 386 proper.	Is it worth implementing via cli/sti?  */
 #endif
 
+struct alt_instr { 
+	u8 *instr; 		/* original instruction */
+	u8  cpuid;		/* cpuid bit set for replacement */
+	u8  instrlen;		/* length of original instruction */
+	u8  replacementlen; 	/* length of new instruction, <= instrlen */ 
+	u8  replacement[0];   	/* new instruction */
+}; 
+
+/* 
+ * Alternative instructions for different CPU types or capabilities.
+ * 
+ * This allows to use optimized instructions even on generic binary
+ * kernels.
+ * 
+ * length of oldinstr must be longer or equal the length of newinstr
+ * It can be padded with nops as needed.
+ * 
+ * For non barrier like inlines please define new variants
+ * without volatile and memory clobber.
+ */
+#define alternative(oldinstr, newinstr, feature) 	\
+	asm volatile ("661:\n\t" oldinstr "\n662:\n" 		     \
+		      ".section .altinstructions,\"a\"\n"     	     \
+		      "  .align 4\n"				       \
+		      "  .long 661b\n"            /* label */          \
+		      "  .byte %c0\n"             /* feature bit */    \
+		      "  .byte 662b-661b\n"       /* sourcelen */      \
+		      "  .byte 664f-663f\n"       /* replacementlen */ \
+		      "663:\n\t" newinstr "\n664:\n"   /* replacement */    \
+		      ".previous" :: "i" (feature) : "memory")  
+
 /*
  * Force strict CPU ordering.
  * And yes, this is required on UP too when we're talking
@@ -294,13 +326,15 @@
  * nop for these.
  */
  
-#ifdef CONFIG_X86_SSE2
-#define mb()	asm volatile("mfence" ::: "memory")
-#define rmb()	asm volatile("lfence" ::: "memory")
-#else
-#define mb() 	__asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory")
-#define rmb()	mb()
-#endif
+
+/* 
+ * Actually only lfence would be needed for mb() because all stores done 
+ * by the kernel should be already ordered. But keep a full barrier for now. 
+ */
+
+#define mb() alternative("lock; addl $0,0(%%esp)", "mfence", X86_FEATURE_XMM2)
+#define rmb() alternative("lock; addl $0,0(%%esp)", "lfence", X86_FEATURE_XMM2)
+
 /**
  * read_barrier_depends - Flush all pending reads that subsequents reads
  * depend on.
@@ -356,7 +390,9 @@
 #define read_barrier_depends()	do { } while(0)
 
 #ifdef CONFIG_X86_OOSTORE
-#define wmb() 	__asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory")
+/* Actually there are no OOO store capable CPUs for now that do SSE, 
+   but make it already an possibility. */
+#define wmb() alternative("lock; addl $0,0(%%esp)", "sfence", X86_FEATURE_XMM)
 #else
 #define wmb()	__asm__ __volatile__ ("": : :"memory")
 #endif
diff -urN linux-2.5.68-bk2/mm/mmap.c linux-2.5.68-bk3/mm/mmap.c
--- linux-2.5.68-bk2/mm/mmap.c	2003-04-19 19:50:02.000000000 -0700
+++ linux-2.5.68-bk3/mm/mmap.c	2003-04-22 04:33:47.000000000 -0700
@@ -355,6 +355,24 @@
 }
 
 /*
+ * If the vma has a ->close operation then the driver probably needs to release
+ * per-vma resources, so we don't attempt to merge those.
+ */
+#define VM_SPECIAL (VM_IO | VM_DONTCOPY | VM_DONTEXPAND | VM_RESERVED)
+
+static inline int is_mergeable_vma(struct vm_area_struct *vma,
+			struct file *file, unsigned long vm_flags)
+{
+	if (vma->vm_ops && vma->vm_ops->close)
+		return 0;
+	if (vma->vm_file != file)
+		return 0;
+	if (vma->vm_flags != vm_flags)
+		return 0;
+	return 1;
+}
+
+/*
  * Return true if we can merge this (vm_flags,file,vm_pgoff,size)
  * in front of (at a lower virtual address and file offset than) the vma.
  *
@@ -366,9 +384,7 @@
 can_vma_merge_before(struct vm_area_struct *vma, unsigned long vm_flags,
 	struct file *file, unsigned long vm_pgoff, unsigned long size)
 {
-	if ((vma->vm_flags & VM_DONTEXPAND) || (vm_flags & VM_DONTEXPAND))
-		return 0;
-	if (vma->vm_file == file && vma->vm_flags == vm_flags) {
+	if (is_mergeable_vma(vma, file, vm_flags)) {
 		if (!file)
 			return 1;	/* anon mapping */
 		if (vma->vm_pgoff == vm_pgoff + size)
@@ -385,9 +401,7 @@
 can_vma_merge_after(struct vm_area_struct *vma, unsigned long vm_flags,
 	struct file *file, unsigned long vm_pgoff)
 {
-	if ((vma->vm_flags & VM_DONTEXPAND) || (vm_flags & VM_DONTEXPAND))
-		return 0;
-	if (vma->vm_file == file && vma->vm_flags == vm_flags) {
+	if (is_mergeable_vma(vma, file, vm_flags)) {
 		unsigned long vma_size;
 
 		if (!file)
@@ -412,6 +426,13 @@
 {
 	spinlock_t * lock = &mm->page_table_lock;
 
+	/*
+	 * We later require that vma->vm_flags == vm_flags, so this tests
+	 * vma->vm_flags & VM_SPECIAL, too.
+	 */
+	if (vm_flags & VM_SPECIAL)
+		return 0;
+
 	if (!prev) {
 		prev = rb_entry(rb_parent, struct vm_area_struct, vm_rb);
 		goto merge_next;
@@ -421,6 +442,7 @@
 	 * Can it merge with the predecessor?
 	 */
 	if (prev->vm_end == addr &&
+			is_mergeable_vma(prev, file, vm_flags) &&
 			can_vma_merge_after(prev, vm_flags, file, pgoff)) {
 		struct vm_area_struct *next;
 		struct inode *inode = file ? file->f_dentry->d_inode : NULL;
