feat: remove RT_USING_SCHED_THREAD_CTX

Prepare for the next release by removing the compatible codes for v5.1.0
and before.

Changes:

- Remove the compatible macros and Kconfig options for the old struct
  rt_thread layout.

Signed-off-by: Shell <smokewood@qq.com>
This commit is contained in:
Shell 2024-05-01 00:17:56 +08:00 committed by Meco Man
parent 76adf376db
commit 645b3c6015
2 changed files with 2 additions and 50 deletions

View File

@ -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 * SPDX-License-Identifier: Apache-2.0
* *
* Change Logs: * Change Logs:
* Date Author Notes * 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. * to rt_sched_thread_ctx. Add definitions of scheduler.
*/ */
#ifndef __RT_SCHED_H__ #ifndef __RT_SCHED_H__
@ -22,8 +22,6 @@ struct rt_thread;
typedef rt_uint8_t rt_sched_thread_status_t; 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 * Scheduler private status binding on thread. Caller should never accessing
* these members. * these members.
@ -85,43 +83,6 @@ struct rt_sched_thread_ctx
struct rt_thread, sched_thread_ctx) struct rt_thread, sched_thread_ctx)
#define RT_THREAD_LIST_NODE(thread) (RT_SCHED_CTX(thread).thread_list_node) #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 * System Scheduler Locking
*/ */

View File

@ -69,7 +69,6 @@ config RT_USING_AMP
config RT_USING_SMP config RT_USING_SMP
bool "Enable SMP (Symmetric multiprocessing)" bool "Enable SMP (Symmetric multiprocessing)"
default n default n
select RT_USING_SCHED_THREAD_CTX
help help
This option should be selected by machines which have an SMP- This option should be selected by machines which have an SMP-
capable CPU. capable CPU.
@ -450,14 +449,6 @@ config RT_USING_THREADSAFE_PRINTF
bool "Enable thread safe kernel print service" bool "Enable thread safe kernel print service"
default y if RT_USING_SMP && RT_USING_SMART 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 config RT_USING_CONSOLE
bool "Using console for rt_kprintf" bool "Using console for rt_kprintf"
default y default y