patch-2.4.5 linux/arch/cris/kernel/traps.c

Next file: linux/arch/cris/lib/dram_init.S
Previous file: linux/arch/cris/kernel/sys_cris.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.4/linux/arch/cris/kernel/traps.c linux/arch/cris/kernel/traps.c
@@ -1,4 +1,4 @@
-/* $Id: traps.c,v 1.8 2001/02/23 13:45:20 bjornw Exp $
+/* $Id: traps.c,v 1.11 2001/04/04 09:43:31 orjanf Exp $
  *
  *  linux/arch/cris/traps.c
  *
@@ -9,11 +9,9 @@
  *  Copyright (C) 2000,2001 Axis Communications AB
  *
  *  Authors:   Bjorn Wesen
- *             Orjan Friberg
  *
  */
 
-#include <linux/config.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <linux/kernel.h>
@@ -45,8 +43,10 @@
         int i;
 	extern char _stext, _etext;
 
-        // debugging aid: "show_stack(NULL);" prints the
-        // back trace for this cpu.
+        /*
+         * debugging aid: "show_stack(NULL);" prints the
+         * back trace for this cpu.
+         */
 
         if(sp == NULL)
                 sp = (unsigned long*)rdsp();
@@ -107,8 +107,8 @@
 {
 	unsigned long usp = rdusp();
 
-	printk("IRP: %08lx SRP: %08lx CCR: %08lx USP: %08lx\n",
-	       regs->irp, regs->srp, regs->dccr, usp );
+	printk("IRP: %08lx SRP: %08lx CCR: %08lx USP: %08lx MOF: %08lx\n",
+	       regs->irp, regs->srp, regs->dccr, usp, regs->mof );
 	printk(" r0: %08lx  r1: %08lx  r2: %08lx  r3: %08lx\n",
 	       regs->r0, regs->r1, regs->r2, regs->r3);
 	printk(" r4: %08lx  r5: %08lx  r6: %08lx  r7: %08lx\n",
@@ -120,7 +120,7 @@
 	printk("Process %s (pid: %d, stackpage=%08lx)\n",
 	       current->comm, current->pid, (unsigned long)current);
 
-	// TODO, fix in_kernel detection
+	/* TODO, fix in_kernel detection */
 
 #if 0
 	/*
@@ -168,65 +168,5 @@
 void __init 
 trap_init(void)
 {
-
+  /* Nothing needs to be done */
 }
-
-/* Use static variables instead of the stack for temporary storage.  */
-static int saved_r0 = 0;
-static int saved_dccr = 0;
-
-asm ("
-  .global _gdb_handle_breakpoint
-  .global _do_sigtrap
-_gdb_handle_breakpoint:
-;;
-;; This handles a break instruction for entering a debug session.
-;;
-  move     dccr,[_saved_dccr]       ; Save dccr.
-  move.d   r0,[_saved_r0]           ; Save r0. "
-#ifdef CONFIG_KGDB
-" 
-  move     ccr,r0                   
-  btstq    8,r0                     ; Test the U-flag.
-  bmi      _ugdb_handle_breakpoint  ; Go to user mode debugging.
-  nop                               ; Delay slot.
-  move.d   [_saved_r0],r0           ; Restore r0.
-  move     [_saved_dccr],dccr       ; Restore dccr.
-  ba       _kgdb_handle_breakpoint  ; Go to kernel debugging.
-  nop                               ; Delay slot. "
-#endif
-" 
-_ugdb_handle_breakpoint:
-;;
-;; Yes, we could do a 'push brp' here and let gdb adjust the pc once it
-;; starts talking to the target again, but this way we avoid a 'P' packet.
-;;
-  move     brp,r0               ; Use r0 temporarily for calculation.
-  subq     2,r0                 ; Set to address of previous instruction.
-  move     r0,brp               ; Restore new brp.
-  move.d   [_saved_r0],r0       ; Restore r0.
-  move     [_saved_dccr],dccr   ; Restore dccr.
-
-_do_sigtrap:
-;; 
-;; SIGTRAP the process that executed the break instruction.
-;; Make a frame that Rexit in entry.S expects.
-;;
-  push     brp                  ; Push breakpoint return pointer.
-  push     srp                  ; Push subroutine return pointer.
-  push     dccr                 ; Push condition codes.
-  push     mof                  ; Push multiply overflow reg.
-  di                            ; Need to disable irq's at this point.
-  subq     14*4,sp              ; Make room for r0-r13.
-  movem    r13,[sp]             ; Push the r0-r13 registers.
-  push     r10                  ; Push orig_r10.
-  clear.d  [sp=sp-4]            ; Frametype - this is a normal stackframe.
-
-  movs.w   -8192,r9             ; THREAD_SIZE == 8192
-  and.d    sp,r9
-  move.d   [r9+LTASK_PID],r10   ; current->pid as arg1.
-  moveq    5,r11                ; SIGTRAP as arg2.
-  jsr      _sys_kill       
-
-  jump     _ret_from_intr       ; Use the return routine for interrupts.
-");

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)