wonger wrote on Thursday, August 18, 2016:
I’m using FreeRTOS on a Zynq 7000. The ARM_CA9 port.c has vPortEnterCritical() function which states this is not the interrupt safe version of the enter critical function and it asserts if called from an interrupt. But I do not see an ISR safe version of this. I have a critical section I want to enter, from a task and from an ISR. How would I do this? The complete function is below for reference.
Thank you for any help.
void vPortEnterCritical( void )
{
/* Mask interrupts up to the max syscall interrupt priority. */
ulPortSetInterruptMask();
/* Now interrupts are disabled ulCriticalNesting can be accessed
directly. Increment ulCriticalNesting to keep a count of how many times
portENTER_CRITICAL() has been called. */
ulCriticalNesting++;
/* This is not the interrupt safe version of the enter critical function so
assert() if it is being called from an interrupt context. Only API
functions that end in "FromISR" can be used in an interrupt. Only assert if
the critical nesting count is 1 to protect against recursive calls if the
assert function also uses a critical section. */
if( ulCriticalNesting == 1 )
{
configASSERT( ulPortInterruptNesting == 0 );
}
}