mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
arm64: add arm64_current_el to obtain current EL
Summary Add a macro to obtain current execute level Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
This commit is contained in:
@@ -391,6 +391,26 @@ static inline void arch_nop(void)
|
|||||||
__asm__ volatile ("nop");
|
__asm__ volatile ("nop");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name:
|
||||||
|
* arm64_current_el()
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
*
|
||||||
|
* Get current execution level
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
#define arm64_current_el() \
|
||||||
|
({ \
|
||||||
|
uint64_t __el; \
|
||||||
|
int __ret; \
|
||||||
|
__asm__ volatile ("mrs %0, CurrentEL" \
|
||||||
|
: "=r" (__el)); \
|
||||||
|
__ret = GET_EL(__el); \
|
||||||
|
__ret; \
|
||||||
|
})
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name:
|
* Name:
|
||||||
* read_/write_/zero_ sysreg
|
* read_/write_/zero_ sysreg
|
||||||
|
|||||||
Reference in New Issue
Block a user