Skip to content

Commit

Permalink
compatible layer
Browse files Browse the repository at this point in the history
  • Loading branch information
polarvid committed May 22, 2024
1 parent 5a819be commit e3a67ba
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,14 @@ config RT_USING_SCHED_THREAD_CTX
mandatory option in the future.
default y if RT_USING_SMP

config RT_USING_ABSTRACT_THREAD_SELF
bool "Using the abstract version of thread self"
depends on !RT_USING_SMP
help
Using the rt_thread_self() to get TCB instead of fetching from
global object rt_current_thread to achieve better maintainability
default n

config RT_USING_CONSOLE
bool "Using console for rt_kprintf"
default y
Expand Down
8 changes: 7 additions & 1 deletion src/cpu_up.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@
#include <rthw.h>
#include <rtthread.h>

static struct rt_cpu _cpu;
#ifndef RT_USING_ABSTRACT_THREAD_SELF
#undef rt_current_thread
#define _cpu rt_current_thread
/* regarding to the legacy codes */
#endif /* RT_USING_ABSTRACT_THREAD_SELF */

struct rt_cpu _cpu;

/**
* @brief Initialize a static spinlock object.
Expand Down

0 comments on commit e3a67ba

Please sign in to comment.