Hi, 
inlined below is the patch against the kgdb git tree that fixes MIPS32 
compilation.

 Signed-off-by: Vitaly Wool <[EMAIL PROTECTED]>

 arch/mips/kernel/kgdb-jmp.c |   32 +++++++++++++-------------------
 arch/mips/kernel/kgdb.c     |    2 +-
 arch/mips/kernel/traps.c    |    4 ++--
 include/asm-mips/kdebug.h   |    5 ++---
 include/asm-mips/kgdb.h     |   16 +++++++++++++---
 5 files changed, 31 insertions(+), 28 deletions(-)

Index: linux-2.6-kgdb.stg/include/asm-mips/kgdb.h
===================================================================
--- linux-2.6-kgdb.stg.orig/include/asm-mips/kgdb.h
+++ linux-2.6-kgdb.stg/include/asm-mips/kgdb.h
@@ -3,17 +3,27 @@
 #define _ASM_KGDB_H_
 
 #ifndef __ASSEMBLY__
-#if (_MIPS_ISA == _MIPS_ISA_MIPS1) || (_MIPS_ISA == _MIPS_ISA_MIPS2)
+#if (_MIPS_ISA == _MIPS_ISA_MIPS1) || (_MIPS_ISA == _MIPS_ISA_MIPS2) || 
(_MIPS_ISA == _MIPS_ISA_MIPS32)
+
+typedef u32 gdb_reg_t;
+
+#elif (_MIPS_ISA == _MIPS_ISA_MIPS3) || (_MIPS_ISA == _MIPS_ISA_MIPS4) || 
(_MIPS_ISA == _MIPS_ISA_MIPS64)
+
+#ifdef CONFIG_32BIT
 typedef u32 gdb_reg_t;
-#elif (_MIPS_ISA == _MIPS_ISA_MIPS3) || (_MIPS_ISA == _MIPS_ISA_MIPS4)
+#else /* CONFIG_CPU_32BIT */
 typedef u64 gdb_reg_t;
+#endif
+
 #else
 #error need to do
 #endif /* _MIPS_ISA */
+#endif /* !__ASSEMBLY__ */
 
 #include <asm-generic/kgdb.h>
 
 #ifndef __ASSEMBLY__
+
 #define BUFMAX                 2048
 #define NUMREGBYTES            (90*sizeof(gdb_reg_t))
 #define NUMCRITREGBYTES                (12*sizeof(gdb_reg_t))
@@ -29,6 +39,6 @@ typedef u64 gdb_reg_t;
 
 extern int kgdb_early_setup;
 
-#endif                         /* !__ASSEMBLY__ */
+#endif                         /* __ASSEMBLY__ */
 #endif                         /* _ASM_KGDB_H_ */
 #endif                         /* __KERNEL__ */
Index: linux-2.6-kgdb.stg/arch/mips/kernel/kgdb-jmp.c
===================================================================
--- linux-2.6-kgdb.stg.orig/arch/mips/kernel/kgdb-jmp.c
+++ linux-2.6-kgdb.stg/arch/mips/kernel/kgdb-jmp.c
@@ -9,7 +9,7 @@
  *
  * Cribbed from glibc, which carries the following:
  * Copyright (C) 1996, 1997, 2000, 2002, 2003 Free Software Foundation, Inc.
- * Copyright (C) 2005 by MontaVista Software.
+ * Copyright (C) 2005-2006 by MontaVista Software.
  *
  * This file is licensed under the terms of the GNU General Public License
  * version 2. This program as licensed "as is" without any warranty of
@@ -17,14 +17,13 @@
  */
 
 #include <linux/kgdb.h>
-#include <asm/interrupt.h>
 
-#ifdef CONFIG_MIPS64
+#ifdef CONFIG_64BIT
 /*
  * MIPS 64-bit
  */
 
-int kgdb_fault_setjmp_aux(unsigned long *curr_context, int sp, int fp)
+int kgdb_fault_setjmp_aux(unsigned long *curr_context, unsigned long sp, 
unsigned long fp)
 {
        __asm__ __volatile__ ("sd $gp, %0" : : "m" (curr_context[0]));
        __asm__ __volatile__ ("sd $16, %0" : : "m" (curr_context[1]));
@@ -36,16 +35,14 @@ int kgdb_fault_setjmp_aux(unsigned long 
        __asm__ __volatile__ ("sd $22, %0" : : "m" (curr_context[7]));
        __asm__ __volatile__ ("sd $23, %0" : : "m" (curr_context[8]));
        __asm__ __volatile__ ("sd $31, %0" : : "m" (curr_context[9]));
-       curr_context[10] = (long *)sp;
-       curr_context[11] = (long *)fp;
+       curr_context[10] = sp;
+       curr_context[11] = fp;
 
        return 0;
 }
 
 void kgdb_fault_longjmp(unsigned long *curr_context)
 {
-       unsigned long sp_val, fp_val;
-
        __asm__ __volatile__ ("ld $gp, %0" : : "m" (curr_context[0]));
        __asm__ __volatile__ ("ld $16, %0" : : "m" (curr_context[1]));
        __asm__ __volatile__ ("ld $17, %0" : : "m" (curr_context[2]));
@@ -56,10 +53,9 @@ void kgdb_fault_longjmp(unsigned long *c
        __asm__ __volatile__ ("ld $22, %0" : : "m" (curr_context[7]));
        __asm__ __volatile__ ("ld $23, %0" : : "m" (curr_context[8]));
        __asm__ __volatile__ ("ld $25, %0" : : "m" (curr_context[9]));
-       sp_val = curr_context[10];
-       fp_val = curr_context[11];
        __asm__ __volatile__ ("ld $29, %0\n\t"
-                             "ld $30, %1\n\t" : : "m" (sp_val), "m" (fp_val));
+                             "ld $30, %1\n\t" : :
+                             "m" (curr_context[10]), "m" (curr_context[11]));
 
        __asm__ __volatile__ ("dli $2, 1");
        __asm__ __volatile__ ("j $25");
@@ -71,7 +67,7 @@ void kgdb_fault_longjmp(unsigned long *c
  * MIPS 32-bit
  */
 
-int kgdb_fault_setjmp_aux(unsigned long *curr_context, int sp, int fp)
+int kgdb_fault_setjmp_aux(unsigned long *curr_context, unsigned long sp, 
unsigned long fp)
 {
        __asm__ __volatile__("sw $gp, %0" : : "m" (curr_context[0]));
        __asm__ __volatile__("sw $16, %0" : : "m" (curr_context[1]));
@@ -83,16 +79,14 @@ int kgdb_fault_setjmp_aux(unsigned long 
        __asm__ __volatile__("sw $22, %0" : : "m" (curr_context[7]));
        __asm__ __volatile__("sw $23, %0" : : "m" (curr_context[8]));
        __asm__ __volatile__("sw $31, %0" : : "m" (curr_context[9]));
-       curr_context[10] = (long *)sp;
-       curr_context[11] = (long *)fp;
+       curr_context[10] = sp;
+       curr_context[11] = fp;
 
        return 0;
 }
 
 void kgdb_fault_longjmp(unsigned long *curr_context)
 {
-       unsigned long sp_val, fp_val;
-
        __asm__ __volatile__("lw $gp, %0" : : "m" (curr_context[0]));
        __asm__ __volatile__("lw $16, %0" : : "m" (curr_context[1]));
        __asm__ __volatile__("lw $17, %0" : : "m" (curr_context[2]));
@@ -103,10 +97,10 @@ void kgdb_fault_longjmp(unsigned long *c
        __asm__ __volatile__("lw $22, %0" : : "m" (curr_context[7]));
        __asm__ __volatile__("lw $23, %0" : : "m" (curr_context[8]));
        __asm__ __volatile__("lw $25, %0" : : "m" (curr_context[9]));
-       sp_val = curr_context[10];
-       fp_val = curr_context[11];
+
        __asm__ __volatile__("lw $29, %0\n\t"
-                             "lw $30, %1\n\t" : : "m" (sp_val), "m" (fp_val));
+                            "lw $30, %1\n\t" : :
+                            "m" (curr_context[10]), "m" (curr_context[11]));
 
        __asm__ __volatile__("li $2, 1");
        __asm__ __volatile__("jr $25");
Index: linux-2.6-kgdb.stg/arch/mips/kernel/kgdb.c
===================================================================
--- linux-2.6-kgdb.stg.orig/arch/mips/kernel/kgdb.c
+++ linux-2.6-kgdb.stg/arch/mips/kernel/kgdb.c
@@ -291,7 +291,7 @@ int kgdb_arch_init(void)
        /* This needs to be done more finely grained again, paired in
         * a before/after in kgdb_handle_exception(...) -- Tom */
        set_debug_traps();
-       notifier_chain_register(&mips_die_chain, &kgdb_notifier);
+       atomic_notifier_chain_register(&mips_die_head, &kgdb_notifier);
 
        return 0;
 }
Index: linux-2.6-kgdb.stg/include/asm-mips/kdebug.h
===================================================================
--- linux-2.6-kgdb.stg.orig/include/asm-mips/kdebug.h
+++ linux-2.6-kgdb.stg/include/asm-mips/kdebug.h
@@ -22,8 +22,7 @@ struct die_args {
        long err;
 };
 
-int register_die_notifier(struct notifier_block *nb);
-extern struct notifier_block *mips_die_chain;
+extern struct atomic_notifier_head mips_die_head;
 
 enum die_val {
        DIE_OOPS = 1,
@@ -41,7 +40,7 @@ enum die_val {
 static inline int notify_die(enum die_val val,char *str,struct pt_regs 
*regs,long err)
 {
        struct die_args args = { .regs=regs, .str=str, .err=err };
-       return notifier_call_chain(&mips_die_chain, val, &args);
+       return atomic_notifier_call_chain(&mips_die_head, val, &args);
 }
 
 #endif /* _MIPS_KDEBUG_H */
Index: linux-2.6-kgdb.stg/arch/mips/kernel/traps.c
===================================================================
--- linux-2.6-kgdb.stg.orig/arch/mips/kernel/traps.c
+++ linux-2.6-kgdb.stg/arch/mips/kernel/traps.c
@@ -82,7 +82,7 @@ void (*board_bind_eic_interrupt)(int irq
  */
 #define MODULE_RANGE (8*1024*1024)
 
-struct notifier_block *mips_die_chain;
+struct atomic_notifier_head mips_die_head;
 static spinlock_t die_notifier_lock = SPIN_LOCK_UNLOCKED;
 
 int register_die_notifier(struct notifier_block *nb)
@@ -91,7 +91,7 @@ int register_die_notifier(struct notifie
        unsigned long flags;
 
        spin_lock_irqsave(&die_notifier_lock, flags);
-       err = notifier_chain_register(&mips_die_chain, nb);
+       err = atomic_notifier_chain_register(&mips_die_head, nb);
        spin_unlock_irqrestore(&die_notifier_lock, flags);
 
        return err;

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Kgdb-bugreport mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to