From e3a14a97a99b85c6ac356e34140c2f48dea05f57 Mon Sep 17 00:00:00 2001 From: Meco Man <920369182@qq.com> Date: Wed, 6 Mar 2024 03:57:19 -0500 Subject: [PATCH] [kernel] fix warning of rt_thread_t struct (#8584) --- include/rtdef.h | 21 +++------------------ include/rtsched.h | 4 ++-- 2 files changed, 5 insertions(+), 20 deletions(-) diff --git a/include/rtdef.h b/include/rtdef.h index c3cfd90346..47e02b3e9e 100644 --- a/include/rtdef.h +++ b/include/rtdef.h @@ -62,18 +62,8 @@ #ifndef __RT_DEF_H__ #define __RT_DEF_H__ -#include - -#include -#include -#include -#ifndef RT_USING_NANO -#include -#include -#if defined(RT_USING_SIGNALS) || defined(RT_USING_SMART) -#include -#endif /* defined(RT_USING_SIGNALS) || defined(RT_USING_SMART) */ -#endif /* RT_USING_NANO */ +#include "rtsched.h" +#include "rttypes.h" #ifdef __cplusplus extern "C" { @@ -97,9 +87,6 @@ extern "C" { #define RTTHREAD_VERSION RT_VERSION_CHECK(RT_VERSION_MAJOR, RT_VERSION_MINOR, RT_VERSION_PATCH) -/* RT-Thread basic data type definitions */ -#include "rttypes.h" - /**@}*/ /* maximum value of base type */ @@ -846,8 +833,6 @@ typedef void (*rt_thread_cleanup_t)(struct rt_thread *tid); * Thread structure */ -#include "rtsched.h" /* for struct rt_sched_thread_ctx */ - struct rt_thread { struct rt_object parent; @@ -866,7 +851,7 @@ struct rt_thread rt_atomic_t cpus_lock_nest; /**< cpus lock count */ #endif - RT_SCHED_THREAD_CTX; + RT_SCHED_THREAD_CTX struct rt_timer thread_timer; /**< built-in thread timer */ rt_thread_cleanup_t cleanup; /**< cleanup function when thread exit */ diff --git a/include/rtsched.h b/include/rtsched.h index 809d03fb4e..d3c590230f 100644 --- a/include/rtsched.h +++ b/include/rtsched.h @@ -62,7 +62,7 @@ struct rt_sched_thread_ctx struct rt_sched_thread_priv sched_thread_priv; /**< private context of scheduler */ }; -#define RT_SCHED_THREAD_CTX struct rt_sched_thread_ctx sched_thread_ctx +#define RT_SCHED_THREAD_CTX struct rt_sched_thread_ctx sched_thread_ctx; #define RT_SCHED_PRIV(thread) ((thread)->sched_thread_ctx.sched_thread_priv) #define RT_SCHED_CTX(thread) ((thread)->sched_thread_ctx) @@ -100,7 +100,7 @@ struct rt_sched_thread_ctx 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 */ + rt_uint32_t number_mask; /**< priority number mask */ #define RT_SCHED_PRIV(thread) (*thread) #define RT_SCHED_CTX(thread) (*thread)