diff --git a/tests/kernel/spinlock/prj.conf b/tests/kernel/spinlock/prj.conf index 26542e0a35c..9467c292689 100644 --- a/tests/kernel/spinlock/prj.conf +++ b/tests/kernel/spinlock/prj.conf @@ -1,2 +1 @@ CONFIG_ZTEST=y -CONFIG_SMP=y diff --git a/tests/kernel/spinlock/src/main.c b/tests/kernel/spinlock/src/main.c index f7f77bf615a..12a4d8ae454 100644 --- a/tests/kernel/spinlock/src/main.c +++ b/tests/kernel/spinlock/src/main.c @@ -9,9 +9,12 @@ #include #include +BUILD_ASSERT(CONFIG_MP_NUM_CPUS > 1); + #define CPU1_STACK_SIZE 1024 K_THREAD_STACK_DEFINE(cpu1_stack, CPU1_STACK_SIZE); +struct k_thread cpu1_thread; static struct k_spinlock bounce_lock; @@ -91,10 +94,11 @@ void bounce_once(int id) k_spin_unlock(&bounce_lock, key); } -void cpu1_fn(int key, void *arg) +void cpu1_fn(void *p1, void *p2, void *p3) { - ARG_UNUSED(key); - ARG_UNUSED(arg); + ARG_UNUSED(p1); + ARG_UNUSED(p2); + ARG_UNUSED(p3); while (1) { bounce_once(4321); @@ -112,7 +116,9 @@ void test_spinlock_bounce(void) { int i; - z_arch_start_cpu(1, cpu1_stack, CPU1_STACK_SIZE, cpu1_fn, 0); + k_thread_create(&cpu1_thread, cpu1_stack, CPU1_STACK_SIZE, + cpu1_fn, NULL, NULL, NULL, + 0, 0, 0); k_busy_wait(10); diff --git a/tests/kernel/spinlock/testcase.yaml b/tests/kernel/spinlock/testcase.yaml index 09c24b2220a..65b9ffbe10e 100644 --- a/tests/kernel/spinlock/testcase.yaml +++ b/tests/kernel/spinlock/testcase.yaml @@ -1,3 +1,3 @@ tests: kernel.multiprocessing: - platform_whitelist: esp32 + filter: CONFIG_SMP and CONFIG_MP_NUM_CPUS > 1