diff --git a/include/rtsched.h b/include/rtsched.h index d650e09e37..01951a2611 100644 --- a/include/rtsched.h +++ b/include/rtsched.h @@ -1,11 +1,11 @@ /* - * Copyright (c) 2023-2024 RT-Thread Development Team + * Copyright (c) 2023-2024, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes - * 2024-01-19 Shell Seperate schduling statements from rt_thread_t + * 2024-01-19 Shell Separate scheduling statements from rt_thread_t * to rt_sched_thread_ctx. Add definitions of scheduler. */ #ifndef __RT_SCHED_H__ @@ -22,8 +22,6 @@ struct rt_thread; typedef rt_uint8_t rt_sched_thread_status_t; -#ifdef RT_USING_SCHED_THREAD_CTX - /** * Scheduler private status binding on thread. Caller should never accessing * these members. @@ -85,43 +83,6 @@ struct rt_sched_thread_ctx struct rt_thread, sched_thread_ctx) #define RT_THREAD_LIST_NODE(thread) (RT_SCHED_CTX(thread).thread_list_node) -#else /* !defined(RT_USING_SCHED_THREAD_CTX) */ - -#if RT_THREAD_PRIORITY_MAX > 32 -#define _RT_SCHED_THREAD_CTX_PRIO_EXT \ - rt_uint8_t number; /**< priority low number */ \ - rt_uint8_t high_mask; /**< priority high mask */ - -#else /* ! RT_THREAD_PRIORITY_MAX > 32 */ - -#define _RT_SCHED_THREAD_CTX_PRIO_EXT -#endif /* RT_THREAD_PRIORITY_MAX > 32 */ - -#define RT_SCHED_THREAD_CTX \ - rt_list_t tlist; /**< node in thread list */ \ - rt_uint8_t stat; /**< thread status */ \ - rt_uint8_t sched_flag_locked:1; \ - /**< calling thread have the scheduler locked */ \ - rt_uint8_t sched_flag_ttmr_set:1; /**< thread timer is start */ \ - rt_tick_t init_tick; /**< thread's initialized tick */ \ - rt_tick_t remaining_tick; /**< remaining tick */ \ - rt_uint8_t current_priority; /**< current priority */ \ - rt_uint8_t init_priority; /**< initialized priority */ \ - _RT_SCHED_THREAD_CTX_PRIO_EXT \ - rt_uint32_t number_mask; /**< priority number mask */ - -#define RT_SCHED_PRIV(thread) (*thread) -#define RT_SCHED_CTX(thread) (*thread) - -/** - * Convert a list node in container RT_SCHED_CTX(thread)->thread_list_node - * to a thread pointer. - */ -#define RT_THREAD_LIST_NODE_ENTRY(node) rt_list_entry((node), struct rt_thread, tlist) -#define RT_THREAD_LIST_NODE(thread) (RT_SCHED_CTX(thread).tlist) - -#endif /* RT_USING_SCHED_THREAD_CTX */ - /** * System Scheduler Locking */ diff --git a/src/Kconfig b/src/Kconfig index 30105c3956..320b4f1bc9 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -69,7 +69,6 @@ config RT_USING_AMP config RT_USING_SMP bool "Enable SMP (Symmetric multiprocessing)" default n - select RT_USING_SCHED_THREAD_CTX help This option should be selected by machines which have an SMP- capable CPU. @@ -450,14 +449,6 @@ config RT_USING_THREADSAFE_PRINTF bool "Enable thread safe kernel print service" default y if RT_USING_SMP && RT_USING_SMART -config RT_USING_SCHED_THREAD_CTX - bool "Using the scheduler thread context" - help - Using the scheduler thread context embedded in the thread object. - This options is only for backward compatible codes. Maybe use as a - mandatory option in the future. - default y if RT_USING_SMP - config RT_USING_CONSOLE bool "Using console for rt_kprintf" default y