Ethernet test for ECE 4180 and others to find your IP address and do a simple HTTP GET request over port 80.
Dependencies: mbed Socket lwip-eth lwip-sys lwip
mbed-rtos/rtx/LPC1768/GCC_ARM/HAL_CM3.s@0:e7ca326e76ee, 2013-04-04 (annotated)
- Committer:
- mkersh3
- Date:
- Thu Apr 04 05:26:09 2013 +0000
- Revision:
- 0:e7ca326e76ee
Ethernet Test for ECE4180 and others to find their IP Address and do a simple HTTP GET request over port 80.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mkersh3 | 0:e7ca326e76ee | 1 | /*---------------------------------------------------------------------------- |
mkersh3 | 0:e7ca326e76ee | 2 | * RL-ARM - RTX |
mkersh3 | 0:e7ca326e76ee | 3 | *---------------------------------------------------------------------------- |
mkersh3 | 0:e7ca326e76ee | 4 | * Name: HAL_CM3.S |
mkersh3 | 0:e7ca326e76ee | 5 | * Purpose: Hardware Abstraction Layer for Cortex-M3 |
mkersh3 | 0:e7ca326e76ee | 6 | * Rev.: V4.50 |
mkersh3 | 0:e7ca326e76ee | 7 | *---------------------------------------------------------------------------- |
mkersh3 | 0:e7ca326e76ee | 8 | * |
mkersh3 | 0:e7ca326e76ee | 9 | * Copyright (c) 1999-2009 KEIL, 2009-2012 ARM Germany GmbH |
mkersh3 | 0:e7ca326e76ee | 10 | * All rights reserved. |
mkersh3 | 0:e7ca326e76ee | 11 | * Redistribution and use in source and binary forms, with or without |
mkersh3 | 0:e7ca326e76ee | 12 | * modification, are permitted provided that the following conditions are met: |
mkersh3 | 0:e7ca326e76ee | 13 | * - Redistributions of source code must retain the above copyright |
mkersh3 | 0:e7ca326e76ee | 14 | * notice, this list of conditions and the following disclaimer. |
mkersh3 | 0:e7ca326e76ee | 15 | * - Redistributions in binary form must reproduce the above copyright |
mkersh3 | 0:e7ca326e76ee | 16 | * notice, this list of conditions and the following disclaimer in the |
mkersh3 | 0:e7ca326e76ee | 17 | * documentation and/or other materials provided with the distribution. |
mkersh3 | 0:e7ca326e76ee | 18 | * - Neither the name of ARM nor the names of its contributors may be used |
mkersh3 | 0:e7ca326e76ee | 19 | * to endorse or promote products derived from this software without |
mkersh3 | 0:e7ca326e76ee | 20 | * specific prior written permission. |
mkersh3 | 0:e7ca326e76ee | 21 | * |
mkersh3 | 0:e7ca326e76ee | 22 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
mkersh3 | 0:e7ca326e76ee | 23 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
mkersh3 | 0:e7ca326e76ee | 24 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
mkersh3 | 0:e7ca326e76ee | 25 | * ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE |
mkersh3 | 0:e7ca326e76ee | 26 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
mkersh3 | 0:e7ca326e76ee | 27 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
mkersh3 | 0:e7ca326e76ee | 28 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
mkersh3 | 0:e7ca326e76ee | 29 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
mkersh3 | 0:e7ca326e76ee | 30 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
mkersh3 | 0:e7ca326e76ee | 31 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
mkersh3 | 0:e7ca326e76ee | 32 | * POSSIBILITY OF SUCH DAMAGE. |
mkersh3 | 0:e7ca326e76ee | 33 | *---------------------------------------------------------------------------*/ |
mkersh3 | 0:e7ca326e76ee | 34 | |
mkersh3 | 0:e7ca326e76ee | 35 | .file "HAL_CM3.S" |
mkersh3 | 0:e7ca326e76ee | 36 | .syntax unified |
mkersh3 | 0:e7ca326e76ee | 37 | |
mkersh3 | 0:e7ca326e76ee | 38 | .equ TCB_TSTACK, 36 |
mkersh3 | 0:e7ca326e76ee | 39 | |
mkersh3 | 0:e7ca326e76ee | 40 | |
mkersh3 | 0:e7ca326e76ee | 41 | /*---------------------------------------------------------------------------- |
mkersh3 | 0:e7ca326e76ee | 42 | * Functions |
mkersh3 | 0:e7ca326e76ee | 43 | *---------------------------------------------------------------------------*/ |
mkersh3 | 0:e7ca326e76ee | 44 | |
mkersh3 | 0:e7ca326e76ee | 45 | .thumb |
mkersh3 | 0:e7ca326e76ee | 46 | |
mkersh3 | 0:e7ca326e76ee | 47 | .section ".text" |
mkersh3 | 0:e7ca326e76ee | 48 | .align 2 |
mkersh3 | 0:e7ca326e76ee | 49 | |
mkersh3 | 0:e7ca326e76ee | 50 | |
mkersh3 | 0:e7ca326e76ee | 51 | /*--------------------------- rt_set_PSP ------------------------------------*/ |
mkersh3 | 0:e7ca326e76ee | 52 | |
mkersh3 | 0:e7ca326e76ee | 53 | # void rt_set_PSP (U32 stack); |
mkersh3 | 0:e7ca326e76ee | 54 | |
mkersh3 | 0:e7ca326e76ee | 55 | .thumb_func |
mkersh3 | 0:e7ca326e76ee | 56 | .type rt_set_PSP, %function |
mkersh3 | 0:e7ca326e76ee | 57 | .global rt_set_PSP |
mkersh3 | 0:e7ca326e76ee | 58 | rt_set_PSP: |
mkersh3 | 0:e7ca326e76ee | 59 | .fnstart |
mkersh3 | 0:e7ca326e76ee | 60 | .cantunwind |
mkersh3 | 0:e7ca326e76ee | 61 | |
mkersh3 | 0:e7ca326e76ee | 62 | MSR PSP,R0 |
mkersh3 | 0:e7ca326e76ee | 63 | BX LR |
mkersh3 | 0:e7ca326e76ee | 64 | |
mkersh3 | 0:e7ca326e76ee | 65 | .fnend |
mkersh3 | 0:e7ca326e76ee | 66 | .size rt_set_PSP, .-rt_set_PSP |
mkersh3 | 0:e7ca326e76ee | 67 | |
mkersh3 | 0:e7ca326e76ee | 68 | |
mkersh3 | 0:e7ca326e76ee | 69 | /*--------------------------- rt_get_PSP ------------------------------------*/ |
mkersh3 | 0:e7ca326e76ee | 70 | |
mkersh3 | 0:e7ca326e76ee | 71 | # U32 rt_get_PSP (void); |
mkersh3 | 0:e7ca326e76ee | 72 | |
mkersh3 | 0:e7ca326e76ee | 73 | .thumb_func |
mkersh3 | 0:e7ca326e76ee | 74 | .type rt_get_PSP, %function |
mkersh3 | 0:e7ca326e76ee | 75 | .global rt_get_PSP |
mkersh3 | 0:e7ca326e76ee | 76 | rt_get_PSP: |
mkersh3 | 0:e7ca326e76ee | 77 | .fnstart |
mkersh3 | 0:e7ca326e76ee | 78 | .cantunwind |
mkersh3 | 0:e7ca326e76ee | 79 | |
mkersh3 | 0:e7ca326e76ee | 80 | MRS R0,PSP |
mkersh3 | 0:e7ca326e76ee | 81 | BX LR |
mkersh3 | 0:e7ca326e76ee | 82 | |
mkersh3 | 0:e7ca326e76ee | 83 | .fnend |
mkersh3 | 0:e7ca326e76ee | 84 | .size rt_get_PSP, .-rt_get_PSP |
mkersh3 | 0:e7ca326e76ee | 85 | |
mkersh3 | 0:e7ca326e76ee | 86 | |
mkersh3 | 0:e7ca326e76ee | 87 | /*--------------------------- os_set_env ------------------------------------*/ |
mkersh3 | 0:e7ca326e76ee | 88 | |
mkersh3 | 0:e7ca326e76ee | 89 | # void os_set_env (void); |
mkersh3 | 0:e7ca326e76ee | 90 | /* Switch to Unprivileged/Privileged Thread mode, use PSP. */ |
mkersh3 | 0:e7ca326e76ee | 91 | |
mkersh3 | 0:e7ca326e76ee | 92 | .thumb_func |
mkersh3 | 0:e7ca326e76ee | 93 | .type os_set_env, %function |
mkersh3 | 0:e7ca326e76ee | 94 | .global os_set_env |
mkersh3 | 0:e7ca326e76ee | 95 | os_set_env: |
mkersh3 | 0:e7ca326e76ee | 96 | .fnstart |
mkersh3 | 0:e7ca326e76ee | 97 | .cantunwind |
mkersh3 | 0:e7ca326e76ee | 98 | |
mkersh3 | 0:e7ca326e76ee | 99 | MOV R0,SP /* PSP = MSP */ |
mkersh3 | 0:e7ca326e76ee | 100 | MSR PSP,R0 |
mkersh3 | 0:e7ca326e76ee | 101 | LDR R0,=os_flags |
mkersh3 | 0:e7ca326e76ee | 102 | LDRB R0,[R0] |
mkersh3 | 0:e7ca326e76ee | 103 | LSLS R0,#31 |
mkersh3 | 0:e7ca326e76ee | 104 | ITE NE |
mkersh3 | 0:e7ca326e76ee | 105 | MOVNE R0,#0x02 /* Privileged Thread mode, use PSP */ |
mkersh3 | 0:e7ca326e76ee | 106 | MOVEQ R0,#0x03 /* Unprivileged Thread mode, use PSP */ |
mkersh3 | 0:e7ca326e76ee | 107 | MSR CONTROL,R0 |
mkersh3 | 0:e7ca326e76ee | 108 | BX LR |
mkersh3 | 0:e7ca326e76ee | 109 | |
mkersh3 | 0:e7ca326e76ee | 110 | .fnend |
mkersh3 | 0:e7ca326e76ee | 111 | .size os_set_env, .-os_set_env |
mkersh3 | 0:e7ca326e76ee | 112 | |
mkersh3 | 0:e7ca326e76ee | 113 | |
mkersh3 | 0:e7ca326e76ee | 114 | /*--------------------------- _alloc_box ------------------------------------*/ |
mkersh3 | 0:e7ca326e76ee | 115 | |
mkersh3 | 0:e7ca326e76ee | 116 | # void *_alloc_box (void *box_mem); |
mkersh3 | 0:e7ca326e76ee | 117 | /* Function wrapper for Unprivileged/Privileged mode. */ |
mkersh3 | 0:e7ca326e76ee | 118 | |
mkersh3 | 0:e7ca326e76ee | 119 | .thumb_func |
mkersh3 | 0:e7ca326e76ee | 120 | .type _alloc_box, %function |
mkersh3 | 0:e7ca326e76ee | 121 | .global _alloc_box |
mkersh3 | 0:e7ca326e76ee | 122 | _alloc_box: |
mkersh3 | 0:e7ca326e76ee | 123 | .fnstart |
mkersh3 | 0:e7ca326e76ee | 124 | .cantunwind |
mkersh3 | 0:e7ca326e76ee | 125 | |
mkersh3 | 0:e7ca326e76ee | 126 | LDR R12,=rt_alloc_box |
mkersh3 | 0:e7ca326e76ee | 127 | MRS R3,IPSR |
mkersh3 | 0:e7ca326e76ee | 128 | LSLS R3,#24 |
mkersh3 | 0:e7ca326e76ee | 129 | IT NE |
mkersh3 | 0:e7ca326e76ee | 130 | BXNE R12 |
mkersh3 | 0:e7ca326e76ee | 131 | MRS R3,CONTROL |
mkersh3 | 0:e7ca326e76ee | 132 | LSLS R3,#31 |
mkersh3 | 0:e7ca326e76ee | 133 | IT EQ |
mkersh3 | 0:e7ca326e76ee | 134 | BXEQ R12 |
mkersh3 | 0:e7ca326e76ee | 135 | SVC 0 |
mkersh3 | 0:e7ca326e76ee | 136 | BX LR |
mkersh3 | 0:e7ca326e76ee | 137 | |
mkersh3 | 0:e7ca326e76ee | 138 | .fnend |
mkersh3 | 0:e7ca326e76ee | 139 | .size _alloc_box, .-_alloc_box |
mkersh3 | 0:e7ca326e76ee | 140 | |
mkersh3 | 0:e7ca326e76ee | 141 | |
mkersh3 | 0:e7ca326e76ee | 142 | /*--------------------------- _free_box -------------------------------------*/ |
mkersh3 | 0:e7ca326e76ee | 143 | |
mkersh3 | 0:e7ca326e76ee | 144 | # int _free_box (void *box_mem, void *box); |
mkersh3 | 0:e7ca326e76ee | 145 | /* Function wrapper for Unprivileged/Privileged mode. */ |
mkersh3 | 0:e7ca326e76ee | 146 | |
mkersh3 | 0:e7ca326e76ee | 147 | .thumb_func |
mkersh3 | 0:e7ca326e76ee | 148 | .type _free_box, %function |
mkersh3 | 0:e7ca326e76ee | 149 | .global _free_box |
mkersh3 | 0:e7ca326e76ee | 150 | _free_box: |
mkersh3 | 0:e7ca326e76ee | 151 | .fnstart |
mkersh3 | 0:e7ca326e76ee | 152 | .cantunwind |
mkersh3 | 0:e7ca326e76ee | 153 | |
mkersh3 | 0:e7ca326e76ee | 154 | LDR R12,=rt_free_box |
mkersh3 | 0:e7ca326e76ee | 155 | MRS R3,IPSR |
mkersh3 | 0:e7ca326e76ee | 156 | LSLS R3,#24 |
mkersh3 | 0:e7ca326e76ee | 157 | IT NE |
mkersh3 | 0:e7ca326e76ee | 158 | BXNE R12 |
mkersh3 | 0:e7ca326e76ee | 159 | MRS R3,CONTROL |
mkersh3 | 0:e7ca326e76ee | 160 | LSLS R3,#31 |
mkersh3 | 0:e7ca326e76ee | 161 | IT EQ |
mkersh3 | 0:e7ca326e76ee | 162 | BXEQ R12 |
mkersh3 | 0:e7ca326e76ee | 163 | SVC 0 |
mkersh3 | 0:e7ca326e76ee | 164 | BX LR |
mkersh3 | 0:e7ca326e76ee | 165 | |
mkersh3 | 0:e7ca326e76ee | 166 | .fnend |
mkersh3 | 0:e7ca326e76ee | 167 | .size _free_box, .-_free_box |
mkersh3 | 0:e7ca326e76ee | 168 | |
mkersh3 | 0:e7ca326e76ee | 169 | |
mkersh3 | 0:e7ca326e76ee | 170 | /*-------------------------- SVC_Handler ------------------------------------*/ |
mkersh3 | 0:e7ca326e76ee | 171 | |
mkersh3 | 0:e7ca326e76ee | 172 | # void SVC_Handler (void); |
mkersh3 | 0:e7ca326e76ee | 173 | |
mkersh3 | 0:e7ca326e76ee | 174 | .thumb_func |
mkersh3 | 0:e7ca326e76ee | 175 | .type SVC_Handler, %function |
mkersh3 | 0:e7ca326e76ee | 176 | .global SVC_Handler |
mkersh3 | 0:e7ca326e76ee | 177 | SVC_Handler: |
mkersh3 | 0:e7ca326e76ee | 178 | .fnstart |
mkersh3 | 0:e7ca326e76ee | 179 | .cantunwind |
mkersh3 | 0:e7ca326e76ee | 180 | |
mkersh3 | 0:e7ca326e76ee | 181 | MRS R0,PSP /* Read PSP */ |
mkersh3 | 0:e7ca326e76ee | 182 | LDR R1,[R0,#24] /* Read Saved PC from Stack */ |
mkersh3 | 0:e7ca326e76ee | 183 | LDRB R1,[R1,#-2] /* Load SVC Number */ |
mkersh3 | 0:e7ca326e76ee | 184 | CBNZ R1,SVC_User |
mkersh3 | 0:e7ca326e76ee | 185 | |
mkersh3 | 0:e7ca326e76ee | 186 | LDM R0,{R0-R3,R12} /* Read R0-R3,R12 from stack */ |
mkersh3 | 0:e7ca326e76ee | 187 | BLX R12 /* Call SVC Function */ |
mkersh3 | 0:e7ca326e76ee | 188 | |
mkersh3 | 0:e7ca326e76ee | 189 | MRS R12,PSP /* Read PSP */ |
mkersh3 | 0:e7ca326e76ee | 190 | STM R12,{R0-R2} /* Store return values */ |
mkersh3 | 0:e7ca326e76ee | 191 | |
mkersh3 | 0:e7ca326e76ee | 192 | LDR R3,=os_tsk |
mkersh3 | 0:e7ca326e76ee | 193 | LDM R3,{R1,R2} /* os_tsk.run, os_tsk.new */ |
mkersh3 | 0:e7ca326e76ee | 194 | CMP R1,R2 |
mkersh3 | 0:e7ca326e76ee | 195 | BEQ SVC_Exit /* no task switch */ |
mkersh3 | 0:e7ca326e76ee | 196 | |
mkersh3 | 0:e7ca326e76ee | 197 | CBZ R1,SVC_Next /* Runtask deleted? */ |
mkersh3 | 0:e7ca326e76ee | 198 | STMDB R12!,{R4-R11} /* Save Old context */ |
mkersh3 | 0:e7ca326e76ee | 199 | STR R12,[R1,#TCB_TSTACK] /* Update os_tsk.run->tsk_stack */ |
mkersh3 | 0:e7ca326e76ee | 200 | |
mkersh3 | 0:e7ca326e76ee | 201 | PUSH {R2,R3} |
mkersh3 | 0:e7ca326e76ee | 202 | BL rt_stk_check /* Check for Stack overflow */ |
mkersh3 | 0:e7ca326e76ee | 203 | POP {R2,R3} |
mkersh3 | 0:e7ca326e76ee | 204 | |
mkersh3 | 0:e7ca326e76ee | 205 | SVC_Next: |
mkersh3 | 0:e7ca326e76ee | 206 | STR R2,[R3] /* os_tsk.run = os_tsk.new */ |
mkersh3 | 0:e7ca326e76ee | 207 | |
mkersh3 | 0:e7ca326e76ee | 208 | LDR R12,[R2,#TCB_TSTACK] /* os_tsk.new->tsk_stack */ |
mkersh3 | 0:e7ca326e76ee | 209 | LDMIA R12!,{R4-R11} /* Restore New Context */ |
mkersh3 | 0:e7ca326e76ee | 210 | MSR PSP,R12 /* Write PSP */ |
mkersh3 | 0:e7ca326e76ee | 211 | |
mkersh3 | 0:e7ca326e76ee | 212 | SVC_Exit: |
mkersh3 | 0:e7ca326e76ee | 213 | MVN LR,#~0xFFFFFFFD /* set EXC_RETURN value */ |
mkersh3 | 0:e7ca326e76ee | 214 | BX LR |
mkersh3 | 0:e7ca326e76ee | 215 | |
mkersh3 | 0:e7ca326e76ee | 216 | /*------------------- User SVC ------------------------------*/ |
mkersh3 | 0:e7ca326e76ee | 217 | |
mkersh3 | 0:e7ca326e76ee | 218 | SVC_User: |
mkersh3 | 0:e7ca326e76ee | 219 | PUSH {R4,LR} /* Save Registers */ |
mkersh3 | 0:e7ca326e76ee | 220 | LDR R2,=SVC_Count |
mkersh3 | 0:e7ca326e76ee | 221 | LDR R2,[R2] |
mkersh3 | 0:e7ca326e76ee | 222 | CMP R1,R2 |
mkersh3 | 0:e7ca326e76ee | 223 | BHI SVC_Done /* Overflow */ |
mkersh3 | 0:e7ca326e76ee | 224 | |
mkersh3 | 0:e7ca326e76ee | 225 | LDR R4,=SVC_Table-4 |
mkersh3 | 0:e7ca326e76ee | 226 | LDR R4,[R4,R1,LSL #2] /* Load SVC Function Address */ |
mkersh3 | 0:e7ca326e76ee | 227 | |
mkersh3 | 0:e7ca326e76ee | 228 | LDM R0,{R0-R3,R12} /* Read R0-R3,R12 from stack */ |
mkersh3 | 0:e7ca326e76ee | 229 | BLX R4 /* Call SVC Function */ |
mkersh3 | 0:e7ca326e76ee | 230 | |
mkersh3 | 0:e7ca326e76ee | 231 | MRS R12,PSP |
mkersh3 | 0:e7ca326e76ee | 232 | STM R12,{R0-R3} /* Function return values */ |
mkersh3 | 0:e7ca326e76ee | 233 | SVC_Done: |
mkersh3 | 0:e7ca326e76ee | 234 | POP {R4,PC} /* RETI */ |
mkersh3 | 0:e7ca326e76ee | 235 | |
mkersh3 | 0:e7ca326e76ee | 236 | .fnend |
mkersh3 | 0:e7ca326e76ee | 237 | .size SVC_Handler, .-SVC_Handler |
mkersh3 | 0:e7ca326e76ee | 238 | |
mkersh3 | 0:e7ca326e76ee | 239 | |
mkersh3 | 0:e7ca326e76ee | 240 | /*-------------------------- PendSV_Handler ---------------------------------*/ |
mkersh3 | 0:e7ca326e76ee | 241 | |
mkersh3 | 0:e7ca326e76ee | 242 | # void PendSV_Handler (void); |
mkersh3 | 0:e7ca326e76ee | 243 | |
mkersh3 | 0:e7ca326e76ee | 244 | .thumb_func |
mkersh3 | 0:e7ca326e76ee | 245 | .type PendSV_Handler, %function |
mkersh3 | 0:e7ca326e76ee | 246 | .global PendSV_Handler |
mkersh3 | 0:e7ca326e76ee | 247 | .global Sys_Switch |
mkersh3 | 0:e7ca326e76ee | 248 | PendSV_Handler: |
mkersh3 | 0:e7ca326e76ee | 249 | .fnstart |
mkersh3 | 0:e7ca326e76ee | 250 | .cantunwind |
mkersh3 | 0:e7ca326e76ee | 251 | |
mkersh3 | 0:e7ca326e76ee | 252 | BL rt_pop_req |
mkersh3 | 0:e7ca326e76ee | 253 | |
mkersh3 | 0:e7ca326e76ee | 254 | Sys_Switch: |
mkersh3 | 0:e7ca326e76ee | 255 | LDR R3,=os_tsk |
mkersh3 | 0:e7ca326e76ee | 256 | LDM R3,{R1,R2} /* os_tsk.run, os_tsk.new */ |
mkersh3 | 0:e7ca326e76ee | 257 | CMP R1,R2 |
mkersh3 | 0:e7ca326e76ee | 258 | BEQ Sys_Exit |
mkersh3 | 0:e7ca326e76ee | 259 | |
mkersh3 | 0:e7ca326e76ee | 260 | MRS R12,PSP /* Read PSP */ |
mkersh3 | 0:e7ca326e76ee | 261 | STMDB R12!,{R4-R11} /* Save Old context */ |
mkersh3 | 0:e7ca326e76ee | 262 | STR R12,[R1,#TCB_TSTACK] /* Update os_tsk.run->tsk_stack */ |
mkersh3 | 0:e7ca326e76ee | 263 | |
mkersh3 | 0:e7ca326e76ee | 264 | PUSH {R2,R3} |
mkersh3 | 0:e7ca326e76ee | 265 | BL rt_stk_check /* Check for Stack overflow */ |
mkersh3 | 0:e7ca326e76ee | 266 | POP {R2,R3} |
mkersh3 | 0:e7ca326e76ee | 267 | |
mkersh3 | 0:e7ca326e76ee | 268 | STR R2,[R3] /* os_tsk.run = os_tsk.new */ |
mkersh3 | 0:e7ca326e76ee | 269 | |
mkersh3 | 0:e7ca326e76ee | 270 | LDR R12,[R2,#TCB_TSTACK] /* os_tsk.new->tsk_stack */ |
mkersh3 | 0:e7ca326e76ee | 271 | LDMIA R12!,{R4-R11} /* Restore New Context */ |
mkersh3 | 0:e7ca326e76ee | 272 | MSR PSP,R12 /* Write PSP */ |
mkersh3 | 0:e7ca326e76ee | 273 | |
mkersh3 | 0:e7ca326e76ee | 274 | Sys_Exit: |
mkersh3 | 0:e7ca326e76ee | 275 | MVN LR,#~0xFFFFFFFD /* set EXC_RETURN value */ |
mkersh3 | 0:e7ca326e76ee | 276 | BX LR /* Return to Thread Mode */ |
mkersh3 | 0:e7ca326e76ee | 277 | |
mkersh3 | 0:e7ca326e76ee | 278 | .fnend |
mkersh3 | 0:e7ca326e76ee | 279 | .size PendSV_Handler, .-PendSV_Handler |
mkersh3 | 0:e7ca326e76ee | 280 | |
mkersh3 | 0:e7ca326e76ee | 281 | |
mkersh3 | 0:e7ca326e76ee | 282 | /*-------------------------- SysTick_Handler --------------------------------*/ |
mkersh3 | 0:e7ca326e76ee | 283 | |
mkersh3 | 0:e7ca326e76ee | 284 | # void SysTick_Handler (void); |
mkersh3 | 0:e7ca326e76ee | 285 | |
mkersh3 | 0:e7ca326e76ee | 286 | .thumb_func |
mkersh3 | 0:e7ca326e76ee | 287 | .type SysTick_Handler, %function |
mkersh3 | 0:e7ca326e76ee | 288 | .global SysTick_Handler |
mkersh3 | 0:e7ca326e76ee | 289 | SysTick_Handler: |
mkersh3 | 0:e7ca326e76ee | 290 | .fnstart |
mkersh3 | 0:e7ca326e76ee | 291 | .cantunwind |
mkersh3 | 0:e7ca326e76ee | 292 | |
mkersh3 | 0:e7ca326e76ee | 293 | BL rt_systick |
mkersh3 | 0:e7ca326e76ee | 294 | B Sys_Switch |
mkersh3 | 0:e7ca326e76ee | 295 | |
mkersh3 | 0:e7ca326e76ee | 296 | .fnend |
mkersh3 | 0:e7ca326e76ee | 297 | .size SysTick_Handler, .-SysTick_Handler |
mkersh3 | 0:e7ca326e76ee | 298 | |
mkersh3 | 0:e7ca326e76ee | 299 | |
mkersh3 | 0:e7ca326e76ee | 300 | /*-------------------------- OS_Tick_Handler --------------------------------*/ |
mkersh3 | 0:e7ca326e76ee | 301 | |
mkersh3 | 0:e7ca326e76ee | 302 | # void OS_Tick_Handler (void); |
mkersh3 | 0:e7ca326e76ee | 303 | |
mkersh3 | 0:e7ca326e76ee | 304 | .thumb_func |
mkersh3 | 0:e7ca326e76ee | 305 | .type OS_Tick_Handler, %function |
mkersh3 | 0:e7ca326e76ee | 306 | .global OS_Tick_Handler |
mkersh3 | 0:e7ca326e76ee | 307 | OS_Tick_Handler: |
mkersh3 | 0:e7ca326e76ee | 308 | .fnstart |
mkersh3 | 0:e7ca326e76ee | 309 | .cantunwind |
mkersh3 | 0:e7ca326e76ee | 310 | |
mkersh3 | 0:e7ca326e76ee | 311 | BL os_tick_irqack |
mkersh3 | 0:e7ca326e76ee | 312 | BL rt_systick |
mkersh3 | 0:e7ca326e76ee | 313 | B Sys_Switch |
mkersh3 | 0:e7ca326e76ee | 314 | |
mkersh3 | 0:e7ca326e76ee | 315 | .fnend |
mkersh3 | 0:e7ca326e76ee | 316 | .size OS_Tick_Handler, .-OS_Tick_Handler |
mkersh3 | 0:e7ca326e76ee | 317 | |
mkersh3 | 0:e7ca326e76ee | 318 | |
mkersh3 | 0:e7ca326e76ee | 319 | .end |
mkersh3 | 0:e7ca326e76ee | 320 | |
mkersh3 | 0:e7ca326e76ee | 321 | /*---------------------------------------------------------------------------- |
mkersh3 | 0:e7ca326e76ee | 322 | * end of file |
mkersh3 | 0:e7ca326e76ee | 323 | *---------------------------------------------------------------------------*/ |