|
18 | 18 | * for the system's highest and the thread entry function does not let out the CPU control, run the specified |
19 | 19 | * number of times in thread 0 to create a high-priority not bound to the core of the thread, the thread will |
20 | 20 | * be preempted by the core 0 is running on the thread! |
| 21 | + * |
| 22 | + * Test Case Name: [smp_affinity_pri1] |
| 23 | + * |
| 24 | + * Test Objectives: |
| 25 | + * - Verify that threads with low-priority bound cores do not preempt high-priority threads. |
| 26 | + * |
| 27 | + * Test Scenarios: |
| 28 | + * - RT_CPUS_NR threads (T0~T(RT_CPUS_NR-1)) are created, with each thread bound to its respective core. Among them, the |
| 29 | + * - thread on core 0 has the lowest priority (LOW_PRIORITY), while the other threads have the highest priority (THREAD_PRIORITY). |
| 30 | + * - All threads share a common entry function "thread_entry". In thread_entry, only the threads running on non-core-0 cores |
| 31 | + * - execute an infinite loop (i.e., they do not release core ownership). After running for a certain period of time, the |
| 32 | + * - thread on core 0 executes list_thread() and creates a medium-priority (THIGH_PRIORITY) thread Tn, whose entry function |
| 33 | + * - is thread_temp_entry. Tn is automatically destroyed after executing list_thread(). |
| 34 | + * |
| 35 | + * Verification Metrics: |
| 36 | + * - Output message: [I/utest] [ PASSED ] [ result ] testcase (core.smp_affinity_pri1) |
| 37 | + * |
| 38 | + * Dependencies: |
| 39 | + * - Enable RT_USING_SMP, set RT_THREAD_PRIORITY_MAX = 256. |
| 40 | + * |
| 41 | + * Expected Results: |
| 42 | + * - You will see the information printed by list_thread() twice on the terminal. For the first time, you will see that T0 is |
| 43 | + * - running on core 0, and T1~T(RT_CPUS_NR-1) are running on their respective cores. For the second time, you will see that Tn |
| 44 | + * - is running on core 0, while T0 is in the ready state. Subsequently, the PASS message will be printed. |
21 | 45 | */ |
22 | 46 |
|
23 | 47 | /* Number of thread runs */ |
|
0 commit comments