mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-12 00:57:44 -04:00
Update port.c
Error on my part, this is the right inline asm code to retreive CPSR register
This commit is contained in:
parent
7111a5a21b
commit
ba19cf89ed
1 changed files with 8 additions and 4 deletions
|
@ -149,10 +149,14 @@
|
|||
|
||||
|
||||
/* Adding the necessary stuff in order to be able to determine from C code wheter or not the IRQs are enabled at the processor level (not interrupt controller level) */
|
||||
#define GET_CPSR() __asm__ __volatile__(\
|
||||
"msr cpsr,%0\n"\
|
||||
: : "r" (v)\
|
||||
)
|
||||
#define GET_CPSR() ({u32 rval = 0U; \
|
||||
__asm__ __volatile__(\
|
||||
"mrs %0, cpsr\n"\
|
||||
: "=r" (rval)\
|
||||
);\
|
||||
rval;\
|
||||
})
|
||||
|
||||
#define CPSR_IRQ_ENABLE_MASK 0x80U
|
||||
|
||||
#define IS_IRQ_DISABLED() ({unsigned int val = 0; val = (GET_CPSR() & CPSR_IRQ_ENABLE_MASK) ? 1 : 0; val;})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue