FreeRTOS is distributed in the hope that it will be useful, but WITHOUT\r
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\r
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\r
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT\r
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\r
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\r
- more details. You should have received a copy of the GNU General Public \r
- License and the FreeRTOS license exception along with FreeRTOS; if not it \r
- can be viewed here: http://www.freertos.org/a00114.html and also obtained \r
+ more details. You should have received a copy of the GNU General Public\r
+ License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+ can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
by writing to Richard Barry, contact details for whom are available on the\r
FreeRTOS WEB site.\r
\r
by writing to Richard Barry, contact details for whom are available on the\r
FreeRTOS WEB site.\r
\r
* the current stack state only - comparing the current top of stack value to\r
* the stack limit. Setting configCHECK_FOR_STACK_OVERFLOW to greater than 1\r
* will also cause the last few stack bytes to be checked to ensure the value\r
* the current stack state only - comparing the current top of stack value to\r
* the stack limit. Setting configCHECK_FOR_STACK_OVERFLOW to greater than 1\r
* will also cause the last few stack bytes to be checked to ensure the value\r
- * to which the bytes were set when the task was created have not been \r
+ * to which the bytes were set when the task was created have not been\r
* overwritten. Note this second test does not guarantee that an overflowed\r
* stack will always be recognised.\r
*/\r
* overwritten. Note this second test does not guarantee that an overflowed\r
* stack will always be recognised.\r
*/\r
/* Only the current stack state is to be checked. */\r
#define taskFIRST_CHECK_FOR_STACK_OVERFLOW() \\r
{ \\r
/* Only the current stack state is to be checked. */\r
#define taskFIRST_CHECK_FOR_STACK_OVERFLOW() \\r
{ \\r
- extern void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName ); \\r
+ extern void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName ); \\r
\\r
/* Is the currently saved stack pointer within the stack limit? */ \\r
if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack ) \\r
\\r
/* Is the currently saved stack pointer within the stack limit? */ \\r
if( pxCurrentTCB->pxTopOfStack >= pxCurrentTCB->pxEndOfStack ) \\r
\r
#define taskSECOND_CHECK_FOR_STACK_OVERFLOW() \\r
{ \\r
\r
#define taskSECOND_CHECK_FOR_STACK_OVERFLOW() \\r
{ \\r
- extern void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName ); \\r
- static const unsigned char ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \\r
+ extern void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName ); \\r
+ static const unsigned char ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \\r
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \\r
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \\r
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \\r
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \\r
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \\r
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \\r
\r
#define taskSECOND_CHECK_FOR_STACK_OVERFLOW() \\r
{ \\r
\r
#define taskSECOND_CHECK_FOR_STACK_OVERFLOW() \\r
{ \\r
- extern void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName ); \\r
- char *pcEndOfStack = ( char * ) pxCurrentTCB->pxEndOfStack; \\r
- static const unsigned char ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \\r
+ extern void vApplicationStackOverflowHook( xTaskHandle *pxTask, signed char *pcTaskName ); \\r
+ char *pcEndOfStack = ( char * ) pxCurrentTCB->pxEndOfStack; \\r
+ static const unsigned char ucExpectedStackBytes[] = { tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \\r
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \\r
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \\r
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \\r
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \\r
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \\r
tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, tskSTACK_FILL_BYTE, \\r
\r
/* Tasks should start with interrupts enabled and in Supervisor mode, therefore\r
PSW is set with U and I set, and PM and IPL clear. */\r
\r
/* Tasks should start with interrupts enabled and in Supervisor mode, therefore\r
PSW is set with U and I set, and PM and IPL clear. */\r
-#define portINITIAL_PSW ( ( portSTACK_TYPE ) 0x00030000 )\r
-#define portINITIAL_FPSW ( ( portSTACK_TYPE ) 0x00000100 )\r
+#define portINITIAL_PSW ( ( portSTACK_TYPE ) 0x00030000 )\r
+#define portINITIAL_FPSW ( ( portSTACK_TYPE ) 0x00000100 )\r
\r
/*-----------------------------------------------------------*/\r
\r
\r
/*-----------------------------------------------------------*/\r
\r
}\r
/*-----------------------------------------------------------*/\r
\r
}\r
/*-----------------------------------------------------------*/\r
\r
-#pragma vector = VECT_CMT0_CMI0\r
+#pragma vector = configTICK_VECTOR\r
__interrupt void vTickISR( void )\r
{\r
/* Re-enable interrupts. */\r
__interrupt void vTickISR( void )\r
{\r
/* Re-enable interrupts. */\r
*/\r
\r
PUBLIC _prvStartFirstTask\r
*/\r
\r
PUBLIC _prvStartFirstTask\r
- PUBLIC _vSoftwareInterruptISR\r
- \r
+ PUBLIC ___interrupt_27\r
+\r
EXTERN _pxCurrentTCB\r
EXTERN _vTaskSwitchContext\r
\r
RSEG CODE:CODE(4)\r
EXTERN _pxCurrentTCB\r
EXTERN _vTaskSwitchContext\r
\r
RSEG CODE:CODE(4)\r
_prvStartFirstTask:\r
\r
/* When starting the scheduler there is nothing that needs moving to the\r
interrupt stack because the function is not called from an interrupt.\r
Just ensure the current stack is the user stack. */\r
_prvStartFirstTask:\r
\r
/* When starting the scheduler there is nothing that needs moving to the\r
interrupt stack because the function is not called from an interrupt.\r
Just ensure the current stack is the user stack. */\r
\r
/* Obtain the location of the stack associated with which ever task\r
pxCurrentTCB is currently pointing to. */\r
\r
/* Obtain the location of the stack associated with which ever task\r
pxCurrentTCB is currently pointing to. */\r
- MOV.L #_pxCurrentTCB, R15 \r
- MOV.L [R15], R15 \r
- MOV.L [R15], R0 \r
+ MOV.L #_pxCurrentTCB, R15\r
+ MOV.L [R15], R15\r
+ MOV.L [R15], R0\r
\r
/* Restore the registers from the stack of the task pointed to by\r
pxCurrentTCB. */\r
\r
/* Restore the registers from the stack of the task pointed to by\r
pxCurrentTCB. */\r
/* Accumulator low 32 bits. */\r
/* Accumulator low 32 bits. */\r
- MVTACLO R15 \r
- POP R15 \r
- \r
+ MVTACLO R15\r
+ POP R15\r
+\r
/* Accumulator high 32 bits. */\r
/* Accumulator high 32 bits. */\r
- MVTACHI R15 \r
- POP R15 \r
- \r
+ MVTACHI R15\r
+ POP R15\r
+\r
/* Floating point status word. */\r
/* Floating point status word. */\r
/* R1 to R15 - R0 is not included as it is the SP. */\r
/* R1 to R15 - R0 is not included as it is the SP. */\r
/* This pops the remaining registers. */\r
/* This pops the remaining registers. */\r
- RTE \r
- NOP \r
- NOP \r
\r
/*-----------------------------------------------------------*/\r
\r
\r
/*-----------------------------------------------------------*/\r
\r
-_vSoftwareInterruptISR:\r
+/* The software interrupt - overwrite the default 'weak' definition. */\r
+___interrupt_27:\r
\r
/* Re-enable interrupts. */\r
SETPSW I\r
\r
/* Move the data that was automatically pushed onto the interrupt stack when\r
the interrupt occurred from the interrupt stack to the user stack.\r
\r
/* Re-enable interrupts. */\r
SETPSW I\r
\r
/* Move the data that was automatically pushed onto the interrupt stack when\r
the interrupt occurred from the interrupt stack to the user stack.\r
R15 is saved before it is clobbered. */\r
R15 is saved before it is clobbered. */\r
/* Read the user stack pointer. */\r
/* Read the user stack pointer. */\r
/* Move the address down to the data being moved. */\r
/* Move the address down to the data being moved. */\r
- SUB #12, R15 \r
- MVTC R15, USP \r
- \r
+ SUB #12, R15\r
+ MVTC R15, USP\r
+\r
/* Copy the data across, R15, then PC, then PSW. */\r
/* Copy the data across, R15, then PC, then PSW. */\r
- MOV.L [ R0 ], [ R15 ] \r
- MOV.L 4[ R0 ], 4[ R15 ] \r
- MOV.L 8[ R0 ], 8[ R15 ] \r
+ MOV.L [ R0 ], [ R15 ]\r
+ MOV.L 4[ R0 ], 4[ R15 ]\r
+ MOV.L 8[ R0 ], 8[ R15 ]\r
\r
/* Move the interrupt stack pointer to its new correct position. */\r
\r
/* Move the interrupt stack pointer to its new correct position. */\r
/* All the rest of the registers are saved directly to the user stack. */\r
/* All the rest of the registers are saved directly to the user stack. */\r
\r
/* Save the rest of the general registers (R15 has been saved already). */\r
\r
/* Save the rest of the general registers (R15 has been saved already). */\r
/* Save the FPSW and accumulator. */\r
/* Save the FPSW and accumulator. */\r
- MVFC FPSW, R15 \r
- PUSH.L R15 \r
- MVFACHI R15 \r
- PUSH.L R15 \r
- \r
+ MVFC FPSW, R15\r
+ PUSH.L R15\r
+ MVFACHI R15\r
+ PUSH.L R15\r
+\r
/* Shifted left as it is restored to the low order word. */\r
/* Shifted left as it is restored to the low order word. */\r
- SHLL #16, R15 \r
- PUSH.L R15 \r
+ SHLL #16, R15\r
+ PUSH.L R15\r
\r
/* Save the stack pointer to the TCB. */\r
\r
/* Save the stack pointer to the TCB. */\r
- MOV.L #_pxCurrentTCB, R15 \r
- MOV.L [ R15 ], R15 \r
- MOV.L R0, [ R15 ] \r
- \r
+ MOV.L #_pxCurrentTCB, R15\r
+ MOV.L [ R15 ], R15\r
+ MOV.L R0, [ R15 ]\r
+\r
/* Ensure the interrupt mask is set to the syscall priority while the kernel\r
structures are being accessed. */\r
/* Ensure the interrupt mask is set to the syscall priority while the kernel\r
structures are being accessed. */\r
\r
/* Select the next task to run. */\r
\r
/* Select the next task to run. */\r
- BSR.A _vTaskSwitchContext \r
+ BSR.A _vTaskSwitchContext\r
\r
/* Reset the interrupt mask as no more data structure access is required. */\r
\r
/* Reset the interrupt mask as no more data structure access is required. */\r
\r
/* Load the stack pointer of the task that is now selected as the Running\r
state task from its TCB. */\r
\r
/* Load the stack pointer of the task that is now selected as the Running\r
state task from its TCB. */\r
- MOV.L #_pxCurrentTCB,R15 \r
- MOV.L [ R15 ], R15 \r
- MOV.L [ R15 ], R0 \r
+ MOV.L #_pxCurrentTCB,R15\r
+ MOV.L [ R15 ], R15\r
+ MOV.L [ R15 ], R0\r
\r
/* Restore the context of the new task. The PSW (Program Status Word) and\r
PC will be popped by the RTE instruction. */\r
\r
/* Restore the context of the new task. The PSW (Program Status Word) and\r
PC will be popped by the RTE instruction. */\r
- POP R15 \r
- MVTACLO R15 \r
- POP R15 \r
- MVTACHI R15 \r
- POP R15 \r
- MVTC R15, FPSW \r
- POPM R1-R15 \r
- RTE \r
- NOP \r
- NOP \r
- \r
- /*:: i(configMAX_SYSCALL_INTERRUPT_PRIORITY), i(configKERNEL_INTERRUPT_PRIORITY)*/\r
-/*-----------------------------------------------------------*/\r
-\r
+ POP R15\r
+ MVTACLO R15\r
+ POP R15\r
+ MVTACHI R15\r
+ POP R15\r
+ MVTC R15, FPSW\r
+ POPM R1-R15\r
+ RTE\r
+ NOP\r
+ NOP\r
+/*-----------------------------------------------------------*/\r