fork
Fork of mbed-rtos by
rtx/TARGET_CORTEX_M/TARGET_M4/TOOLCHAIN_ARM/HAL_CM4.c@49:77c8e4604045, 2014-11-06 (annotated)
- Committer:
- mbed_official
- Date:
- Thu Nov 06 13:00:11 2014 +0000
- Revision:
- 49:77c8e4604045
Synchronized with git revision 7b90c2ba137baaf9769219e0e8a7b8e8d1299c4f
Full URL: https://github.com/mbedmicro/mbed/commit/7b90c2ba137baaf9769219e0e8a7b8e8d1299c4f/
This target is not yet tested, so it can't be released as part of the official
SDK build for now.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_official | 49:77c8e4604045 | 1 | /*---------------------------------------------------------------------------- |
mbed_official | 49:77c8e4604045 | 2 | * RL-ARM - RTX |
mbed_official | 49:77c8e4604045 | 3 | *---------------------------------------------------------------------------- |
mbed_official | 49:77c8e4604045 | 4 | * Name: HAL_CM4.C |
mbed_official | 49:77c8e4604045 | 5 | * Purpose: Hardware Abstraction Layer for Cortex-M4 |
mbed_official | 49:77c8e4604045 | 6 | * Rev.: V4.70 |
mbed_official | 49:77c8e4604045 | 7 | *---------------------------------------------------------------------------- |
mbed_official | 49:77c8e4604045 | 8 | * |
mbed_official | 49:77c8e4604045 | 9 | * Copyright (c) 1999-2009 KEIL, 2009-2013 ARM Germany GmbH |
mbed_official | 49:77c8e4604045 | 10 | * All rights reserved. |
mbed_official | 49:77c8e4604045 | 11 | * Redistribution and use in source and binary forms, with or without |
mbed_official | 49:77c8e4604045 | 12 | * modification, are permitted provided that the following conditions are met: |
mbed_official | 49:77c8e4604045 | 13 | * - Redistributions of source code must retain the above copyright |
mbed_official | 49:77c8e4604045 | 14 | * notice, this list of conditions and the following disclaimer. |
mbed_official | 49:77c8e4604045 | 15 | * - Redistributions in binary form must reproduce the above copyright |
mbed_official | 49:77c8e4604045 | 16 | * notice, this list of conditions and the following disclaimer in the |
mbed_official | 49:77c8e4604045 | 17 | * documentation and/or other materials provided with the distribution. |
mbed_official | 49:77c8e4604045 | 18 | * - Neither the name of ARM nor the names of its contributors may be used |
mbed_official | 49:77c8e4604045 | 19 | * to endorse or promote products derived from this software without |
mbed_official | 49:77c8e4604045 | 20 | * specific prior written permission. |
mbed_official | 49:77c8e4604045 | 21 | * |
mbed_official | 49:77c8e4604045 | 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mbed_official | 49:77c8e4604045 | 23 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mbed_official | 49:77c8e4604045 | 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
mbed_official | 49:77c8e4604045 | 25 | * ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE |
mbed_official | 49:77c8e4604045 | 26 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
mbed_official | 49:77c8e4604045 | 27 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
mbed_official | 49:77c8e4604045 | 28 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
mbed_official | 49:77c8e4604045 | 29 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
mbed_official | 49:77c8e4604045 | 30 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
mbed_official | 49:77c8e4604045 | 31 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
mbed_official | 49:77c8e4604045 | 32 | * POSSIBILITY OF SUCH DAMAGE. |
mbed_official | 49:77c8e4604045 | 33 | *---------------------------------------------------------------------------*/ |
mbed_official | 49:77c8e4604045 | 34 | |
mbed_official | 49:77c8e4604045 | 35 | #include "rt_TypeDef.h" |
mbed_official | 49:77c8e4604045 | 36 | #include "RTX_Conf.h" |
mbed_official | 49:77c8e4604045 | 37 | #include "rt_System.h" |
mbed_official | 49:77c8e4604045 | 38 | #include "rt_HAL_CM.h" |
mbed_official | 49:77c8e4604045 | 39 | #include "rt_Task.h" |
mbed_official | 49:77c8e4604045 | 40 | #include "rt_MemBox.h" |
mbed_official | 49:77c8e4604045 | 41 | |
mbed_official | 49:77c8e4604045 | 42 | |
mbed_official | 49:77c8e4604045 | 43 | /*---------------------------------------------------------------------------- |
mbed_official | 49:77c8e4604045 | 44 | * Functions |
mbed_official | 49:77c8e4604045 | 45 | *---------------------------------------------------------------------------*/ |
mbed_official | 49:77c8e4604045 | 46 | |
mbed_official | 49:77c8e4604045 | 47 | |
mbed_official | 49:77c8e4604045 | 48 | /*--------------------------- rt_set_PSP ------------------------------------*/ |
mbed_official | 49:77c8e4604045 | 49 | |
mbed_official | 49:77c8e4604045 | 50 | __asm void rt_set_PSP (U32 stack) { |
mbed_official | 49:77c8e4604045 | 51 | MSR PSP,R0 |
mbed_official | 49:77c8e4604045 | 52 | BX LR |
mbed_official | 49:77c8e4604045 | 53 | } |
mbed_official | 49:77c8e4604045 | 54 | |
mbed_official | 49:77c8e4604045 | 55 | |
mbed_official | 49:77c8e4604045 | 56 | /*--------------------------- rt_get_PSP ------------------------------------*/ |
mbed_official | 49:77c8e4604045 | 57 | |
mbed_official | 49:77c8e4604045 | 58 | __asm U32 rt_get_PSP (void) { |
mbed_official | 49:77c8e4604045 | 59 | MRS R0,PSP |
mbed_official | 49:77c8e4604045 | 60 | BX LR |
mbed_official | 49:77c8e4604045 | 61 | } |
mbed_official | 49:77c8e4604045 | 62 | |
mbed_official | 49:77c8e4604045 | 63 | |
mbed_official | 49:77c8e4604045 | 64 | /*--------------------------- os_set_env ------------------------------------*/ |
mbed_official | 49:77c8e4604045 | 65 | |
mbed_official | 49:77c8e4604045 | 66 | __asm void os_set_env (void) { |
mbed_official | 49:77c8e4604045 | 67 | /* Switch to Unprivileged/Privileged Thread mode, use PSP. */ |
mbed_official | 49:77c8e4604045 | 68 | MOV R0,SP ; PSP = MSP |
mbed_official | 49:77c8e4604045 | 69 | MSR PSP,R0 |
mbed_official | 49:77c8e4604045 | 70 | LDR R0,=__cpp(&os_flags) |
mbed_official | 49:77c8e4604045 | 71 | LDRB R0,[R0] |
mbed_official | 49:77c8e4604045 | 72 | LSLS R0,#31 |
mbed_official | 49:77c8e4604045 | 73 | MOVNE R0,#0x02 ; Privileged Thread mode, use PSP |
mbed_official | 49:77c8e4604045 | 74 | MOVEQ R0,#0x03 ; Unprivileged Thread mode, use PSP |
mbed_official | 49:77c8e4604045 | 75 | MSR CONTROL,R0 |
mbed_official | 49:77c8e4604045 | 76 | BX LR |
mbed_official | 49:77c8e4604045 | 77 | |
mbed_official | 49:77c8e4604045 | 78 | ALIGN |
mbed_official | 49:77c8e4604045 | 79 | } |
mbed_official | 49:77c8e4604045 | 80 | |
mbed_official | 49:77c8e4604045 | 81 | |
mbed_official | 49:77c8e4604045 | 82 | /*--------------------------- _alloc_box ------------------------------------*/ |
mbed_official | 49:77c8e4604045 | 83 | |
mbed_official | 49:77c8e4604045 | 84 | __asm void *_alloc_box (void *box_mem) { |
mbed_official | 49:77c8e4604045 | 85 | /* Function wrapper for Unprivileged/Privileged mode. */ |
mbed_official | 49:77c8e4604045 | 86 | LDR R12,=__cpp(rt_alloc_box) |
mbed_official | 49:77c8e4604045 | 87 | MRS R3,IPSR |
mbed_official | 49:77c8e4604045 | 88 | LSLS R3,#24 |
mbed_official | 49:77c8e4604045 | 89 | BXNE R12 |
mbed_official | 49:77c8e4604045 | 90 | MRS R3,CONTROL |
mbed_official | 49:77c8e4604045 | 91 | LSLS R3,#31 |
mbed_official | 49:77c8e4604045 | 92 | BXEQ R12 |
mbed_official | 49:77c8e4604045 | 93 | SVC 0 |
mbed_official | 49:77c8e4604045 | 94 | BX LR |
mbed_official | 49:77c8e4604045 | 95 | |
mbed_official | 49:77c8e4604045 | 96 | ALIGN |
mbed_official | 49:77c8e4604045 | 97 | } |
mbed_official | 49:77c8e4604045 | 98 | |
mbed_official | 49:77c8e4604045 | 99 | |
mbed_official | 49:77c8e4604045 | 100 | /*--------------------------- _free_box -------------------------------------*/ |
mbed_official | 49:77c8e4604045 | 101 | |
mbed_official | 49:77c8e4604045 | 102 | __asm int _free_box (void *box_mem, void *box) { |
mbed_official | 49:77c8e4604045 | 103 | /* Function wrapper for Unprivileged/Privileged mode. */ |
mbed_official | 49:77c8e4604045 | 104 | LDR R12,=__cpp(rt_free_box) |
mbed_official | 49:77c8e4604045 | 105 | MRS R3,IPSR |
mbed_official | 49:77c8e4604045 | 106 | LSLS R3,#24 |
mbed_official | 49:77c8e4604045 | 107 | BXNE R12 |
mbed_official | 49:77c8e4604045 | 108 | MRS R3,CONTROL |
mbed_official | 49:77c8e4604045 | 109 | LSLS R3,#31 |
mbed_official | 49:77c8e4604045 | 110 | BXEQ R12 |
mbed_official | 49:77c8e4604045 | 111 | SVC 0 |
mbed_official | 49:77c8e4604045 | 112 | BX LR |
mbed_official | 49:77c8e4604045 | 113 | |
mbed_official | 49:77c8e4604045 | 114 | ALIGN |
mbed_official | 49:77c8e4604045 | 115 | } |
mbed_official | 49:77c8e4604045 | 116 | |
mbed_official | 49:77c8e4604045 | 117 | |
mbed_official | 49:77c8e4604045 | 118 | /*-------------------------- SVC_Handler ------------------------------------*/ |
mbed_official | 49:77c8e4604045 | 119 | |
mbed_official | 49:77c8e4604045 | 120 | __asm void SVC_Handler (void) { |
mbed_official | 49:77c8e4604045 | 121 | PRESERVE8 |
mbed_official | 49:77c8e4604045 | 122 | |
mbed_official | 49:77c8e4604045 | 123 | IMPORT SVC_Count |
mbed_official | 49:77c8e4604045 | 124 | IMPORT SVC_Table |
mbed_official | 49:77c8e4604045 | 125 | IMPORT rt_stk_check |
mbed_official | 49:77c8e4604045 | 126 | |
mbed_official | 49:77c8e4604045 | 127 | #ifdef IFX_XMC4XXX |
mbed_official | 49:77c8e4604045 | 128 | EXPORT SVC_Handler_Veneer |
mbed_official | 49:77c8e4604045 | 129 | SVC_Handler_Veneer |
mbed_official | 49:77c8e4604045 | 130 | #endif |
mbed_official | 49:77c8e4604045 | 131 | |
mbed_official | 49:77c8e4604045 | 132 | MRS R0,PSP ; Read PSP |
mbed_official | 49:77c8e4604045 | 133 | LDR R1,[R0,#24] ; Read Saved PC from Stack |
mbed_official | 49:77c8e4604045 | 134 | LDRB R1,[R1,#-2] ; Load SVC Number |
mbed_official | 49:77c8e4604045 | 135 | CBNZ R1,SVC_User |
mbed_official | 49:77c8e4604045 | 136 | |
mbed_official | 49:77c8e4604045 | 137 | LDM R0,{R0-R3,R12} ; Read R0-R3,R12 from stack |
mbed_official | 49:77c8e4604045 | 138 | PUSH {R4,LR} ; Save EXC_RETURN |
mbed_official | 49:77c8e4604045 | 139 | BLX R12 ; Call SVC Function |
mbed_official | 49:77c8e4604045 | 140 | POP {R4,LR} ; Restore EXC_RETURN |
mbed_official | 49:77c8e4604045 | 141 | |
mbed_official | 49:77c8e4604045 | 142 | MRS R12,PSP ; Read PSP |
mbed_official | 49:77c8e4604045 | 143 | STM R12,{R0-R2} ; Store return values |
mbed_official | 49:77c8e4604045 | 144 | |
mbed_official | 49:77c8e4604045 | 145 | LDR R3,=__cpp(&os_tsk) |
mbed_official | 49:77c8e4604045 | 146 | LDM R3,{R1,R2} ; os_tsk.run, os_tsk.new |
mbed_official | 49:77c8e4604045 | 147 | CMP R1,R2 |
mbed_official | 49:77c8e4604045 | 148 | #ifdef IFX_XMC4XXX |
mbed_official | 49:77c8e4604045 | 149 | PUSHEQ {LR} |
mbed_official | 49:77c8e4604045 | 150 | POPEQ {PC} |
mbed_official | 49:77c8e4604045 | 151 | #else |
mbed_official | 49:77c8e4604045 | 152 | BXEQ LR ; RETI, no task switch |
mbed_official | 49:77c8e4604045 | 153 | #endif |
mbed_official | 49:77c8e4604045 | 154 | |
mbed_official | 49:77c8e4604045 | 155 | CBZ R1,SVC_Next ; Runtask deleted? |
mbed_official | 49:77c8e4604045 | 156 | TST LR,#0x10 ; is it extended frame? |
mbed_official | 49:77c8e4604045 | 157 | VSTMDBEQ R12!,{S16-S31} ; yes, stack also VFP hi-regs |
mbed_official | 49:77c8e4604045 | 158 | MOVEQ R0,#0x01 ; os_tsk->stack_frame val |
mbed_official | 49:77c8e4604045 | 159 | MOVNE R0,#0x00 |
mbed_official | 49:77c8e4604045 | 160 | STRB R0,[R1,#TCB_STACKF] ; os_tsk.run->stack_frame = val |
mbed_official | 49:77c8e4604045 | 161 | STMDB R12!,{R4-R11} ; Save Old context |
mbed_official | 49:77c8e4604045 | 162 | STR R12,[R1,#TCB_TSTACK] ; Update os_tsk.run->tsk_stack |
mbed_official | 49:77c8e4604045 | 163 | |
mbed_official | 49:77c8e4604045 | 164 | PUSH {R2,R3} |
mbed_official | 49:77c8e4604045 | 165 | BL rt_stk_check ; Check for Stack overflow |
mbed_official | 49:77c8e4604045 | 166 | POP {R2,R3} |
mbed_official | 49:77c8e4604045 | 167 | |
mbed_official | 49:77c8e4604045 | 168 | SVC_Next |
mbed_official | 49:77c8e4604045 | 169 | STR R2,[R3] ; os_tsk.run = os_tsk.new |
mbed_official | 49:77c8e4604045 | 170 | |
mbed_official | 49:77c8e4604045 | 171 | LDR R12,[R2,#TCB_TSTACK] ; os_tsk.new->tsk_stack |
mbed_official | 49:77c8e4604045 | 172 | LDMIA R12!,{R4-R11} ; Restore New Context |
mbed_official | 49:77c8e4604045 | 173 | LDRB R0,[R2,#TCB_STACKF] ; Stack Frame |
mbed_official | 49:77c8e4604045 | 174 | CMP R0,#0 ; Basic/Extended Stack Frame |
mbed_official | 49:77c8e4604045 | 175 | VLDMIANE R12!,{S16-S31} ; restore VFP hi-registers |
mbed_official | 49:77c8e4604045 | 176 | MVNNE LR,#:NOT:0xFFFFFFED ; set EXC_RETURN value |
mbed_official | 49:77c8e4604045 | 177 | MVNEQ LR,#:NOT:0xFFFFFFFD |
mbed_official | 49:77c8e4604045 | 178 | MSR PSP,R12 ; Write PSP |
mbed_official | 49:77c8e4604045 | 179 | |
mbed_official | 49:77c8e4604045 | 180 | SVC_Exit |
mbed_official | 49:77c8e4604045 | 181 | #ifdef IFX_XMC4XXX |
mbed_official | 49:77c8e4604045 | 182 | PUSH {LR} |
mbed_official | 49:77c8e4604045 | 183 | POP {PC} |
mbed_official | 49:77c8e4604045 | 184 | #else |
mbed_official | 49:77c8e4604045 | 185 | BX LR |
mbed_official | 49:77c8e4604045 | 186 | #endif |
mbed_official | 49:77c8e4604045 | 187 | |
mbed_official | 49:77c8e4604045 | 188 | /*------------------- User SVC ------------------------------*/ |
mbed_official | 49:77c8e4604045 | 189 | |
mbed_official | 49:77c8e4604045 | 190 | SVC_User |
mbed_official | 49:77c8e4604045 | 191 | PUSH {R4,LR} ; Save Registers |
mbed_official | 49:77c8e4604045 | 192 | LDR R2,=SVC_Count |
mbed_official | 49:77c8e4604045 | 193 | LDR R2,[R2] |
mbed_official | 49:77c8e4604045 | 194 | CMP R1,R2 |
mbed_official | 49:77c8e4604045 | 195 | BHI SVC_Done ; Overflow |
mbed_official | 49:77c8e4604045 | 196 | |
mbed_official | 49:77c8e4604045 | 197 | LDR R4,=SVC_Table-4 |
mbed_official | 49:77c8e4604045 | 198 | LDR R4,[R4,R1,LSL #2] ; Load SVC Function Address |
mbed_official | 49:77c8e4604045 | 199 | |
mbed_official | 49:77c8e4604045 | 200 | LDM R0,{R0-R3,R12} ; Read R0-R3,R12 from stack |
mbed_official | 49:77c8e4604045 | 201 | BLX R4 ; Call SVC Function |
mbed_official | 49:77c8e4604045 | 202 | |
mbed_official | 49:77c8e4604045 | 203 | MRS R12,PSP |
mbed_official | 49:77c8e4604045 | 204 | STM R12,{R0-R3} ; Function return values |
mbed_official | 49:77c8e4604045 | 205 | SVC_Done |
mbed_official | 49:77c8e4604045 | 206 | POP {R4,PC} ; RETI |
mbed_official | 49:77c8e4604045 | 207 | |
mbed_official | 49:77c8e4604045 | 208 | ALIGN |
mbed_official | 49:77c8e4604045 | 209 | } |
mbed_official | 49:77c8e4604045 | 210 | |
mbed_official | 49:77c8e4604045 | 211 | |
mbed_official | 49:77c8e4604045 | 212 | /*-------------------------- PendSV_Handler ---------------------------------*/ |
mbed_official | 49:77c8e4604045 | 213 | |
mbed_official | 49:77c8e4604045 | 214 | __asm void PendSV_Handler (void) { |
mbed_official | 49:77c8e4604045 | 215 | PRESERVE8 |
mbed_official | 49:77c8e4604045 | 216 | |
mbed_official | 49:77c8e4604045 | 217 | #ifdef IFX_XMC4XXX |
mbed_official | 49:77c8e4604045 | 218 | EXPORT PendSV_Handler_Veneer |
mbed_official | 49:77c8e4604045 | 219 | PendSV_Handler_Veneer |
mbed_official | 49:77c8e4604045 | 220 | #endif |
mbed_official | 49:77c8e4604045 | 221 | |
mbed_official | 49:77c8e4604045 | 222 | PUSH {R4,LR} ; Save EXC_RETURN |
mbed_official | 49:77c8e4604045 | 223 | BL __cpp(rt_pop_req) |
mbed_official | 49:77c8e4604045 | 224 | |
mbed_official | 49:77c8e4604045 | 225 | Sys_Switch |
mbed_official | 49:77c8e4604045 | 226 | POP {R4,LR} ; Restore EXC_RETURN |
mbed_official | 49:77c8e4604045 | 227 | |
mbed_official | 49:77c8e4604045 | 228 | LDR R3,=__cpp(&os_tsk) |
mbed_official | 49:77c8e4604045 | 229 | LDM R3,{R1,R2} ; os_tsk.run, os_tsk.new |
mbed_official | 49:77c8e4604045 | 230 | CMP R1,R2 |
mbed_official | 49:77c8e4604045 | 231 | #ifdef IFX_XMC4XXX |
mbed_official | 49:77c8e4604045 | 232 | PUSHEQ {LR} |
mbed_official | 49:77c8e4604045 | 233 | POPEQ {PC} |
mbed_official | 49:77c8e4604045 | 234 | #else |
mbed_official | 49:77c8e4604045 | 235 | BXEQ LR ; RETI, no task switch |
mbed_official | 49:77c8e4604045 | 236 | #endif |
mbed_official | 49:77c8e4604045 | 237 | |
mbed_official | 49:77c8e4604045 | 238 | MRS R12,PSP ; Read PSP |
mbed_official | 49:77c8e4604045 | 239 | TST LR,#0x10 ; is it extended frame? |
mbed_official | 49:77c8e4604045 | 240 | VSTMDBEQ R12!,{S16-S31} ; yes, stack also VFP hi-regs |
mbed_official | 49:77c8e4604045 | 241 | MOVEQ R0,#0x01 ; os_tsk->stack_frame val |
mbed_official | 49:77c8e4604045 | 242 | MOVNE R0,#0x00 |
mbed_official | 49:77c8e4604045 | 243 | STRB R0,[R1,#TCB_STACKF] ; os_tsk.run->stack_frame = val |
mbed_official | 49:77c8e4604045 | 244 | STMDB R12!,{R4-R11} ; Save Old context |
mbed_official | 49:77c8e4604045 | 245 | STR R12,[R1,#TCB_TSTACK] ; Update os_tsk.run->tsk_stack |
mbed_official | 49:77c8e4604045 | 246 | |
mbed_official | 49:77c8e4604045 | 247 | PUSH {R2,R3} |
mbed_official | 49:77c8e4604045 | 248 | BL rt_stk_check ; Check for Stack overflow |
mbed_official | 49:77c8e4604045 | 249 | POP {R2,R3} |
mbed_official | 49:77c8e4604045 | 250 | |
mbed_official | 49:77c8e4604045 | 251 | STR R2,[R3] ; os_tsk.run = os_tsk.new |
mbed_official | 49:77c8e4604045 | 252 | |
mbed_official | 49:77c8e4604045 | 253 | LDR R12,[R2,#TCB_TSTACK] ; os_tsk.new->tsk_stack |
mbed_official | 49:77c8e4604045 | 254 | LDMIA R12!,{R4-R11} ; Restore New Context |
mbed_official | 49:77c8e4604045 | 255 | LDRB R0,[R2,#TCB_STACKF] ; Stack Frame |
mbed_official | 49:77c8e4604045 | 256 | CMP R0,#0 ; Basic/Extended Stack Frame |
mbed_official | 49:77c8e4604045 | 257 | VLDMIANE R12!,{S16-S31} ; restore VFP hi-regs |
mbed_official | 49:77c8e4604045 | 258 | MVNNE LR,#:NOT:0xFFFFFFED ; set EXC_RETURN value |
mbed_official | 49:77c8e4604045 | 259 | MVNEQ LR,#:NOT:0xFFFFFFFD |
mbed_official | 49:77c8e4604045 | 260 | MSR PSP,R12 ; Write PSP |
mbed_official | 49:77c8e4604045 | 261 | |
mbed_official | 49:77c8e4604045 | 262 | Sys_Exit |
mbed_official | 49:77c8e4604045 | 263 | #ifdef IFX_XMC4XXX |
mbed_official | 49:77c8e4604045 | 264 | PUSH {LR} |
mbed_official | 49:77c8e4604045 | 265 | POP {PC} |
mbed_official | 49:77c8e4604045 | 266 | #else |
mbed_official | 49:77c8e4604045 | 267 | BX LR ; Return to Thread Mode |
mbed_official | 49:77c8e4604045 | 268 | #endif |
mbed_official | 49:77c8e4604045 | 269 | |
mbed_official | 49:77c8e4604045 | 270 | ALIGN |
mbed_official | 49:77c8e4604045 | 271 | } |
mbed_official | 49:77c8e4604045 | 272 | |
mbed_official | 49:77c8e4604045 | 273 | |
mbed_official | 49:77c8e4604045 | 274 | /*-------------------------- SysTick_Handler --------------------------------*/ |
mbed_official | 49:77c8e4604045 | 275 | |
mbed_official | 49:77c8e4604045 | 276 | __asm void SysTick_Handler (void) { |
mbed_official | 49:77c8e4604045 | 277 | PRESERVE8 |
mbed_official | 49:77c8e4604045 | 278 | |
mbed_official | 49:77c8e4604045 | 279 | #ifdef IFX_XMC4XXX |
mbed_official | 49:77c8e4604045 | 280 | EXPORT SysTick_Handler_Veneer |
mbed_official | 49:77c8e4604045 | 281 | SysTick_Handler_Veneer |
mbed_official | 49:77c8e4604045 | 282 | #endif |
mbed_official | 49:77c8e4604045 | 283 | |
mbed_official | 49:77c8e4604045 | 284 | PUSH {R4,LR} ; Save EXC_RETURN |
mbed_official | 49:77c8e4604045 | 285 | BL __cpp(rt_systick) |
mbed_official | 49:77c8e4604045 | 286 | B Sys_Switch |
mbed_official | 49:77c8e4604045 | 287 | |
mbed_official | 49:77c8e4604045 | 288 | ALIGN |
mbed_official | 49:77c8e4604045 | 289 | } |
mbed_official | 49:77c8e4604045 | 290 | |
mbed_official | 49:77c8e4604045 | 291 | |
mbed_official | 49:77c8e4604045 | 292 | /*-------------------------- OS_Tick_Handler --------------------------------*/ |
mbed_official | 49:77c8e4604045 | 293 | |
mbed_official | 49:77c8e4604045 | 294 | __asm void OS_Tick_Handler (void) { |
mbed_official | 49:77c8e4604045 | 295 | PRESERVE8 |
mbed_official | 49:77c8e4604045 | 296 | |
mbed_official | 49:77c8e4604045 | 297 | PUSH {R4,LR} ; Save EXC_RETURN |
mbed_official | 49:77c8e4604045 | 298 | BL __cpp(os_tick_irqack) |
mbed_official | 49:77c8e4604045 | 299 | BL __cpp(rt_systick) |
mbed_official | 49:77c8e4604045 | 300 | B Sys_Switch |
mbed_official | 49:77c8e4604045 | 301 | |
mbed_official | 49:77c8e4604045 | 302 | ALIGN |
mbed_official | 49:77c8e4604045 | 303 | } |
mbed_official | 49:77c8e4604045 | 304 | |
mbed_official | 49:77c8e4604045 | 305 | |
mbed_official | 49:77c8e4604045 | 306 | /*---------------------------------------------------------------------------- |
mbed_official | 49:77c8e4604045 | 307 | * end of file |
mbed_official | 49:77c8e4604045 | 308 | *---------------------------------------------------------------------------*/ |
mbed_official | 49:77c8e4604045 | 309 |