## Automatically generated incremental diff
## From:   linux-2.4.30-pre3
## To:     linux-2.4.30-rc1
## Robot:  $Id: make-incremental-diff,v 1.12 2004/01/06 07:19:36 hpa Exp $

diff -urN linux-2.4.30-pre3/Makefile linux-2.4.30-rc1/Makefile
--- linux-2.4.30-pre3/Makefile	2005-03-18 19:16:19.441014381 -0800
+++ linux-2.4.30-rc1/Makefile	2005-03-18 19:16:22.134127218 -0800
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 30
-EXTRAVERSION = -pre3
+EXTRAVERSION = -rc1
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
diff -urN linux-2.4.30-pre3/arch/i386/kernel/earlyquirk.c linux-2.4.30-rc1/arch/i386/kernel/earlyquirk.c
--- linux-2.4.30-pre3/arch/i386/kernel/earlyquirk.c	2005-03-18 19:16:19.443014465 -0800
+++ linux-2.4.30-rc1/arch/i386/kernel/earlyquirk.c	2005-03-18 19:16:22.136127302 -0800
@@ -8,7 +8,7 @@
 #include <asm/pci-direct.h>
 #include <asm/acpi.h>
 
-#ifdef CONFIG_ACPI
+#ifdef CONFIG_ACPI_BOOT
 static int __init check_bridge(int vendor, int device) 
 {
 	/* According to Nvidia all timer overrides are bogus. Just ignore
diff -urN linux-2.4.30-pre3/arch/i386/kernel/i387.c linux-2.4.30-rc1/arch/i386/kernel/i387.c
--- linux-2.4.30-pre3/arch/i386/kernel/i387.c	2003-08-25 04:44:39.000000000 -0700
+++ linux-2.4.30-rc1/arch/i386/kernel/i387.c	2005-03-18 19:16:22.137127344 -0800
@@ -128,16 +128,17 @@
 static inline unsigned long twd_fxsr_to_i387( struct i387_fxsave_struct *fxsave )
 {
 	struct _fpxreg *st = NULL;
+	unsigned long tos = (fxsave->swd >> 11) & 7;
 	unsigned long twd = (unsigned long) fxsave->twd;
 	unsigned long tag;
 	unsigned long ret = 0xffff0000;
 	int i;
 
-#define FPREG_ADDR(f, n)	((char *)&(f)->st_space + (n) * 16);
+#define FPREG_ADDR(f, n)	((void *)&(f)->st_space + (n) * 16);
 
 	for ( i = 0 ; i < 8 ; i++ ) {
 		if ( twd & 0x1 ) {
-			st = (struct _fpxreg *) FPREG_ADDR( fxsave, i );
+			st = FPREG_ADDR( fxsave, (i - tos) & 7 );
 
 			switch ( st->exponent & 0x7fff ) {
 			case 0x7fff:
diff -urN linux-2.4.30-pre3/arch/sparc/Makefile linux-2.4.30-rc1/arch/sparc/Makefile
--- linux-2.4.30-pre3/arch/sparc/Makefile	2004-08-07 16:26:04.000000000 -0700
+++ linux-2.4.30-rc1/arch/sparc/Makefile	2005-03-18 19:16:22.191129607 -0800
@@ -45,6 +45,7 @@
 	$(TOPDIR)/arch/sparc/lib/lib.a
 
 # This one has to come last
+_dir_arch/sparc/boot : $(patsubst %, _dir_%, $(SUBDIRS))
 SUBDIRS += arch/sparc/boot
 CORE_FILES_NO_BTFIX := $(CORE_FILES)
 CORE_FILES += arch/sparc/boot/btfix.o
diff -urN linux-2.4.30-pre3/arch/sparc/boot/Makefile linux-2.4.30-rc1/arch/sparc/boot/Makefile
--- linux-2.4.30-pre3/arch/sparc/boot/Makefile	2002-08-02 17:39:43.000000000 -0700
+++ linux-2.4.30-rc1/arch/sparc/boot/Makefile	2005-03-18 19:16:22.191129607 -0800
@@ -26,11 +26,14 @@
 BTLIBS := $(CORE_FILES_NO_BTFIX) $(FILESYSTEMS) \
 	$(DRIVERS) $(NETWORKS)
 
-# I wanted to make this depend upon BTOBJS so that a parallel
-# build would work, but this fails because $(HEAD) cannot work
-# properly as it will cause head.o to be built with the implicit
-# rules not the ones in kernel/Makefile.  Someone please fix. --DaveM
-vmlinux.o: dummy
+GENFILES := include/linux/version.h include/linux/compile.h $(foreach dirname, $(CORE_FILES_NO_BTFIX), _dir_$(dir $(dirname)))
+.PHONY : $(GENFILES)
+GENFILES += $(BTOBJS)
+
+$(GENFILES):
+	$(MAKE) -C $(TOPDIR) $@
+
+vmlinux.o: $(GENFILES)
 	$(LD) -r $(patsubst %,$(TOPDIR)/%,$(BTOBJS)) \
 		--start-group \
 		$(patsubst %,$(TOPDIR)/%,$(BTLIBS)) \
diff -urN linux-2.4.30-pre3/arch/sparc/kernel/sun4d_smp.c linux-2.4.30-rc1/arch/sparc/kernel/sun4d_smp.c
--- linux-2.4.30-pre3/arch/sparc/kernel/sun4d_smp.c	2003-11-28 10:26:19.000000000 -0800
+++ linux-2.4.30-rc1/arch/sparc/kernel/sun4d_smp.c	2005-03-18 19:16:22.193129690 -0800
@@ -132,8 +132,7 @@
 		
 	/* Fix idle thread fields. */
 	__asm__ __volatile__("ld [%0], %%g6\n\t"
-			     "sta %%g6, [%%g0] %1\n\t"
-			     : : "r" (&current_set[cpuid]), "i" (ASI_M_VIKING_TMP2)
+			     : : "r" (&current_set[cpuid])
 			     : "memory" /* paranoid */);
 
 	cpu_leds[cpuid] = 0x9;
@@ -494,25 +493,18 @@
 
 void __init smp4d_blackbox_current(unsigned *addr)
 {
-	/* We have a nice Linux current register :) */
-	int rd = addr[1] & 0x3e000000;
+	int rd = *addr & 0x3e000000;
 	
-	addr[0] = 0x10800006;			/* b .+24 */
-	addr[1] = 0xc0800820 | rd;		/* lda [%g0] ASI_M_VIKING_TMP2, reg */
+	addr[0] = 0xc0800800 | rd;		/* lda [%g0] ASI_M_VIKING_TMP1, reg */
+	addr[2] = 0x81282002 | rd | (rd >> 11);	/* sll reg, 2, reg */
+	addr[4] = 0x01000000;			/* nop */
 }
 
 void __init sun4d_init_smp(void)
 {
 	int i;
-	extern unsigned int patchme_store_new_current[];
 	extern unsigned int t_nmi[], linux_trap_ipi15_sun4d[], linux_trap_ipi15_sun4m[];
 
-	/* Store current into Linux current register :) */
-	__asm__ __volatile__("sta %%g6, [%%g0] %0" : : "i"(ASI_M_VIKING_TMP2));
-	
-	/* Patch switch_to */
-	patchme_store_new_current[0] = (patchme_store_new_current[0] & 0x3e000000) | 0xc0a00820;
-	
 	/* Patch ipi15 trap table */
 	t_nmi[1] = t_nmi[1] + (linux_trap_ipi15_sun4d - linux_trap_ipi15_sun4m);
 	
diff -urN linux-2.4.30-pre3/arch/sparc/mm/io-unit.c linux-2.4.30-rc1/arch/sparc/mm/io-unit.c
--- linux-2.4.30-pre3/arch/sparc/mm/io-unit.c	2002-11-28 15:53:12.000000000 -0800
+++ linux-2.4.30-rc1/arch/sparc/mm/io-unit.c	2005-03-18 19:16:22.194129732 -0800
@@ -188,7 +188,7 @@
 			pte_t *ptep;
 			long i;
 
-			pgdp = pgd_offset(init_task.mm, addr);
+			pgdp = pgd_offset(&init_mm, addr);
 			pmdp = pmd_offset(pgdp, addr);
 			ptep = pte_offset(pmdp, addr);
 
diff -urN linux-2.4.30-pre3/arch/sparc/prom/ranges.c linux-2.4.30-rc1/arch/sparc/prom/ranges.c
--- linux-2.4.30-pre3/arch/sparc/prom/ranges.c	2002-02-25 11:37:56.000000000 -0800
+++ linux-2.4.30-rc1/arch/sparc/prom/ranges.c	2005-03-18 19:16:22.194129732 -0800
@@ -34,7 +34,7 @@
 	}
 }
 
-static void
+void
 prom_adjust_ranges(struct linux_prom_ranges *ranges1, int nranges1,
 		   struct linux_prom_ranges *ranges2, int nranges2)
 {
diff -urN linux-2.4.30-pre3/arch/sparc64/kernel/sys_sparc32.c linux-2.4.30-rc1/arch/sparc64/kernel/sys_sparc32.c
--- linux-2.4.30-pre3/arch/sparc64/kernel/sys_sparc32.c	2005-03-18 19:16:19.504017021 -0800
+++ linux-2.4.30-rc1/arch/sparc64/kernel/sys_sparc32.c	2005-03-18 19:16:22.253132205 -0800
@@ -829,7 +829,7 @@
 					       (struct sembuf *)A(ptr),
 					       second,
 					       (const struct timespec32 *)
-					       A(third));
+					       A(fifth));
 		case SEMGET:
 			err = sys_semget((key_t)first, (int)second,
 					 (int)third);
diff -urN linux-2.4.30-pre3/arch/x86_64/ia32/fpu32.c linux-2.4.30-rc1/arch/x86_64/ia32/fpu32.c
--- linux-2.4.30-pre3/arch/x86_64/ia32/fpu32.c	2003-06-13 07:51:32.000000000 -0700
+++ linux-2.4.30-rc1/arch/x86_64/ia32/fpu32.c	2005-03-18 19:16:22.257132372 -0800
@@ -28,16 +28,17 @@
 static inline unsigned long twd_fxsr_to_i387(struct i387_fxsave_struct *fxsave)
 {
 	struct _fpxreg *st = NULL;
+	unsigned long tos = (fxsave->swd >> 11) & 7;
 	unsigned long twd = (unsigned long) fxsave->twd;
 	unsigned long tag;
 	unsigned long ret = 0xffff0000;
 	int i;
 
-#define FPREG_ADDR(f, n)	((char *)&(f)->st_space + (n) * 16);
+#define FPREG_ADDR(f, n)	((void *)&(f)->st_space + (n) * 16);
 
 	for (i = 0 ; i < 8 ; i++) {
 		if (twd & 0x1) {
-			st = (struct _fpxreg *) FPREG_ADDR( fxsave, i );
+			st = FPREG_ADDR( fxsave, (i - tos) & 7 );
 
 			switch (st->exponent & 0x7fff) {
 			case 0x7fff:
diff -urN linux-2.4.30-pre3/drivers/char/agp/agp.h linux-2.4.30-rc1/drivers/char/agp/agp.h
--- linux-2.4.30-pre3/drivers/char/agp/agp.h	2004-11-17 03:54:21.000000000 -0800
+++ linux-2.4.30-rc1/drivers/char/agp/agp.h	2005-03-18 19:16:22.264132665 -0800
@@ -217,6 +217,12 @@
 #ifndef PCI_DEVICE_ID_INTEL_915_G_1
 #define PCI_DEVICE_ID_INTEL_915_G_1	0x2582
 #endif
+#ifndef PCI_DEVICE_ID_INTEL_915_GM_0
+#define PCI_DEVICE_ID_INTEL_915_GM_0	0x2590
+#endif
+#ifndef PCI_DEVICE_ID_INTEL_915_GM_1
+#define PCI_DEVICE_ID_INTEL_915_GM_1	0x2592
+#endif
 #ifndef PCI_DEVICE_ID_INTEL_820_0
 #define PCI_DEVICE_ID_INTEL_820_0       0x2500
 #endif
diff -urN linux-2.4.30-pre3/drivers/char/agp/agpgart_be.c linux-2.4.30-rc1/drivers/char/agp/agpgart_be.c
--- linux-2.4.30-pre3/drivers/char/agp/agpgart_be.c	2004-11-17 03:54:21.000000000 -0800
+++ linux-2.4.30-rc1/drivers/char/agp/agpgart_be.c	2005-03-18 19:16:22.269132875 -0800
@@ -1170,14 +1170,14 @@
 	{128, 32768, 5},
 	/* The 64M mode still requires a 128k gatt */
 	{64, 16384, 5},
-	/* For I915G */
+	/* For I915G/I915GM */
 	{256, 65536, 6}
 };
 
 static struct _intel_i830_private {
 	struct pci_dev *i830_dev;   /* device one */
 	volatile u8 *registers;
-	volatile u32 *gtt;	/* I915G */
+	volatile u32 *gtt;	/* I915G/I915GM */
 	int gtt_entries;
 } intel_i830_private;
 
@@ -1220,14 +1220,16 @@
 			break;
 		case I915_GMCH_GMS_STOLEN_48M:
 			/* Check it's really I915 */
-			if (agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_G_0)
+			if (agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_G_0 ||
+			    agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_GM_0)
 				gtt_entries = MB(48) - KB(size);
 			else
 				gtt_entries = 0;
 			break;
 		case I915_GMCH_GMS_STOLEN_64M:
 			/* Check it's really I915 */
-			if (agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_G_0)
+			if (agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_G_0 ||
+			    agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_GM_0)
 				gtt_entries = MB(64) - KB(size);
 			else
 				gtt_entries = 0;
@@ -1287,7 +1289,8 @@
 	num_entries = size->num_entries;
 	agp_bridge.gatt_table_real = 0;
 
-	if (agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_G_0) {
+	if (agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_G_0 ||
+	    agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_GM_0) {
 		pci_read_config_dword(intel_i830_private.i830_dev,
 							I915_MMADDR,&temp);
 		pci_read_config_dword(intel_i830_private.i830_dev,
@@ -1331,7 +1334,8 @@
 
 	values = A_SIZE_FIX(agp_bridge.aperture_sizes);
 
-	if (agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_G_0) {
+	if (agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_G_0 ||
+	    agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_GM_0) {
 		u32 temp, offset = 0;
 		pci_read_config_dword(intel_i830_private.i830_dev,
 							I915_GMADDR,&temp);
@@ -1375,7 +1379,8 @@
 
 	current_size = A_SIZE_FIX(agp_bridge.current_size);
 
-	if (agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_G_0)
+	if (agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_G_0 ||
+	    agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_GM_0)
 		pci_read_config_dword(intel_i830_private.i830_dev,
 							I915_GMADDR,&temp);
 	else
@@ -1392,7 +1397,8 @@
 	CACHE_FLUSH();
 
 	if (agp_bridge.needs_scratch_page == TRUE) {
-		if (agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_G_0) {
+		if (agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_G_0 ||
+		    agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_GM_0) {
 			for (i = intel_i830_private.gtt_entries; i < current_size->num_entries; i++)
 				OUTREG32(intel_i830_private.gtt, i, agp_bridge.scratch_page);
 		} else {
@@ -1406,7 +1412,8 @@
 
 static void intel_i830_cleanup(void)
 {
-	if (agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_G_0)
+	if (agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_G_0 ||
+	    agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_GM_0)
 		iounmap((void *)intel_i830_private.gtt);
 
 	iounmap((void *) intel_i830_private.registers);
@@ -1441,7 +1448,8 @@
 
 	CACHE_FLUSH();
 
-	if (agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_G_0) {
+	if (agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_G_0 ||
+	    agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_GM_0) {
 		for (i = 0, j = pg_start; i < mem->page_count; i++, j++)
 			OUTREG32(intel_i830_private.gtt, j, agp_bridge.mask_memory(mem->memory[i], mem->type));
 	} else {
@@ -1467,7 +1475,8 @@
 		return (-EINVAL);
 	}
 
-	if (agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_G_0) {
+	if (agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_G_0 ||
+	    agp_bridge.dev->device == PCI_DEVICE_ID_INTEL_915_GM_0) {
 		for (i = pg_start; i < (mem->page_count + pg_start); i++)
 			OUTREG32(intel_i830_private.gtt, i, agp_bridge.scratch_page);
 	} else {
@@ -6270,6 +6279,13 @@
 		"915G",
 		 intel_845_setup },
 
+	{ PCI_DEVICE_ID_INTEL_915_GM_0,
+		PCI_VENDOR_ID_INTEL,
+		INTEL_I915_GM,
+		"Intel(R)",
+		"915GM",
+		 intel_845_setup },
+
 	{ PCI_DEVICE_ID_INTEL_840_0,
 		PCI_VENDOR_ID_INTEL,
 		INTEL_I840,
@@ -7021,6 +7037,33 @@
 			agp_bridge.type = INTEL_I810;
 			return intel_i830_setup(i810_dev);
 
+		case PCI_DEVICE_ID_INTEL_915_GM_0:
+			i810_dev = pci_find_device(PCI_VENDOR_ID_INTEL,
+					PCI_DEVICE_ID_INTEL_915_GM_1, NULL);
+			if(i810_dev && PCI_FUNC(i810_dev->devfn) != 0) {
+				i810_dev = pci_find_device(PCI_VENDOR_ID_INTEL,
+					PCI_DEVICE_ID_INTEL_915_GM_1, i810_dev);
+			}
+
+			if (i810_dev == NULL) {
+                                /* 
+                                 * We probably have a 915GM chipset
+                                 * with an external graphics
+                                 * card. It will be initialized later 
+                                 */
+				printk(KERN_ERR PFX "Detected an "
+				       "Intel(R) 915GM, but could not"
+				       " find the"
+				       " secondary device. Assuming a "
+				       "non-integrated video card.\n");
+				agp_bridge.type = INTEL_I915_GM;
+				break;
+			}
+			printk(KERN_INFO PFX "Detected an Intel(R) "
+				   "915GM Chipset.\n");
+			agp_bridge.type = INTEL_I810;
+			return intel_i830_setup(i810_dev);
+
 		default:
 			break;
 		}
diff -urN linux-2.4.30-pre3/drivers/char/pty.c linux-2.4.30-rc1/drivers/char/pty.c
--- linux-2.4.30-pre3/drivers/char/pty.c	2005-01-19 06:09:48.000000000 -0800
+++ linux-2.4.30-rc1/drivers/char/pty.c	2005-03-18 19:16:22.271132959 -0800
@@ -218,13 +218,15 @@
 static int pty_chars_in_buffer(struct tty_struct *tty)
 {
 	struct tty_struct *to = tty->link;
+	ssize_t (*chars_in_buffer)(struct tty_struct *);
 	int count;
 
-	if (!to || !to->ldisc.chars_in_buffer)
+	/* We should get the line discipline lock for "tty->link" */
+	if (!to || !(chars_in_buffer = to->ldisc.chars_in_buffer))
 		return 0;
 
 	/* The ldisc must report 0 if no characters available to be read */
-	count = to->ldisc.chars_in_buffer(to);
+	count = chars_in_buffer(to);
 
 	if (tty->driver.subtype == PTY_TYPE_SLAVE) return count;
 
diff -urN linux-2.4.30-pre3/drivers/char/softdog.c linux-2.4.30-rc1/drivers/char/softdog.c
--- linux-2.4.30-pre3/drivers/char/softdog.c	2003-11-28 10:26:20.000000000 -0800
+++ linux-2.4.30-rc1/drivers/char/softdog.c	2005-03-18 19:16:22.272133001 -0800
@@ -124,7 +124,7 @@
 	 *	Shut off the timer.
 	 * 	Lock it in if it's a module and we set nowayout
 	 */
-	if (expect_close || nowayout == 0) {
+	if (expect_close && nowayout == 0) {
 		del_timer(&watchdog_ticktock);
 	} else {
 		printk(KERN_CRIT "SOFTDOG: WDT device closed unexpectedly.  WDT will not stop!\n");
diff -urN linux-2.4.30-pre3/drivers/net/ppp_async.c linux-2.4.30-rc1/drivers/net/ppp_async.c
--- linux-2.4.30-pre3/drivers/net/ppp_async.c	2005-01-19 06:09:56.000000000 -0800
+++ linux-2.4.30-rc1/drivers/net/ppp_async.c	2005-03-18 19:16:22.482141800 -0800
@@ -996,7 +996,7 @@
 	data += 4;
 	dlen -= 4;
 	/* data[0] is code, data[1] is length */
-	while (dlen >= 2 && dlen >= data[1]) {
+	while (dlen >= 2 && dlen >= data[1] && data[1] >= 2) {
 		switch (data[0]) {
 		case LCP_MRU:
 			val = (data[2] << 8) + data[3];
diff -urN linux-2.4.30-pre3/drivers/sbus/char/zs.c linux-2.4.30-rc1/drivers/sbus/char/zs.c
--- linux-2.4.30-pre3/drivers/sbus/char/zs.c	2005-01-19 06:09:59.000000000 -0800
+++ linux-2.4.30-rc1/drivers/sbus/char/zs.c	2005-03-18 19:16:22.674149845 -0800
@@ -65,19 +65,19 @@
 
 /* On 32-bit sparcs we need to delay after register accesses
  * to accomodate sun4 systems, but we do not need to flush writes.
- * On 64-bit sparc we only need to flush single writes to ensure
+ * On 64-bit and sun4d we need to flush single writes to ensure
  * completion.
  */
 #ifndef __sparc_v9__
 #define ZSDELAY()		udelay(5)
 #define ZSDELAY_LONG()		udelay(20)
-#define ZS_WSYNC(channel)	do { } while(0)
 #else
 #define ZSDELAY()
 #define ZSDELAY_LONG()
+#endif
+
 #define ZS_WSYNC(__channel) \
 	sbus_readb(&((__channel)->control))
-#endif
 
 struct sun_zslayout **zs_chips;
 struct sun_zschannel **zs_channels;
diff -urN linux-2.4.30-pre3/drivers/sbus/sbus.c linux-2.4.30-rc1/drivers/sbus/sbus.c
--- linux-2.4.30-pre3/drivers/sbus/sbus.c	2003-08-25 04:44:42.000000000 -0700
+++ linux-2.4.30-rc1/drivers/sbus/sbus.c	2005-03-18 19:16:22.682150180 -0800
@@ -215,6 +215,8 @@
  * prom_sbus_ranges_init(), with all sun4d stuff cut away.
  * Ask DaveM what is going on here, how is sun4d supposed to work... XXX
  */
+/* added back sun4d patch from Thomas Bogendoerfer - should be OK (crn) */
+
 static void __init sbus_bus_ranges_init(int parent_node, struct sbus_bus *sbus)
 {
 	int len;
@@ -227,6 +229,20 @@
 		return;
 	}
 	sbus->num_sbus_ranges = len / sizeof(struct linux_prom_ranges);
+#ifdef CONFIG_SPARC32
+	if (sparc_cpu_model == sun4d) {
+		struct linux_prom_ranges iounit_ranges[PROMREG_MAX];
+		int num_iounit_ranges;
+
+		len = prom_getproperty(parent_node, "ranges",
+				       (char *) iounit_ranges,
+				       sizeof (iounit_ranges));
+		if (len != -1) {
+			num_iounit_ranges = (len/sizeof(struct linux_prom_ranges));
+			prom_adjust_ranges (sbus->sbus_ranges, sbus->num_sbus_ranges, iounit_ranges, num_iounit_ranges);
+		}
+	}
+#endif
 }
 
 static void __init __apply_ranges_to_regs(struct linux_prom_ranges *ranges,
diff -urN linux-2.4.30-pre3/include/asm-i386/acpi.h linux-2.4.30-rc1/include/asm-i386/acpi.h
--- linux-2.4.30-pre3/include/asm-i386/acpi.h	2005-03-18 19:16:19.676024228 -0800
+++ linux-2.4.30-rc1/include/asm-i386/acpi.h	2005-03-18 19:16:22.926160404 -0800
@@ -28,6 +28,8 @@
 
 #ifdef __KERNEL__
 
+#include <linux/init.h>
+
 #define COMPILER_DEPENDENT_INT64   long long
 #define COMPILER_DEPENDENT_UINT64  unsigned long long
 
diff -urN linux-2.4.30-pre3/include/asm-sparc/asi.h linux-2.4.30-rc1/include/asm-sparc/asi.h
--- linux-2.4.30-pre3/include/asm-sparc/asi.h	1998-04-14 17:44:23.000000000 -0700
+++ linux-2.4.30-rc1/include/asm-sparc/asi.h	2005-03-18 19:16:22.929160529 -0800
@@ -104,7 +104,8 @@
 #define ASI_M_DCDR         0x39   /* Data Cache Diagnostics Register rw, ss */
 
 #define ASI_M_VIKING_TMP1  0x40	  /* Emulation temporary 1 on Viking */
-#define ASI_M_VIKING_TMP2  0x41	  /* Emulation temporary 2 on Viking */
+/* only available on SuperSparc I */
+/* #define ASI_M_VIKING_TMP2  0x41 */  /* Emulation temporary 2 on Viking */
 
 #define ASI_M_ACTION       0x4c   /* Breakpoint Action Register (GNU/Viking) */
 
diff -urN linux-2.4.30-pre3/include/asm-sparc/oplib.h linux-2.4.30-rc1/include/asm-sparc/oplib.h
--- linux-2.4.30-pre3/include/asm-sparc/oplib.h	2004-02-18 05:36:32.000000000 -0800
+++ linux-2.4.30-rc1/include/asm-sparc/oplib.h	2005-03-18 19:16:22.929160529 -0800
@@ -296,6 +296,9 @@
 
 /* Dorking with Bus ranges... */
 
+extern void prom_adjust_ranges(struct linux_prom_ranges *, int,
+			       struct linux_prom_ranges *, int);
+
 /* Apply promlib probes OBIO ranges to registers. */
 extern void prom_apply_obio_ranges(struct linux_prom_registers *obioregs, int nregs);
 
diff -urN linux-2.4.30-pre3/include/asm-sparc/winmacro.h linux-2.4.30-rc1/include/asm-sparc/winmacro.h
--- linux-2.4.30-pre3/include/asm-sparc/winmacro.h	2003-06-13 07:51:38.000000000 -0700
+++ linux-2.4.30-rc1/include/asm-sparc/winmacro.h	2005-03-18 19:16:22.930160571 -0800
@@ -113,9 +113,12 @@
 	and      %idreg, 0xc, %idreg; \
 	ld       [%idreg + %dest_reg], %dest_reg;
 
-/* Sliiick. We have a Linux current register :) -jj */
-#define LOAD_CURRENT4D(dest_reg) \
-	lda	 [%g0] ASI_M_VIKING_TMP2, %dest_reg;
+#define LOAD_CURRENT4D(dest_reg, idreg) \
+	lda	 [%g0] ASI_M_VIKING_TMP1, %idreg; \
+	sethi	%hi(C_LABEL(current_set)), %dest_reg; \
+	sll	%idreg, 2, %idreg; \
+	or	%dest_reg, %lo(C_LABEL(current_set)), %dest_reg; \
+	ld	[%idreg + %dest_reg], %dest_reg;
 
 /* Blackbox - take care with this... - check smp4m and smp4d before changing this. */
 #define LOAD_CURRENT(dest_reg, idreg) 					\
diff -urN linux-2.4.30-pre3/include/linux/agp_backend.h linux-2.4.30-rc1/include/linux/agp_backend.h
--- linux-2.4.30-pre3/include/linux/agp_backend.h	2004-11-17 03:54:22.000000000 -0800
+++ linux-2.4.30-rc1/include/linux/agp_backend.h	2005-03-18 19:16:22.934160739 -0800
@@ -56,6 +56,7 @@
 	INTEL_I860,
 	INTEL_I865_G,
 	INTEL_I915_G,
+	INTEL_I915_GM,
 	INTEL_I7205,
 	INTEL_I7505,
 	INTEL_460GX,
diff -urN linux-2.4.30-pre3/include/linux/kernel.h linux-2.4.30-rc1/include/linux/kernel.h
--- linux-2.4.30-pre3/include/linux/kernel.h	2004-11-17 03:54:22.000000000 -0800
+++ linux-2.4.30-rc1/include/linux/kernel.h	2005-03-18 19:16:22.937160865 -0800
@@ -73,14 +73,17 @@
 extern long long simple_strtoll(const char *,char **,unsigned int);
 extern int sprintf(char * buf, const char * fmt, ...)
 	__attribute__ ((format (printf, 2, 3)));
-extern int vsprintf(char *buf, const char *, va_list);
+extern int vsprintf(char *buf, const char *, va_list)
+	__attribute__ ((format (printf, 2, 0)));
 extern int snprintf(char * buf, size_t size, const char * fmt, ...)
 	__attribute__ ((format (printf, 3, 4)));
-extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
+extern int vsnprintf(char *buf, size_t size, const char *fmt, va_list args)
+	__attribute__ ((format (printf, 3, 0)));
 
 extern int sscanf(const char *, const char *, ...)
-	__attribute__ ((format (scanf,2,3)));
-extern int vsscanf(const char *, const char *, va_list);
+	__attribute__ ((format (scanf, 2, 3)));
+extern int vsscanf(const char *, const char *, va_list)
+	__attribute__ ((format (scanf, 2, 0)));
 
 extern int get_option(char **str, int *pint);
 extern char *get_options(char *str, int nints, int *ints);
diff -urN linux-2.4.30-pre3/mm/memory.c linux-2.4.30-rc1/mm/memory.c
--- linux-2.4.30-pre3/mm/memory.c	2005-01-19 06:10:13.000000000 -0800
+++ linux-2.4.30-rc1/mm/memory.c	2005-03-18 19:16:22.950161409 -0800
@@ -499,9 +499,11 @@
 				/* FIXME: call the correct function,
 				 * depending on the type of the found page
 				 */
-				if (!pages[i])
-					goto bad_page;
-				page_cache_get(pages[i]);
+				if (!pages[i] || PageReserved(pages[i])) {
+					if (pages[i] != ZERO_PAGE(start))
+						goto bad_page;
+				} else
+					page_cache_get(pages[i]);
 			}
 			if (vmas)
 				vmas[i] = vma;
diff -urN linux-2.4.30-pre3/mm/page_alloc.c linux-2.4.30-rc1/mm/page_alloc.c
--- linux-2.4.30-pre3/mm/page_alloc.c	2004-11-17 03:54:22.000000000 -0800
+++ linux-2.4.30-rc1/mm/page_alloc.c	2005-03-18 19:16:22.950161409 -0800
@@ -551,7 +551,7 @@
 		class_idx = zone_idx(zone);
 
 		sum += zone->nr_cache_pages;
-		for (zone = pgdat->node_zones; zone < pgdat->node_zones + MAX_NR_ZONES; zone++) {
+		for (; zone; zone = *zonep++) {
 			int free = zone->free_pages - zone->watermarks[class_idx].high;
 			if (free <= 0)
 				continue;
diff -urN linux-2.4.30-pre3/net/ipv4/tcp_input.c linux-2.4.30-rc1/net/ipv4/tcp_input.c
--- linux-2.4.30-pre3/net/ipv4/tcp_input.c	2005-03-18 19:16:19.721026113 -0800
+++ linux-2.4.30-rc1/net/ipv4/tcp_input.c	2005-03-18 19:16:22.965162038 -0800
@@ -1642,7 +1642,10 @@
 static void tcp_undo_cwr(struct tcp_opt *tp, int undo)
 {
 	if (tp->prior_ssthresh) {
-		tp->snd_cwnd = max(tp->snd_cwnd, tp->snd_ssthresh<<1);
+		if (tcp_is_bic(tp))
+			tp->snd_cwnd = max(tp->snd_cwnd, tp->bictcp.last_max_cwnd);
+		else
+			tp->snd_cwnd = max(tp->snd_cwnd, tp->snd_ssthresh<<1);
 
 		if (undo && tp->prior_ssthresh > tp->snd_ssthresh) {
 			tp->snd_ssthresh = tp->prior_ssthresh;
