]> git.sur5r.net Git - freertos/commitdiff
Continue 78K0R development.
authorRichardBarry <RichardBarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Wed, 4 Feb 2009 13:08:12 +0000 (13:08 +0000)
committerRichardBarry <RichardBarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Wed, 4 Feb 2009 13:08:12 +0000 (13:08 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@673 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Source/portable/IAR/78K0R/ISR_Support.h [new file with mode: 0644]
Source/portable/IAR/78K0R/portasm.s26
Source/portable/IAR/78K0R/portmacro.h

diff --git a/Source/portable/IAR/78K0R/ISR_Support.h b/Source/portable/IAR/78K0R/ISR_Support.h
new file mode 100644 (file)
index 0000000..6b291cc
--- /dev/null
@@ -0,0 +1,99 @@
+;      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
index 62206ed5c059c452c7a0548716278b156698ffb3..2bb46e1ccb0cec034266dc0f36976597d19fa4a1 100644 (file)
@@ -29,8 +29,7 @@
 ;      ***************************************************************************\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
@@ -68,66 +61,6 @@ MD_INTTM05    SYMBOL "MD_INTTM05"
 `??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
index 08d68cf23a31e3ec1660e02df73e5f34623ab44d..1255ff6d5e04fc43f23cc947af9e06bf82b8046d 100644 (file)
@@ -124,9 +124,8 @@ extern volatile unsigned portSHORT usCriticalNesting;                                                       \
 \r
 /* Task utilities. */\r
 extern void vPortStart( void );\r
-extern void portSAVE_CONTEXT( void );\r
-extern void portRESTORE_CONTEXT( void );\r
 #define portYIELD()    __asm( "BRK" )\r
+#define portYIELD_FROM_ISR( xHigherPriorityTaskWoken ) if( xHigherPriorityTaskWoken ) vTaskSwitchContext()\r
 #define portNOP()      __asm( "NOP" )\r
 /*-----------------------------------------------------------*/\r
 \r