\r
portBASE_TYPE xPortStartScheduler( void )\r
{\r
+extern void vPortStartFirstTask( void );\r
+\r
ulCriticalNesting = 0UL;\r
\r
vApplicationSetupInterrupts();\r
-\r
- asm volatile(\r
- "move.l pxCurrentTCB, %sp \n\t"\\r
- "move.l (%sp), %sp \n\t"\\r
- "movem.l (%sp), %d0-%fp \n\t"\\r
- "lea.l %sp@(60), %sp \n\t"\\r
- "rte "\r
- );\r
+ vPortStartFirstTask();\r
\r
return pdFALSE;\r
}\r
{\r
}\r
\r
+void vPortClearYield( void )\r
+{\r
+ /* -32 as we are using the high word of the 64bit mask. */\r
+ MCF_INTC0_INTFRCH &= ~( 1UL << ( configYIELD_INTERRUPT_VECTOR - 32UL ) );\r
+}\r
+\r
+\r
\r
\r
\r
*/\r
\r
.global ulPortSetIPL\r
+ .global __cs3_isr_interrupt_127\r
+ .global __cs3_isr_interrupt_119\r
+ .global vPortStartFirstTask\r
\r
.text\r
\r
+.macro portSAVE_CONTEXT\r
+\r
+ lea.l (-60, %sp), %sp\r
+ movem.l %d0-%fp, (%sp)\r
+ move.l pxCurrentTCB, %a0\r
+ move.l %sp, (%a0)\r
+\r
+ .endm\r
+\r
+.macro portRESTORE_CONTEXT\r
+\r
+ move.l pxCurrentTCB, %sp\r
+ move.l (%sp), %sp\r
+ movem.l (%sp), %d0-%fp\r
+ lea.l %sp@(60), %sp\r
+ rte\r
+\r
+ .endm\r
+\r
/********************************************************************/\r
/*\r
* This routines changes the IPL to the value passed into the routine.\r
rts\r
\r
/********************************************************************/\r
+\r
+/* Yield interrupt. */\r
+__cs3_isr_interrupt_127:\r
+ portSAVE_CONTEXT\r
+ jsr vPortClearYield\r
+ jsr vTaskSwitchContext\r
+ portRESTORE_CONTEXT\r
+\r
+/********************************************************************/\r
+\r
+\r
+vPortStartFirstTask:\r
+ portRESTORE_CONTEXT\r
+\r
.end\r
\r
\r