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

diff -urN linux-2.4.22-bk26/Makefile linux-2.4.22-bk27/Makefile
--- linux-2.4.22-bk26/Makefile	2003-09-30 02:53:00.000000000 -0700
+++ linux-2.4.22-bk27/Makefile	2003-09-30 02:53:03.000000000 -0700
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 4
 SUBLEVEL = 22
-EXTRAVERSION = -bk26
+EXTRAVERSION = -bk27
 
 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
 
diff -urN linux-2.4.22-bk26/arch/x86_64/config.in linux-2.4.22-bk27/arch/x86_64/config.in
--- linux-2.4.22-bk26/arch/x86_64/config.in	2003-09-30 02:53:00.000000000 -0700
+++ linux-2.4.22-bk27/arch/x86_64/config.in	2003-09-30 02:53:03.000000000 -0700
@@ -10,7 +10,7 @@
 define_bool CONFIG_ISA n
 define_bool CONFIG_SBUS n
 
-define_bool CONFIG_UID16 y
+define_bool CONFIG_UID16 n
 define_bool CONFIG_RWSEM_GENERIC_SPINLOCK y
 define_bool CONFIG_RWSEM_XCHGADD_ALGORITHM n
 define_bool CONFIG_X86_CMPXCHG y
diff -urN linux-2.4.22-bk26/arch/x86_64/ia32/sys_ia32.c linux-2.4.22-bk27/arch/x86_64/ia32/sys_ia32.c
--- linux-2.4.22-bk26/arch/x86_64/ia32/sys_ia32.c	2003-09-30 02:53:00.000000000 -0700
+++ linux-2.4.22-bk27/arch/x86_64/ia32/sys_ia32.c	2003-09-30 02:53:03.000000000 -0700
@@ -56,6 +56,7 @@
 #include <linux/rwsem.h>
 #include <linux/binfmts.h>
 #include <linux/init.h>
+#include <linux/highuid.h>
 #include <asm/mman.h>
 #include <asm/types.h>
 #include <asm/uaccess.h>
@@ -84,6 +85,10 @@
 #define low2highgid(gid) ((gid) == (u16)-1) ? (gid_t)-1 : (gid_t)(gid)
 extern int overflowuid,overflowgid; 
 
+typedef u16 old_uid_t;
+typedef u16 old_gid_t;
+
+#include "../../../kernel/uid16.c" 
 
 static int
 putstat(struct stat32 *ubuf, struct stat *kbuf)
@@ -93,8 +98,8 @@
 	    __put_user (kbuf->st_ino, &ubuf->st_ino) ||
 	    __put_user (kbuf->st_mode, &ubuf->st_mode) ||
 	    __put_user (kbuf->st_nlink, &ubuf->st_nlink) ||
-	    __put_user (kbuf->st_uid, &ubuf->st_uid) ||
-	    __put_user (kbuf->st_gid, &ubuf->st_gid) ||
+	    __put_user (high2lowuid(kbuf->st_uid), &ubuf->st_uid) ||
+	    __put_user (high2lowgid(kbuf->st_gid), &ubuf->st_gid) ||
 	    __put_user (kbuf->st_rdev, &ubuf->st_rdev) ||
 	    __put_user (kbuf->st_size, &ubuf->st_size) ||
 	    __put_user (kbuf->st_atime, &ubuf->st_atime) ||
diff -urN linux-2.4.22-bk26/drivers/pci/pci.c linux-2.4.22-bk27/drivers/pci/pci.c
--- linux-2.4.22-bk26/drivers/pci/pci.c	2003-09-30 02:53:01.000000000 -0700
+++ linux-2.4.22-bk27/drivers/pci/pci.c	2003-09-30 02:53:05.000000000 -0700
@@ -1475,17 +1475,22 @@
 	u8 hdr_type;
 
 	for (func = 0; func < 8; func++, temp->devfn++) {
-		if (func && !is_multi)		/* not a multi-function device */
-			continue;
 		if (pci_read_config_byte(temp, PCI_HEADER_TYPE, &hdr_type))
 			continue;
 		temp->hdr_type = hdr_type & 0x7f;
 
 		dev = pci_scan_device(temp);
-		if (!dev)
-			continue;
+		if (!pcibios_scan_all_fns() && func == 0) {
+			if (!dev)
+				break;
+		} else {
+			if (!dev)
+				continue;
+			is_multi = 1;
+		}
+
 		pci_name_device(dev);
-		if (!func) {
+		if (!first_dev) {
 			is_multi = hdr_type & 0x80;
 			first_dev = dev;
 		}
@@ -1499,6 +1504,14 @@
 
 		/* Fix up broken headers */
 		pci_fixup_device(PCI_FIXUP_HEADER, dev);
+
+		/*
+		 * If this is a single function device
+		 * don't scan past the first function.
+		 */
+		if (!is_multi)
+			break;
+
 	}
 	return first_dev;
 }
diff -urN linux-2.4.22-bk26/drivers/video/vesafb.c linux-2.4.22-bk27/drivers/video/vesafb.c
--- linux-2.4.22-bk26/drivers/video/vesafb.c	2003-08-25 04:44:43.000000000 -0700
+++ linux-2.4.22-bk27/drivers/video/vesafb.c	2003-09-30 02:53:05.000000000 -0700
@@ -93,7 +93,11 @@
 } fbcon_cmap;
 
 static int             inverse   = 0;
+#ifdef __x86_64__
+static int             mtrr      = 1;
+#else
 static int             mtrr      = 0;
+#endif
 static int	 vram __initdata = 0;	/* needed for vram boot option */
 static int             currcon   = 0;
 
diff -urN linux-2.4.22-bk26/fs/proc/generic.c linux-2.4.22-bk27/fs/proc/generic.c
--- linux-2.4.22-bk26/fs/proc/generic.c	2003-06-13 07:51:37.000000000 -0700
+++ linux-2.4.22-bk27/fs/proc/generic.c	2003-09-30 02:53:05.000000000 -0700
@@ -150,13 +150,14 @@
 			offset += file->f_pos;
 	}
 	retval = -EINVAL;
-	if (offset>=0 && offset<=file->f_dentry->d_inode->i_sb->s_maxbytes) {
+	if (offset>=0 && (unsigned long long)offset<=file->f_dentry->d_inode->i_sb->s_maxbytes) {
 		if (offset != file->f_pos) {
 			file->f_pos = offset;
 			file->f_reada = 0;
 		}
 		retval = offset;
 	}
+	/* RED-PEN user can fake an error here by setting offset to >=-4095 && <0  */
 	return retval;
 }
 
diff -urN linux-2.4.22-bk26/fs/proc/inode.c linux-2.4.22-bk27/fs/proc/inode.c
--- linux-2.4.22-bk26/fs/proc/inode.c	2003-06-13 07:51:37.000000000 -0700
+++ linux-2.4.22-bk27/fs/proc/inode.c	2003-09-30 02:53:05.000000000 -0700
@@ -186,6 +186,7 @@
 	s->s_blocksize_bits = 10;
 	s->s_magic = PROC_SUPER_MAGIC;
 	s->s_op = &proc_sops;
+	s->s_maxbytes = ~0UL;
 	
 	root_inode = proc_get_inode(s, PROC_ROOT_INO, &proc_root);
 	if (!root_inode)
diff -urN linux-2.4.22-bk26/fs/proc/kcore.c linux-2.4.22-bk27/fs/proc/kcore.c
--- linux-2.4.22-bk26/fs/proc/kcore.c	2002-08-02 17:39:45.000000000 -0700
+++ linux-2.4.22-bk27/fs/proc/kcore.c	2003-09-30 02:53:05.000000000 -0700
@@ -27,11 +27,14 @@
 	return capable(CAP_SYS_RAWIO) ? 0 : -EPERM;
 }
 
+static loff_t lseek_kcore(struct file * file, loff_t offset, int origin);
+
 static ssize_t read_kcore(struct file *, char *, size_t, loff_t *);
 
 struct file_operations proc_kcore_operations = {
 	read:		read_kcore,
 	open:		open_kcore,
+	llseek:		lseek_kcore,
 };
 
 #ifdef CONFIG_KCORE_AOUT
@@ -112,9 +115,9 @@
 
 extern char saved_command_line[];
 
-static size_t get_kcore_size(int *num_vma, size_t *elf_buflen)
+static unsigned long get_kcore_size(int *num_vma, size_t *elf_buflen)
 {
-	size_t try, size;
+	unsigned long try, size;
 	struct vm_struct *m;
 
 	*num_vma = 0;
@@ -125,7 +128,7 @@
 	}
 
 	for (m=vmlist; m; m=m->next) {
-		try = (size_t)m->addr + m->size;
+		try = (unsigned long)m->addr + m->size;
 		if (try > size)
 			size = try;
 		*num_vma = *num_vma + 1;
@@ -313,14 +316,14 @@
 static ssize_t read_kcore(struct file *file, char *buffer, size_t buflen, loff_t *fpos)
 {
 	ssize_t acc = 0;
-	size_t size, tsz;
+	unsigned long size, tsz;
 	size_t elf_buflen;
 	int num_vma;
 	unsigned long start;
 
 	read_lock(&vmlist_lock);
 	proc_root_kcore->size = size = get_kcore_size(&num_vma, &elf_buflen);
-	if (buflen == 0 || *fpos >= size) {
+	if (buflen == 0 || (unsigned long long)*fpos >= size) {
 		read_unlock(&vmlist_lock);
 		return 0;
 	}
@@ -390,9 +393,16 @@
 	start = PAGE_OFFSET + (*fpos - elf_buflen);
 	if ((tsz = (PAGE_SIZE - (start & ~PAGE_MASK))) > buflen)
 		tsz = buflen;
-		
 	while (buflen) {
-		if ((start >= VMALLOC_START) && (start < VMALLOC_END)) {
+		int err; 
+	
+		if ((start > PAGE_OFFSET) && (start < (unsigned long)high_memory)) {
+			if (kern_addr_valid(start)) {
+				err = copy_to_user(buffer, (char *)start, tsz);
+			} else {
+				err = clear_user(buffer, tsz);
+			}
+		} else {
 			char * elf_buf;
 			struct vm_struct *m;
 			unsigned long curstart = start;
@@ -432,24 +442,11 @@
 					(char *)vmstart, vmsize);
 			}
 			read_unlock(&vmlist_lock);
-			if (copy_to_user(buffer, elf_buf, tsz)) {
+			err = copy_to_user(buffer, elf_buf, tsz); 
 				kfree(elf_buf);
-				return -EFAULT;
 			}
-			kfree(elf_buf);
-		} else if ((start > PAGE_OFFSET) && (start < 
-						(unsigned long)high_memory)) {
-			if (kern_addr_valid(start)) {
-				if (copy_to_user(buffer, (char *)start, tsz))
+		if (err)
 					return -EFAULT;
-			} else {
-				if (clear_user(buffer, tsz))
-					return -EFAULT;
-			}
-		} else {
-			if (clear_user(buffer, tsz))
-				return -EFAULT;
-		}
 		buflen -= tsz;
 		*fpos += tsz;
 		buffer += tsz;
@@ -461,3 +458,17 @@
 	return acc;
 }
 #endif /* CONFIG_KCORE_AOUT */
+
+static loff_t lseek_kcore(struct file * file, loff_t offset, int origin)
+{
+	switch (origin) {
+		case 2:
+			offset += file->f_dentry->d_inode->i_size;
+			break;
+		case 1:
+			offset += file->f_pos;
+	}
+	/* RED-PEN user can fake an error here by setting offset to >=-4095 && <0  */
+	file->f_pos = offset;
+	return offset;
+}
diff -urN linux-2.4.22-bk26/include/asm-alpha/pci.h linux-2.4.22-bk27/include/asm-alpha/pci.h
--- linux-2.4.22-bk26/include/asm-alpha/pci.h	2003-06-13 07:51:38.000000000 -0700
+++ linux-2.4.22-bk27/include/asm-alpha/pci.h	2003-09-30 02:53:05.000000000 -0700
@@ -50,6 +50,7 @@
    bus numbers.  */
 
 #define pcibios_assign_all_busses()	1
+#define pcibios_scan_all_fns()		0
 
 #define PCIBIOS_MIN_IO		alpha_mv.min_io_address
 #define PCIBIOS_MIN_MEM		alpha_mv.min_mem_address
diff -urN linux-2.4.22-bk26/include/asm-arm/pci.h linux-2.4.22-bk27/include/asm-arm/pci.h
--- linux-2.4.22-bk26/include/asm-arm/pci.h	2003-08-25 04:44:43.000000000 -0700
+++ linux-2.4.22-bk27/include/asm-arm/pci.h	2003-09-30 02:53:05.000000000 -0700
@@ -53,6 +53,8 @@
 	/* We don't do dynamic PCI IRQ allocation */
 }
 
+#define pcibios_scan_all_fns()		0
+
 struct pci_dev;
 
 /* Allocate and map kernel buffer using consistent mode DMA for a device.
diff -urN linux-2.4.22-bk26/include/asm-i386/pci.h linux-2.4.22-bk27/include/asm-i386/pci.h
--- linux-2.4.22-bk26/include/asm-i386/pci.h	2003-08-25 04:44:43.000000000 -0700
+++ linux-2.4.22-bk27/include/asm-i386/pci.h	2003-09-30 02:53:05.000000000 -0700
@@ -14,6 +14,7 @@
 #else
 #define pcibios_assign_all_busses()	0
 #endif
+#define pcibios_scan_all_fns()		0
 
 extern unsigned long pci_mem_start;
 #define PCIBIOS_MIN_IO		0x1000
diff -urN linux-2.4.22-bk26/include/asm-ia64/pci.h linux-2.4.22-bk27/include/asm-ia64/pci.h
--- linux-2.4.22-bk26/include/asm-ia64/pci.h	2003-09-30 02:53:01.000000000 -0700
+++ linux-2.4.22-bk27/include/asm-ia64/pci.h	2003-09-30 02:53:05.000000000 -0700
@@ -15,6 +15,7 @@
  * loader.
  */
 #define pcibios_assign_all_busses()     0
+#define pcibios_scan_all_fns()		0
 
 #define PCIBIOS_MIN_IO		0x1000
 #define PCIBIOS_MIN_MEM		0x10000000
diff -urN linux-2.4.22-bk26/include/asm-m68k/pci.h linux-2.4.22-bk27/include/asm-m68k/pci.h
--- linux-2.4.22-bk26/include/asm-m68k/pci.h	2002-11-28 15:53:15.000000000 -0800
+++ linux-2.4.22-bk27/include/asm-m68k/pci.h	2003-09-30 02:53:05.000000000 -0700
@@ -34,6 +34,7 @@
 };
 
 #define pcibios_assign_all_busses()	0
+#define pcibios_scan_all_fns()		0
 
 extern inline void pcibios_set_master(struct pci_dev *dev)
 {
diff -urN linux-2.4.22-bk26/include/asm-mips/pci.h linux-2.4.22-bk27/include/asm-mips/pci.h
--- linux-2.4.22-bk26/include/asm-mips/pci.h	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.22-bk27/include/asm-mips/pci.h	2003-09-30 02:53:05.000000000 -0700
@@ -19,6 +19,7 @@
 #else
 #define pcibios_assign_all_busses()	0
 #endif
+#define pcibios_scan_all_fns()		0
 
 #define PCIBIOS_MIN_IO		0x1000
 #define PCIBIOS_MIN_MEM		0x10000000
diff -urN linux-2.4.22-bk26/include/asm-mips64/pci.h linux-2.4.22-bk27/include/asm-mips64/pci.h
--- linux-2.4.22-bk26/include/asm-mips64/pci.h	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.22-bk27/include/asm-mips64/pci.h	2003-09-30 02:53:05.000000000 -0700
@@ -19,6 +19,7 @@
 #else
 #define pcibios_assign_all_busses()	0
 #endif
+#define pcibios_scan_all_fns()		0
 
 #define PCIBIOS_MIN_IO		0x1000
 #define PCIBIOS_MIN_MEM		0x10000000
diff -urN linux-2.4.22-bk26/include/asm-parisc/pci.h linux-2.4.22-bk27/include/asm-parisc/pci.h
--- linux-2.4.22-bk26/include/asm-parisc/pci.h	2003-06-13 07:51:38.000000000 -0700
+++ linux-2.4.22-bk27/include/asm-parisc/pci.h	2003-09-30 02:53:05.000000000 -0700
@@ -259,6 +259,7 @@
 **   to zero for legacy platforms and one for PAT platforms.
 */
 #define pcibios_assign_all_busses()     (pdc_type == PDC_TYPE_PAT)
+#define pcibios_scan_all_fns()		0
 
 #define PCIBIOS_MIN_IO          0x10
 #define PCIBIOS_MIN_MEM         0x1000 /* NBPG - but pci/setup-res.c dies */
diff -urN linux-2.4.22-bk26/include/asm-ppc/pci.h linux-2.4.22-bk27/include/asm-ppc/pci.h
--- linux-2.4.22-bk26/include/asm-ppc/pci.h	2003-09-30 02:53:01.000000000 -0700
+++ linux-2.4.22-bk27/include/asm-ppc/pci.h	2003-09-30 02:53:05.000000000 -0700
@@ -24,6 +24,7 @@
 extern int pci_assign_all_busses;
 
 #define pcibios_assign_all_busses()	(pci_assign_all_busses)
+#define pcibios_scan_all_fns()		0
 
 #define PCIBIOS_MIN_IO		0x1000
 #define PCIBIOS_MIN_MEM		0x10000000
diff -urN linux-2.4.22-bk26/include/asm-ppc64/pci.h linux-2.4.22-bk27/include/asm-ppc64/pci.h
--- linux-2.4.22-bk26/include/asm-ppc64/pci.h	2002-11-28 15:53:15.000000000 -0800
+++ linux-2.4.22-bk27/include/asm-ppc64/pci.h	2003-09-30 02:53:05.000000000 -0700
@@ -25,6 +25,12 @@
 #define PCIBIOS_MIN_IO		0x1000
 #define PCIBIOS_MIN_MEM		0x10000000
 
+/*
+ * ppc64 can have multifunction devices that do not respond to function 0.
+ * In this case we must scan all functions.
+ */
+#define pcibios_scan_all_fns()     1
+
 static inline void pcibios_set_master(struct pci_dev *dev)
 {
 	/* No special bus mastering setup handling */
diff -urN linux-2.4.22-bk26/include/asm-sh/pci.h linux-2.4.22-bk27/include/asm-sh/pci.h
--- linux-2.4.22-bk26/include/asm-sh/pci.h	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.22-bk27/include/asm-sh/pci.h	2003-09-30 02:53:05.000000000 -0700
@@ -10,6 +10,7 @@
    or architectures with incomplete PCI setup by the loader */
 
 #define pcibios_assign_all_busses()	1
+#define pcibios_scan_all_fns()		0
 
 #if defined(CONFIG_CPU_SUBTYPE_ST40)
 /* These are currently the correct values for the ST40 based chips.
diff -urN linux-2.4.22-bk26/include/asm-sparc/pci.h linux-2.4.22-bk27/include/asm-sparc/pci.h
--- linux-2.4.22-bk26/include/asm-sparc/pci.h	2002-11-28 15:53:15.000000000 -0800
+++ linux-2.4.22-bk27/include/asm-sparc/pci.h	2003-09-30 02:53:05.000000000 -0700
@@ -8,6 +8,7 @@
  * or architectures with incomplete PCI setup by the loader.
  */
 #define pcibios_assign_all_busses()	0
+#define pcibios_scan_all_fns()		0
 
 #define PCIBIOS_MIN_IO		0UL
 #define PCIBIOS_MIN_MEM		0UL
diff -urN linux-2.4.22-bk26/include/asm-sparc64/pci.h linux-2.4.22-bk27/include/asm-sparc64/pci.h
--- linux-2.4.22-bk26/include/asm-sparc64/pci.h	2002-02-25 11:38:13.000000000 -0800
+++ linux-2.4.22-bk27/include/asm-sparc64/pci.h	2003-09-30 02:53:05.000000000 -0700
@@ -11,6 +11,7 @@
  * or architectures with incomplete PCI setup by the loader.
  */
 #define pcibios_assign_all_busses()	0
+#define pcibios_scan_all_fns()		0
 
 #define PCIBIOS_MIN_IO		0UL
 #define PCIBIOS_MIN_MEM		0UL
diff -urN linux-2.4.22-bk26/include/asm-x86_64/pci.h linux-2.4.22-bk27/include/asm-x86_64/pci.h
--- linux-2.4.22-bk26/include/asm-x86_64/pci.h	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.22-bk27/include/asm-x86_64/pci.h	2003-09-30 02:53:05.000000000 -0700
@@ -17,6 +17,7 @@
 #else
 #define pcibios_assign_all_busses()	0
 #endif
+#define pcibios_scan_all_fns()		0
 
 extern unsigned long pci_mem_start;
 #define PCIBIOS_MIN_IO		0x1000
diff -urN linux-2.4.22-bk26/include/linux/personality.h linux-2.4.22-bk27/include/linux/personality.h
--- linux-2.4.22-bk26/include/linux/personality.h	2003-08-25 04:44:44.000000000 -0700
+++ linux-2.4.22-bk27/include/linux/personality.h	2003-09-30 02:53:05.000000000 -0700
@@ -57,6 +57,7 @@
 	PER_SUNOS =		0x0006 | STICKY_TIMEOUTS,
 	PER_XENIX =		0x0007 | STICKY_TIMEOUTS | SHORT_INODE,
 	PER_LINUX32 =		0x0008,
+	PER_LINUX32_3GB =	0x0008 | ADDR_LIMIT_3GB,
 	PER_IRIX32 =		0x0009 | STICKY_TIMEOUTS,/* IRIX5 32-bit */
 	PER_IRIXN32 =		0x000a | STICKY_TIMEOUTS,/* IRIX6 new 32-bit */
 	PER_IRIX64 =		0x000b | STICKY_TIMEOUTS,/* IRIX6 64-bit */
