mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2026-10-10 08:02:57 -04:00
riscv: add generic way to detect if inside interrupt context
This commit is contained in:
parent
8be86d4a24
commit
50013cf591
4 changed files with 33 additions and 2 deletions
|
|
@ -97,6 +97,12 @@ volatile uint64_t * pullMachineTimerCompareRegister = NULL;
|
|||
size_t xCriticalNesting = ( size_t ) 0xaaaaaaaa;
|
||||
size_t * pxCriticalNesting = &xCriticalNesting;
|
||||
|
||||
/*
|
||||
* Counts the interrupt nesting depth.
|
||||
*/
|
||||
size_t xInterruptNesting = 0;
|
||||
size_t * pxInterruptNesting = &xInterruptNesting;
|
||||
|
||||
/* Used to catch tasks that attempt to return from their implementing function. */
|
||||
size_t xTaskReturnAddress = ( size_t ) portTASK_RETURN_ADDRESS;
|
||||
|
||||
|
|
@ -205,3 +211,9 @@ void vPortEndScheduler( void )
|
|||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
BaseType_t xPortIsInsideInterrupt( void )
|
||||
{
|
||||
return ( xInterruptNesting == 0 ) ? pdFALSE : pdTRUE;
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue