Skip to content

Commit 3740f60

Browse files
dcpleungnashif
authored andcommitted
tests: mem_protect: use MP_NUM_CPUS instead of SMP
The test_mem_domain_migration test creates a new thread with different priority based on whether SMP is enabled. This causes an issue where SMP=y and MP_NUM_CPUS=1 where the spin_entry() would spin forever (with k_busy_wait()) and not yielding since it has cooperative priority. Fix this by using MP_NUM_CPUS to figure out which priority to use, as it is valid configuration to have SMP=y and MP_NUM_CPUS=1. Signed-off-by: Daniel Leung <[email protected]>
1 parent 95712bd commit 3740f60

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/kernel/mem_protect/mem_protect/src/mem_domain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ static void spin_entry(void *p1, void *p2, void *p3)
298298
* @see k_mem_domain_add_thread()
299299
*/
300300

301-
#ifdef CONFIG_SMP
301+
#if CONFIG_MP_NUM_CPUS > 1
302302
#define PRIO K_PRIO_COOP(0)
303303
#else
304304
#define PRIO K_PRIO_PREEMPT(1)

0 commit comments

Comments
 (0)