diff options
| author | Shell <[email protected]> | 2024-02-23 17:49:15 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-02-23 17:49:15 +0800 |
| commit | 71560bafb5735220696ca24a42ba4a668b55949b (patch) | |
| tree | 236df5973a1fd5b6f0cc9f6c6b6a2d71fd069203 /components/libc | |
| parent | 6fe69d7431ed54fcea863ed68d7c4f9746e771b0 (diff) | |
🎯 Sync smart & scheduler codes (#8537)
Signed-off-by: Shell <[email protected]>
Co-authored-by: xqyjlj <[email protected]>
Diffstat (limited to 'components/libc')
| -rw-r--r-- | components/libc/compilers/common/include/sys/time.h | 23 | ||||
| -rw-r--r-- | components/libc/posix/libdl/dlmodule.c | 2 | ||||
| -rw-r--r-- | components/libc/posix/pthreads/pthread_cond.c | 2 |
3 files changed, 14 insertions, 13 deletions
diff --git a/components/libc/compilers/common/include/sys/time.h b/components/libc/compilers/common/include/sys/time.h index c9968a9f29..817fe78676 100644 --- a/components/libc/compilers/common/include/sys/time.h +++ b/components/libc/compilers/common/include/sys/time.h @@ -46,7 +46,17 @@ int8_t rt_tz_is_dst(void); struct itimerspec; -#if defined(_GNU_SOURCE) && (defined(__x86_64__) || defined(__i386__)) +/* 'struct timeval' is defined on __x86_64__ toolchain */ +#if !defined(__x86_64__) && !defined(_TIMEVAL_DEFINED) +#define _TIMEVAL_DEFINED +struct timeval +{ + time_t tv_sec; /* seconds */ + suseconds_t tv_usec; /* and microseconds */ +}; +#endif /* _TIMEVAL_DEFINED */ + +#if defined(_GNU_SOURCE) && (defined(__x86_64__) || defined(__i386__) || defined(RT_USING_SMART)) /* linux x86 platform gcc use! */ #define _TIMEVAL_DEFINED /* Values for the first argument to `getitimer' and `setitimer'. */ @@ -71,16 +81,7 @@ struct itimerval /* Time to the next timer expiration. */ struct timeval it_value; }; -#endif /* defined(_GNU_SOURCE) && (defined(__x86_64__) || defined(__i386__)) */ - -#ifndef _TIMEVAL_DEFINED -#define _TIMEVAL_DEFINED -struct timeval -{ - time_t tv_sec; /* seconds */ - suseconds_t tv_usec; /* and microseconds */ -}; -#endif /* _TIMEVAL_DEFINED */ +#endif /* defined(_GNU_SOURCE) && (defined(__x86_64__) || defined(__i386__)) || defined(RT_USING_SMART) */ #if defined(__ARMCC_VERSION) || defined(_WIN32) || (defined(__ICCARM__) && (__VER__ < 8010001)) struct timespec diff --git a/components/libc/posix/libdl/dlmodule.c b/components/libc/posix/libdl/dlmodule.c index eebc5be0f9..1f245e4121 100644 --- a/components/libc/posix/libdl/dlmodule.c +++ b/components/libc/posix/libdl/dlmodule.c @@ -203,7 +203,7 @@ void dlmodule_destroy_subthread(struct rt_dlmodule *module, rt_thread_t thread) rt_enter_critical(); /* remove thread from thread_list (ready or defunct thread list) */ - rt_list_remove(&(thread->tlist)); + rt_list_remove(&RT_THREAD_LIST_NODE(thread)); if ((thread->stat & RT_THREAD_STAT_MASK) != RT_THREAD_CLOSE && (thread->thread_timer.parent.type == (RT_Object_Class_Static | RT_Object_Class_Timer))) diff --git a/components/libc/posix/pthreads/pthread_cond.c b/components/libc/posix/pthreads/pthread_cond.c index 1fe9ede905..6c3db2eb11 100644 --- a/components/libc/posix/pthreads/pthread_cond.c +++ b/components/libc/posix/pthreads/pthread_cond.c @@ -285,7 +285,7 @@ rt_err_t _pthread_cond_timedwait(pthread_cond_t *cond, rt_thread_suspend(thread); /* Only support FIFO */ - rt_list_insert_before(&(sem->parent.suspend_thread), &(thread->tlist)); + rt_list_insert_before(&(sem->parent.suspend_thread), &RT_THREAD_LIST_NODE(thread)); /** rt_ipc_list_suspend(&(sem->parent.suspend_thread), |
