File tree 2 files changed +15
-1
lines changed
2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -443,6 +443,14 @@ config RT_USING_SCHED_THREAD_CTX
443
443
mandatory option in the future.
444
444
default y if RT_USING_SMP
445
445
446
+ config RT_USING_ABSTRACT_THREAD_SELF
447
+ bool "Using the abstract version of thread self"
448
+ depends on !RT_USING_SMP
449
+ help
450
+ Using the rt_thread_self() to get TCB instead of fetching from
451
+ global object rt_current_thread to achieve better maintainability
452
+ default n
453
+
446
454
config RT_USING_CONSOLE
447
455
bool "Using console for rt_kprintf"
448
456
default y
Original file line number Diff line number Diff line change 12
12
#include <rthw.h>
13
13
#include <rtthread.h>
14
14
15
- static struct rt_cpu _cpu ;
15
+ #ifndef RT_USING_ABSTRACT_THREAD_SELF
16
+ #undef rt_current_thread
17
+ #define _cpu rt_current_thread
18
+ /* regarding to the legacy codes */
19
+ #endif /* RT_USING_ABSTRACT_THREAD_SELF */
20
+
21
+ struct rt_cpu _cpu ;
16
22
17
23
/**
18
24
* @brief Initialize a static spinlock object.
You can’t perform that action at this time.
0 commit comments