r2510 - trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches

Thiemo Seufer ths-guest@costa.debian.org
Thu, 17 Feb 2005 21:22:38 +0100


Author: ths-guest
Date: 2005-02-17 21:22:38 +0100 (Thu, 17 Feb 2005)
New Revision: 2510

Added:
   trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/22_module.dpatch
   trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/23_wchan.dpatch
   trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/35_ip32-memsizeprint.dpatch
   trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/50_compat32-syscalls.dpatch
   trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/51_iomap.dpatch
   trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/52_ip22-sercon.dpatch
   trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/53_ip22-zilogtimeout.dpatch
   trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/54_ip32-eth0.dpatch
   trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/55_o32-kcore.dpatch
   trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/56_systimedwait.dpatch
Modified:
   trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/00list
Log:
Backport patches for 2.6.10.


Modified: trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/00list
===================================================================
--- trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/00list	2005-02-17 19:43:43 UTC (rev 2509)
+++ trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/00list	2005-02-17 20:22:38 UTC (rev 2510)
@@ -9,3 +9,10 @@
 30_ip22-eisa-update.dpatch
 35_ip32-memsizeprint.dpatch
 40_ip27-horribles.dpatch
+50_compat32-syscalls.dpatch
+51_iomap.dpatch
+52_ip22-sercon.dpatch
+53_ip22-zilogtimeout.dpatch
+54_ip32-eth0.dpatch
+55_o32-kcore.dpatch
+56_systimedwait.dpatch

Added: trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/22_module.dpatch
===================================================================
--- trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/22_module.dpatch	2005-02-17 19:43:43 UTC (rev 2509)
+++ trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/22_module.dpatch	2005-02-17 20:22:38 UTC (rev 2510)
@@ -0,0 +1,1003 @@
+#! /bin/sh -e
+## 22_module.dpatch by Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Module loader fix.
+
+if [ $# -lt 1 ]; then
+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+    -patch) patch -p0 ${patch_opts} < $0;;
+    -unpatch) patch -R -p0 ${patch_opts} < $0;;
+    *)
+        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+        exit 1;;
+esac
+
+exit 0
+
+Index: arch/mips/kernel/Makefile
+===================================================================
+RCS file: /home/cvs/linux/arch/mips/kernel/Makefile,v
+retrieving revision 1.87
+diff -u -p -r1.87 Makefile
+--- arch/mips/kernel/Makefile	7 Jan 2005 04:26:49 -0000	1.87
++++ arch/mips/kernel/Makefile	31 Jan 2005 02:26:26 -0000
+@@ -11,11 +11,7 @@ obj-y		+= cpu-probe.o branch.o entry.o g
+ binfmt_irix-objs	:= irixelf.o irixinv.o irixioctl.o irixsig.o	\
+ 			   irix5sys.o sysirix.o
+ 
+-ifdef CONFIG_MODULES
+-obj-y				+= mips_ksyms.o module.o
+-obj-$(CONFIG_MIPS32)		+= module-elf32.o
+-obj-$(CONFIG_MIPS64)		+= module-elf64.o
+-endif
++obj-$(CONFIG_MODULES)		+= mips_ksyms.o module.o
+ 
+ obj-$(CONFIG_CPU_R3000)		+= r2300_fpu.o r2300_switch.o
+ obj-$(CONFIG_CPU_TX39XX)	+= r2300_fpu.o r2300_switch.o
+Index: arch/mips/kernel/module-elf32.c
+===================================================================
+RCS file: arch/mips/kernel/module-elf32.c
+diff -N arch/mips/kernel/module-elf32.c
+--- arch/mips/kernel/module-elf32.c	17 Jun 2004 01:43:44 -0000	1.4
++++ /dev/null	1 Jan 1970 00:00:00 -0000
+@@ -1,250 +0,0 @@
+-/*
+- *  This program is free software; you can redistribute it and/or modify
+- *  it under the terms of the GNU General Public License as published by
+- *  the Free Software Foundation; either version 2 of the License, or
+- *  (at your option) any later version.
+- *
+- *  This program is distributed in the hope that it will be useful,
+- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- *  GNU General Public License for more details.
+- *
+- *  You should have received a copy of the GNU General Public License
+- *  along with this program; if not, write to the Free Software
+- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+- *
+- *  Copyright (C) 2001 Rusty Russell.
+- *  Copyright (C) 2003, 2004 Ralf Baechle (ralf@linux-mips.org)
+- */
+-
+-#undef DEBUG
+-
+-#include <linux/moduleloader.h>
+-#include <linux/elf.h>
+-#include <linux/vmalloc.h>
+-#include <linux/slab.h>
+-#include <linux/fs.h>
+-#include <linux/string.h>
+-#include <linux/kernel.h>
+-
+-struct mips_hi16 {
+-	struct mips_hi16 *next;
+-	Elf32_Addr *addr;
+-	Elf32_Addr value;
+-};
+-
+-static struct mips_hi16 *mips_hi16_list;
+-
+-void *module_alloc(unsigned long size)
+-{
+-	if (size == 0)
+-		return NULL;
+-	return vmalloc(size);
+-}
+-
+-
+-/* Free memory returned from module_alloc */
+-void module_free(struct module *mod, void *module_region)
+-{
+-	vfree(module_region);
+-	/* FIXME: If module_region == mod->init_region, trim exception
+-           table entries. */
+-}
+-
+-int module_frob_arch_sections(Elf_Ehdr *hdr,
+-			      Elf_Shdr *sechdrs,
+-			      char *secstrings,
+-			      struct module *mod)
+-{
+-	return 0;
+-}
+-
+-static int apply_r_mips_none(struct module *me, uint32_t *location,
+-	Elf32_Addr v)
+-{
+-	return 0;
+-}
+-
+-static int apply_r_mips_32(struct module *me, uint32_t *location,
+-	Elf32_Addr v)
+-{
+-	*location += v;
+-
+-	return 0;
+-}
+-
+-static int apply_r_mips_26(struct module *me, uint32_t *location,
+-	Elf32_Addr v)
+-{
+-	if (v % 4) {
+-		printk(KERN_ERR "module %s: dangerous relocation\n", me->name);
+-		return -ENOEXEC;
+-	}
+-
+-	if ((v & 0xf0000000) != (((unsigned long)location + 4) & 0xf0000000)) {
+-		printk(KERN_ERR
+-		       "module %s: relocation overflow\n",
+-		       me->name);
+-		return -ENOEXEC;
+-	}
+-
+-	*location = (*location & ~0x03ffffff) |
+-	            ((*location + (v >> 2)) & 0x03ffffff);
+-
+-	return 0;
+-}
+-
+-static int apply_r_mips_hi16(struct module *me, uint32_t *location,
+-	Elf32_Addr v)
+-{
+-	struct mips_hi16 *n;
+-
+-	/*
+-	 * We cannot relocate this one now because we don't know the value of
+-	 * the carry we need to add.  Save the information, and let LO16 do the
+-	 * actual relocation.
+-	 */
+-	n = kmalloc(sizeof *n, GFP_KERNEL);
+-	if (!n)
+-		return -ENOMEM;
+-
+-	n->addr = location;
+-	n->value = v;
+-	n->next = mips_hi16_list;
+-	mips_hi16_list = n;
+-
+-	return 0;
+-}
+-
+-static int apply_r_mips_lo16(struct module *me, uint32_t *location,
+-	Elf32_Addr v)
+-{
+-	unsigned long insnlo = *location;
+-	Elf32_Addr val, vallo;
+-
+-	/* Sign extend the addend we extract from the lo insn.  */
+-	vallo = ((insnlo & 0xffff) ^ 0x8000) - 0x8000;
+-
+-	if (mips_hi16_list != NULL) {
+-		struct mips_hi16 *l;
+-
+-		l = mips_hi16_list;
+-		while (l != NULL) {
+-			struct mips_hi16 *next;
+-			unsigned long insn;
+-
+-			/*
+-			 * The value for the HI16 had best be the same.
+-			 */
+-			if (v != l->value)
+-				goto out_danger;
+-
+-			/*
+-			 * Do the HI16 relocation.  Note that we actually don't
+-			 * need to know anything about the LO16 itself, except
+-			 * where to find the low 16 bits of the addend needed
+-			 * by the LO16.
+-			 */
+-			insn = *l->addr;
+-			val = ((insn & 0xffff) << 16) + vallo;
+-			val += v;
+-
+-			/*
+-			 * Account for the sign extension that will happen in
+-			 * the low bits.
+-			 */
+-			val = ((val >> 16) + ((val & 0x8000) != 0)) & 0xffff;
+-
+-			insn = (insn & ~0xffff) | val;
+-			*l->addr = insn;
+-
+-			next = l->next;
+-			kfree(l);
+-			l = next;
+-		}
+-
+-		mips_hi16_list = NULL;
+-	}
+-
+-	/*
+-	 * Ok, we're done with the HI16 relocs.  Now deal with the LO16.
+-	 */
+-	val = v + vallo;
+-	insnlo = (insnlo & ~0xffff) | (val & 0xffff);
+-	*location = insnlo;
+-
+-	return 0;
+-
+-out_danger:
+-	printk(KERN_ERR "module %s: dangerous " "relocation\n", me->name);
+-
+-	return -ENOEXEC;
+-}
+-
+-static int (*reloc_handlers[]) (struct module *me, uint32_t *location,
+-	Elf32_Addr v) = {
+-	[R_MIPS_NONE]	= apply_r_mips_none,
+-	[R_MIPS_32]	= apply_r_mips_32,
+-	[R_MIPS_26]	= apply_r_mips_26,
+-	[R_MIPS_HI16]	= apply_r_mips_hi16,
+-	[R_MIPS_LO16]	= apply_r_mips_lo16
+-};
+-
+-int apply_relocate(Elf32_Shdr *sechdrs,
+-		   const char *strtab,
+-		   unsigned int symindex,
+-		   unsigned int relsec,
+-		   struct module *me)
+-{
+-	Elf32_Rel *rel = (void *) sechdrs[relsec].sh_addr;
+-	Elf32_Sym *sym;
+-	uint32_t *location;
+-	unsigned int i;
+-	Elf32_Addr v;
+-	int res;
+-
+-	pr_debug("Applying relocate section %u to %u\n", relsec,
+-	       sechdrs[relsec].sh_info);
+-
+-	for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
+-		Elf32_Word r_info = rel[i].r_info;
+-
+-		/* This is where to make the change */
+-		location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr
+-			+ rel[i].r_offset;
+-		/* This is the symbol it is referring to */
+-		sym = (Elf32_Sym *)sechdrs[symindex].sh_addr
+-			+ ELF32_R_SYM(r_info);
+-		if (!sym->st_value) {
+-			printk(KERN_WARNING "%s: Unknown symbol %s\n",
+-			       me->name, strtab + sym->st_name);
+-			return -ENOENT;
+-		}
+-
+-		v = sym->st_value;
+-
+-		res = reloc_handlers[ELF32_R_TYPE(r_info)](me, location, v);
+-		if (res)
+-			return res;
+-	}
+-
+-	return 0;
+-}
+-
+-int apply_relocate_add(Elf32_Shdr *sechdrs,
+-		       const char *strtab,
+-		       unsigned int symindex,
+-		       unsigned int relsec,
+-		       struct module *me)
+-{
+-	/*
+-	 * Current binutils always generate .rela relocations.  Keep smiling
+-	 * if it's empty, abort otherwise.
+-	 */
+-	if (!sechdrs[relsec].sh_size)
+-		return 0;
+-
+-	printk(KERN_ERR "module %s: ADD RELOCATION unsupported\n",
+-	       me->name);
+-	return -ENOEXEC;
+-}
+Index: arch/mips/kernel/module-elf64.c
+===================================================================
+RCS file: arch/mips/kernel/module-elf64.c
+diff -N arch/mips/kernel/module-elf64.c
+--- arch/mips/kernel/module-elf64.c	17 Jun 2004 01:43:44 -0000	1.4
++++ /dev/null	1 Jan 1970 00:00:00 -0000
+@@ -1,274 +0,0 @@
+-/*
+- *  This program is free software; you can redistribute it and/or modify
+- *  it under the terms of the GNU General Public License as published by
+- *  the Free Software Foundation; either version 2 of the License, or
+- *  (at your option) any later version.
+- *
+- *  This program is distributed in the hope that it will be useful,
+- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- *  GNU General Public License for more details.
+- *
+- *  You should have received a copy of the GNU General Public License
+- *  along with this program; if not, write to the Free Software
+- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+- *
+- *  Copyright (C) 2001 Rusty Russell.
+- *  Copyright (C) 2003, 2004 Ralf Baechle (ralf@linux-mips.org)
+- */
+-
+-#undef DEBUG
+-
+-#include <linux/moduleloader.h>
+-#include <linux/elf.h>
+-#include <linux/vmalloc.h>
+-#include <linux/slab.h>
+-#include <linux/fs.h>
+-#include <linux/string.h>
+-#include <linux/kernel.h>
+-
+-struct mips_hi16 {
+-	struct mips_hi16 *next;
+-	Elf32_Addr *addr;
+-	Elf64_Addr value;
+-};
+-
+-static struct mips_hi16 *mips_hi16_list;
+-
+-void *module_alloc(unsigned long size)
+-{
+-	if (size == 0)
+-		return NULL;
+-	return vmalloc(size);
+-}
+-
+-
+-/* Free memory returned from module_alloc */
+-void module_free(struct module *mod, void *module_region)
+-{
+-	vfree(module_region);
+-	/* FIXME: If module_region == mod->init_region, trim exception
+-           table entries. */
+-}
+-
+-int module_frob_arch_sections(Elf_Ehdr *hdr,
+-			      Elf_Shdr *sechdrs,
+-			      char *secstrings,
+-			      struct module *mod)
+-{
+-	return 0;
+-}
+-
+-int apply_relocate(Elf64_Shdr *sechdrs,
+-		   const char *strtab,
+-		   unsigned int symindex,
+-		   unsigned int relsec,
+-		   struct module *me)
+-{
+-	/*
+-	 * We don't want to deal with REL relocations - RELA is so much saner.
+-	 */
+-	if (!sechdrs[relsec].sh_size)
+-		return 0;
+-
+-	printk(KERN_ERR "module %s: REL relocation unsupported\n",
+-	       me->name);
+-	return -ENOEXEC;
+-}
+-
+-static int apply_r_mips_none(struct module *me, uint32_t *location,
+-	Elf64_Addr v)
+-{
+-	return 0;
+-}
+-
+-static int apply_r_mips_32(struct module *me, uint32_t *location,
+-	Elf64_Addr v)
+-{
+-	*location = v;
+-
+-	return 0;
+-}
+-
+-static int apply_r_mips_26(struct module *me, uint32_t *location,
+-	Elf64_Addr v)
+-{
+-	if (v % 4) {
+-		printk(KERN_ERR "module %s: dangerous relocation\n", me->name);
+-		return -ENOEXEC;
+-	}
+-
+-	if ((v & 0xf0000000) != (((unsigned long)location + 4) & 0xf0000000)) {
+-		printk(KERN_ERR
+-		       "module %s: relocation overflow\n",
+-		       me->name);
+-		return -ENOEXEC;
+-	}
+-
+-	*location = (*location & ~0x03ffffff) | ((v >> 2) & 0x03ffffff);
+-
+-	return 0;
+-}
+-
+-static int apply_r_mips_hi16(struct module *me, uint32_t *location,
+-	Elf64_Addr v)
+-{
+-	struct mips_hi16 *n;
+-
+-	/*
+-	 * We cannot relocate this one now because we don't know the value of
+-	 * the carry we need to add.  Save the information, and let LO16 do the
+-	 * actual relocation.
+-	 */
+-	n = kmalloc(sizeof *n, GFP_KERNEL);
+-	if (!n)
+-		return -ENOMEM;
+-
+-	n->addr = location;
+-	n->value = v;
+-	n->next = mips_hi16_list;
+-	mips_hi16_list = n;
+-
+-	return 0;
+-}
+-
+-static int apply_r_mips_lo16(struct module *me, uint32_t *location,
+-	Elf64_Addr v)
+-{
+-	unsigned long insnlo = *location;
+-	Elf32_Addr val, vallo;
+-
+-	/* Sign extend the addend we extract from the lo insn.  */
+-	vallo = ((insnlo & 0xffff) ^ 0x8000) - 0x8000;
+-
+-	if (mips_hi16_list != NULL) {
+-		struct mips_hi16 *l;
+-
+-		l = mips_hi16_list;
+-		while (l != NULL) {
+-			struct mips_hi16 *next;
+-			unsigned long insn;
+-
+-			/*
+-			 * The value for the HI16 had best be the same.
+-			 */
+-			if (v != l->value)
+-				goto out_danger;
+-
+-			/*
+-			 * Do the HI16 relocation.  Note that we actually don't
+-			 * need to know anything about the LO16 itself, except
+-			 * where to find the low 16 bits of the addend needed
+-			 * by the LO16.
+-			 */
+-			insn = *l->addr;
+-			val = ((insn & 0xffff) << 16) + vallo;
+-			val += v;
+-
+-			/*
+-			 * Account for the sign extension that will happen in
+-			 * the low bits.
+-			 */
+-			val = ((val >> 16) + ((val & 0x8000) != 0)) & 0xffff;
+-
+-			insn = (insn & ~0xffff) | val;
+-			*l->addr = insn;
+-
+-			next = l->next;
+-			kfree(l);
+-			l = next;
+-		}
+-
+-		mips_hi16_list = NULL;
+-	}
+-
+-	/*
+-	 * Ok, we're done with the HI16 relocs.  Now deal with the LO16.
+-	 */
+-	insnlo = (insnlo & ~0xffff) | (v & 0xffff);
+-	*location = insnlo;
+-
+-	return 0;
+-
+-out_danger:
+-	printk(KERN_ERR "module %s: dangerous " "relocation\n", me->name);
+-
+-	return -ENOEXEC;
+-}
+-
+-static int apply_r_mips_64(struct module *me, uint32_t *location,
+-	Elf64_Addr v)
+-{
+-	*(uint64_t *) location = v;
+-
+-	return 0;
+-}
+-
+-
+-static int apply_r_mips_higher(struct module *me, uint32_t *location,
+-	Elf64_Addr v)
+-{
+-	*location = (*location & 0xffff0000) |
+-	            ((((long long) v + 0x80008000LL) >> 32) & 0xffff);
+-
+-	return 0;
+-}
+-
+-static int apply_r_mips_highest(struct module *me, uint32_t *location,
+-	Elf64_Addr v)
+-{
+-	*location = (*location & 0xffff0000) |
+-	            ((((long long) v + 0x800080008000LL) >> 48) & 0xffff);
+-
+-	return 0;
+-}
+-
+-static int (*reloc_handlers[]) (struct module *me, uint32_t *location,
+-	Elf64_Addr v) = {
+-	[R_MIPS_NONE]		= apply_r_mips_none,
+-	[R_MIPS_32]		= apply_r_mips_32,
+-	[R_MIPS_26]		= apply_r_mips_26,
+-	[R_MIPS_HI16]		= apply_r_mips_hi16,
+-	[R_MIPS_LO16]		= apply_r_mips_lo16,
+-	[R_MIPS_64]		= apply_r_mips_64,
+-	[R_MIPS_HIGHER]		= apply_r_mips_higher,
+-	[R_MIPS_HIGHEST]	= apply_r_mips_highest
+-};
+-
+-int apply_relocate_add(Elf64_Shdr *sechdrs,
+-		       const char *strtab,
+-		       unsigned int symindex,
+-		       unsigned int relsec,
+-		       struct module *me)
+-{
+-	Elf64_Mips_Rela *rel = (void *) sechdrs[relsec].sh_addr;
+-	Elf64_Sym *sym;
+-	uint32_t *location;
+-	unsigned int i;
+-	Elf64_Addr v;
+-	int res;
+-
+-	pr_debug("Applying relocate section %u to %u\n", relsec,
+-	       sechdrs[relsec].sh_info);
+-
+-	for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
+-		/* This is where to make the change */
+-		location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr
+-			+ rel[i].r_offset;
+-		/* This is the symbol it is referring to */
+-		sym = (Elf64_Sym *)sechdrs[symindex].sh_addr + rel[i].r_sym;
+-		if (!sym->st_value) {
+-			printk(KERN_WARNING "%s: Unknown symbol %s\n",
+-			       me->name, strtab + sym->st_name);
+-			return -ENOENT;
+-		}
+-
+-		v = sym->st_value;
+-
+-		res = reloc_handlers[rel[i].r_type](me, location, v);
+-		if (res)
+-			return res;
+-	}
+-
+-	return 0;
+-}
+Index: arch/mips/kernel/module.c
+===================================================================
+RCS file: /home/cvs/linux/arch/mips/kernel/module.c,v
+retrieving revision 1.7
+diff -u -p -r1.7 module.c
+--- arch/mips/kernel/module.c	26 Jun 2004 15:15:10 -0000	1.7
++++ arch/mips/kernel/module.c	31 Jan 2005 02:26:26 -0000
+@@ -1,9 +1,345 @@
++/*
++ *  This program is free software; you can redistribute it and/or modify
++ *  it under the terms of the GNU General Public License as published by
++ *  the Free Software Foundation; either version 2 of the License, or
++ *  (at your option) any later version.
++ *
++ *  This program is distributed in the hope that it will be useful,
++ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ *  GNU General Public License for more details.
++ *
++ *  You should have received a copy of the GNU General Public License
++ *  along with this program; if not, write to the Free Software
++ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
++ *
++ *  Copyright (C) 2001 Rusty Russell.
++ *  Copyright (C) 2003, 2004 Ralf Baechle (ralf@linux-mips.org)
++ *  Copyright (C) 2005 Thiemo Seufer
++ */
++
++#undef DEBUG
++
++#include <linux/moduleloader.h>
++#include <linux/elf.h>
++#include <linux/vmalloc.h>
++#include <linux/slab.h>
++#include <linux/fs.h>
++#include <linux/string.h>
++#include <linux/kernel.h>
+ #include <linux/module.h>
+ #include <linux/spinlock.h>
+ 
++struct mips_hi16 {
++	struct mips_hi16 *next;
++	Elf_Addr *addr;
++	Elf_Addr value;
++};
++
++static struct mips_hi16 *mips_hi16_list;
++
+ static LIST_HEAD(dbe_list);
+ static spinlock_t dbe_lock = SPIN_LOCK_UNLOCKED;
+ 
++void *module_alloc(unsigned long size)
++{
++	if (size == 0)
++		return NULL;
++	return vmalloc(size);
++}
++
++/* Free memory returned from module_alloc */
++void module_free(struct module *mod, void *module_region)
++{
++	vfree(module_region);
++	/* FIXME: If module_region == mod->init_region, trim exception
++           table entries. */
++}
++
++int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs,
++			      char *secstrings, struct module *mod)
++{
++	return 0;
++}
++
++static int apply_r_mips_none(struct module *me, u32 *location, Elf_Addr v)
++{
++	return 0;
++}
++
++static int apply_r_mips_32_rel(struct module *me, u32 *location, Elf_Addr v)
++{
++	*location += v;
++
++	return 0;
++}
++
++static int apply_r_mips_32_rela(struct module *me, u32 *location, Elf_Addr v)
++{
++	*location = v;
++
++	return 0;
++}
++
++static int apply_r_mips_26_rel(struct module *me, u32 *location, Elf_Addr v)
++{
++	if (v % 4) {
++		printk(KERN_ERR "module %s: dangerous relocation\n", me->name);
++		return -ENOEXEC;
++	}
++
++	if ((v & 0xf0000000) != (((unsigned long)location + 4) & 0xf0000000)) {
++		printk(KERN_ERR
++		       "module %s: relocation overflow\n",
++		       me->name);
++		return -ENOEXEC;
++	}
++
++	*location = (*location & ~0x03ffffff) |
++	            ((*location + (v >> 2)) & 0x03ffffff);
++
++	return 0;
++}
++
++static int apply_r_mips_26_rela(struct module *me, u32 *location, Elf_Addr v)
++{
++	if (v % 4) {
++		printk(KERN_ERR "module %s: dangerous relocation\n", me->name);
++		return -ENOEXEC;
++	}
++
++	if ((v & 0xf0000000) != (((unsigned long)location + 4) & 0xf0000000)) {
++		printk(KERN_ERR
++		       "module %s: relocation overflow\n",
++		       me->name);
++		return -ENOEXEC;
++	}
++
++	*location = (*location & ~0x03ffffff) | ((v >> 2) & 0x03ffffff);
++
++	return 0;
++}
++
++static int apply_r_mips_hi16_rel(struct module *me, u32 *location, Elf_Addr v)
++{
++	struct mips_hi16 *n;
++
++	/*
++	 * We cannot relocate this one now because we don't know the value of
++	 * the carry we need to add.  Save the information, and let LO16 do the
++	 * actual relocation.
++	 */
++	n = kmalloc(sizeof *n, GFP_KERNEL);
++	if (!n)
++		return -ENOMEM;
++
++	n->addr = (Elf_Addr *)location;
++	n->value = v;
++	n->next = mips_hi16_list;
++	mips_hi16_list = n;
++
++	return 0;
++}
++
++static int apply_r_mips_hi16_rela(struct module *me, u32 *location, Elf_Addr v)
++{
++	*location = (*location & 0xffff0000) |
++	            ((((long long) v + 0x8000LL) >> 16) & 0xffff);
++
++	return 0;
++}
++
++static int apply_r_mips_lo16_rel(struct module *me, u32 *location, Elf_Addr v)
++{
++	unsigned long insnlo = *location;
++	Elf_Addr val, vallo;
++
++	/* Sign extend the addend we extract from the lo insn.  */
++	vallo = ((insnlo & 0xffff) ^ 0x8000) - 0x8000;
++
++	if (mips_hi16_list != NULL) {
++		struct mips_hi16 *l;
++
++		l = mips_hi16_list;
++		while (l != NULL) {
++			struct mips_hi16 *next;
++			unsigned long insn;
++
++			/*
++			 * The value for the HI16 had best be the same.
++			 */
++			if (v != l->value)
++				goto out_danger;
++
++			/*
++			 * Do the HI16 relocation.  Note that we actually don't
++			 * need to know anything about the LO16 itself, except
++			 * where to find the low 16 bits of the addend needed
++			 * by the LO16.
++			 */
++			insn = *l->addr;
++			val = ((insn & 0xffff) << 16) + vallo;
++			val += v;
++
++			/*
++			 * Account for the sign extension that will happen in
++			 * the low bits.
++			 */
++			val = ((val >> 16) + ((val & 0x8000) != 0)) & 0xffff;
++
++			insn = (insn & ~0xffff) | val;
++			*l->addr = insn;
++
++			next = l->next;
++			kfree(l);
++			l = next;
++		}
++
++		mips_hi16_list = NULL;
++	}
++
++	/*
++	 * Ok, we're done with the HI16 relocs.  Now deal with the LO16.
++	 */
++	val = v + vallo;
++	insnlo = (insnlo & ~0xffff) | (val & 0xffff);
++	*location = insnlo;
++
++	return 0;
++
++out_danger:
++	printk(KERN_ERR "module %s: dangerous " "relocation\n", me->name);
++
++	return -ENOEXEC;
++}
++
++static int apply_r_mips_lo16_rela(struct module *me, u32 *location, Elf_Addr v)
++{
++	*location = (*location & 0xffff0000) | (v & 0xffff);
++
++	return 0;
++}
++
++static int apply_r_mips_64_rela(struct module *me, u32 *location, Elf_Addr v)
++{
++	*(Elf_Addr *)location = v;
++
++	return 0;
++}
++
++static int apply_r_mips_higher_rela(struct module *me, u32 *location,
++				    Elf_Addr v)
++{
++	*location = (*location & 0xffff0000) |
++	            ((((long long) v + 0x80008000LL) >> 32) & 0xffff);
++
++	return 0;
++}
++
++static int apply_r_mips_highest_rela(struct module *me, u32 *location,
++				     Elf_Addr v)
++{
++	*location = (*location & 0xffff0000) |
++	            ((((long long) v + 0x800080008000LL) >> 48) & 0xffff);
++
++	return 0;
++}
++
++static int (*reloc_handlers_rel[]) (struct module *me, u32 *location,
++				Elf_Addr v) = {
++	[R_MIPS_NONE]		= apply_r_mips_none,
++	[R_MIPS_32]		= apply_r_mips_32_rel,
++	[R_MIPS_26]		= apply_r_mips_26_rel,
++	[R_MIPS_HI16]		= apply_r_mips_hi16_rel,
++	[R_MIPS_LO16]		= apply_r_mips_lo16_rel
++};
++
++static int (*reloc_handlers_rela[]) (struct module *me, u32 *location,
++				Elf_Addr v) = {
++	[R_MIPS_NONE]		= apply_r_mips_none,
++	[R_MIPS_32]		= apply_r_mips_32_rela,
++	[R_MIPS_26]		= apply_r_mips_26_rela,
++	[R_MIPS_HI16]		= apply_r_mips_hi16_rela,
++	[R_MIPS_LO16]		= apply_r_mips_lo16_rela,
++	[R_MIPS_64]		= apply_r_mips_64_rela,
++	[R_MIPS_HIGHER]		= apply_r_mips_higher_rela,
++	[R_MIPS_HIGHEST]	= apply_r_mips_highest_rela
++};
++
++int apply_relocate(Elf_Shdr *sechdrs, const char *strtab,
++		   unsigned int symindex, unsigned int relsec,
++		   struct module *me)
++{
++	Elf_Mips_Rel *rel = (void *) sechdrs[relsec].sh_addr;
++	Elf_Sym *sym;
++	u32 *location;
++	unsigned int i;
++	Elf_Addr v;
++	int res;
++
++	pr_debug("Applying relocate section %u to %u\n", relsec,
++	       sechdrs[relsec].sh_info);
++
++	for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
++		/* This is where to make the change */
++		location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr
++			+ rel[i].r_offset;
++		/* This is the symbol it is referring to */
++		sym = (Elf_Sym *)sechdrs[symindex].sh_addr
++			+ ELF_MIPS_R_SYM(rel[i]);
++		if (!sym->st_value) {
++			printk(KERN_WARNING "%s: Unknown symbol %s\n",
++			       me->name, strtab + sym->st_name);
++			return -ENOENT;
++		}
++
++		v = sym->st_value;
++
++		res = reloc_handlers_rel[ELF_MIPS_R_TYPE(rel[i])](me, location, v);
++		if (res)
++			return res;
++	}
++
++	return 0;
++}
++
++int apply_relocate_add(Elf_Shdr *sechdrs, const char *strtab,
++		       unsigned int symindex, unsigned int relsec,
++		       struct module *me)
++{
++	Elf_Mips_Rela *rel = (void *) sechdrs[relsec].sh_addr;
++	Elf_Sym *sym;
++	u32 *location;
++	unsigned int i;
++	Elf_Addr v;
++	int res;
++
++	pr_debug("Applying relocate section %u to %u\n", relsec,
++	       sechdrs[relsec].sh_info);
++
++	for (i = 0; i < sechdrs[relsec].sh_size / sizeof(*rel); i++) {
++		/* This is where to make the change */
++		location = (void *)sechdrs[sechdrs[relsec].sh_info].sh_addr
++			+ rel[i].r_offset;
++		/* This is the symbol it is referring to */
++		sym = (Elf_Sym *)sechdrs[symindex].sh_addr
++			+ ELF_MIPS_R_SYM(rel[i]);
++		if (!sym->st_value) {
++			printk(KERN_WARNING "%s: Unknown symbol %s\n",
++			       me->name, strtab + sym->st_name);
++			return -ENOENT;
++		}
++
++		v = sym->st_value + rel[i].r_addend;
++
++		res = reloc_handlers_rela[ELF_MIPS_R_TYPE(rel[i])](me, location, v);
++		if (res)
++			return res;
++	}
++
++	return 0;
++}
++
+ /* Given an address, look for it in the module exception tables. */
+ const struct exception_table_entry *search_module_dbetables(unsigned long addr)
+ {
+Index: include/asm-mips/module.h
+===================================================================
+RCS file: /home/cvs/linux/include/asm-mips/module.h,v
+retrieving revision 1.7
+diff -u -p -r1.7 module.h
+--- include/asm-mips/module.h	17 Jun 2004 01:43:44 -0000	1.7
++++ include/asm-mips/module.h	31 Jan 2005 02:26:46 -0000
+@@ -14,15 +14,23 @@ struct mod_arch_specific {
+ 
+ typedef uint8_t Elf64_Byte;		/* Type for a 8-bit quantity.  */
+ 
+-typedef struct
+-{
+-  Elf64_Addr r_offset;			/* Address of relocation.  */
+-  Elf64_Word r_sym;			/* Symbol index.  */
+-  Elf64_Byte r_ssym;			/* Special symbol.  */
+-  Elf64_Byte r_type3;			/* Third relocation.  */
+-  Elf64_Byte r_type2;			/* Second relocation.  */
+-  Elf64_Byte r_type;			/* First relocation.  */
+-  Elf64_Sxword r_addend;		/* Addend.  */
++typedef struct {
++	Elf64_Addr r_offset;			/* Address of relocation.  */
++	Elf64_Word r_sym;			/* Symbol index.  */
++	Elf64_Byte r_ssym;			/* Special symbol.  */
++	Elf64_Byte r_type3;			/* Third relocation.  */
++	Elf64_Byte r_type2;			/* Second relocation.  */
++	Elf64_Byte r_type;			/* First relocation.  */
++} Elf64_Mips_Rel;
++
++typedef struct {
++	Elf64_Addr r_offset;			/* Address of relocation.  */
++	Elf64_Word r_sym;			/* Symbol index.  */
++	Elf64_Byte r_ssym;			/* Special symbol.  */
++	Elf64_Byte r_type3;			/* Third relocation.  */
++	Elf64_Byte r_type2;			/* Second relocation.  */
++	Elf64_Byte r_type;			/* First relocation.  */
++	Elf64_Sxword r_addend;			/* Addend.  */
+ } Elf64_Mips_Rela;
+ 
+ #ifdef CONFIG_MIPS32
+@@ -30,6 +38,13 @@ typedef struct
+ #define Elf_Shdr	Elf32_Shdr
+ #define Elf_Sym		Elf32_Sym
+ #define Elf_Ehdr	Elf32_Ehdr
++#define Elf_Addr	Elf32_Addr
++
++#define Elf_Mips_Rel	Elf32_Rel
++#define Elf_Mips_Rela	Elf32_Rela
++
++#define ELF_MIPS_R_SYM(rel) ELF32_R_SYM(rel.r_info)
++#define ELF_MIPS_R_TYPE(rel) ELF32_R_TYPE(rel.r_info)
+ 
+ #endif
+ 
+@@ -38,6 +53,13 @@ typedef struct
+ #define Elf_Shdr	Elf64_Shdr
+ #define Elf_Sym		Elf64_Sym
+ #define Elf_Ehdr	Elf64_Ehdr
++#define Elf_Addr	Elf64_Addr
++
++#define Elf_Mips_Rel	Elf64_Mips_Rel
++#define Elf_Mips_Rela	Elf64_Mips_Rela
++
++#define ELF_MIPS_R_SYM(rel) (rel.r_sym)
++#define ELF_MIPS_R_TYPE(rel) (rel.r_type)
+ 
+ #endif
+ 


Property changes on: trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/22_module.dpatch
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/23_wchan.dpatch
===================================================================
--- trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/23_wchan.dpatch	2005-02-17 19:43:43 UTC (rev 2509)
+++ trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/23_wchan.dpatch	2005-02-17 20:22:38 UTC (rev 2510)
@@ -0,0 +1,228 @@
+#! /bin/sh -e
+## 23_wchan.dpatch
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix wchan implementation, based on earlier patch from
+## DP: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
+## DP: http://www.linux-mips.org/archives/linux-mips/2004-10/msg00312.html
+
+if [ $# -lt 1 ]; then
+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+    -patch) patch -p0 ${patch_opts} < $0;;
+    -unpatch) patch -R -p0 ${patch_opts} < $0;;
+    *)
+        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+        exit 1;;
+esac
+
+exit 0
+
+Index: scripts/kallsyms.c
+===================================================================
+RCS file: /home/cvs/linux/scripts/kallsyms.c,v
+retrieving revision 1.10
+diff -u -p -r1.10 kallsyms.c
+--- scripts/kallsyms.c	15 Nov 2004 11:49:52 -0000	1.10
++++ scripts/kallsyms.c	2 Feb 2005 03:37:37 -0000
+@@ -145,6 +145,9 @@ read_symbol(FILE *in, struct sym_entry *
+ 	else if (toupper(s->type) == 'U' ||
+ 		 is_arm_mapping_symbol(str))
+ 		return -1;
++	/* exclude also MIPS NewABI local symbols */
++	else if (strncmp(str, "$L", 2) == 0)
++		return -1;
+ 
+ 	/* include the type field in the symbol name, so that it gets
+ 	 * compressed together */
+Index: arch/mips/kernel/process.c
+===================================================================
+RCS file: /home/cvs/linux/arch/mips/kernel/process.c,v
+retrieving revision 1.72
+diff -u -p -r1.72 process.c
+--- arch/mips/kernel/process.c	7 Jan 2005 04:26:49 -0000	1.72
++++ arch/mips/kernel/process.c	2 Feb 2005 03:37:37 -0000
+@@ -181,22 +181,49 @@ long kernel_thread(int (*fn)(void *), vo
+ 	return do_fork(flags | CLONE_VM | CLONE_UNTRACED, 0, &regs, 0, NULL, NULL);
+ }
+ 
+-struct mips_frame_info {
++static struct mips_frame_info {
++	void *func;
++	int omit_fp;	/* compiled without fno-omit-frame-pointer */
+ 	int frame_offset;
+ 	int pc_offset;
++} schedule_frame, mfinfo[] = {
++	{ schedule, 0 },	/* must be first */
++	/* arch/mips/kernel/semaphore.c */
++	{ __down, 1 },
++	{ __down_interruptible, 1 },
++	/* kernel/sched.c */
++#ifdef CONFIG_PREEMPT
++	{ preempt_schedule, 0 },
++#endif
++	{ wait_for_completion, 0 },
++	{ interruptible_sleep_on, 0 },
++	{ interruptible_sleep_on_timeout, 0 },
++	{ sleep_on, 0 },
++	{ sleep_on_timeout, 0 },
++	{ __cond_resched, 0 },
++	{ yield, 0 },
++	{ io_schedule, 0 },
++	{ io_schedule_timeout, 0 },
++#if defined(CONFIG_SMP) && defined(CONFIG_PREEMPT)
++	{ __preempt_spin_lock, 0 },
++	{ __preempt_write_lock, 0 },
++#endif
++	/* kernel/timer.c */
++	{ schedule_timeout, 1 },
++/*	{ nanosleep_restart, 1 }, */
++	/* lib/rwsem-spinlock.c */
++	{ __down_read, 1 },
++	{ __down_write, 1 },
+ };
+-static struct mips_frame_info schedule_frame;
+-static struct mips_frame_info schedule_timeout_frame;
+-static struct mips_frame_info sleep_on_frame;
+-static struct mips_frame_info sleep_on_timeout_frame;
+-static struct mips_frame_info wait_for_completion_frame;
++
+ static int mips_frame_info_initialized;
+-static int __init get_frame_info(struct mips_frame_info *info, void *func)
++static int __init get_frame_info(struct mips_frame_info *info)
+ {
+ 	int i;
++	void *func = info->func;
+ 	union mips_instruction *ip = (union mips_instruction *)func;
+ 	info->pc_offset = -1;
+-	info->frame_offset = -1;
++	info->frame_offset = info->omit_fp ? 0 : -1;
+ 	for (i = 0; i < 128; i++, ip++) {
+ 		/* if jal, jalr, jr, stop. */
+ 		if (ip->j_format.opcode == jal_op ||
+@@ -217,14 +244,16 @@ static int __init get_frame_info(struct 
+ 			/* sw / sd $ra, offset($sp) */
+ 			if (ip->i_format.rt == 31) {
+ 				if (info->pc_offset != -1)
+-					break;
++					continue;
+ 				info->pc_offset =
+ 					ip->i_format.simmediate / sizeof(long);
+ 			}
+ 			/* sw / sd $s8, offset($sp) */
+ 			if (ip->i_format.rt == 30) {
++//#if 0	/* gcc 3.4 does aggressive optimization... */
+ 				if (info->frame_offset != -1)
+-					break;
++					continue;
++//#endif
+ 				info->frame_offset =
+ 					ip->i_format.simmediate / sizeof(long);
+ 			}
+@@ -242,13 +271,25 @@ static int __init get_frame_info(struct 
+ 
+ static int __init frame_info_init(void)
+ {
+-	mips_frame_info_initialized =
+-		!get_frame_info(&schedule_frame, schedule) &&
+-		!get_frame_info(&schedule_timeout_frame, schedule_timeout) &&
+-		!get_frame_info(&sleep_on_frame, sleep_on) &&
+-		!get_frame_info(&sleep_on_timeout_frame, sleep_on_timeout) &&
+-		!get_frame_info(&wait_for_completion_frame, wait_for_completion);
+-
++	int i, found;
++	for (i = 0; i < ARRAY_SIZE(mfinfo); i++)
++		if (get_frame_info(&mfinfo[i]))
++			return -1;
++	schedule_frame = mfinfo[0];
++	/* bubble sort */
++	do {
++		struct mips_frame_info tmp;
++		found = 0;
++		for (i = 1; i < ARRAY_SIZE(mfinfo); i++) {
++			if (mfinfo[i-1].func > mfinfo[i].func) {
++				tmp = mfinfo[i];
++				mfinfo[i] = mfinfo[i-1];
++				mfinfo[i-1] = tmp;
++				found = 1;
++			}
++		}
++	} while (found);
++	mips_frame_info_initialized = 1;
+ 	return 0;
+ }
+ 
+@@ -281,53 +322,27 @@ unsigned long get_wchan(struct task_stru
+ 	if (!mips_frame_info_initialized)
+ 		return 0;
+ 	pc = thread_saved_pc(p);
++
+ 	if (!in_sched_functions(pc))
+ 		goto out;
+ 
+-	if (pc >= (unsigned long) sleep_on_timeout)
+-		goto schedule_timeout_caller;
+-	if (pc >= (unsigned long) sleep_on)
+-		goto schedule_caller;
+-	if (pc >= (unsigned long) interruptible_sleep_on_timeout)
+-		goto schedule_timeout_caller;
+-	if (pc >= (unsigned long)interruptible_sleep_on)
+-		goto schedule_caller;
+-	if (pc >= (unsigned long)wait_for_completion)
+-		goto schedule_caller;
+-	goto schedule_timeout_caller;
+-
+-schedule_caller:
+-	frame = ((unsigned long *)p->thread.reg30)[schedule_frame.frame_offset];
+-	if (pc >= (unsigned long) sleep_on)
+-		pc = ((unsigned long *)frame)[sleep_on_frame.pc_offset];
+-	else
+-		pc = ((unsigned long *)frame)[wait_for_completion_frame.pc_offset];
+-	goto out;
+-
+-schedule_timeout_caller:
+-	/*
+-	 * The schedule_timeout frame
+-	 */
+ 	frame = ((unsigned long *)p->thread.reg30)[schedule_frame.frame_offset];
++	do {
++		int i;
++		for (i = ARRAY_SIZE(mfinfo) - 1; i >= 0; i--) {
++			if (pc >= (unsigned long) mfinfo[i].func)
++				break;
++		}
++		if (i < 0)
++			break;
+ 
+-	/*
+-	 * frame now points to sleep_on_timeout's frame
+-	 */
+-	pc    = ((unsigned long *)frame)[schedule_timeout_frame.pc_offset];
+-
+-	if (in_sched_functions(pc)) {
+-		/* schedule_timeout called by [interruptible_]sleep_on_timeout */
+-		frame = ((unsigned long *)frame)[schedule_timeout_frame.frame_offset];
+-		pc    = ((unsigned long *)frame)[sleep_on_timeout_frame.pc_offset];
+-	}
++		if (mfinfo[i].omit_fp)
++			break;
++		pc = ((unsigned long *)frame)[mfinfo[i].pc_offset];
++		frame = ((unsigned long *)frame)[mfinfo[i].frame_offset];
++	} while (in_sched_functions(pc));
+ 
+ out:
+-
+-#ifdef CONFIG_MIPS64
+-	if (current->thread.mflags & MF_32BIT_REGS) /* Kludge for 32-bit ps  */
+-		pc &= 0xffffffffUL;
+-#endif
+-
+ 	return pc;
+ }
+ 


Property changes on: trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/23_wchan.dpatch
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/35_ip32-memsizeprint.dpatch
===================================================================
--- trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/35_ip32-memsizeprint.dpatch	2005-02-17 19:43:43 UTC (rev 2509)
+++ trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/35_ip32-memsizeprint.dpatch	2005-02-17 20:22:38 UTC (rev 2510)
@@ -0,0 +1,42 @@
+#! /bin/sh -e
+## 35_ip32-memsizeprint.dpatch
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fix RAM size output on ip32.
+
+if [ $# -lt 1 ]; then
+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+    -patch) patch -p0 ${patch_opts} < $0;;
+    -unpatch) patch -R -p0 ${patch_opts} < $0;;
+    *)
+        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+        exit 1;;
+esac
+
+exit 0
+
+Index: arch/mips/sgi-ip32/ip32-memory.c
+===================================================================
+RCS file: /home/cvs/linux/arch/mips/sgi-ip32/ip32-memory.c,v
+retrieving revision 1.1
+diff -u -p -r1.1 ip32-memory.c
+--- arch/mips/sgi-ip32/ip32-memory.c	12 Jan 2005 00:10:42 -0000	1.1
++++ arch/mips/sgi-ip32/ip32-memory.c	1 Feb 2005 00:32:14 -0000
+@@ -36,8 +36,8 @@ void __init prom_meminit (void)
+ 		if (base + size > (256 << 20))
+ 			base += CRIME_HI_MEM_BASE;
+ 
+-		printk("CRIME MC: bank %u base 0x%016lx size %luMB\n",
+-			bank, base, size);
++		printk("CRIME MC: bank %u base 0x%016lx size %luMiB\n",
++			bank, base, size >> 20);
+ 		add_memory_region (base, size, BOOT_MEM_RAM);
+ 	}
+ }


Property changes on: trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/35_ip32-memsizeprint.dpatch
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/50_compat32-syscalls.dpatch
===================================================================
--- trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/50_compat32-syscalls.dpatch	2005-02-17 19:43:43 UTC (rev 2509)
+++ trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/50_compat32-syscalls.dpatch	2005-02-17 20:22:38 UTC (rev 2510)
@@ -0,0 +1,391 @@
+#! /bin/sh -e
+## 50_compat32-syscalls.dpatch by Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Originally from Daniel Jacobowitz for 2.6.11-rc3 CVS HEAD
+## DP: 
+## DP: 
+## DP: A grab bag of fixes from testing glibc, o32 only, under both 32-bit and
+## DP: 64-bit kernels.  Changes are:
+## DP: 
+## DP:   - There is a generic compat_sys_wait4; use it.
+## DP:   - waitid needs compat routines for o32 (siginfo and rusage) and n32
+## DP:     (just rusage).
+## DP:   - timer_create needs a compat routine for both o32 and n32 (struct
+## DP:     sigevent).
+## DP:   - rt_sigtimedwait can use the generic compat routine for o32, but not
+## DP:     for n32, because n32 uses a 64-bit struct siginfo.  I didn't
+## DP:     actually test this one yet - I'll be doing n32 testing in a couple
+## DP:     of weeks...
+## DP:   - For the same reason n32 should not use sys32_rt_sigqueueinfo.
+## DP:   - n32 does need compat versions of the other timer_* and clock_*
+## DP:     functions however.
+## DP:   - o32 signal delivery was not handling SI_TIMER.
+## DP:   - waitid takes five arguments now, not four.
+## DP:   - PTRACE_GETEVENTMSG needs a compat wrapper since it writes a long to
+## DP:     userspace.
+## DP: 
+## DP: Signed-off-by: Daniel Jacobowitz <dan@codesourcery.com>
+
+if [ $# -lt 1 ]; then
+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+    -patch) patch -p1 ${patch_opts} < $0;;
+    -unpatch) patch -R -p1 ${patch_opts} < $0;;
+    *)
+        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+        exit 1;;
+esac
+
+exit 0
+
+Index: linux/arch/mips/kernel/linux32.c
+===================================================================
+--- linux.orig/arch/mips/kernel/linux32.c	2005-02-13 20:55:57.729574958 -0500
++++ linux/arch/mips/kernel/linux32.c	2005-02-13 21:28:08.198089040 -0500
+@@ -215,81 +215,36 @@ sys32_readdir(unsigned int fd, void * di
+ 	return(n);
+ }
+ 
+-struct rusage32 {
+-        struct compat_timeval ru_utime;
+-        struct compat_timeval ru_stime;
+-        int    ru_maxrss;
+-        int    ru_ixrss;
+-        int    ru_idrss;
+-        int    ru_isrss;
+-        int    ru_minflt;
+-        int    ru_majflt;
+-        int    ru_nswap;
+-        int    ru_inblock;
+-        int    ru_oublock;
+-        int    ru_msgsnd;
+-        int    ru_msgrcv;
+-        int    ru_nsignals;
+-        int    ru_nvcsw;
+-        int    ru_nivcsw;
+-};
+ 
+-static int
+-put_rusage (struct rusage32 *ru, struct rusage *r)
+-{
+-	int err;
++asmlinkage int compat_sys_wait4(compat_pid_t pid, unsigned int * stat_addr,
++				int options, struct compat_rusage * ru);
+ 
+-	if (verify_area(VERIFY_WRITE, ru, sizeof *ru))
+-		return -EFAULT;
+-
+-	err = __put_user (r->ru_utime.tv_sec, &ru->ru_utime.tv_sec);
+-	err |= __put_user (r->ru_utime.tv_usec, &ru->ru_utime.tv_usec);
+-	err |= __put_user (r->ru_stime.tv_sec, &ru->ru_stime.tv_sec);
+-	err |= __put_user (r->ru_stime.tv_usec, &ru->ru_stime.tv_usec);
+-	err |= __put_user (r->ru_maxrss, &ru->ru_maxrss);
+-	err |= __put_user (r->ru_ixrss, &ru->ru_ixrss);
+-	err |= __put_user (r->ru_idrss, &ru->ru_idrss);
+-	err |= __put_user (r->ru_isrss, &ru->ru_isrss);
+-	err |= __put_user (r->ru_minflt, &ru->ru_minflt);
+-	err |= __put_user (r->ru_majflt, &ru->ru_majflt);
+-	err |= __put_user (r->ru_nswap, &ru->ru_nswap);
+-	err |= __put_user (r->ru_inblock, &ru->ru_inblock);
+-	err |= __put_user (r->ru_oublock, &ru->ru_oublock);
+-	err |= __put_user (r->ru_msgsnd, &ru->ru_msgsnd);
+-	err |= __put_user (r->ru_msgrcv, &ru->ru_msgrcv);
+-	err |= __put_user (r->ru_nsignals, &ru->ru_nsignals);
+-	err |= __put_user (r->ru_nvcsw, &ru->ru_nvcsw);
+-	err |= __put_user (r->ru_nivcsw, &ru->ru_nivcsw);
+-
+-	return err;
++asmlinkage int
++sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr, int options)
++{
++	return compat_sys_wait4(pid, stat_addr, options, NULL);
+ }
+ 
+-asmlinkage int
+-sys32_wait4(compat_pid_t pid, unsigned int * stat_addr, int options,
+-	    struct rusage32 * ru)
++asmlinkage long
++sysn32_waitid(int which, compat_pid_t pid,
++	      siginfo_t __user *uinfo, int options,
++	      struct compat_rusage __user *uru)
+ {
+-	if (!ru)
+-		return sys_wait4(pid, stat_addr, options, NULL);
+-	else {
+-		struct rusage r;
+-		int ret;
+-		unsigned int status;
+-		mm_segment_t old_fs = get_fs();
++	struct rusage ru;
++	long ret;
++	mm_segment_t old_fs = get_fs();
+ 
+-		set_fs(KERNEL_DS);
+-		ret = sys_wait4(pid, stat_addr ? &status : NULL, options, &r);
+-		set_fs(old_fs);
+-		if (put_rusage (ru, &r)) return -EFAULT;
+-		if (stat_addr && put_user (status, stat_addr))
+-			return -EFAULT;
++	set_fs (KERNEL_DS);
++	ret = sys_waitid(which, pid, uinfo, options,
++			 uru ? (struct rusage __user *) &ru : NULL);
++	set_fs (old_fs);
++
++	if (ret < 0 || uinfo->si_signo == 0)
+ 		return ret;
+-	}
+-}
+ 
+-asmlinkage int
+-sys32_waitpid(compat_pid_t pid, unsigned int *stat_addr, int options)
+-{
+-	return sys32_wait4(pid, stat_addr, options, NULL);
++	if (uru)
++		ret = put_compat_rusage(&ru, uru);
++	return ret;
+ }
+ 
+ struct sysinfo32 {
+@@ -1496,3 +1451,53 @@ _sys32_clone(unsigned long __dummy0,
+ 	return do_fork(clone_flags, newsp, &regs, 0,
+ 	               parent_tidptr, child_tidptr);
+ }
++
++struct sigevent32 { 
++	u32 sigev_value;
++	u32 sigev_signo; 
++	u32 sigev_notify; 
++	u32 payload[(64 / 4) - 3]; 
++}; 
++
++extern asmlinkage long
++sys_timer_create(clockid_t which_clock,
++		 struct sigevent __user *timer_event_spec,
++		 timer_t __user * created_timer_id);
++
++long
++sys32_timer_create(u32 clock, struct sigevent32 __user *se32, timer_t __user *timer_id)
++{
++	struct sigevent __user *p = NULL;
++	if (se32) { 
++		struct sigevent se;
++		p = compat_alloc_user_space(sizeof(struct sigevent));
++		memset(&se, 0, sizeof(struct sigevent)); 
++		if (get_user(se.sigev_value.sival_int,  &se32->sigev_value) ||
++		    __get_user(se.sigev_signo, &se32->sigev_signo) ||
++		    __get_user(se.sigev_notify, &se32->sigev_notify) ||
++		    __copy_from_user(&se._sigev_un._pad, &se32->payload, 
++				     sizeof(se32->payload)) ||
++		    copy_to_user(p, &se, sizeof(se)))
++			return -EFAULT;
++	} 
++	return sys_timer_create(clock, p, timer_id);
++} 
++
++asmlinkage long
++sysn32_rt_sigtimedwait(const sigset_t __user *uthese,
++		       siginfo_t __user *uinfo,
++		       const struct compat_timespec __user *uts32,
++		       size_t sigsetsize)
++{
++	struct timespec __user *uts = NULL;
++
++	if (uts32) {
++		struct timespec ts;
++		uts = compat_alloc_user_space(sizeof(struct timespec));
++		if (get_user(ts.tv_sec, &uts32->tv_sec) ||
++		    get_user(ts.tv_nsec, &uts32->tv_nsec) ||
++		    copy_to_user (uts, &ts, sizeof (ts)))
++			return -EFAULT;
++	}
++	return sys_rt_sigtimedwait(uthese, uinfo, uts, sigsetsize);
++}
+Index: linux/arch/mips/kernel/scall64-o32.S
+===================================================================
+--- linux.orig/arch/mips/kernel/scall64-o32.S	2005-02-13 20:55:57.729574958 -0500
++++ linux/arch/mips/kernel/scall64-o32.S	2005-02-13 21:28:08.199088801 -0500
+@@ -316,7 +316,7 @@ sys_call_table:
+ 	PTR	sys_vhangup
+ 	PTR	sys_ni_syscall			/* was sys_idle	 */
+ 	PTR	sys_ni_syscall			/* sys_vm86 */
+-	PTR	sys32_wait4
++	PTR	compat_sys_wait4
+ 	PTR	sys_swapoff			/* 4115 */
+ 	PTR	sys32_sysinfo
+ 	PTR	sys32_ipc
+@@ -459,7 +459,7 @@ sys_call_table:
+ 	PTR	sys_fadvise64_64
+ 	PTR	compat_sys_statfs64		/* 4255 */
+ 	PTR	compat_sys_fstatfs64
+-	PTR	sys_timer_create
++	PTR	sys32_timer_create
+ 	PTR	compat_sys_timer_settime
+ 	PTR	compat_sys_timer_gettime
+ 	PTR	sys_timer_getoverrun		/* 4260 */
+@@ -480,7 +480,7 @@ sys_call_table:
+ 	PTR	compat_sys_mq_notify		/* 4275 */
+ 	PTR	compat_sys_mq_getsetattr
+ 	PTR	sys_ni_syscall			/* sys_vserver */
+-	PTR	sys_waitid
++	PTR	sys32_waitid
+ 	PTR	sys_ni_syscall			/* available, was setaltroot */
+ 	PTR	sys_add_key			/* 4280 */
+ 	PTR	sys_request_key
+Index: linux/arch/mips/kernel/scall64-n32.S
+===================================================================
+--- linux.orig/arch/mips/kernel/scall64-n32.S	2005-02-13 21:26:31.765170354 -0500
++++ linux/arch/mips/kernel/scall64-n32.S	2005-02-13 21:28:08.199088801 -0500
+@@ -176,7 +176,7 @@ EXPORT(sysn32_call_table)
+ 	PTR	sys_fork
+ 	PTR	sys32_execve
+ 	PTR	sys_exit
+-	PTR	sys32_wait4
++	PTR	compat_sys_wait4
+ 	PTR	sys_kill			/* 6060 */
+ 	PTR	sys32_newuname
+ 	PTR	sys_semget
+@@ -243,8 +243,8 @@ EXPORT(sysn32_call_table)
+ 	PTR	sys_capget
+ 	PTR	sys_capset
+ 	PTR	sys32_rt_sigpending		/* 6125 */
+-	PTR	sys32_rt_sigtimedwait
+-	PTR	sys32_rt_sigqueueinfo
++	PTR	sysn32_rt_sigtimedwait
++	PTR	sys_rt_sigqueueinfo
+ 	PTR	sys32_rt_sigsuspend
+ 	PTR	sys32_sigaltstack
+ 	PTR	compat_sys_utime		/* 6130 */
+@@ -337,15 +337,15 @@ EXPORT(sysn32_call_table)
+ 	PTR	compat_sys_statfs64
+ 	PTR	compat_sys_fstatfs64
+ 	PTR	sys_sendfile64
+-	PTR	sys_timer_create		/* 6220 */
+-	PTR	sys_timer_settime
+-	PTR	sys_timer_gettime
++	PTR	sys32_timer_create		/* 6220 */
++	PTR	compat_sys_timer_settime
++	PTR	compat_sys_timer_gettime
+ 	PTR	sys_timer_getoverrun
+ 	PTR	sys_timer_delete
+-	PTR	sys_clock_settime		/* 6225 */
+-	PTR	sys_clock_gettime
+-	PTR	sys_clock_getres
+-	PTR	sys_clock_nanosleep
++	PTR	compat_sys_clock_settime		/* 6225 */
++	PTR	compat_sys_clock_gettime
++	PTR	compat_sys_clock_getres
++	PTR	compat_sys_clock_nanosleep
+ 	PTR	sys_tgkill
+ 	PTR	compat_sys_utimes		/* 6230 */
+ 	PTR	sys_ni_syscall			/* sys_mbind */
+@@ -358,7 +358,7 @@ EXPORT(sysn32_call_table)
+ 	PTR	compat_sys_mq_notify
+ 	PTR	compat_sys_mq_getsetattr
+ 	PTR	sys_ni_syscall			/* 6240, sys_vserver */
+-	PTR	sys_waitid
++	PTR	sysn32_waitid
+ 	PTR	sys_ni_syscall			/* available, was setaltroot */
+ 	PTR	sys_add_key
+ 	PTR	sys_request_key
+Index: linux/arch/mips/kernel/signal32.c
+===================================================================
+--- linux.orig/arch/mips/kernel/signal32.c	2005-02-11 10:36:55.000000000 -0500
++++ linux/arch/mips/kernel/signal32.c	2005-02-13 21:28:08.199088801 -0500
+@@ -81,8 +81,10 @@ typedef struct compat_siginfo {
+ 
+ 		/* POSIX.1b timers */
+ 		struct {
+-			unsigned int _timer1;
+-			unsigned int _timer2;
++			timer_t _tid;		/* timer id */
++			int _overrun;		/* overrun count */
++			sigval_t32 _sigval;	/* same as below */
++			int _sys_private;       /* not to be passed to user */
+ 		} _timer;
+ 
+ 		/* POSIX.1b signals */
+@@ -416,6 +418,11 @@ int copy_siginfo_to_user32(compat_siginf
+ 		err |= __copy_to_user(&to->_sifields._pad, &from->_sifields._pad, SI_PAD_SIZE);
+ 	else {
+ 		switch (from->si_code >> 16) {
++		case __SI_TIMER >> 16:
++			err |= __put_user(from->si_tid, &to->si_tid);
++			err |= __put_user(from->si_overrun, &to->si_overrun);
++			err |= __put_user(from->si_int, &to->si_int);
++			break;
+ 		case __SI_CHLD >> 16:
+ 			err |= __put_user(from->si_utime, &to->si_utime);
+ 			err |= __put_user(from->si_stime, &to->si_stime);
+@@ -908,3 +915,30 @@ asmlinkage int sys32_rt_sigqueueinfo(int
+ 	set_fs (old_fs);
+ 	return ret;
+ }
++
++asmlinkage long
++sys32_waitid(int which, compat_pid_t pid,
++	     siginfo_t32 __user *uinfo, int options,
++	     struct compat_rusage __user *uru)
++{
++	siginfo_t info;
++	struct rusage ru;
++	long ret;
++	mm_segment_t old_fs = get_fs();
++
++	info.si_signo = 0;
++	set_fs (KERNEL_DS);
++	ret = sys_waitid(which, pid, (siginfo_t __user *) &info, options,
++			 uru ? (struct rusage __user *) &ru : NULL);
++	set_fs (old_fs);
++
++	if (ret < 0 || info.si_signo == 0)
++		return ret;
++
++	if (uru && (ret = put_compat_rusage(&ru, uru)))
++		return ret;
++
++	BUG_ON(info.si_code & __SI_MASK);
++	info.si_code |= __SI_CHLD;
++	return copy_siginfo_to_user32(uinfo, &info);
++}
+Index: linux/arch/mips/kernel/scall32-o32.S
+===================================================================
+--- linux.orig/arch/mips/kernel/scall32-o32.S	2005-02-13 20:55:57.739572561 -0500
++++ linux/arch/mips/kernel/scall32-o32.S	2005-02-13 21:28:08.200088562 -0500
+@@ -618,7 +618,7 @@ einval:	li	v0, -EINVAL
+ 	sys	sys_mq_notify		2	/* 4275 */
+ 	sys	sys_mq_getsetattr	3
+ 	sys	sys_ni_syscall		0	/* sys_vserver */
+-	sys	sys_waitid		4
++	sys	sys_waitid		5
+ 	sys	sys_ni_syscall		0	/* available, was setaltroot */
+ 	sys	sys_add_key		5
+ 	sys	sys_request_key		4
+Index: linux/arch/mips/kernel/ptrace32.c
+===================================================================
+--- linux.orig/arch/mips/kernel/ptrace32.c	2005-02-13 20:55:57.740572322 -0500
++++ linux/arch/mips/kernel/ptrace32.c	2005-02-13 21:28:04.328015337 -0500
+@@ -277,6 +277,11 @@ asmlinkage int sys32_ptrace(int request,
+ 		ret = ptrace_detach(child, data);
+ 		break;
+ 
++	case PTRACE_GETEVENTMSG:
++		ret = put_user(child->ptrace_message,
++			       (unsigned int __user *) (unsigned long) data);
++		break;
++
+ 	default:
+ 		ret = ptrace_request(child, request, addr, data);
+ 		break;
+
+-- 
+Daniel Jacobowitz
+CodeSourcery, LLC
+
+


Property changes on: trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/50_compat32-syscalls.dpatch
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/51_iomap.dpatch
===================================================================
--- trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/51_iomap.dpatch	2005-02-17 19:43:43 UTC (rev 2509)
+++ trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/51_iomap.dpatch	2005-02-17 20:22:38 UTC (rev 2510)
@@ -0,0 +1,162 @@
+#! /bin/sh -e
+## 51_iomap.dpatch by Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
+##
+## DP: iomap implementation for Linux/MIPS
+## DP: 
+## DP: Signed-off-by: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
+
+if [ $# -lt 1 ]; then
+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+    -patch) patch -p1 ${patch_opts} < $0;;
+    -unpatch) patch -R -p1 ${patch_opts} < $0;;
+    *)
+        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+        exit 1;;
+esac
+
+exit 0
+
+diff -urN -X dontdiff a-orig/arch/mips/lib/Makefile a/arch/mips/lib/Makefile
+--- a-orig/arch/mips/lib/Makefile	Mon Jan  5 17:27:29 2004
++++ a/arch/mips/lib/Makefile	Wed Jan 12 01:10:23 2005
+@@ -2,7 +2,7 @@
+ # Makefile for MIPS-specific library files..
+ #
+ 
+-lib-y	+= csum_partial_copy.o dec_and_lock.o memcpy.o promlib.o strlen_user.o \
+-	   strncpy_user.o strnlen_user.o
++lib-y	+= csum_partial_copy.o dec_and_lock.o iomap.o memcpy.o promlib.o \
++	   strlen_user.o strncpy_user.o strnlen_user.o
+ 
+ EXTRA_AFLAGS := $(CFLAGS)
+diff -urN -X dontdiff a-orig/arch/mips/lib/iomap.c a/arch/mips/lib/iomap.c
+--- a-orig/arch/mips/lib/iomap.c	Thu Jan  1 09:00:00 1970
++++ a/arch/mips/lib/iomap.c	Thu Jan 13 01:14:11 2005
+@@ -0,0 +1,78 @@
++/*
++ *  iomap.c, Memory Mapped I/O routines for MIPS architecture.
++ *
++ *  This code is based on lib/iomap.c, by Linus Torvalds.
++ *
++ *  Copyright (C) 2004-2005  Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
++ *
++ *  This program is free software; you can redistribute it and/or modify
++ *  it under the terms of the GNU General Public License as published by
++ *  the Free Software Foundation; either version 2 of the License, or
++ *  (at your option) any later version.
++ *
++ *  This program is distributed in the hope that it will be useful,
++ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ *  GNU General Public License for more details.
++ *
++ *  You should have received a copy of the GNU General Public License
++ *  along with this program; if not, write to the Free Software
++ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
++ */
++#include <linux/ioport.h>
++#include <linux/module.h>
++#include <linux/pci.h>
++
++#include <asm/io.h>
++
++void __iomem *ioport_map(unsigned long port, unsigned int nr)
++{
++	unsigned long end;
++
++	end = port + nr - 1UL;
++	if (ioport_resource.start > port ||
++	    ioport_resource.end < end || port > end)
++		return NULL;
++
++	return (void __iomem *)(mips_io_port_base + port);
++}
++
++void ioport_unmap(void __iomem *addr)
++{
++}
++EXPORT_SYMBOL(ioport_map);
++EXPORT_SYMBOL(ioport_unmap);
++
++void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long maxlen)
++{
++	unsigned long start, len, flags;
++
++	if (dev == NULL)
++		return NULL;
++
++	start = pci_resource_start(dev, bar);
++	len = pci_resource_len(dev, bar);
++	if (!start || !len)
++		return NULL;
++
++	if (maxlen != 0 && len > maxlen)
++		len = maxlen;
++
++	flags = pci_resource_flags(dev, bar);
++	if (flags & IORESOURCE_IO)
++		return ioport_map(start, len);
++	if (flags & IORESOURCE_MEM) {
++		if (flags & IORESOURCE_CACHEABLE)
++			return ioremap_cacheable_cow(start, len);
++		return ioremap_nocache(start, len);
++	}
++
++	return NULL;
++}
++
++void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
++{
++	iounmap(addr);
++}
++EXPORT_SYMBOL(pci_iomap);
++EXPORT_SYMBOL(pci_iounmap);
+diff -urN -X dontdiff a-orig/include/asm-mips/io.h a/include/asm-mips/io.h
+--- a-orig/include/asm-mips/io.h	Mon Dec 27 15:22:30 2004
++++ a/include/asm-mips/io.h	Thu Jan 13 01:35:51 2005
+@@ -478,6 +478,34 @@
+ #define memcpy_toio(a,b,c)	memcpy((void *)(a),(b),(c))
+ 
+ /*
++ * Memory Mapped I/O
++ */
++#define ioread8(addr)		readb(addr)
++#define ioread16(addr)		readw(addr)
++#define ioread32(addr)		readl(addr)
++
++#define iowrite8(b,addr)	writeb(b,addr)
++#define iowrite16(w,addr)	writew(w,addr)
++#define iowrite32(l,addr)	writel(l,addr)
++
++#define ioread8_rep(a,b,c)	readsb(a,b,c)
++#define ioread16_rep(a,b,c)	readsw(a,b,c)
++#define ioread32_rep(a,b,c)	readsl(a,b,c)
++
++#define iowrite8_rep(a,b,c)	writesb(a,b,c)
++#define iowrite16_rep(a,b,c)	writesw(a,b,c)
++#define iowrite32_rep(a,b,c)	writesl(a,b,c)
++
++/* Create a virtual mapping cookie for an IO port range */
++extern void __iomem *ioport_map(unsigned long port, unsigned int nr);
++extern void ioport_unmap(void __iomem *);
++
++/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
++struct pci_dev;
++extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
++extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
++
++/*
+  * ISA space is 'always mapped' on currently supported MIPS systems, no need
+  * to explicitly ioremap() it. The fact that the ISA IO space is mapped
+  * to PAGE_OFFSET is pure coincidence - it does not mean ISA values
+
+
+
+


Property changes on: trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/51_iomap.dpatch
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/52_ip22-sercon.dpatch
===================================================================
--- trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/52_ip22-sercon.dpatch	2005-02-17 19:43:43 UTC (rev 2509)
+++ trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/52_ip22-sercon.dpatch	2005-02-17 20:22:38 UTC (rev 2510)
@@ -0,0 +1,65 @@
+#! /bin/sh -e
+## 52_ip22-sercon.dpatch by Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+##
+## DP: Originally from Kaj-Michael Lang <milang@tal.org>
+## DP: 
+## DP: In ip22-setup.c the checks for serial/graphics console logic does
+## DP: not check if ARCS console=g but the machine is using serial console, as
+## DP: it does if no keyboard is attached.
+## DP: 
+## DP: This patch adds a check if ConsoleOut is serial. There might also be 
+## DP: support for other graphics than Newport soon...
+
+if [ $# -lt 1 ]; then
+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+    -patch) patch -p0 ${patch_opts} < $0;;
+    -unpatch) patch -R -p0 ${patch_opts} < $0;;
+    *)
+        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+        exit 1;;
+esac
+
+exit 0
+
+--- arch/mips/sgi-ip22/ip22-setup.c.orig	2005-02-17 01:53:53.000000000 +0100
++++ arch/mips/sgi-ip22/ip22-setup.c	2005-02-17 10:32:35.000000000 +0100
+@@ -56,6 +56,7 @@ extern void ip22_time_init(void) __init;
+ static int __init ip22_setup(void)
+ {
+ 	char *ctype;
++	char *cserial;
+ 
+ 	board_be_init = ip22_be_init;
+ 	ip22_time_init();
+@@ -81,9 +82,14 @@ static int __init ip22_setup(void)
+ 	/* ARCS console environment variable is set to "g?" for
+ 	 * graphics console, it is set to "d" for the first serial
+ 	 * line and "d2" for the second serial line.
++	 * 
++	 * Need to check if the case is 'g' but no keyboard:
++	 * (ConsoleIn/Out = serial)
+ 	 */
+ 	ctype = ArcGetEnvironmentVariable("console");
+-	if (ctype && *ctype == 'd') {
++	cserial = ArcGetEnvironmentVariable("ConsoleOut");
++
++	if ((ctype && *ctype == 'd') || (cserial && *cserial == 's')) {
+ 		static char options[8];
+ 		char *baud = ArcGetEnvironmentVariable("dbaud");
+ 		if (baud)
+@@ -91,7 +97,7 @@ static int __init ip22_setup(void)
+ 		add_preferred_console("ttyS", *(ctype + 1) == '2' ? 1 : 0,
+ 				      baud ? options : NULL);
+ 	} else if (!ctype || *ctype != 'g') {
+-		/* Use ARC if we don't want serial ('d') or Newport ('g'). */
++		/* Use ARC if we don't want serial ('d') or graphics ('g'). */
+ 		prom_flags |= PROM_FLAG_USE_AS_CONSOLE;
+ 		add_preferred_console("arc", 0, NULL);
+ 	}


Property changes on: trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/52_ip22-sercon.dpatch
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/53_ip22-zilogtimeout.dpatch
===================================================================
--- trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/53_ip22-zilogtimeout.dpatch	2005-02-17 19:43:43 UTC (rev 2509)
+++ trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/53_ip22-zilogtimeout.dpatch	2005-02-17 20:22:38 UTC (rev 2510)
@@ -0,0 +1,42 @@
+#! /bin/sh -e
+## 53_ip22-zilogtimeout.dpatch by Thiemo Seufer <seufer@csv.ica.uni-stuttgart.de>
+##
+## DP: Originally from Peter Fuerst
+
+if [ $# -lt 1 ]; then
+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+    -patch) patch -p0 ${patch_opts} < $0;;
+    -unpatch) patch -R -p0 ${patch_opts} < $0;;
+    *)
+        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+        exit 1;;
+esac
+
+exit 0
+
+--- drivers/serial/ip22zilog.c.orig	2005-02-17 01:53:55.000000000 +0100
++++ drivers/serial/ip22zilog.c	2005-02-17 10:38:56.000000000 +0100
+@@ -881,6 +881,7 @@ ip22zilog_set_termios(struct uart_port *
+ 	up->cflag = termios->c_cflag;
+ 
+ 	ip22zilog_maybe_update_regs(up, ZILOG_CHANNEL_FROM_PORT(port));
++	uart_update_timeout(port, termios->c_cflag, baud);
+ 
+ 	spin_unlock_irqrestore(&up->port.lock, flags);
+ }
+@@ -1047,6 +1048,8 @@ ip22serial_console_termios(struct consol
+ 	}
+ 
+ 	con->cflag = cflag | CS8;			/* 8N1 */
++
++	uart_update_timeout(&ip22zilog_port_table[con->index].port, cflag, baud);
+ }
+ 
+ static int __init ip22zilog_console_setup(struct console *con, char *options)


Property changes on: trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/53_ip22-zilogtimeout.dpatch
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/54_ip32-eth0.dpatch
===================================================================
--- trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/54_ip32-eth0.dpatch	2005-02-17 19:43:43 UTC (rev 2509)
+++ trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/54_ip32-eth0.dpatch	2005-02-17 20:22:38 UTC (rev 2510)
@@ -0,0 +1,48 @@
+#! /bin/sh -e
+## 54_ip32-eth0.dpatch by ilya@total-knowledge.com
+##
+## DP: meth is built-in ethernet card on O2, and it would make sense for it to be
+## DP: eth0, even if there is also another network card in PCI slot.
+
+if [ $# -lt 1 ]; then
+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+    -patch) patch -p0 ${patch_opts} < $0;;
+    -unpatch) patch -R -p0 ${patch_opts} < $0;;
+    *)
+        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+        exit 1;;
+esac
+
+exit 0
+
+Index: drivers/net/Makefile
+===================================================================
+RCS file: /home/cvs/linux/drivers/net/Makefile,v
+retrieving revision 1.107
+diff -u -r1.107 Makefile
+--- drivers/net/Makefile        15 Nov 2004 11:49:28 -0000      1.107
++++ drivers/net/Makefile        12 Jan 2005 19:58:47 -0000
+@@ -28,6 +28,8 @@
+ obj-$(CONFIG_MYRI_SBUS) += myri_sbus.o
+ obj-$(CONFIG_SUNGEM) += sungem.o sungem_phy.o
+
++obj-$(CONFIG_SGI_O2MACE_ETH) += meth.o
++
+ obj-$(CONFIG_MACE) += mace.o
+ obj-$(CONFIG_BMAC) += bmac.o
+
+@@ -125,7 +127,6 @@
+ obj-$(CONFIG_SUN3LANCE) += sun3lance.o
+ obj-$(CONFIG_DEFXX) += defxx.o
+ obj-$(CONFIG_SGISEEQ) += sgiseeq.o
+-obj-$(CONFIG_SGI_O2MACE_ETH) += meth.o
+ obj-$(CONFIG_AT1700) += at1700.o
+ obj-$(CONFIG_FMV18X) += fmv18x.o
+ obj-$(CONFIG_EL1) += 3c501.o


Property changes on: trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/54_ip32-eth0.dpatch
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/55_o32-kcore.dpatch
===================================================================
--- trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/55_o32-kcore.dpatch	2005-02-17 19:43:43 UTC (rev 2509)
+++ trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/55_o32-kcore.dpatch	2005-02-17 20:22:38 UTC (rev 2510)
@@ -0,0 +1,71 @@
+#! /bin/sh -e
+## 55_o32-kcore.dpatch by Daniel Jacobowitz <dan@codesourcery.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: I wanted to do live debugging on an ornery task_struct this morning, so I
+## DP: hooked up /proc/kcore for MIPS.  I'm pretty sure that the CKSEG0 bits are
+## DP: wrong, but I did need to cover that region - because the SB-1 kernel links
+## DP: at 0xffffffff80100000 or so, disassembly and printing static variables don't
+## DP: work unless the debugger can read that region.
+## DP: 
+## DP: Signed-off-by: Daniel Jacobowitz <dan@codesourcery.com>
+
+if [ $# -lt 1 ]; then
+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+    -patch) patch -p1 ${patch_opts} < $0;;
+    -unpatch) patch -R -p1 ${patch_opts} < $0;;
+    *)
+        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+        exit 1;;
+esac
+
+exit 0
+
+Index: linux/arch/mips/mm/init.c
+===================================================================
+--- linux.orig/arch/mips/mm/init.c	2005-01-20 16:26:58.791321462 -0500
++++ linux/arch/mips/mm/init.c	2005-01-20 16:34:27.231213174 -0500
+@@ -24,6 +24,7 @@
+ #include <linux/bootmem.h>
+ #include <linux/highmem.h>
+ #include <linux/swap.h>
++#include <linux/proc_fs.h>
+ 
+ #include <asm/bootinfo.h>
+ #include <asm/cachectl.h>
+@@ -197,6 +198,11 @@
+ 	return 0;
+ }
+ 
++static struct kcore_list kcore_mem, kcore_vmalloc;
++#ifdef CONFIG_MIPS64
++static struct kcore_list kcore_kseg0;
++#endif
++
+ void __init mem_init(void)
+ {
+ 	unsigned long codesize, reservedpages, datasize, initsize;
+@@ -247,6 +253,16 @@
+ 	datasize =  (unsigned long) &_edata - (unsigned long) &_etext;
+ 	initsize =  (unsigned long) &__init_end - (unsigned long) &__init_begin;
+ 
++#ifdef CONFIG_MIPS64
++	if ((unsigned long) &_text > (unsigned long) CKSEG0)
++		/* The -4 is a hack so that user tools don't have to handle
++		   the overflow.  */
++		kclist_add(&kcore_kseg0, (void *) CKSEG0, 0x80000000 - 4);
++#endif
++	kclist_add(&kcore_mem, __va(0), max_low_pfn << PAGE_SHIFT);
++	kclist_add(&kcore_vmalloc, (void *)VMALLOC_START,
++		   VMALLOC_END-VMALLOC_START);
++
+ 	printk(KERN_INFO "Memory: %luk/%luk available (%ldk kernel code, "
+ 	       "%ldk reserved, %ldk data, %ldk init, %ldk highmem)\n",
+ 	       (unsigned long) nr_free_pages() << (PAGE_SHIFT-10),


Property changes on: trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/55_o32-kcore.dpatch
___________________________________________________________________
Name: svn:executable
   + *

Added: trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/56_systimedwait.dpatch
===================================================================
--- trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/56_systimedwait.dpatch	2005-02-17 19:43:43 UTC (rev 2509)
+++ trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/56_systimedwait.dpatch	2005-02-17 20:22:38 UTC (rev 2510)
@@ -0,0 +1,76 @@
+#! /bin/sh -e
+## 56_systimedwait.dpatch by Daniel Jacobowitz <dan@codesourcery.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: The copy of this logic in arch/mips/ has gotten out of sync with the copy in
+## DP: kernel/ - fatally so.  Because it doesn't set real_blocked, sigwaiting for a
+## DP: blocked but otherwise fatal signal may cause the thread group to exit.
+## DP: 
+## DP: Signed-off-by: Daniel Jacobowitz <dan@codesourcery.com>
+
+if [ $# -lt 1 ]; then
+    echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+    exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch} ${2:+-d $2}"
+
+case "$1" in
+    -patch) patch -p1 ${patch_opts} < $0;;
+    -unpatch) patch -R -p1 ${patch_opts} < $0;;
+    *)
+        echo "`basename $0`: script expects -patch|-unpatch as argument" >&2
+        exit 1;;
+esac
+
+exit 0
+
+Index: linux/arch/mips/kernel/signal32.c
+===================================================================
+--- linux.orig/arch/mips/kernel/signal32.c	2005-01-20 18:43:07.056683648 -0500
++++ linux/arch/mips/kernel/signal32.c	2005-01-21 00:34:37.213772391 -0500
+@@ -948,25 +948,29 @@
+ 	spin_lock_irq(&current->sighand->siglock);
+ 	sig = dequeue_signal(current, &these, &info);
+ 	if (!sig) {
+-		/* None ready -- temporarily unblock those we're interested
+-		   in so that we'll be awakened when they arrive.  */
+-		sigset_t oldblocked = current->blocked;
+-		sigandsets(&current->blocked, &current->blocked, &these);
+-		recalc_sigpending();
+-		spin_unlock_irq(&current->sighand->siglock);
+-
+ 		timeout = MAX_SCHEDULE_TIMEOUT;
+ 		if (uts)
+ 			timeout = (timespec_to_jiffies(&ts)
+ 				   + (ts.tv_sec || ts.tv_nsec));
+ 
+-		current->state = TASK_INTERRUPTIBLE;
+-		timeout = schedule_timeout(timeout);
+-
+-		spin_lock_irq(&current->sighand->siglock);
+-		sig = dequeue_signal(current, &these, &info);
+-		current->blocked = oldblocked;
+-		recalc_sigpending();
++		if (timeout) {
++			/* None ready -- temporarily unblock those we're
++			 * interested while we are sleeping in so that we'll
++			 * be awakened when they arrive.  */
++			current->real_blocked = current->blocked;
++			sigandsets(&current->blocked, &current->blocked, &these);
++			recalc_sigpending();
++			spin_unlock_irq(&current->sighand->siglock);
++
++			current->state = TASK_INTERRUPTIBLE;
++			timeout = schedule_timeout(timeout);
++
++			spin_lock_irq(&current->sighand->siglock);
++			sig = dequeue_signal(current, &these, &info);
++			current->blocked = current->real_blocked;
++			siginitset(&current->real_blocked, 0);
++			recalc_sigpending();
++		}
+ 	}
+ 	spin_unlock_irq(&current->sighand->siglock);
+ 


Property changes on: trunk/kernel/mips/kernel-patch-2.6.10-mips-2.6.10/debian/patches/56_systimedwait.dpatch
___________________________________________________________________
Name: svn:executable
   + *