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

diff -urN linux-2.4.21-bk6/Makefile linux-2.4.21-bk7/Makefile
--- linux-2.4.21-bk6/Makefile	2003-07-11 02:53:39.000000000 -0700
+++ linux-2.4.21-bk7/Makefile	2003-07-11 02:53:44.000000000 -0700
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 21
-EXTRAVERSION = -bk6
+EXTRAVERSION = -bk7
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
diff -urN linux-2.4.21-bk6/drivers/video/matrox/matroxfb_base.h linux-2.4.21-bk7/drivers/video/matrox/matroxfb_base.h
--- linux-2.4.21-bk6/drivers/video/matrox/matroxfb_base.h	2003-06-13 07:51:37.000000000 -0700
+++ linux-2.4.21-bk7/drivers/video/matrox/matroxfb_base.h	2003-07-11 02:53:46.000000000 -0700
@@ -111,6 +111,9 @@
 #if defined(__alpha__) || defined(__mc68000__)
 #define READx_WORKS
 #define MEMCPYTOIO_WORKS
+#elif defined(__powerpc64__)
+#define RAW_READx_WORKS
+#define MEMCPYTOIO_WORKS
 #else
 #define READx_FAILS
 /* recheck __ppc__, maybe that __ppc__ needs MEMCPYTOIO_WRITEL */
@@ -196,6 +199,30 @@
 static inline void mga_writel(vaddr_t va, unsigned int offs, u_int32_t value) {
 	writel(value, va.vaddr + offs);
 }
+#elif defined(RAW_READx_WORKS)
+static inline unsigned int mga_readb(vaddr_t va, unsigned int offs) {
+	return __raw_readb(va.vaddr + offs);
+}
+
+static inline unsigned int mga_readw(vaddr_t va, unsigned int offs) {
+	return __raw_readw(va.vaddr + offs);
+}
+
+static inline u_int32_t mga_readl(vaddr_t va, unsigned int offs) {
+	return __raw_readl(va.vaddr + offs);
+}
+
+static inline void mga_writeb(vaddr_t va, unsigned int offs, u_int8_t value) {
+	__raw_writeb(value, va.vaddr + offs);
+}
+
+static inline void mga_writew(vaddr_t va, unsigned int offs, u_int16_t value) {
+	__raw_writew(value, va.vaddr + offs);
+}
+
+static inline void mga_writel(vaddr_t va, unsigned int offs, u_int32_t value) {
+	__raw_writel(value, va.vaddr + offs);
+}
 #else
 static inline unsigned int mga_readb(vaddr_t va, unsigned int offs) {
 	return *(volatile u_int8_t*)(va.vaddr + offs);
diff -urN linux-2.4.21-bk6/include/video/fbcon.h linux-2.4.21-bk7/include/video/fbcon.h
--- linux-2.4.21-bk6/include/video/fbcon.h	2002-11-28 15:53:15.000000000 -0800
+++ linux-2.4.21-bk7/include/video/fbcon.h	2003-07-11 02:53:47.000000000 -0700
@@ -207,7 +207,8 @@
 #define fb_memset sbus_memset_io
 
 #elif defined(__i386__) || defined(__alpha__) || \
-      defined(__x86_64__) || defined(__hppa__)
+      defined(__x86_64__) || defined(__hppa__) || \
+      defined(__powerpc64__)
 
 #define fb_readb __raw_readb
 #define fb_readw __raw_readw
diff -urN linux-2.4.21-bk6/lib/vsprintf.c linux-2.4.21-bk7/lib/vsprintf.c
--- linux-2.4.21-bk6/lib/vsprintf.c	2003-06-13 07:51:39.000000000 -0700
+++ linux-2.4.21-bk7/lib/vsprintf.c	2003-07-11 02:53:47.000000000 -0700
@@ -131,8 +131,8 @@
 {
 	char c,sign,tmp[66];
 	const char *digits;
-	const char small_digits[] = "0123456789abcdefghijklmnopqrstuvwxyz";
-	const char large_digits[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+	static const char small_digits[] = "0123456789abcdefghijklmnopqrstuvwxyz";
+	static const char large_digits[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
 	int i;
 
 	digits = (type & LARGE) ? large_digits : small_digits;
@@ -306,7 +306,8 @@
 
 		/* get the conversion qualifier */
 		qualifier = -1;
-		if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt =='Z') {
+		if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' ||
+		    *fmt =='Z' || *fmt == 'z') {
 			qualifier = *fmt;
 			++fmt;
 			if (qualifier == 'l' && *fmt == 'l') {
@@ -381,7 +382,7 @@
 				if (qualifier == 'l') {
 					long * ip = va_arg(args, long *);
 					*ip = (str - buf);
-				} else if (qualifier == 'Z') {
+				} else if (qualifier == 'Z' || qualifier == 'z') {
 					size_t * ip = va_arg(args, size_t *);
 					*ip = (str - buf);
 				} else {
@@ -432,7 +433,7 @@
 			num = va_arg(args, unsigned long);
 			if (flags & SIGN)
 				num = (signed long) num;
-		} else if (qualifier == 'Z') {
+		} else if (qualifier == 'Z' || qualifier == 'z') {
 			num = va_arg(args, size_t);
 		} else if (qualifier == 'h') {
 			num = (unsigned short) va_arg(args, int);
@@ -517,10 +518,11 @@
 {
 	const char *str = buf;
 	char *next;
+	char digit;
 	int num = 0;
 	int qualifier;
 	int base;
-	int field_width = -1;
+	int field_width;
 	int is_sign = 0;
 
 	while(*fmt && *str) {
@@ -558,12 +560,14 @@
 		}
 
 		/* get field width */
+		field_width = -1;
 		if (isdigit(*fmt))
 			field_width = skip_atoi(&fmt);
 
 		/* get conversion qualifier */
 		qualifier = -1;
-		if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' || *fmt == 'Z') {
+		if (*fmt == 'h' || *fmt == 'l' || *fmt == 'L' ||
+		    *fmt == 'Z' || *fmt == 'z') {
 			qualifier = *fmt;
 			fmt++;
 		}
@@ -616,8 +620,9 @@
 		case 'X':
 			base = 16;
 			break;
-		case 'd':
 		case 'i':
+                        base = 0;
+		case 'd':
 			is_sign = 1;
 		case 'u':
 			break;
@@ -637,12 +642,16 @@
 		while (isspace(*str))
 			str++;
 
-		if (!*str
-		    || (base == 16 && !isxdigit(*str))
-		    || (base == 10 && !isdigit(*str))
-		    || (base == 8 && (!isdigit(*str) || *str > '7'))
-		    || (base == 0 && !isdigit(*str)))
-			break;
+		digit = *str;
+		if (is_sign && digit == '-')
+			digit = *(str + 1);
+
+		if (!digit
+                    || (base == 16 && !isxdigit(digit))
+                    || (base == 10 && !isdigit(digit))
+                    || (base == 8 && (!isdigit(digit) || digit > '7'))
+                    || (base == 0 && !isdigit(digit)))
+				break;
 
 		switch(qualifier) {
 		case 'h':
@@ -673,6 +682,7 @@
 			}
 			break;
 		case 'Z':
+		case 'z':
 		{
 			size_t *s = (size_t*) va_arg(args,size_t*);
 			*s = (size_t) simple_strtoul(str,&next,base);
