mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Committer:
mbed_official
Date:
Wed Jul 01 08:15:11 2015 +0100
Revision:
577:15494b56c2f3
Parent:
targets/cmsis/TARGET_WIZNET/TARGET_W7500x/TARGET_WIZwiki_W7500/TOOLCHAIN_GCC_ARM/startup_W7500.s@558:0880f51c4036
Synchronized with git revision 7766e75dd858812cd79aedb3080349715f55dd56

Full URL: https://github.com/mbedmicro/mbed/commit/7766e75dd858812cd79aedb3080349715f55dd56/

GCC asm updates

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 558:0880f51c4036 1 /* File: startup_W7500.s
mbed_official 558:0880f51c4036 2 * Purpose: startup file for Cortex-M0 devices. Should use with
mbed_official 558:0880f51c4036 3 * GCC for ARM Embedded Processors
mbed_official 558:0880f51c4036 4 * Version: V1.4
mbed_official 558:0880f51c4036 5 * Date: 20 Dezember 2012
mbed_official 558:0880f51c4036 6 *
mbed_official 558:0880f51c4036 7 */
mbed_official 558:0880f51c4036 8 /* Copyright (c) 2011 - 2012 ARM LIMITED
mbed_official 558:0880f51c4036 9
mbed_official 558:0880f51c4036 10 All rights reserved.
mbed_official 558:0880f51c4036 11 Redistribution and use in source and binary forms, with or without
mbed_official 558:0880f51c4036 12 modification, are permitted provided that the following conditions are met:
mbed_official 558:0880f51c4036 13 - Redistributions of source code must retain the above copyright
mbed_official 558:0880f51c4036 14 notice, this list of conditions and the following disclaimer.
mbed_official 558:0880f51c4036 15 - Redistributions in binary form must reproduce the above copyright
mbed_official 558:0880f51c4036 16 notice, this list of conditions and the following disclaimer in the
mbed_official 558:0880f51c4036 17 documentation and/or other materials provided with the distribution.
mbed_official 558:0880f51c4036 18 - Neither the name of ARM nor the names of its contributors may be used
mbed_official 558:0880f51c4036 19 to endorse or promote products derived from this software without
mbed_official 558:0880f51c4036 20 specific prior written permission.
mbed_official 558:0880f51c4036 21 *
mbed_official 558:0880f51c4036 22 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
mbed_official 558:0880f51c4036 23 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
mbed_official 558:0880f51c4036 24 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
mbed_official 558:0880f51c4036 25 ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
mbed_official 558:0880f51c4036 26 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
mbed_official 558:0880f51c4036 27 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
mbed_official 558:0880f51c4036 28 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
mbed_official 558:0880f51c4036 29 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
mbed_official 558:0880f51c4036 30 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
mbed_official 558:0880f51c4036 31 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
mbed_official 558:0880f51c4036 32 POSSIBILITY OF SUCH DAMAGE.
mbed_official 558:0880f51c4036 33 ---------------------------------------------------------------------------*/
mbed_official 558:0880f51c4036 34
mbed_official 558:0880f51c4036 35
mbed_official 558:0880f51c4036 36 .syntax unified
mbed_official 558:0880f51c4036 37 .arch armv6-m
mbed_official 558:0880f51c4036 38
mbed_official 558:0880f51c4036 39 .section .stack
mbed_official 558:0880f51c4036 40 .align 3
mbed_official 558:0880f51c4036 41
mbed_official 558:0880f51c4036 42 /*
mbed_official 558:0880f51c4036 43 // <h> Stack Configuration
mbed_official 558:0880f51c4036 44 // <o> Stack Size (in Bytes) <0x0-0xFFFFFFFF:8>
mbed_official 558:0880f51c4036 45 // </h>
mbed_official 558:0880f51c4036 46 */
mbed_official 558:0880f51c4036 47
mbed_official 558:0880f51c4036 48 .section .stack
mbed_official 558:0880f51c4036 49 .align 3
mbed_official 558:0880f51c4036 50 #ifdef __STACK_SIZE
mbed_official 558:0880f51c4036 51 .equ Stack_Size, __STACK_SIZE
mbed_official 558:0880f51c4036 52 #else
mbed_official 558:0880f51c4036 53 .equ Stack_Size, 0x200
mbed_official 558:0880f51c4036 54 #endif
mbed_official 558:0880f51c4036 55 .globl __StackTop
mbed_official 558:0880f51c4036 56 .globl __StackLimit
mbed_official 558:0880f51c4036 57 __StackLimit:
mbed_official 558:0880f51c4036 58 .space Stack_Size
mbed_official 558:0880f51c4036 59 .size __StackLimit, . - __StackLimit
mbed_official 558:0880f51c4036 60 __StackTop:
mbed_official 558:0880f51c4036 61 .size __StackTop, . - __StackTop
mbed_official 558:0880f51c4036 62
mbed_official 558:0880f51c4036 63
mbed_official 558:0880f51c4036 64 /*
mbed_official 558:0880f51c4036 65 // <h> Heap Configuration
mbed_official 558:0880f51c4036 66 // <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
mbed_official 558:0880f51c4036 67 // </h>
mbed_official 558:0880f51c4036 68 */
mbed_official 558:0880f51c4036 69
mbed_official 558:0880f51c4036 70 .section .heap
mbed_official 558:0880f51c4036 71 .align 3
mbed_official 558:0880f51c4036 72 #ifdef __HEAP_SIZE
mbed_official 558:0880f51c4036 73 .equ Heap_Size, __HEAP_SIZE
mbed_official 558:0880f51c4036 74 #else
mbed_official 558:0880f51c4036 75 .equ Heap_Size, 0
mbed_official 558:0880f51c4036 76 #endif
mbed_official 558:0880f51c4036 77 .globl __HeapBase
mbed_official 558:0880f51c4036 78 .globl __HeapLimit
mbed_official 558:0880f51c4036 79 __HeapBase:
mbed_official 558:0880f51c4036 80 .if Heap_Size
mbed_official 558:0880f51c4036 81 .space Heap_Size
mbed_official 558:0880f51c4036 82 .endif
mbed_official 558:0880f51c4036 83 .size __HeapBase, . - __HeapBase
mbed_official 558:0880f51c4036 84 __HeapLimit:
mbed_official 558:0880f51c4036 85 .size __HeapLimit, . - __HeapLimit
mbed_official 558:0880f51c4036 86
mbed_official 558:0880f51c4036 87
mbed_official 558:0880f51c4036 88 /* Vector Table */
mbed_official 558:0880f51c4036 89
mbed_official 558:0880f51c4036 90 .section .isr_vector
mbed_official 558:0880f51c4036 91 .align 2
mbed_official 558:0880f51c4036 92 .globl __isr_vector
mbed_official 558:0880f51c4036 93 __isr_vector:
mbed_official 558:0880f51c4036 94 .long __StackTop /* Top of Stack */
mbed_official 558:0880f51c4036 95 .long Reset_Handler /* Reset Handler */
mbed_official 558:0880f51c4036 96 .long NMI_Handler /* NMI Handler */
mbed_official 558:0880f51c4036 97 .long HardFault_Handler /* Hard Fault Handler */
mbed_official 558:0880f51c4036 98 .long 0 /* Reserved */
mbed_official 558:0880f51c4036 99 .long 0 /* Reserved */
mbed_official 558:0880f51c4036 100 .long 0 /* Reserved */
mbed_official 558:0880f51c4036 101 .long 0 /* Reserved */
mbed_official 558:0880f51c4036 102 .long 0 /* Reserved */
mbed_official 558:0880f51c4036 103 .long 0 /* Reserved */
mbed_official 558:0880f51c4036 104 .long 0 /* Reserved */
mbed_official 558:0880f51c4036 105 .long SVC_Handler /* SVCall Handler */
mbed_official 558:0880f51c4036 106 .long 0 /* Debug Monitor Handler */
mbed_official 558:0880f51c4036 107 .long 0 /* Reserved */
mbed_official 558:0880f51c4036 108 .long PendSV_Handler /* PendSV Handler */
mbed_official 558:0880f51c4036 109 .long SysTick_Handler /* SysTick Handler */
mbed_official 558:0880f51c4036 110
mbed_official 558:0880f51c4036 111 /* External Interrupts */
mbed_official 558:0880f51c4036 112 .long SSP0_Handler /* 16+ 0: SSP 0 Handler */
mbed_official 558:0880f51c4036 113 .long SSP1_Handler /* 16+ 1: SSP 1 Handler */
mbed_official 558:0880f51c4036 114 .long UART0_Handler /* 16+ 2: UART 0 Handler */
mbed_official 558:0880f51c4036 115 .long UART1_Handler /* 16+ 3: UART 1 Handler */
mbed_official 558:0880f51c4036 116 .long UART2_Handler /* 16+ 4: UART 2 Handler */
mbed_official 558:0880f51c4036 117 .long I2C0_Handler /* 16+ 5: I2C 0 Handler */
mbed_official 558:0880f51c4036 118 .long I2C1_Handler /* 16+ 6: I2C 1 Handler */
mbed_official 558:0880f51c4036 119 .long PORT0_Handler /* 16+ 7: GPIO Port 0 Combined Handler */
mbed_official 558:0880f51c4036 120 .long PORT1_Handler /* 16+ 8: GPIO Port 1 Combined Handler */
mbed_official 558:0880f51c4036 121 .long PORT2_Handler /* 16+ 9: GPIO Port 2 Combined Handler */
mbed_official 558:0880f51c4036 122 .long PORT3_Handler /* 16+10: GPIO Port 3 Combined Handler */
mbed_official 558:0880f51c4036 123 .long DMA_Handler /* 16+11: DMA Combined Handler */
mbed_official 558:0880f51c4036 124 .long DUALTIMER0_Handler /* 16+12: Dual timer 0 handler */
mbed_official 558:0880f51c4036 125 .long DUALTIMER1_Handler /* 16+ 13: Dual timer 1 Handler */
mbed_official 558:0880f51c4036 126 .long PWM0_Handler /* 16+ 14: PWM0 Handler */
mbed_official 558:0880f51c4036 127 .long PWM1_Handler /* 16+ 15: PWM1 Handler */
mbed_official 558:0880f51c4036 128 .long PWM2_Handler /* 16+ 16: PWM2 Handler */
mbed_official 558:0880f51c4036 129 .long PWM3_Handler /* 16+ 17: PWM3 Handler */
mbed_official 558:0880f51c4036 130 .long PWM4_Handler /* 16+ 18: PWM4 Handler */
mbed_official 558:0880f51c4036 131 .long PWM5_Handler /* 16+ 19: PWM5 Handler */
mbed_official 558:0880f51c4036 132 .long PWM6_Handler /* 16+ 20: PWM6 Handler */
mbed_official 558:0880f51c4036 133 .long PWM7_Handler /* 16+ 21: PWM7 Handler */
mbed_official 558:0880f51c4036 134 .long RTC_Handler /* 16+ 22: RTC Handler */
mbed_official 558:0880f51c4036 135 .long ADC_Handler /* 16+ 23: ADC Handler */
mbed_official 558:0880f51c4036 136 .long WZTOE_Handler /* 16+ 24: WZTOE Handler */
mbed_official 558:0880f51c4036 137 .long EXTI_Handler /* 16+ 25: EXTI Handler */
mbed_official 558:0880f51c4036 138
mbed_official 558:0880f51c4036 139 .size __isr_vector, . - __isr_vector
mbed_official 558:0880f51c4036 140 /* Reset Handler */
mbed_official 558:0880f51c4036 141 .text
mbed_official 558:0880f51c4036 142 .thumb
mbed_official 558:0880f51c4036 143 .thumb_func
mbed_official 558:0880f51c4036 144 .align 2
mbed_official 558:0880f51c4036 145 .globl Reset_Handler
mbed_official 558:0880f51c4036 146 .type Reset_Handler, %function
mbed_official 558:0880f51c4036 147 Reset_Handler:
mbed_official 558:0880f51c4036 148 /* Loop to copy data from read only memory to RAM. The ranges
mbed_official 558:0880f51c4036 149 * of copy from/to are specified by following symbols evaluated in
mbed_official 558:0880f51c4036 150 * linker script.
mbed_official 558:0880f51c4036 151 * __etext: End of code section, i.e., begin of data sections to copy from.
mbed_official 558:0880f51c4036 152 * __data_start__/__data_end__: RAM address range that data should be
mbed_official 558:0880f51c4036 153 * copied to. Both must be aligned to 4 bytes boundary. */
mbed_official 558:0880f51c4036 154
mbed_official 558:0880f51c4036 155 ldr r1, =__etext
mbed_official 558:0880f51c4036 156 ldr r2, =__data_start__
mbed_official 558:0880f51c4036 157 ldr r3, =__data_end__
mbed_official 558:0880f51c4036 158
mbed_official 558:0880f51c4036 159 subs r3, r2
mbed_official 558:0880f51c4036 160 ble .LC1
mbed_official 558:0880f51c4036 161 .LC0:
mbed_official 558:0880f51c4036 162 subs r3, #4
mbed_official 558:0880f51c4036 163 ldr r0, [r1, r3]
mbed_official 558:0880f51c4036 164 str r0, [r2, r3]
mbed_official 558:0880f51c4036 165 bgt .LC0
mbed_official 558:0880f51c4036 166 .LC1:
mbed_official 558:0880f51c4036 167
mbed_official 558:0880f51c4036 168 #ifdef __STARTUP_CLEAR_BSS
mbed_official 558:0880f51c4036 169 /* This part of work usually is done in C library startup code. Otherwise,
mbed_official 558:0880f51c4036 170 * define this macro to enable it in this startup.
mbed_official 558:0880f51c4036 171 *
mbed_official 558:0880f51c4036 172 * Loop to zero out BSS section, which uses following symbols
mbed_official 558:0880f51c4036 173 * in linker script:
mbed_official 558:0880f51c4036 174 * __bss_start__: start of BSS section. Must align to 4
mbed_official 558:0880f51c4036 175 * __bss_end__: end of BSS section. Must align to 4
mbed_official 558:0880f51c4036 176 */
mbed_official 558:0880f51c4036 177 ldr r1, =__bss_start__
mbed_official 558:0880f51c4036 178 ldr r2, =__bss_end__
mbed_official 558:0880f51c4036 179
mbed_official 558:0880f51c4036 180 subs r2, r1
mbed_official 558:0880f51c4036 181 ble .LC3
mbed_official 558:0880f51c4036 182
mbed_official 558:0880f51c4036 183 movs r0, 0
mbed_official 558:0880f51c4036 184 .LC2:
mbed_official 558:0880f51c4036 185 str r0, [r1, r2]
mbed_official 558:0880f51c4036 186 subs r2, 4
mbed_official 558:0880f51c4036 187 bge .LC2
mbed_official 558:0880f51c4036 188 .LC3:
mbed_official 558:0880f51c4036 189 #endif /* __STARTUP_CLEAR_BSS */
mbed_official 558:0880f51c4036 190
mbed_official 558:0880f51c4036 191 /*bl _start*/
mbed_official 558:0880f51c4036 192 bl main
mbed_official 558:0880f51c4036 193
mbed_official 558:0880f51c4036 194 .pool
mbed_official 558:0880f51c4036 195 .size Reset_Handler, . - Reset_Handler
mbed_official 558:0880f51c4036 196
mbed_official 558:0880f51c4036 197 /* Macro to define default handlers. Default handler
mbed_official 558:0880f51c4036 198 * will be weak symbol and just dead loops. They can be
mbed_official 558:0880f51c4036 199 * overwritten by other handlers */
mbed_official 558:0880f51c4036 200 .macro def_default_handler handler_name
mbed_official 558:0880f51c4036 201 .align 1
mbed_official 558:0880f51c4036 202 .thumb_func
mbed_official 558:0880f51c4036 203 .weak \handler_name
mbed_official 558:0880f51c4036 204 .type \handler_name, %function
mbed_official 558:0880f51c4036 205 \handler_name :
mbed_official 558:0880f51c4036 206 b .
mbed_official 558:0880f51c4036 207 .size \handler_name, . - \handler_name
mbed_official 558:0880f51c4036 208 .endm
mbed_official 558:0880f51c4036 209
mbed_official 558:0880f51c4036 210 /* System Exception Handlers */
mbed_official 558:0880f51c4036 211
mbed_official 558:0880f51c4036 212 def_default_handler NMI_Handler
mbed_official 558:0880f51c4036 213 def_default_handler HardFault_Handler
mbed_official 558:0880f51c4036 214 def_default_handler MemManage_Handler
mbed_official 558:0880f51c4036 215 def_default_handler BusFault_Handler
mbed_official 558:0880f51c4036 216 def_default_handler UsageFault_Handler
mbed_official 558:0880f51c4036 217 def_default_handler SVC_Handler
mbed_official 558:0880f51c4036 218 def_default_handler DebugMon_Handler
mbed_official 558:0880f51c4036 219 def_default_handler PendSV_Handler
mbed_official 558:0880f51c4036 220 def_default_handler SysTick_Handler
mbed_official 558:0880f51c4036 221
mbed_official 558:0880f51c4036 222 /* IRQ Handlers */
mbed_official 558:0880f51c4036 223
mbed_official 558:0880f51c4036 224 def_default_handler SSP0_Handler
mbed_official 558:0880f51c4036 225 def_default_handler SSP1_Handler
mbed_official 558:0880f51c4036 226 def_default_handler UART0_Handler
mbed_official 558:0880f51c4036 227 def_default_handler UART1_Handler
mbed_official 558:0880f51c4036 228 def_default_handler UART2_Handler
mbed_official 558:0880f51c4036 229 def_default_handler I2C0_Handler
mbed_official 558:0880f51c4036 230 def_default_handler I2C1_Handler
mbed_official 558:0880f51c4036 231 def_default_handler PORT0_Handler
mbed_official 558:0880f51c4036 232 def_default_handler PORT1_Handler
mbed_official 558:0880f51c4036 233 def_default_handler PORT2_Handler
mbed_official 558:0880f51c4036 234 def_default_handler PORT3_Handler
mbed_official 558:0880f51c4036 235
mbed_official 558:0880f51c4036 236 def_default_handler DMA_Handler
mbed_official 558:0880f51c4036 237 def_default_handler DUALTIMER0_Handler
mbed_official 558:0880f51c4036 238 def_default_handler DUALTIMER1_Handler
mbed_official 558:0880f51c4036 239 def_default_handler PWM0_Handler
mbed_official 558:0880f51c4036 240 def_default_handler PWM1_Handler
mbed_official 558:0880f51c4036 241 def_default_handler PWM2_Handler
mbed_official 558:0880f51c4036 242 def_default_handler PWM3_Handler
mbed_official 558:0880f51c4036 243 def_default_handler PWM4_Handler
mbed_official 558:0880f51c4036 244 def_default_handler PWM5_Handler
mbed_official 558:0880f51c4036 245 def_default_handler PWM6_Handler
mbed_official 558:0880f51c4036 246 def_default_handler PWM7_Handler
mbed_official 558:0880f51c4036 247 def_default_handler RTC_Handler
mbed_official 558:0880f51c4036 248 def_default_handler ADC_Handler
mbed_official 558:0880f51c4036 249 def_default_handler WZTOE_Handler
mbed_official 558:0880f51c4036 250 def_default_handler EXTI_Handler
mbed_official 558:0880f51c4036 251
mbed_official 558:0880f51c4036 252 /*
mbed_official 558:0880f51c4036 253 def_default_handler Default_Handler
mbed_official 558:0880f51c4036 254 .weak DEF_IRQHandler
mbed_official 558:0880f51c4036 255 .set DEF_IRQHandler, Default_Handler
mbed_official 558:0880f51c4036 256 */
mbed_official 558:0880f51c4036 257
mbed_official 558:0880f51c4036 258 .end
mbed_official 558:0880f51c4036 259