diff options
author | Paul Mundt <lethal@linux-sh.org> | 2008-09-21 03:43:45 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2008-09-21 03:43:45 -0400 |
commit | 9d2b1f81dd93b198e12bca8120afec4a7b609b06 (patch) | |
tree | 8091aa3e15c8d1d15f8109be7222b4b68b6a7f73 /arch/sh/kernel/entry-common.S | |
parent | 3d58695edbfac785161bf282dc11fd42a483d6c9 (diff) |
sh: ftrace support.
This adds support for ftrace to SH. This only includes CONFIG_FTRACE,
and does not handle dynamic ftrace presently.
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/entry-common.S')
-rw-r--r-- | arch/sh/kernel/entry-common.S | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S index efbb4268875e..1a5cf9dd82de 100644 --- a/arch/sh/kernel/entry-common.S +++ b/arch/sh/kernel/entry-common.S | |||
@@ -371,3 +371,47 @@ syscall_exit: | |||
371 | #endif | 371 | #endif |
372 | 7: .long do_syscall_trace_enter | 372 | 7: .long do_syscall_trace_enter |
373 | 8: .long do_syscall_trace_leave | 373 | 8: .long do_syscall_trace_leave |
374 | |||
375 | #ifdef CONFIG_FTRACE | ||
376 | .align 2 | ||
377 | .globl _mcount | ||
378 | .type _mcount,@function | ||
379 | .globl mcount | ||
380 | .type mcount,@function | ||
381 | _mcount: | ||
382 | mcount: | ||
383 | mov.l r4, @-r15 | ||
384 | mov.l r5, @-r15 | ||
385 | mov.l r6, @-r15 | ||
386 | mov.l r7, @-r15 | ||
387 | sts.l pr, @-r15 | ||
388 | |||
389 | mov.l @(20,r15),r4 | ||
390 | sts pr, r5 | ||
391 | |||
392 | mov.l 1f, r6 | ||
393 | mov.l ftrace_stub, r7 | ||
394 | cmp/eq r6, r7 | ||
395 | bt skip_trace | ||
396 | |||
397 | mov.l @r6, r6 | ||
398 | jsr @r6 | ||
399 | nop | ||
400 | |||
401 | skip_trace: | ||
402 | |||
403 | lds.l @r15+, pr | ||
404 | mov.l @r15+, r7 | ||
405 | mov.l @r15+, r6 | ||
406 | mov.l @r15+, r5 | ||
407 | rts | ||
408 | mov.l @r15+, r4 | ||
409 | |||
410 | .align 2 | ||
411 | 1: .long ftrace_trace_function | ||
412 | |||
413 | .globl ftrace_stub | ||
414 | ftrace_stub: | ||
415 | rts | ||
416 | nop | ||
417 | #endif /* CONFIG_FTRACE */ | ||