OSDN Git Service

rx: add v2 exception handler
authorYoshinori Sato <ysato@users.sourceforge.jp>
Fri, 1 Jan 2016 11:43:28 +0000 (20:43 +0900)
committerYoshinori Sato <yo-satoh@sios.com>
Fri, 28 Jan 2022 13:11:57 +0000 (22:11 +0900)
Signed-off-by: Yoshinori Sato <ysato@users.sourceforge.jp>
arch/rx/kernel/rx_exception.S [new file with mode: 0644]
arch/rx/kernel/rxv2_exception.S [new file with mode: 0644]

diff --git a/arch/rx/kernel/rx_exception.S b/arch/rx/kernel/rx_exception.S
new file mode 100644 (file)
index 0000000..8e7201f
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * arch/rx/board/tkdn-rx62n/exception.S
+ *  Copyright (C) 2011 Yoshinori Sato
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+#include <asm/ptrace.h>
+       
+       .global install_exception_entry
+       .section        ".rx.exception","ax"
+       .rept   32
+1:     
+       bsr.a   2f
+       .endr
+2:     
+       sub     #4,r0
+       pushm   r1-r15
+       mov.l   r0,r13
+       add     #-(19*4),r13
+       mov.l   r13,[-r0]
+       mvfc    usp,r13
+       mov.l   r13,OFF_USP[r0]
+       mov.l   OFF_VEC[r0],r13
+       mov.l   #exception_top,r14
+       sub     [r14],r13
+       shlr    #2,r13
+       sub     #1,r13
+       /* r13 is exception no */
+       mov     #rx_exception_handler,r1
+       jmp     r1
+
+
+       .text
+install_exception_entry:
+       mov.l   #0xfffffff8,r1  /* NMI entry */
+       mov.l   [r1],r1
+       sub     #31*4,r1
+       mov.l   #exception_top,r2
+       mov.l   r1,[r2]
+       mov.l   #ram_exception_handler,r2
+       mov.l   #sizeof_ram_exception_handler,r3
+       smovf
+       rts
+
+       .bss
+exception_top:
+       .space  4
+
+       .end
diff --git a/arch/rx/kernel/rxv2_exception.S b/arch/rx/kernel/rxv2_exception.S
new file mode 100644 (file)
index 0000000..5eaa101
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * arch/rx/board/tkdn-rx62n/exception.S
+ *  Copyright (C) 2011 Yoshinori Sato
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ */
+
+#include <asm/ptrace.h>
+       
+       .global install_exception_entry
+       .section        ".rx.exception","ax"
+       .rept   32
+1:     
+       bsr.a   2f
+       .endr
+2:     
+       sub     #4,r0
+       pushm   r1-r15
+       mov.l   r0,r13
+       add     #-(19*4),r13
+       mov.l   r13,[-r0]
+       mvfc    usp,r13
+       mov.l   r13,OFF_USP[r0]
+       mov.l   OFF_VEC[r0],r13
+       mov.l   #1b,r14
+       sub     [r14],r13
+       shlr    #2,r13
+       sub     #1,r13
+       /* r13 is exception no */
+       mov     #rx_exception_handler,r1
+       jmp     r1
+
+
+       .text
+install_exception_entry:
+       mvtc    #ram_exception_handler,extb
+       rts
+
+       .end