Skip to content

Commit 35264cc

Browse files
tbr-ttcarlescufi
authored andcommitted
SPARC: add support for the tracing subsystem
This commit implements the architecture specific parts for the Zephyr tracing subsystem on SPARC and LEON3. It does so by calling sys_trace_isr_enter(), sys_trace_isr_exit() and sys_trace_idle(). The logic for the ISR tracing is: 1. switch to interrupt stack 2. *call sys_trace_isr_enter()* if CONFIG_TRACING_ISR 3. call the interrupt handler 4. *call sys_trace_isr_exit()* if CONFIG_TRACING_ISR 5. switch back to thread stack Signed-off-by: Martin Åberg <[email protected]>
1 parent a5fd0d5 commit 35264cc

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

arch/sparc/core/interrupt_trap.S

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,20 @@ __sparc_trap_interrupt:
127127
nop
128128
nop
129129

130-
/* SPARC interrupt request level is the first agrument */
130+
#ifdef CONFIG_TRACING_ISR
131+
call sys_trace_isr_enter
132+
nop
133+
#endif
134+
135+
/* SPARC interrupt request level is the first argument */
131136
call z_sparc_enter_irq
132137
mov %l3, %o0
133138

139+
#ifdef CONFIG_TRACING_ISR
140+
call sys_trace_isr_exit
141+
nop
142+
#endif
143+
134144
/*
135145
* Switch back to interrupted task stack
136146
* %fp: %sp of interrupted task - ISF_SIZE.

soc/sparc/leon3/idle.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@
55
*/
66

77
#include <kernel.h>
8+
#include <tracing/tracing.h>
89

910
static void leon_idle(unsigned int key)
1011
{
12+
sys_trace_idle();
1113
irq_unlock(key);
1214

1315
__asm__ volatile ("wr %g0, %asr19");

0 commit comments

Comments
 (0)