Add changes from the Linux-2.6 tree.
[linux-2.6.git] / arch / cris / arch-v10 / kernel / kgdb.c
index 4e5d50d..07628a1 100644 (file)
 *! Jul 21 1999  Bjorn Wesen     eLinux port
 *!
 *! $Log: kgdb.c,v $
+*! Revision 1.6  2005/01/14 10:12:17  starvik
+*! KGDB on separate port.
+*! Console fixes from 2.4.
+*!
+*! Revision 1.5  2004/10/07 13:59:08  starvik
+*! Corrected call to set_int_vector
+*!
 *! Revision 1.4  2003/04/09 05:20:44  starvik
 *! Merge of Linux 2.5.67
 *!
@@ -26,7 +33,7 @@
 *!
 *! Revision 1.2  2002/11/19 14:35:24  starvik
 *! Changes from linux 2.4
-*! Changed struct initializer syntax to the currently prefered notation
+*! Changed struct initializer syntax to the currently preferred notation
 *!
 *! Revision 1.1  2001/12/17 13:59:27  bjornw
 *! Initial revision
@@ -68,7 +75,7 @@
 *!
 *!---------------------------------------------------------------------------
 *!
-*! $Id: kgdb.c,v 1.4 2003/04/09 05:20:44 starvik Exp $
+*! $Id: kgdb.c,v 1.6 2005/01/14 10:12:17 starvik Exp $
 *!
 *! (C) Copyright 1999, Axis Communications AB, LUND, SWEDEN
 *!
 #include <linux/kernel.h>
 #include <linux/delay.h>
 #include <linux/linkage.h>
+#include <linux/reboot.h>
 
 #include <asm/setup.h>
 #include <asm/ptrace.h>
@@ -561,12 +569,6 @@ gdb_cris_strtol (const char *s, char **endptr, int base)
        return x;
 }
 
-int
-double_this(int x)
-{
-        return 2 * x;
-}
-
 /********************************* Register image ****************************/
 /* Copy the content of a register image into another. The size n is
    the size of the register image. Due to struct assignment generation of
@@ -1341,12 +1343,11 @@ handle_exception (int sigval)
        }
 }
 
-/* The jump is to the address 0x00000002. Performs a complete re-start
-   from scratch. */
+/* Performs a complete re-start from scratch. */
 static void
 kill_restart ()
 {
-       __asm__ volatile ("jump 2");
+       machine_restart("");
 }
 
 /********************************** Breakpoint *******************************/
@@ -1503,6 +1504,11 @@ kgdb_handle_serial:
   bne goback
   nop
 
+  move.d  [reg+0x5E], $r10             ; Get DCCR
+  btstq           8, $r10                      ; Test the U-flag.
+  bmi     goback
+  nop
+
 ;;
 ;; Handle the communication
 ;;
@@ -1557,7 +1563,7 @@ kgdb_init(void)
        /* could initialize debug port as well but it's done in head.S already... */
 
         /* breakpoint handler is now set in irq.c */
-       set_int_vector(8, kgdb_handle_serial, 0);
+       set_int_vector(8, kgdb_handle_serial);
        
        enableDebugIRQ();
 }