]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Source/portable/RVDS/ARM_CM3/port.c
Make the parameters to vPortDefineHeapRegions() const.
[freertos] / FreeRTOS / Source / portable / RVDS / ARM_CM3 / port.c
index d813c5b06dd5f6d30d166f5adcdc2d6f419097df..cfefb2cef7705afe1d8de86a2ab7c7198c19ca3d 100644 (file)
@@ -110,6 +110,9 @@ is defined. */
 #define portNVIC_PENDSVCLEAR_BIT                       ( 1UL << 27UL )\r
 #define portNVIC_PEND_SYSTICK_CLEAR_BIT                ( 1UL << 25UL )\r
 \r
+/* Masks off all bits but the VECTACTIVE bits in the ICSR register. */\r
+#define portVECTACTIVE_MASK                                    ( 0x1FUL )\r
+\r
 #define portNVIC_PENDSV_PRI                                    ( ( ( uint32_t ) configKERNEL_INTERRUPT_PRIORITY ) << 16UL )\r
 #define portNVIC_SYSTICK_PRI                           ( ( ( uint32_t ) configKERNEL_INTERRUPT_PRIORITY ) << 24UL )\r
 \r
@@ -268,11 +271,13 @@ __asm void prvStartFirstTask( void )
        msr msp, r0\r
        /* Globally enable interrupts. */\r
        cpsie i\r
+       cpsie f\r
        dsb\r
        isb\r
        /* Call SVC to start the first task. */\r
        svc 0\r
        nop\r
+       nop\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
@@ -370,6 +375,16 @@ void vPortEnterCritical( void )
        uxCriticalNesting++;\r
        __dsb( portSY_FULL_READ_WRITE );\r
        __isb( portSY_FULL_READ_WRITE );\r
+\r
+       /* This is not the interrupt safe version of the enter critical function so\r
+       assert() if it is being called from an interrupt context.  Only API\r
+       functions that end in "FromISR" can be used in an interrupt.  Only assert if\r
+       the critical nesting count is 1 to protect against recursive calls if the\r
+       assert function also uses a critical section. */\r
+       if( uxCriticalNesting == 1 )\r
+       {\r
+               configASSERT( ( portNVIC_INT_CTRL_REG & portVECTACTIVE_MASK ) == 0 );\r
+       }\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r