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>
27 lines
377 B
C
27 lines
377 B
C
/*
|
|
* Copyright (c) 2019-2020 Cobham Gaisler AB
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#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");
|
|
}
|
|
|
|
void arch_cpu_idle(void)
|
|
{
|
|
leon_idle(0);
|
|
}
|
|
|
|
void arch_cpu_atomic_idle(unsigned int key)
|
|
{
|
|
leon_idle(key);
|
|
}
|