aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mn10300/kernel/entry.S
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2011-03-18 12:54:30 -0400
committerDavid Howells <dhowells@redhat.com>2011-03-18 12:54:30 -0400
commit67ddb4052daac9d449caf2643ac365d42a04219a (patch)
tree7c610973a19b7e70b47294c540b182f203680fde /arch/mn10300/kernel/entry.S
parent7f386ac3272e057fbf51e5b5712fad1a80e77125 (diff)
MN10300: Create generic kernel debugger hooks
Create generic kernel debugger hooks in the MN10300 arch and make gdbstub use them. This is a preparation for KGDB support. Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'arch/mn10300/kernel/entry.S')
-rw-r--r--arch/mn10300/kernel/entry.S36
1 files changed, 24 insertions, 12 deletions
diff --git a/arch/mn10300/kernel/entry.S b/arch/mn10300/kernel/entry.S
index 8e79a04f1cb0..fb93ad720b82 100644
--- a/arch/mn10300/kernel/entry.S
+++ b/arch/mn10300/kernel/entry.S
@@ -266,7 +266,11 @@ ENTRY(raw_bus_error)
266 266
267############################################################################### 267###############################################################################
268# 268#
269# Miscellaneous exception entry points 269# NMI exception entry points
270#
271# This is used by ordinary interrupt channels that have the GxICR_NMI bit set
272# in addition to the main NMI and Watchdog channels. SMP NMI IPIs use this
273# facility.
270# 274#
271############################################################################### 275###############################################################################
272ENTRY(nmi_handler) 276ENTRY(nmi_handler)
@@ -281,7 +285,7 @@ ENTRY(nmi_handler)
281 and NMIAGR_GN,d0 285 and NMIAGR_GN,d0
282 lsr 0x2,d0 286 lsr 0x2,d0
283 cmp CALL_FUNCTION_NMI_IPI,d0 287 cmp CALL_FUNCTION_NMI_IPI,d0
284 bne 5f # if not call function, jump 288 bne nmi_not_smp_callfunc # if not call function, jump
285 289
286 # function call nmi ipi 290 # function call nmi ipi
287 add 4,sp # no need to store TBR 291 add 4,sp # no need to store TBR
@@ -295,30 +299,38 @@ ENTRY(nmi_handler)
295 call smp_nmi_call_function_interrupt[],0 299 call smp_nmi_call_function_interrupt[],0
296 RESTORE_ALL 300 RESTORE_ALL
297 301
2985: 302nmi_not_smp_callfunc:
299#ifdef CONFIG_GDBSTUB 303#ifdef CONFIG_KERNEL_DEBUGGER
300 cmp GDB_NMI_IPI,d0 304 cmp DEBUGGER_NMI_IPI,d0
301 bne 3f # if not gdb nmi ipi, jump 305 bne nmi_not_debugger # if not kernel debugger NMI IPI, jump
302 306
303 # gdb nmi ipi 307 # kernel debugger NMI IPI
304 add 4,sp # no need to store TBR 308 add 4,sp # no need to store TBR
305 mov GxICR_DETECT,d0 # clear NMI 309 mov GxICR_DETECT,d0 # clear NMI
306 movbu d0,(GxICR(GDB_NMI_IPI)) 310 movbu d0,(GxICR(DEBUGGER_NMI_IPI))
307 movhu (GxICR(GDB_NMI_IPI)),d0 311 movhu (GxICR(DEBUGGER_NMI_IPI)),d0
308 and ~EPSW_NMID,epsw # enable NMI 312 and ~EPSW_NMID,epsw # enable NMI
309 313
310 mov (sp),d0 314 mov (sp),d0
311 SAVE_ALL 315 SAVE_ALL
312 call gdbstub_nmi_wait[],0 316 mov fp,d0 # arg 0: stacked register file
317 mov a2,d1 # arg 1: exception number
318 call debugger_nmi_interrupt[],0
313 RESTORE_ALL 319 RESTORE_ALL
3143: 320
315#endif /* CONFIG_GDBSTUB */ 321nmi_not_debugger:
322#endif /* CONFIG_KERNEL_DEBUGGER */
316 mov (sp),d0 # restore TBR to d0 323 mov (sp),d0 # restore TBR to d0
317 add 4,sp 324 add 4,sp
318#endif /* CONFIG_SMP */ 325#endif /* CONFIG_SMP */
319 326
320 bra __common_exception_nonmi 327 bra __common_exception_nonmi
321 328
329###############################################################################
330#
331# General exception entry point
332#
333###############################################################################
322ENTRY(__common_exception) 334ENTRY(__common_exception)
323 add -4,sp 335 add -4,sp
324 mov d0,(sp) 336 mov d0,(sp)