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 /libcpu/arm | |
| parent | 6fe69d7431ed54fcea863ed68d7c4f9746e771b0 (diff) | |
🎯 Sync smart & scheduler codes (#8537)
Signed-off-by: Shell <[email protected]>
Co-authored-by: xqyjlj <[email protected]>
Diffstat (limited to 'libcpu/arm')
| -rw-r--r-- | libcpu/arm/cortex-a/cpuport.c | 7 | ||||
| -rw-r--r-- | libcpu/arm/cortex-a/cpuport.h | 2 |
2 files changed, 9 insertions, 0 deletions
diff --git a/libcpu/arm/cortex-a/cpuport.c b/libcpu/arm/cortex-a/cpuport.c index ac947fb823..064db011b0 100644 --- a/libcpu/arm/cortex-a/cpuport.c +++ b/libcpu/arm/cortex-a/cpuport.c @@ -103,4 +103,11 @@ int __rt_ffs(int value) } #endif +rt_bool_t rt_hw_interrupt_is_disabled(void) +{ + int rc; + __asm__ volatile("mrs %0, cpsr" : "=r" (rc)); + return !!(rc & 0x80); +} + /*@}*/ diff --git a/libcpu/arm/cortex-a/cpuport.h b/libcpu/arm/cortex-a/cpuport.h index 5aec5a84bc..5fb067999c 100644 --- a/libcpu/arm/cortex-a/cpuport.h +++ b/libcpu/arm/cortex-a/cpuport.h @@ -10,6 +10,8 @@ #ifndef CPUPORT_H__ #define CPUPORT_H__ +#include <rtcompiler.h> + /* the exception stack without VFP registers */ struct rt_hw_exp_stack { |
