mirror of
https://github.com/apache/nuttx.git
synced 2026-05-23 14:58:13 +08:00
libc/localtime: tz_lock/unlock should not touch tcb except FLAT
Causing kernel build report undefined reference 'g_nx_initstate' Also protect build, as user elf have no access of kernel objects. Signed-off-by: buxiasen <buxiasen@xiaomi.com>
This commit is contained in:
@@ -392,7 +392,7 @@ static int tzparse(FAR const char *name, FAR struct state_s *sp,
|
||||
|
||||
static inline void tz_lock(FAR rmutex_t *lock)
|
||||
{
|
||||
#ifndef __KERNEL__
|
||||
#if defined(__KERNEL__) || defined(CONFIG_BUILD_FLAT)
|
||||
if (up_interrupt_context() || (sched_idletask() && OSINIT_IDLELOOP()))
|
||||
{
|
||||
return;
|
||||
@@ -404,7 +404,7 @@ static inline void tz_lock(FAR rmutex_t *lock)
|
||||
|
||||
static inline void tz_unlock(FAR rmutex_t *lock)
|
||||
{
|
||||
#ifndef __KERNEL__
|
||||
#if defined(__KERNEL__) || defined(CONFIG_BUILD_FLAT)
|
||||
if (up_interrupt_context() || (sched_idletask() && OSINIT_IDLELOOP()))
|
||||
{
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user