sh: Share bug/debug traps across _32 and _64.
[safe/jmp/linux-2.6] / arch / sh / kernel / cpu / sh2 / entry.S
index d51fa5e..4ff2334 100644 (file)
@@ -165,6 +165,7 @@ ENTRY(exception_handler)
 
 interrupt_entry:
        mov     r9,r4
+       mov     r15,r5
        mov.l   6f,r9
        mov.l   7f,r8
        jmp     @r8
@@ -178,12 +179,10 @@ interrupt_entry:
 8:     .long   do_exception_error
        
 trap_entry:
-       /* verbose BUG trapa entry check */
-       mov     #0x3e,r8
-       cmp/ge  r8,r9
-       bf/s    1f
-        add    #-0x10,r9
-       add     #0x10,r9
+       mov     #0x30,r8
+       cmp/ge  r8,r9           ! vector 0x20-0x2f is systemcall
+       bt      1f
+       add     #-0x10,r9       ! convert SH2 to SH3/4 ABI
 1:     
        shll2   r9                      ! TRA
        mov     #OFF_TRA,r8
@@ -206,7 +205,7 @@ trap_entry:
 
 #if defined(CONFIG_SH_STANDARD_BIOS)
        /* Unwind the stack and jmp to the debug entry */
-debug_kernel_fw:
+ENTRY(sh_bios_handler)
        mov     r15,r0
        add     #(22-4)*4-4,r0
        ldc.l   @r0+,gbr
@@ -251,7 +250,7 @@ debug_kernel_fw:
 1:     .long   gdb_vbr_vector
 #endif /* CONFIG_SH_STANDARD_BIOS */
 
-ENTRY(address_error_handler)
+ENTRY(address_error_trap_handler)
        mov     r15,r4                          ! regs
        add     #4,r4
        mov     #OFF_PC,r0
@@ -312,6 +311,7 @@ restore_all:
        rte
         nop
 
+       .align 2
 #ifdef CONFIG_TRACE_IRQFLAGS
 1:     .long   trace_hardirqs_off
 #endif