From 8dc83c1d94d3507b2958ab2b43c01feb7ba76c00 Mon Sep 17 00:00:00 2001 From: Ioannis Glaropoulos Date: Sun, 28 Jul 2019 15:38:54 +0200 Subject: [PATCH] tests: several tweaks for passing tests on qemu This commit includes tweaks in several tests, so that the tests can be passing on ARM QEMU targets, mps2_an385 and mps2_an521 with Qemu 4.x release. Signed-off-by: Ioannis Glaropoulos --- .../cmsis_rtos_v2/timer_synchronization/prj.conf | 1 + tests/kernel/sched/schedule_api/prj_multiq.conf | 1 + tests/kernel/sched/schedule_api/src/main.c | 6 +++++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/samples/portability/cmsis_rtos_v2/timer_synchronization/prj.conf b/samples/portability/cmsis_rtos_v2/timer_synchronization/prj.conf index cd8feb23b3f..5f99624a3fc 100644 --- a/samples/portability/cmsis_rtos_v2/timer_synchronization/prj.conf +++ b/samples/portability/cmsis_rtos_v2/timer_synchronization/prj.conf @@ -10,6 +10,7 @@ CONFIG_INIT_STACKS=y CONFIG_POLL=y CONFIG_SCHED_SCALABLE=y CONFIG_SMP=n +CONFIG_QEMU_TICKLESS_WORKAROUND=y # The Zephyr CMSIS v2 emulation assumes that ticks are ms, currently CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000 diff --git a/tests/kernel/sched/schedule_api/prj_multiq.conf b/tests/kernel/sched/schedule_api/prj_multiq.conf index 42a4b14f7a8..a0bb000771e 100644 --- a/tests/kernel/sched/schedule_api/prj_multiq.conf +++ b/tests/kernel/sched/schedule_api/prj_multiq.conf @@ -2,5 +2,6 @@ CONFIG_ZTEST=y CONFIG_IRQ_OFFLOAD=y CONFIG_TEST_USERSPACE=y CONFIG_SCHED_MULTIQ=y +CONFIG_QEMU_TICKLESS_WORKAROUND=y CONFIG_MAX_THREAD_BYTES=4 CONFIG_SMP=n diff --git a/tests/kernel/sched/schedule_api/src/main.c b/tests/kernel/sched/schedule_api/src/main.c index 75eab936d26..6e8671a9de3 100644 --- a/tests/kernel/sched/schedule_api/src/main.c +++ b/tests/kernel/sched/schedule_api/src/main.c @@ -15,10 +15,14 @@ K_THREAD_STACK_EXTERN(ustack); void spin_for_ms(int ms) { -#if defined(CONFIG_X86_64) && defined(CONFIG_QEMU_TARGET) +#if (defined(CONFIG_SOC_SERIES_MPS2) || defined(CONFIG_X86_64)) \ + && defined(CONFIG_QEMU_TARGET) /* qemu-system-x86_64 has a known bug with the hpet device * where it will drop interrupts if you try to spin on the * counter. + * + * qemu-system-arm has a similar issue of dropping interrupts + * on MPS2+ targets. */ k_busy_wait(ms * 1000); #else