Add xPortInIsrContext function + unit test. This function returns true when the current CPU runs in an interrupt handler context.

This commit is contained in:
Jeroen Domburg
2017-02-27 16:34:19 +08:00
parent 290c40a4ab
commit 6739d5b99f
5 changed files with 77 additions and 14 deletions

View File

@@ -36,16 +36,6 @@ static inline void *get_sp()
return sp;
}
/* Return true if the CPU is in an interrupt context
(PS.UM == 0)
*/
static inline bool cpu_in_interrupt_context(void)
{
uint32_t ps;
RSR(PS, ps);
return (ps & PS_UM) == 0;
}
/* Functions to set page attributes for Region Protection option in the CPU.
* See Xtensa ISA Reference manual for explanation of arguments (section 4.6.3.2).
*/