--- /dev/null
+; FreeRTOS.org V5.1.1 - Copyright (C) 2003-2008 Richard Barry.\r
+;\r
+; This file is part of the FreeRTOS.org distribution.\r
+;\r
+; FreeRTOS.org is free software; you can redistribute it and/or modify\r
+; it under the terms of the GNU General Public License as published by\r
+; the Free Software Foundation; either version 2 of the License, or\r
+; (at your option) any later version.\r
+;\r
+; FreeRTOS.org is distributed in the hope that it will be useful,\r
+; but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\r
+; GNU General Public License for more details.\r
+;\r
+; You should have received a copy of the GNU General Public License\r
+; along with FreeRTOS.org; if not, write to the Free Software\r
+; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\r
+;\r
+; A special exception to the GPL can be applied should you wish to distribute\r
+; a combined work that includes FreeRTOS.org, without being obliged to provide\r
+; the source code for any proprietary components. See the licensing section\r
+; of http://www.FreeRTOS.org for full details of how and when the exception\r
+; can be applied.\r
+;\r
+; ***************************************************************************\r
+; See http://www.FreeRTOS.org for documentation, latest information, license\r
+; and contact details. Please ensure to read the configuration and relevant\r
+; port sections of the online documentation.\r
+; ***************************************************************************\r
+;\r
+;------------------------------------------------------------------------------\r
+\r
+#include "FreeRTOSConfig.h"\r
+\r
+; Variables used by scheduler\r
+;------------------------------------------------------------------------------\r
+ EXTERN pxCurrentTCB\r
+ EXTERN usCriticalNesting\r
+\r
+;------------------------------------------------------------------------------\r
+; portSAVE_CONTEXT MACRO\r
+; Saves the context of the remaining general purpose registers, CS and ES\r
+; (only in far memory mode) registers\r
+; the usCriticalNesting Value and the Stack Pointer\r
+; of the active Task onto the task stack\r
+;------------------------------------------------------------------------------\r
+portSAVE_CONTEXT MACRO\r
+\r
+ PUSH AX ; save AX Register to stack\r
+ PUSH HL\r
+#if configMEMORY_MODE == 1\r
+ MOV A, CS ; save CS register\r
+ XCH A, X\r
+ MOV A, ES ; save ES register\r
+ PUSH AX\r
+#else\r
+ MOV A, CS ; save CS register\r
+ PUSH AX\r
+#endif\r
+ PUSH DE ; save the remaining general purpose registers\r
+ PUSH BC\r
+ MOVW AX, usCriticalNesting ; save the usCriticalNesting value \r
+ PUSH AX \r
+ MOVW AX, pxCurrentTCB ; save the Stack pointer \r
+ MOVW HL, AX \r
+ MOVW AX, SP \r
+ MOVW [HL], AX \r
+ ENDM\r
+;------------------------------------------------------------------------------\r
+\r
+;------------------------------------------------------------------------------\r
+; portRESTORE_CONTEXT MACRO\r
+; Restores the context of the Stack Pointer, usCriticalNesting\r
+; value, general purpose registers and the CS and ES (only in far memory mode)\r
+; of the selected task from the task stack\r
+;------------------------------------------------------------------------------\r
+\r
+portRESTORE_CONTEXT MACRO\r
+ MOVW AX, pxCurrentTCB ; restore the Stack pointer\r
+ MOVW HL, AX\r
+ MOVW AX, [HL]\r
+ MOVW SP, AX\r
+ POP AX ; restore usCriticalNesting value\r
+ MOVW usCriticalNesting, AX\r
+ POP BC ; restore the necessary general purpose registers\r
+ POP DE\r
+#if configMEMORY_MODE == 1\r
+ POP AX ; restore the ES register\r
+ MOV ES, A\r
+ XCH A, X ; restore the CS register\r
+ MOV CS, A\r
+#else\r
+ POP AX\r
+ MOV CS, A ; restore CS register\r
+#endif\r
+ POP HL ; restore general purpose register HL\r
+ POP AX ; restore AX \r
+ ENDM\r
+;------------------------------------------------------------------------------\r
; ***************************************************************************\r
;\r
;------------------------------------------------------------------------------\r
-; Note: Select the correct include files for the device used by the application.\r
-#include "FreeRTOSConfig.h"\r
+#include "ISR_Support.h"\r
;------------------------------------------------------------------------------\r
\r
#if __CORE__ != __78K0R__\r
EXTERN vTaskSwitchContext\r
EXTERN vTaskIncrementTick\r
\r
-; Variables used by scheduler\r
-;------------------------------------------------------------------------------\r
- EXTERN pxCurrentTCB\r
- EXTERN usCriticalNesting\r
-\r
-\r
; Tick ISR Prototype\r
;------------------------------------------------------------------------------\r
EXTERN ?CL78K0R_V2_L00\r
`??MD_INTTM05??INTVEC 68` SYMBOL "??INTVEC 68", MD_INTTM05\r
\r
\r
-;------------------------------------------------------------------------------\r
-; portSAVE_CONTEXT MACRO\r
-; Saves the context of the remaining general purpose registers, CS and ES\r
-; (only in far memory mode) registers\r
-; the usCriticalNesting Value and the Stack Pointer\r
-; of the active Task onto the task stack\r
-;------------------------------------------------------------------------------\r
-portSAVE_CONTEXT MACRO\r
-\r
- PUSH AX ; save AX Register to stack\r
- PUSH HL\r
-#if configMEMORY_MODE == 1\r
- MOV A, CS ; save CS register\r
- XCH A, X\r
- MOV A, ES ; save ES register\r
- PUSH AX\r
-#else\r
- MOV A, CS ; save CS register\r
- PUSH AX\r
-#endif\r
- PUSH DE ; save the remaining general purpose registers\r
- PUSH BC\r
- MOVW AX, usCriticalNesting ; save the usCriticalNesting value \r
- PUSH AX \r
- MOVW AX, pxCurrentTCB ; save the Stack pointer \r
- MOVW HL, AX \r
- MOVW AX, SP \r
- MOVW [HL], AX \r
- ENDM\r
-;------------------------------------------------------------------------------\r
-\r
-;------------------------------------------------------------------------------\r
-; portRESTORE_CONTEXT MACRO\r
-; Restores the context of the Stack Pointer, usCriticalNesting\r
-; value, general purpose registers and the CS and ES (only in far memory mode)\r
-; of the selected task from the task stack\r
-;------------------------------------------------------------------------------\r
-\r
-portRESTORE_CONTEXT MACRO\r
- MOVW AX, pxCurrentTCB ; restore the Stack pointer\r
- MOVW HL, AX\r
- MOVW AX, [HL]\r
- MOVW SP, AX\r
- POP AX ; restore usCriticalNesting value\r
- MOVW usCriticalNesting, AX\r
- POP BC ; restore the necessary general purpose registers\r
- POP DE\r
-#if configMEMORY_MODE == 1\r
- POP AX ; restore the ES register\r
- MOV ES, A\r
- XCH A, X ; restore the CS register\r
- MOV CS, A\r
-#else\r
- POP AX\r
- MOV CS, A ; restore CS register\r
-#endif\r
- POP HL ; restore general purpose register HL\r
- POP AX ; restore AX \r
- ENDM\r
-;------------------------------------------------------------------------------\r
\r
;------------------------------------------------------------------------------\r
; Port Yield function to check for a Task switch in the cooperative mode\r