From 5d4f8193aa2b6e05ec8e7a9d1a70205455c59157 Mon Sep 17 00:00:00 2001 From: Yaochenger <1516081466@qq.com> Date: Mon, 2 Sep 2024 11:24:27 +0800 Subject: [PATCH] =?UTF-8?q?[add]=20=E4=BF=AE=E6=94=B9=E7=BA=BF=E7=A8=8B?= =?UTF-8?q?=E6=A0=88=E5=A4=A7=E5=B0=8F=E4=B8=BAUTEST=5FTHR=5FSTACK=5FSIZE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/utest/testcases/kernel/smp/smp_affinity_pri1_tc.c | 2 +- examples/utest/testcases/kernel/smp/smp_affinity_pri2_tc.c | 2 +- .../utest/testcases/kernel/smp/smp_assigned_idle_cores_tc.c | 2 +- examples/utest/testcases/kernel/smp/smp_bind_affinity_tc.c | 2 +- examples/utest/testcases/kernel/smp/smp_spinlock_tc.c | 2 +- .../utest/testcases/kernel/smp/smp_thread_preemption_tc.c | 5 +++-- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/examples/utest/testcases/kernel/smp/smp_affinity_pri1_tc.c b/examples/utest/testcases/kernel/smp/smp_affinity_pri1_tc.c index 56a8355f93..e9df641779 100644 --- a/examples/utest/testcases/kernel/smp/smp_affinity_pri1_tc.c +++ b/examples/utest/testcases/kernel/smp/smp_affinity_pri1_tc.c @@ -22,7 +22,7 @@ /* Number of thread runs */ static int run_num = 10; -#define THREAD_STACK_SIZE 1024 +#define THREAD_STACK_SIZE UTEST_THR_STACK_SIZE #define THREAD_PRIORITY 2 #define LOW_PRIORITY 50 #define THIGH_PRIORITY 10 diff --git a/examples/utest/testcases/kernel/smp/smp_affinity_pri2_tc.c b/examples/utest/testcases/kernel/smp/smp_affinity_pri2_tc.c index 6036f341d6..ae2eeb689f 100644 --- a/examples/utest/testcases/kernel/smp/smp_affinity_pri2_tc.c +++ b/examples/utest/testcases/kernel/smp/smp_affinity_pri2_tc.c @@ -22,7 +22,7 @@ /* Number of thread runs */ static int run_num = 10; -#define THREAD_STACK_SIZE 1024 +#define THREAD_STACK_SIZE UTEST_THR_STACK_SIZE #define THREAD_PRIORITY 2 #define LOW_PRIORITY 50 #define THIGH_PRIORITY 10 diff --git a/examples/utest/testcases/kernel/smp/smp_assigned_idle_cores_tc.c b/examples/utest/testcases/kernel/smp/smp_assigned_idle_cores_tc.c index 7c138d5da8..d8b72a6ee1 100644 --- a/examples/utest/testcases/kernel/smp/smp_assigned_idle_cores_tc.c +++ b/examples/utest/testcases/kernel/smp/smp_assigned_idle_cores_tc.c @@ -19,7 +19,7 @@ * running on each core. */ -#define THREAD_STACK_SIZE 1024 +#define THREAD_STACK_SIZE UTEST_THR_STACK_SIZE #define THREAD_PRIORITY 20 static rt_thread_t threads[RT_CPUS_NR]; static int tick = 0, finsh_flag = 0; diff --git a/examples/utest/testcases/kernel/smp/smp_bind_affinity_tc.c b/examples/utest/testcases/kernel/smp/smp_bind_affinity_tc.c index e44ebeb2a6..ec10050cd8 100644 --- a/examples/utest/testcases/kernel/smp/smp_bind_affinity_tc.c +++ b/examples/utest/testcases/kernel/smp/smp_bind_affinity_tc.c @@ -21,7 +21,7 @@ /* Number of thread runs */ static int run_num = 100; -#define THREAD_STACK_SIZE 1024 +#define THREAD_STACK_SIZE UTEST_THR_STACK_SIZE #define THREAD_PRIORITY 20 static rt_thread_t threads[RT_CPUS_NR]; static struct rt_spinlock lock; diff --git a/examples/utest/testcases/kernel/smp/smp_spinlock_tc.c b/examples/utest/testcases/kernel/smp/smp_spinlock_tc.c index a6d58b605b..bf3d01b22a 100644 --- a/examples/utest/testcases/kernel/smp/smp_spinlock_tc.c +++ b/examples/utest/testcases/kernel/smp/smp_spinlock_tc.c @@ -20,7 +20,7 @@ #define THREAD_PRIORITY 20 #define THREAD_TIMESLICE 20 -#define THREAD_STACK_SIZE 1024 +#define THREAD_STACK_SIZE UTEST_THR_STACK_SIZE static rt_thread_t thread1; static rt_thread_t thread2; static rt_uint8_t finsh_flag = 0; diff --git a/examples/utest/testcases/kernel/smp/smp_thread_preemption_tc.c b/examples/utest/testcases/kernel/smp/smp_thread_preemption_tc.c index 7ffb673888..0390a21ac0 100644 --- a/examples/utest/testcases/kernel/smp/smp_thread_preemption_tc.c +++ b/examples/utest/testcases/kernel/smp/smp_thread_preemption_tc.c @@ -21,6 +21,7 @@ #define THREAD_PRIORITY_HIGH 21 #define THREAD_PRIORITY_LOW 30 +#define THREAD_STACK_SIZE UTEST_THR_STACK_SIZE static rt_thread_t threads[2]; static struct rt_spinlock lock; @@ -50,7 +51,7 @@ static void thread_low_entry(void *parameter) static void thread_preemptions_tc(void) { /* Creating low-priority thread */ - threads[0] = rt_thread_create("tlow", thread_low_entry, RT_NULL, 1024, THREAD_PRIORITY_LOW, 10); + threads[0] = rt_thread_create("tlow", thread_low_entry, RT_NULL, THREAD_STACK_SIZE, THREAD_PRIORITY_LOW, 10); if (threads[0] != RT_NULL) { uassert_true(1); @@ -59,7 +60,7 @@ static void thread_preemptions_tc(void) rt_thread_delay(5); /* Creating high-priority thread */ - threads[1] = rt_thread_create("thigh", thread_high_entry, RT_NULL, 1024, THREAD_PRIORITY_HIGH, 10); + threads[1] = rt_thread_create("thigh", thread_high_entry, RT_NULL, THREAD_STACK_SIZE, THREAD_PRIORITY_HIGH, 10); if (threads[1] != RT_NULL) { uassert_true(1);