From fa12f101963ecf77d998d3e23563f549704cb993 Mon Sep 17 00:00:00 2001 From: Jean-Paul Etienne Date: Wed, 11 Jan 2017 00:24:31 +0100 Subject: [PATCH] tests: kernel: context: account for riscv32 architecture Added TICK_IRQ definition for CONFIG_PULPINO_TIMER and CONFIG_RISCV_QEMU_TIMER skip definition of HAS_POWERSAVE_INSTRUCTION for CONFIG_SOC_RISCV32_QEMU, since it does not provide power saving instruction. Otherwise, not passing sanitycheck. Change-Id: I43a5c5112d694efdc14c5a0bcb4cafdc196d2680 Signed-off-by: Jean-Paul Etienne --- tests/kernel/context/src/context.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/kernel/context/src/context.c b/tests/kernel/context/src/context.c index 7501b802cd6..cd66490a704 100644 --- a/tests/kernel/context/src/context.c +++ b/tests/kernel/context/src/context.c @@ -65,6 +65,10 @@ #define TICK_IRQ TIMER_0_IRQ #elif defined(CONFIG_ARCV2_TIMER) #define TICK_IRQ IRQ_TIMER0 +#elif defined(CONFIG_PULPINO_TIMER) +#define TICK_IRQ PULP_TIMER_A_CMP_IRQ +#elif defined(CONFIG_RISCV_QEMU_TIMER) +#define TICK_IRQ RISCV_QEMU_TIMER_IRQ #elif defined(CONFIG_CPU_CORTEX_M) /* * The Cortex-M use the SYSTICK exception for the system timer, which is @@ -75,13 +79,16 @@ #error Timer type is not defined for this platform #endif -/* Nios II doesn't have a power saving instruction, so k_cpu_idle() - * returns immediately +/* Nios II and RISCV32 without CONFIG_RISCV_HAS_CPU_IDLE + * do have a power saving instruction, so k_cpu_idle() returns immediately */ -#if !defined(CONFIG_NIOS2) +#if !defined(CONFIG_NIOS2) && \ + (!defined(CONFIG_RISCV32) || defined(CONFIG_RISCV_HAS_CPU_IDLE)) #define HAS_POWERSAVE_INSTRUCTION #endif + + extern uint32_t _tick_get_32(void); extern int64_t _tick_get(void);