From 142e3cb0f334bb9cfd7c71d0ff95e279fc02f19c Mon Sep 17 00:00:00 2001 From: Jean-Paul Etienne Date: Wed, 11 Jan 2017 00:24:31 +0100 Subject: [PATCH] tests: legacy: 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: I2faa823226cd76d129d2bc3db961c9b862aaf784 Signed-off-by: Jean-Paul Etienne --- tests/legacy/kernel/test_context/src/context.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/legacy/kernel/test_context/src/context.c b/tests/legacy/kernel/test_context/src/context.c index 57327548db3..47305d5bca2 100644 --- a/tests/legacy/kernel/test_context/src/context.c +++ b/tests/legacy/kernel/test_context/src/context.c @@ -66,6 +66,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 @@ -76,10 +80,12 @@ #error Timer type is not defined for this platform #endif -/* Nios II doesn't have a power saving instruction, so nano_cpu_idle() +/* Nios II and RISCV32 without CONFIG_RISCV_HAS_CPU_IDLE + * do not have a power saving instruction, so nano_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