2 ; * FreeRTOS Kernel V10.2.1
\r
3 ; * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
\r
5 ; * Permission is hereby granted, free of charge, to any person obtaining a copy of
\r
6 ; * this software and associated documentation files (the "Software"), to deal in
\r
7 ; * the Software without restriction, including without limitation the rights to
\r
8 ; * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
\r
9 ; * the Software, and to permit persons to whom the Software is furnished to do so,
\r
10 ; * subject to the following conditions:
\r
12 ; * The above copyright notice and this permission notice shall be included in all
\r
13 ; * copies or substantial portions of the Software.
\r
15 ; * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
16 ; * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
\r
17 ; * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
\r
18 ; * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
\r
19 ; * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
20 ; * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
22 ; * http://www.FreeRTOS.org
\r
23 ; * http://aws.amazon.com/freertos
\r
25 ; * 1 tab == 4 spaces!
\r
28 #include "ISR_Support.h"
\r
29 ;------------------------------------------------------------------------------
\r
31 #if __CORE__ != __78K0R__
\r
32 #error "This file is only for 78K0R Devices"
\r
38 ; Functions implemented in this file
\r
39 ;------------------------------------------------------------------------------
\r
43 ; Functions used by scheduler
\r
44 ;------------------------------------------------------------------------------
\r
45 EXTERN vTaskSwitchContext
\r
46 EXTERN xTaskIncrementTick
\r
48 ; Tick ISR Prototype
\r
49 ;------------------------------------------------------------------------------
\r
50 ; EXTERN ?CL78K0R_V2_L00
\r
52 PUBWEAK `??MD_INTTM05??INTVEC 68`
\r
55 MD_INTTM05 SYMBOL "MD_INTTM05"
\r
56 `??MD_INTTM05??INTVEC 68` SYMBOL "??INTVEC 68", MD_INTTM05
\r
60 ;------------------------------------------------------------------------------
\r
61 ; Yield to another task. Implemented as a software interrupt. The return
\r
62 ; address and PSW will have been saved to the stack automatically before
\r
67 ; Call: CALL vPortYield
\r
71 ;------------------------------------------------------------------------------
\r
74 portSAVE_CONTEXT ; Save the context of the current task.
\r
75 call vTaskSwitchContext ; Call the scheduler to select the next task.
\r
76 portRESTORE_CONTEXT ; Restore the context of the next task to run.
\r
80 ;------------------------------------------------------------------------------
\r
81 ; Restore the context of the first task that is going to run.
\r
85 ; Call: CALL vPortStart
\r
89 ;------------------------------------------------------------------------------
\r
92 portRESTORE_CONTEXT ; Restore the context of whichever task the ...
\r
93 reti ; An interrupt stack frame is used so the task
\r
94 ; is started using a RETI instruction.
\r
96 ;------------------------------------------------------------------------------
\r
97 ; Perform the necessary steps of the Tick Count Increment and Task Switch
\r
98 ; depending on the chosen kernel configuration
\r
106 ;------------------------------------------------------------------------------
\r
110 portSAVE_CONTEXT ; Save the context of the current task.
\r
111 call xTaskIncrementTick ; Call the timer tick function.
\r
112 #if configUSE_PREEMPTION == 1
\r
113 call vTaskSwitchContext ; Call the scheduler to select the next task.
\r
115 portRESTORE_CONTEXT ; Restore the context of the next task to run.
\r
120 ; REQUIRE ?CL78K0R_V2_L00
\r
121 COMMON INTVEC:CODE:ROOT(1) ; Set ISR location to the Interrupt vector table.
\r
123 `??MD_INTTM05??INTVEC 68`:
\r
126 COMMON INTVEC:CODE:ROOT(1) ; Set ISR location to the Interrupt vector table.
\r
128 `??vPortYield??INTVEC 126`:
\r
131 ; Set value for the usCriticalNesting.
\r
132 RSEG NEAR_ID:CONST:SORT:NOROOT(1)
\r
133 `?<Initializer for usCriticalNesting>`:
\r