Folks,

the patch (interdiff) inlined fixes compilation breakage powerpc-lite.patch's 
compilation breakage on ppc32. Thanks to Sergey Shtylyov, 8250 UART support was 
added to powerpc as well. So, kgdb even (partially) works with this patch 
applied on my Sandpoint w/ 2.6.18-rc4 ;-)

 arch/powerpc/kernel/kgdb.c              |   19 +++++++++++++++++--
 arch/powerpc/kernel/legacy_serial.c     |    6 ++++++
 arch/powerpc/platforms/powermac/setup.c |    2 --
 3 files changed, 23 insertions(+), 4 deletions(-)

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

diff -u linux-2.6.git/arch/powerpc/platforms/powermac/setup.c 
powerpc.git/arch/powerpc/platforms/powermac/setup.c
--- linux-2.6.git/arch/powerpc/platforms/powermac/setup.c       2006-08-10 
20:45:57.000000000 +0400
+++ powerpc.git/arch/powerpc/platforms/powermac/setup.c
@@ -98,8 +98,6 @@
 int sccdbg;
 #endif
 
-extern void zs_kgdb_hook(int tty_num);
-
 sys_ctrler_t sys_ctrler = SYS_CTRLER_UNKNOWN;
 EXPORT_SYMBOL(sys_ctrler);
 
diff -u linux-2.6.git/arch/powerpc/kernel/kgdb.c 
powerpc.git/arch/powerpc/kernel/kgdb.c
--- linux-2.6.git/arch/powerpc/kernel/kgdb.c    2006-08-10 20:45:57.000000000 
+0400
+++ powerpc.git/arch/powerpc/kernel/kgdb.c
@@ -1,7 +1,7 @@
 /*
- * arch/ppc64/kernel/kgdb.c
+ * arch/powerpc/kernel/kgdb.c
  *
- * PowerPC64 backend to the KGDB stub.
+ * PowerPC backend to the KGDB stub.
  *
  * Maintainer: Tom Rini <[EMAIL PROTECTED]>
  *
@@ -13,6 +13,7 @@
  * 2004 (c) MontaVista Software, Inc.
  * 2005 (c) MontaVista Software, Inc.
  * PPC64 Mods (C) 2005 Frank Rowand ([EMAIL PROTECTED])
+ * PPC32 restored by Vitaly Wool <[EMAIL PROTECTED]>
  *
  * 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 any
@@ -335,6 +336,12 @@
 
 int kgdb_fault_setjmp(unsigned long *curr_context)
 {
+#ifdef CONFIG_PPC32
+        __asm__ __volatile__("mflr 0; stw 0,0(%0);\n\
+                              stw 1,4(%0); stw 2,8(%0);\n\
+                              mfcr 0; stw 0,12(%0);\n\
+                              stmw 13,16(%0)\n" : : "r" (curr_context));
+#else
        __asm__ __volatile__("mflr 0; std 0,0(%0)\n\
                              std       1,8(%0)\n\
                              std       2,16(%0)\n\
@@ -358,11 +365,18 @@
                              std       29,160(%0)\n\
                              std       30,168(%0)\n\
                              std       31,176(%0)\n" : : "r" (curr_context));
+#endif
        return 0;
 }
 
 void kgdb_fault_longjmp(unsigned long *curr_context)
 {
+#ifdef CONFIG_PPC32
+       __asm__ __volatile__("lmw 13,16(%0);\n\
+                             lwz 0,12(%0); mtcrf 0x38,0;\n\
+                             lwz 0,0(%0); lwz 1,4(%0); lwz 2,8(%0);\n\
+                             mtlr 0; mr 3,1\n" : : "r" (curr_context));
+#else
        __asm__ __volatile__("ld        13,32(%0)\n\
                              ld        14,40(%0)\n\
                              ld        15,48(%0)\n\
@@ -389,6 +403,7 @@
                              ld        2,16(%0)\n\
                              mtlr      0\n\
                              mr        3,1\n" : : "r" (curr_context));
+#endif
 }
 
 /*
diff -u powerpc.git.orig/arch/powerpc/kernel/legacy_serial.c 
powerpc.git/arch/powerpc/kernel/legacy_serial.c
--- powerpc.git.orig/arch/powerpc/kernel/legacy_serial.c
+++ powerpc.git/arch/powerpc/kernel/legacy_serial.c
@@ -11,6 +11,9 @@
 #include <asm/udbg.h>
 #include <asm/pci-bridge.h>
 #include <asm/ppc-pci.h>
+#ifdef CONFIG_KGDB_8250
+#include <linux/kgdb.h>
+#endif
 
 #undef DEBUG
 
@@ -467,6 +470,9 @@ static int __init serial_dev_init(void)
                        fixup_port_pio(i, np, port);
                if (port->iotype == UPIO_MEM)
                        fixup_port_mmio(i, np, port);
+#ifdef CONFIG_KGDB_8250
+               kgdb8250_add_platform_port(i, port);
+#endif
        }
 
        DBG("Registering platform serial ports\n");

-------------------------------------------------------------------------
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