#define portNVIC_PENDSV_PRI ( ( ( uint32_t ) configKERNEL_INTERRUPT_PRIORITY ) << 16 )\r
#define portNVIC_SYSTICK_PRI ( ( ( uint32_t ) configKERNEL_INTERRUPT_PRIORITY ) << 24 )\r
\r
+/* Masks off all bits but the VECTACTIVE bits in the ICSR register. */\r
+#define portVECTACTIVE_MASK ( 0x1FUL )\r
+\r
/* Constants required to manipulate the VFP. */\r
#define portFPCCR ( ( volatile uint32_t * ) 0xe000ef34 ) /* Floating point context control register. */\r
#define portASPEN_AND_LSPEN_BITS ( 0x3UL << 30UL )\r
ulCriticalNesting++;\r
__DSB();\r
__ISB();\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( ulCriticalNesting == 1 )\r
+ {\r
+ configASSERT( ( ( *(portNVIC_INT_CTRL) ) & portVECTACTIVE_MASK ) == 0 );\r
+ }\r
}\r
/*-----------------------------------------------------------*/\r
\r
\r
stmdb sp!, {r3}\r
ldr.w r0, =ulMaxSyscallInterruptPriorityConst\r
+ ldr r0, [r0]\r
msr basepri, r0\r
bl vTaskSwitchContext\r
mov r0, #0\r
\r
stmdb sp!, {r3}\r
ldr.w r0, =ulMaxSyscallInterruptPriorityConst\r
+ ldr r0, [r0]\r
msr basepri, r0\r
bl vTaskSwitchContext\r
mov r0, #0\r
msr msp, r0\r
;Call SVC to start the first task.\r
cpsie i\r
+ cpsie f\r
dsb\r
isb\r
svc 0\r
ulPortSetInterruptMask:\r
mrs r0, basepri\r
ldr.w r1, =ulMaxSyscallInterruptPriorityConst\r
+ ldr r1, [r1]\r
msr basepri, r1\r
bx r14\r
.size ulPortSetInterruptMask, $-ulPortSetInterruptMask\r