]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/portable/GCC/ARM_CRx_No_GIC/portmacro.h
Simplify and improve GIC-less Cortex-R4 port.
[freertos] / FreeRTOS / Source / portable / GCC / ARM_CRx_No_GIC / portmacro.h
index 73ec1e94f6baaad43473d1783ddb979679435a28..fd8a7657753d278b0b83272d77d593ad61ee2bb2 100644 (file)
@@ -118,7 +118,7 @@ not need to be guarded with a critical section. */
 /* Called at the end of an ISR that can cause a context switch. */\r
 #define portEND_SWITCHING_ISR( xSwitchRequired )\\r
 {                                                                                              \\r
-extern uint32_t ulPortYieldRequired;                   \\r
+extern volatile uint32_t ulPortYieldRequired;  \\r
                                                                                                \\r
        if( xSwitchRequired != pdFALSE )                        \\r
        {                                                                                       \\r
@@ -153,7 +153,7 @@ globally enable and disable interrupts. */
                                                                                                         "DSB           \n"             \\r
                                                                                                         "ISB             " );\r
 \r
-__attribute__( ( always_inline ) ) static __inline uint32_t portSET_INTERRUPT_MASK_FROM_ISR( void )\r
+__attribute__( ( always_inline ) ) static __inline uint32_t portINLINE_SET_INTERRUPT_MASK_FROM_ISR( void )\r
 {\r
 volatile uint32_t ulCPSR;\r
 \r
@@ -163,7 +163,8 @@ volatile uint32_t ulCPSR;
        return ulCPSR;\r
 }\r
 \r
-#define portCLEAR_INTERRUPT_MASK_FROM_ISR(x)   if( x != 0 ) portENABLE_INTERRUPTS()\r
+#define portSET_INTERRUPT_MASK_FROM_ISR() portINLINE_SET_INTERRUPT_MASK_FROM_ISR()\r
+#define portCLEAR_INTERRUPT_MASK_FROM_ISR(x)   if( x == 0 ) portENABLE_INTERRUPTS()\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
@@ -198,7 +199,7 @@ void vPortTaskUsesFPU( void );
 \r
        /*-----------------------------------------------------------*/\r
 \r
-       #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31UL - __builtin_clz( uxReadyPriorities ) )\r
+       #define portGET_HIGHEST_PRIORITY( uxTopPriority, uxReadyPriorities ) uxTopPriority = ( 31UL - ( uint32_t ) __builtin_clz( uxReadyPriorities ) )\r
 \r
 #endif /* configUSE_PORT_OPTIMISED_TASK_SELECTION */\r
 \r