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 <martin.aberg@gaisler.com>
This commit is contained in:
Martin Åberg 2020-11-16 12:24:58 +01:00 committed by Carles Cufí
commit 35264cc214
2 changed files with 13 additions and 1 deletions

View file

@ -127,10 +127,20 @@ __sparc_trap_interrupt:
nop
nop
/* SPARC interrupt request level is the first agrument */
#ifdef CONFIG_TRACING_ISR
call sys_trace_isr_enter
nop
#endif
/* SPARC interrupt request level is the first argument */
call z_sparc_enter_irq
mov %l3, %o0
#ifdef CONFIG_TRACING_ISR
call sys_trace_isr_exit
nop
#endif
/*
* Switch back to interrupted task stack
* %fp: %sp of interrupted task - ISF_SIZE.

View file

@ -5,9 +5,11 @@
*/
#include <kernel.h>
#include <tracing/tracing.h>
static void leon_idle(unsigned int key)
{
sys_trace_idle();
irq_unlock(key);
__asm__ volatile ("wr %g0, %asr19");