--- /dev/null
+ .macro portSAVE_CONTEXT\r
+\r
+ ; Save r0 to r14 and pr.\r
+ movml.l r15, @-r15\r
+ \r
+ ; Save mac1, mach and gbr\r
+ sts.l macl, @-r15\r
+ sts.l mach, @-r15\r
+ stc.l gbr, @-r15\r
+ \r
+ ; Get the address of pxCurrentTCB\r
+ mov.l #_pxCurrentTCB, r0\r
+ \r
+ ; Get the address of pxTopOfStack from the TCB.\r
+ mov.l @r0, r0\r
+ \r
+ ; Save the stack pointer in pxTopOfStack.\r
+ mov.l r15, @r0\r
+\r
+ .endm\r
+\r
+;-----------------------------------------------------------\r
+\r
+ .macro portRESTORE_CONTEXT\r
+\r
+ ; Get the address of the pxCurrentTCB variable.\r
+ mov.l #_pxCurrentTCB, r0\r
+\r
+ ; Get the address of the task stack from pxCurrentTCB.\r
+ mov.l @r0, r0\r
+\r
+ ; Get the task stack itself into the stack pointer. \r
+ mov.l @r0, r15 \r
+\r
+ ; Restore system registers.\r
+ ldc.l @r15+, gbr\r
+ lds.l @r15+, mach\r
+ lds.l @r15+, macl\r
+\r
+ ; Restore r0 to r14 and PR\r
+ movml.l @r15+, r15\r
+ \r
+ ; Pop the SR and PC to jump to the start of the task.\r
+ rte\r
+ nop\r
+\r
+ .endm\r
+;-----------------------------------------------------------
\ No newline at end of file
trapa( portYIELD_TRAP_NO );\r
\r
/* Restore the interrupt mask to whatever it was previously (when the\r
- function was entered. */\r
+ function was entered). */\r
set_imask( ( int ) lInterruptMask );\r
}\r
/*-----------------------------------------------------------*/\r
/*-----------------------------------------------------------*/\r
\r
\r
-\r
-\r
-\r
-\r
-\r
\r
.section P\r
\r
- .macro portSAVE_CONTEXT\r
-\r
- ; Save r0 to r14 and pr.\r
- movml.l r15, @-r15\r
- \r
- ; Save mac1, mach and gbr\r
- sts.l macl, @-r15\r
- sts.l mach, @-r15\r
- stc.l gbr, @-r15\r
- \r
- ; Get the address of pxCurrentTCB\r
- mov.l #_pxCurrentTCB, r0\r
- \r
- ; Get the address of pxTopOfStack from the TCB.\r
- mov.l @r0, r0\r
- \r
- ; Save the stack pointer in pxTopOfStack.\r
- mov.l r15, @r0\r
-\r
- .endm\r
-\r
-;-----------------------------------------------------------\r
-\r
- .macro portRESTORE_CONTEXT\r
-\r
- ; Get the address of the pxCurrentTCB variable.\r
- mov.l #_pxCurrentTCB, r0\r
-\r
- ; Get the address of the task stack from pxCurrentTCB.\r
- mov.l @r0, r0\r
-\r
- ; Get the task stack itself into the stack pointer. \r
- mov.l @r0, r15 \r
-\r
- ; Restore system registers.\r
- ldc.l @r15+, gbr\r
- lds.l @r15+, mach\r
- lds.l @r15+, macl\r
-\r
- ; Restore r0 to r14 and PR\r
- movml.l @r15+, r15\r
- \r
- ; Pop the SR and PC to jump to the start of the task.\r
- rte\r
- nop\r
-\r
- .endm\r
-;-----------------------------------------------------------\r
+ .INCLUDE "ISR_Support.inc"\r
\r
_vPortStartFirstTask:\r
\r
void vPortYield( void );\r
#define portYIELD() vPortYield()\r
\r
+extern void vTaskSwitchContext( void );\r
+#define portYIELD_FROM_ISR( x ) if( x != pdFALSE ) vTaskSwitchContext()\r
+\r
/* \r
* This function tells the kernel that the task referenced by xTask is going to \r
* use the floating point registers and therefore requires the floating point \r