Ver Fonte

[add] 修改线程栈大小为UTEST_THR_STACK_SIZE

Yaochenger há 11 meses atrás
pai
commit
5d4f8193aa

+ 1 - 1
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

+ 1 - 1
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

+ 1 - 1
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;

+ 1 - 1
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;

+ 1 - 1
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;

+ 3 - 2
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);