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

diff -urN linux-2.4.22-bk21/Makefile linux-2.4.22-bk22/Makefile
--- linux-2.4.22-bk21/Makefile	2003-09-19 03:04:52.000000000 -0700
+++ linux-2.4.22-bk22/Makefile	2003-09-19 03:05:46.000000000 -0700
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 22
-EXTRAVERSION = -bk21
+EXTRAVERSION = -bk22
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
diff -urN linux-2.4.22-bk21/arch/ppc/boot/common/util.S linux-2.4.22-bk22/arch/ppc/boot/common/util.S
--- linux-2.4.22-bk21/arch/ppc/boot/common/util.S	2003-09-19 03:05:02.000000000 -0700
+++ linux-2.4.22-bk22/arch/ppc/boot/common/util.S	2003-09-19 03:05:50.000000000 -0700
@@ -198,7 +198,7 @@
 	 *  timebase_period_ns defaults to 60 (16.6MHz) */
 	lis	r5,timebase_period_ns@ha
 	lwz	r5,timebase_period_ns@l(r5)
-	addi	r4,r4,r5
+	add	r4,r4,r5
 	addi	r4,r4,-1
 	divw	r4,r4,r5	/* BUS ticks */
 1:	mftbu	r5
diff -urN linux-2.4.22-bk21/arch/ppc/boot/simple/Makefile linux-2.4.22-bk22/arch/ppc/boot/simple/Makefile
--- linux-2.4.22-bk21/arch/ppc/boot/simple/Makefile	2003-09-19 03:05:02.000000000 -0700
+++ linux-2.4.22-bk22/arch/ppc/boot/simple/Makefile	2003-09-19 03:05:50.000000000 -0700
@@ -31,6 +31,7 @@
 ifeq ($(CONFIG_IBM_OPENBIOS),y)
 ZIMAGE				:= zImage-TREE
 ZIMAGEINITRD			:= zImage.initrd-TREE
+END				:= treeboot
 ZNETBOOT			:= zImage.treeboot
 ZNETBOOTRD			:= zImage.initrd.treeboot
 TFTPIMAGE			:= /tftpboot/zImage.embedded
diff -urN linux-2.4.22-bk21/arch/ppc/boot/simple/embed_config.c linux-2.4.22-bk22/arch/ppc/boot/simple/embed_config.c
--- linux-2.4.22-bk21/arch/ppc/boot/simple/embed_config.c	2003-09-19 03:05:02.000000000 -0700
+++ linux-2.4.22-bk22/arch/ppc/boot/simple/embed_config.c	2003-09-19 03:05:50.000000000 -0700
@@ -655,15 +655,12 @@
 	bd_t *(*get_board_info)(void) =
 	    (bd_t *(*)(void))(*(unsigned long *)BOARD_INFO_VECTOR);
 #if !defined(CONFIG_STB03xxx)
-	volatile emac_t *emacp;
-	emacp = (emac_t *)EMAC0_BASE;  /* assume 1st emac - armin */
-
 	/* shut down the Ethernet controller that the boot rom
 	 * sometimes leaves running.
 	 */
-	mtdcr(DCRN_MALCR, MALCR_MMSR);                /* 1st reset MAL */
-	while (mfdcr(DCRN_MALCR) & MALCR_MMSR) {};    /* wait for the reset */
-	emacp->em0mr0 = 0x20000000;        /* then reset EMAC */
+	mtdcr(DCRN_MALCR(DCRN_MAL_BASE), MALCR_MMSR);                /* 1st reset MAL */
+	while (mfdcr(DCRN_MALCR(DCRN_MAL_BASE)) & MALCR_MMSR) {};    /* wait for the reset */
+	out_be32((u32 *)EMAC0_BASE, 0x20000000);        /* then reset EMAC */
 	eieio();
 #endif
 
diff -urN linux-2.4.22-bk21/arch/ppc/boot/simple/misc-embedded.c linux-2.4.22-bk22/arch/ppc/boot/simple/misc-embedded.c
--- linux-2.4.22-bk21/arch/ppc/boot/simple/misc-embedded.c	2003-06-13 07:51:31.000000000 -0700
+++ linux-2.4.22-bk22/arch/ppc/boot/simple/misc-embedded.c	2003-09-19 03:05:50.000000000 -0700
@@ -16,6 +16,7 @@
 #include <linux/types.h>
 #include <linux/elf.h>
 #include <asm/bootinfo.h>
+#include <asm/ibm4xx.h>
 #include <asm/mmu.h>
 #include <asm/mpc8xx.h>
 #include <asm/mpc8260.h>
diff -urN linux-2.4.22-bk21/arch/ppc/kernel/cputable.c linux-2.4.22-bk22/arch/ppc/kernel/cputable.c
--- linux-2.4.22-bk21/arch/ppc/kernel/cputable.c	2003-09-19 03:05:03.000000000 -0700
+++ linux-2.4.22-bk22/arch/ppc/kernel/cputable.c	2003-09-19 03:05:50.000000000 -0700
@@ -325,7 +325,7 @@
     {	/* PPC970 */
 	0xffff0000, 0x00390000, "PPC970",
 	CPU_FTR_SPLIT_ID_CACHE | CPU_FTR_USE_TB | CPU_FTR_HPTE_TABLE |
-	CPU_FTR_ALTIVEC_COMP,
+	CPU_FTR_ALTIVEC_COMP | CPU_FTR_CAN_NAP,
 	COMMON_PPC | PPC_FEATURE_64 | PPC_FEATURE_HAS_ALTIVEC,
 	128, 128,
 	__setup_cpu_ppc970
diff -urN linux-2.4.22-bk21/arch/ppc/kernel/head.S linux-2.4.22-bk22/arch/ppc/kernel/head.S
--- linux-2.4.22-bk21/arch/ppc/kernel/head.S	2003-09-19 03:05:03.000000000 -0700
+++ linux-2.4.22-bk22/arch/ppc/kernel/head.S	2003-09-19 03:05:50.000000000 -0700
@@ -1700,9 +1700,8 @@
 	mtspr	0x3f6,r0
 	isync
 	mfspr	r0,SPRN_HID0
-	li	r11,0x40		/* clear NAP bit */
-	sldi	r11,r11,48
-	andc	r0,r0,r11
+	li	r11,5			/* clear DOZE and SLEEP */
+	rldimi	r0,r11,52,8		/* and set NAP and DPM */
 	mtspr	SPRN_HID0,r0
 	mfspr	r0,SPRN_HID0
 	mfspr	r0,SPRN_HID0
diff -urN linux-2.4.22-bk21/arch/ppc/kernel/idle_gen.c linux-2.4.22-bk22/arch/ppc/kernel/idle_gen.c
--- linux-2.4.22-bk21/arch/ppc/kernel/idle_gen.c	2003-08-25 04:44:40.000000000 -0700
+++ linux-2.4.22-bk22/arch/ppc/kernel/idle_gen.c	2003-09-19 03:05:50.000000000 -0700
@@ -15,10 +15,15 @@
 
 void power_save(void)
 {
-	/* Make sure the CPU has the DOZE feature set. */
+	/*
+	 * Make sure the CPU has the DOZE or NAP feature set.
+	 * We assume that chip-specific initialization code
+	 * has set any other registers necessary (e.g. HID0).
+	 */
 	if (!(cur_cpu_spec[smp_processor_id()]->cpu_features
-				& CPU_FTR_CAN_DOZE))
+	      & (CPU_FTR_CAN_DOZE | CPU_FTR_CAN_NAP)))
 		return;
+
 	/*
 	 * Disable interrupts to prevent a lost wakeup
 	 * when going to sleep.  This is necessary even with
diff -urN linux-2.4.22-bk21/arch/ppc/kernel/signal.c linux-2.4.22-bk22/arch/ppc/kernel/signal.c
--- linux-2.4.22-bk21/arch/ppc/kernel/signal.c	2003-09-19 03:05:04.000000000 -0700
+++ linux-2.4.22-bk22/arch/ppc/kernel/signal.c	2003-09-19 03:05:50.000000000 -0700
@@ -315,7 +315,7 @@
 				     sizeof(sr->mc_vregs)))
 			return 1;
 	} else if (current->thread.used_vr)
-		memset(&current->thread.vr, 0, sizeof(current->thread.vr));
+		memset(&current->thread.vr, 0, ELF_NVRREG * sizeof(vector128));
 
 	/* Always get VRSAVE back */
 	if (__get_user(current->thread.vrsave, (u32 *)&sr->mc_vregs[32]))
@@ -371,7 +371,6 @@
 			  &rt_sf->uc.uc_stack.ss_flags)
 	    || __put_user(current->sas_ss_size, &rt_sf->uc.uc_stack.ss_size)
 	    || __put_user(&rt_sf->uc.uc_mcontext, &rt_sf->uc.uc_regs)
-	    || __copy_to_user(&rt_sf->uc.uc_oldsigmask, oldset, sizeof(*oldset))
 	    || __copy_to_user(&rt_sf->uc.uc_sigmask, oldset, sizeof(*oldset)))
 		goto badframe;
 
@@ -405,12 +404,13 @@
 static int do_setcontext(struct ucontext *ucp, struct pt_regs *regs)
 {
 	sigset_t set;
+	struct mcontext *mcp;
 
-	if (__copy_from_user(&set, &ucp->uc_sigmask, sizeof(set)))
+	if (__copy_from_user(&set, &ucp->uc_sigmask, sizeof(set))
+	    || __get_user(mcp, &ucp->uc_regs))
 		return -EFAULT;
 	restore_sigmask(&set);
-
-	if (restore_user_regs(regs, &ucp->uc_mcontext))
+	if (restore_user_regs(regs, mcp))
 		return -EFAULT;
 
 	return 0;
@@ -426,9 +426,6 @@
 		    || save_user_regs(regs, &old_ctx->uc_mcontext, 0)
 		    || __copy_to_user(&old_ctx->uc_sigmask,
 				      &current->blocked, sizeof(sigset_t))
-		    /* the next 2 things aren't strictly necessary */
-		    || __copy_to_user(&old_ctx->uc_oldsigmask,
-				      &current->blocked, sizeof(sigset_t))
 		    || __put_user(&old_ctx->uc_mcontext, &old_ctx->uc_regs))
 			return -EFAULT;
 	}
diff -urN linux-2.4.22-bk21/include/asm-ppc/ucontext.h linux-2.4.22-bk22/include/asm-ppc/ucontext.h
--- linux-2.4.22-bk21/include/asm-ppc/ucontext.h	2003-09-19 03:05:39.000000000 -0700
+++ linux-2.4.22-bk22/include/asm-ppc/ucontext.h	2003-09-19 03:06:11.000000000 -0700
@@ -16,12 +16,11 @@
 	struct ucontext *uc_link;
 	stack_t		 uc_stack;
 	int		 uc_pad[7];
-	struct mcontext	*uc_regs;	/* backward compat */
-	sigset_t	 uc_oldsigmask;	/* backward compat */
-	int		 uc_pad2;
+	struct mcontext	*uc_regs;	/* points to uc_mcontext field */
 	sigset_t	 uc_sigmask;
 	/* glibc has 1024-bit signal masks, ours are 64-bit */
 	int		 uc_maskext[30];
+	int		 uc_pad2[3];
 	struct mcontext	 uc_mcontext;
 };
 
diff -urN linux-2.4.22-bk21/mm/page_alloc.c linux-2.4.22-bk22/mm/page_alloc.c
--- linux-2.4.22-bk21/mm/page_alloc.c	2003-09-19 03:05:39.000000000 -0700
+++ linux-2.4.22-bk22/mm/page_alloc.c	2003-09-19 03:06:11.000000000 -0700
@@ -258,8 +258,6 @@
 	struct page * page = NULL;
 	int __freed;
 
-	if (!(gfp_mask & __GFP_WAIT))
-		goto out;
 	if (in_interrupt())
 		BUG();
 
@@ -512,14 +510,12 @@
 		class_idx = zone_idx(zone);
 
 		sum += zone->nr_cache_pages;
-		do {
-			unsigned int free = zone->free_pages - zone->watermarks[class_idx].high;
-			zonep++;
-			zone = *zonep;
+		for (zone = pgdat->node_zones; zone < pgdat->node_zones + MAX_NR_ZONES; zone++) {
+			int free = zone->free_pages - zone->watermarks[class_idx].high;
 			if (free <= 0)
 				continue;
 			sum += free;
-		} while (zone);
+		}
 	}
 
 	return sum;
