summaryrefslogtreecommitdiff
path: root/FreeRTOS/Source/portable/IAR/ARM_CM4F_MPU/portmacro.h
diff options
context:
space:
mode:
Diffstat (limited to 'FreeRTOS/Source/portable/IAR/ARM_CM4F_MPU/portmacro.h')
-rw-r--r--FreeRTOS/Source/portable/IAR/ARM_CM4F_MPU/portmacro.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/FreeRTOS/Source/portable/IAR/ARM_CM4F_MPU/portmacro.h b/FreeRTOS/Source/portable/IAR/ARM_CM4F_MPU/portmacro.h
index f26f45f9b..51de83ba0 100644
--- a/FreeRTOS/Source/portable/IAR/ARM_CM4F_MPU/portmacro.h
+++ b/FreeRTOS/Source/portable/IAR/ARM_CM4F_MPU/portmacro.h
@@ -191,6 +191,36 @@ not necessary for to use this port. They are defined so the common demo files
/* portNOP() is not required by this port. */
#define portNOP()
+
+#define portINLINE __inline
+
+#ifndef portFORCE_INLINE
+ #define portFORCE_INLINE inline __attribute__(( always_inline))
+#endif
+
+/*-----------------------------------------------------------*/
+
+portFORCE_INLINE static BaseType_t xPortIsInsideInterrupt( void )
+{
+uint32_t ulCurrentInterrupt;
+BaseType_t xReturn;
+
+ /* Obtain the number of the currently executing interrupt. */
+ __asm volatile( "mrs %0, ipsr" : "=r"( ulCurrentInterrupt ) :: "memory" );
+
+ if( ulCurrentInterrupt == 0 )
+ {
+ xReturn = pdFALSE;
+ }
+ else
+ {
+ xReturn = pdTRUE;
+ }
+
+ return xReturn;
+}
+
+
/*-----------------------------------------------------------*/
extern BaseType_t xIsPrivileged( void );