arm64: fix compile failed 'tpidr_el1' undeclared
time/lib_localtime.c: In function 'tz_lock':
time/lib_localtime.c:396:7: error: 'tpidr_el1' undeclared (first use in this function)
396 | if (up_interrupt_context() || (sched_idletask() && OSINIT_IDLELOOP()))
| ^~~~~~~~~~~~~~~~~~~~
Signed-off-by: ligd <liguiding1@xiaomi.com>
This commit is contained in:
parent
dfa24a056e
commit
a88652fe53
2 changed files with 38 additions and 36 deletions
|
|
@ -34,9 +34,10 @@
|
|||
#ifndef __ASSEMBLY__
|
||||
# include <stdint.h>
|
||||
# include <stddef.h>
|
||||
# include <nuttx/macro.h>
|
||||
#endif
|
||||
|
||||
#include <nuttx/irq.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Prototypes
|
||||
****************************************************************************/
|
||||
|
|
@ -53,41 +54,6 @@
|
|||
|
||||
#endif /* CONFIG_ARCH_ADDRENV */
|
||||
|
||||
/****************************************************************************
|
||||
* Name:
|
||||
* read_/write_/zero_/modify_ sysreg
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
* ARMv8 Architecture Registers access method
|
||||
* All the macros need a memory clobber
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#define read_sysreg(reg) \
|
||||
({ \
|
||||
uint64_t __val; \
|
||||
__asm__ volatile ("mrs %0, " STRINGIFY(reg) \
|
||||
: "=r" (__val) :: "memory"); \
|
||||
__val; \
|
||||
})
|
||||
|
||||
#define write_sysreg(__val, reg) \
|
||||
({ \
|
||||
__asm__ volatile ("msr " STRINGIFY(reg) ", %0" \
|
||||
: : "r" (__val) : "memory"); \
|
||||
})
|
||||
|
||||
#define zero_sysreg(reg) \
|
||||
({ \
|
||||
__asm__ volatile ("msr " STRINGIFY(reg) ", xzr" \
|
||||
::: "memory"); \
|
||||
})
|
||||
|
||||
#define modify_sysreg(v,m,a) \
|
||||
write_sysreg((read_sysreg(a) & ~(m)) | \
|
||||
((uintptr_t)(v) & (m)), a)
|
||||
|
||||
/****************************************************************************
|
||||
* Inline functions
|
||||
****************************************************************************/
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
#ifndef __ASSEMBLY__
|
||||
# include <stdint.h>
|
||||
# include <arch/syscall.h>
|
||||
# include <nuttx/macro.h>
|
||||
#endif
|
||||
|
||||
/* Include NuttX-specific IRQ definitions */
|
||||
|
|
@ -394,6 +395,41 @@ static inline void up_irq_restore(irqstate_t flags)
|
|||
# define up_cpu_index() ((int)MPID_TO_CORE(GET_MPIDR()))
|
||||
#endif /* CONFIG_ARCH_HAVE_MULTICPU */
|
||||
|
||||
/****************************************************************************
|
||||
* Name:
|
||||
* read_/write_/zero_/modify_ sysreg
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
* ARMv8 Architecture Registers access method
|
||||
* All the macros need a memory clobber
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#define read_sysreg(reg) \
|
||||
({ \
|
||||
uint64_t __val; \
|
||||
__asm__ volatile ("mrs %0, " STRINGIFY(reg) \
|
||||
: "=r" (__val) :: "memory"); \
|
||||
__val; \
|
||||
})
|
||||
|
||||
#define write_sysreg(__val, reg) \
|
||||
({ \
|
||||
__asm__ volatile ("msr " STRINGIFY(reg) ", %0" \
|
||||
: : "r" (__val) : "memory"); \
|
||||
})
|
||||
|
||||
#define zero_sysreg(reg) \
|
||||
({ \
|
||||
__asm__ volatile ("msr " STRINGIFY(reg) ", xzr" \
|
||||
::: "memory"); \
|
||||
})
|
||||
|
||||
#define modify_sysreg(v,m,a) \
|
||||
write_sysreg((read_sysreg(a) & ~(m)) | \
|
||||
((uintptr_t)(v) & (m)), a)
|
||||
|
||||
/****************************************************************************
|
||||
* Schedule acceleration macros
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue