add more protection for per-core data

This commit is contained in:
Liu Zhi Fu
2016-12-26 19:04:41 +08:00
parent 99f4c697ee
commit d2e58193d2
3 changed files with 45 additions and 19 deletions

View File

@@ -213,7 +213,6 @@ portBASE_TYPE vPortCPUReleaseMutex(portMUX_TYPE *mux);
#define portEXIT_CRITICAL_ISR(mux) vPortCPUReleaseMutex(mux)
#endif
// Cleaner and preferred solution allows nested interrupts disabling and restoring via local registers or stack.
// They can be called from interrupts too.
//NOT SMP-COMPATIBLE! Use only if all you want is to disable the interrupts locally!
@@ -225,6 +224,9 @@ static inline unsigned portENTER_CRITICAL_NESTED() { unsigned state = XTOS_SET_I
#define portCLEAR_INTERRUPT_MASK_FROM_ISR(state) portEXIT_CRITICAL_NESTED(state)
#define portDisableINT() portENTER_CRITICAL_NESTED()
#define portEnableINT(state) portEXIT_CRITICAL_NESTED((state))
/*
* Wrapper for the Xtensa compare-and-set instruction. This subroutine will atomically compare
* *mux to compare, and if it's the same, will set *mux to set. It will return the old value