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_Silicon_Labs/TARGET_EFM32/TARGET_EFM32HG_STK3400/TOOLCHAIN_GCC_ARM/startup_efm32hg.s@525:c320967f86b9
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 525:c320967f86b9 1 /* @file startup_efm32hg.S
mbed_official 525:c320967f86b9 2 * @brief startup file for Silicon Labs EFM32HG devices.
mbed_official 525:c320967f86b9 3 * For use with GCC for ARM Embedded Processors
mbed_official 525:c320967f86b9 4 * @version 3.20.12
mbed_official 525:c320967f86b9 5 * Date: 08 Feb 2012
mbed_official 525:c320967f86b9 6 *
mbed_official 525:c320967f86b9 7 * Copyright (c) 2012, ARM Limited
mbed_official 525:c320967f86b9 8 * All rights reserved.
mbed_official 525:c320967f86b9 9 *
mbed_official 525:c320967f86b9 10 * Redistribution and use in source and binary forms, with or without
mbed_official 525:c320967f86b9 11 * modification, are permitted provided that the following conditions are met:
mbed_official 525:c320967f86b9 12 * Redistributions of source code must retain the above copyright
mbed_official 525:c320967f86b9 13 notice, this list of conditions and the following disclaimer.
mbed_official 525:c320967f86b9 14 * Redistributions in binary form must reproduce the above copyright
mbed_official 525:c320967f86b9 15 notice, this list of conditions and the following disclaimer in the
mbed_official 525:c320967f86b9 16 documentation and/or other materials provided with the distribution.
mbed_official 525:c320967f86b9 17 * Neither the name of the ARM Limited nor the
mbed_official 525:c320967f86b9 18 names of its contributors may be used to endorse or promote products
mbed_official 525:c320967f86b9 19 derived from this software without specific prior written permission.
mbed_official 525:c320967f86b9 20 *
mbed_official 525:c320967f86b9 21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
mbed_official 525:c320967f86b9 22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
mbed_official 525:c320967f86b9 23 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
mbed_official 525:c320967f86b9 24 * DISCLAIMED. IN NO EVENT SHALL ARM LIMITED BE LIABLE FOR ANY
mbed_official 525:c320967f86b9 25 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
mbed_official 525:c320967f86b9 26 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
mbed_official 525:c320967f86b9 27 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
mbed_official 525:c320967f86b9 28 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
mbed_official 525:c320967f86b9 29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
mbed_official 525:c320967f86b9 30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
mbed_official 525:c320967f86b9 31 */
mbed_official 525:c320967f86b9 32 .syntax unified
mbed_official 525:c320967f86b9 33 .arch armv6-m
mbed_official 525:c320967f86b9 34
mbed_official 525:c320967f86b9 35
mbed_official 525:c320967f86b9 36 .section .stack
mbed_official 525:c320967f86b9 37 .align 3
mbed_official 525:c320967f86b9 38 #ifdef __STACK_SIZE
mbed_official 525:c320967f86b9 39 .equ Stack_Size, __STACK_SIZE
mbed_official 525:c320967f86b9 40 #else
mbed_official 525:c320967f86b9 41 .equ Stack_Size, 0x400
mbed_official 525:c320967f86b9 42 #endif
mbed_official 525:c320967f86b9 43 .globl __StackTop
mbed_official 525:c320967f86b9 44 .globl __StackLimit
mbed_official 525:c320967f86b9 45 __StackLimit:
mbed_official 525:c320967f86b9 46 .space Stack_Size
mbed_official 525:c320967f86b9 47 .size __StackLimit, . - __StackLimit
mbed_official 525:c320967f86b9 48 __StackTop:
mbed_official 525:c320967f86b9 49 .size __StackTop, . - __StackTop
mbed_official 525:c320967f86b9 50
mbed_official 525:c320967f86b9 51 .section .heap
mbed_official 525:c320967f86b9 52 .align 3
mbed_official 525:c320967f86b9 53 #ifdef __HEAP_SIZE
mbed_official 525:c320967f86b9 54 .equ Heap_Size, __HEAP_SIZE
mbed_official 525:c320967f86b9 55 #else
mbed_official 525:c320967f86b9 56 .equ Heap_Size, 0x0
mbed_official 525:c320967f86b9 57 #endif
mbed_official 525:c320967f86b9 58 .globl __HeapBase
mbed_official 525:c320967f86b9 59 .globl __HeapLimit
mbed_official 525:c320967f86b9 60 __HeapBase:
mbed_official 525:c320967f86b9 61 .if Heap_Size
mbed_official 525:c320967f86b9 62 .space Heap_Size
mbed_official 525:c320967f86b9 63 .endif
mbed_official 525:c320967f86b9 64 .size __HeapBase, . - __HeapBase
mbed_official 525:c320967f86b9 65 __HeapLimit:
mbed_official 525:c320967f86b9 66 .size __HeapLimit, . - __HeapLimit
mbed_official 525:c320967f86b9 67
mbed_official 525:c320967f86b9 68 .section .isr_vector
mbed_official 525:c320967f86b9 69 .align 8
mbed_official 525:c320967f86b9 70 .globl __isr_vector
mbed_official 525:c320967f86b9 71 __isr_vector:
mbed_official 525:c320967f86b9 72 .long __StackTop /* Top of Stack */
mbed_official 525:c320967f86b9 73 .long Reset_Handler /* Reset Handler */
mbed_official 525:c320967f86b9 74 .long NMI_Handler /* NMI Handler */
mbed_official 525:c320967f86b9 75 .long HardFault_Handler /* Hard Fault Handler */
mbed_official 525:c320967f86b9 76 .long Default_Handler /* Reserved */
mbed_official 525:c320967f86b9 77 .long Default_Handler /* Reserved */
mbed_official 525:c320967f86b9 78 .long Default_Handler /* Reserved */
mbed_official 525:c320967f86b9 79 .long Default_Handler /* Reserved */
mbed_official 525:c320967f86b9 80 .long Default_Handler /* Reserved */
mbed_official 525:c320967f86b9 81 .long Default_Handler /* Reserved */
mbed_official 525:c320967f86b9 82 .long Default_Handler /* Reserved */
mbed_official 525:c320967f86b9 83 .long SVC_Handler /* SVCall Handler */
mbed_official 525:c320967f86b9 84 .long Default_Handler /* Reserved */
mbed_official 525:c320967f86b9 85 .long Default_Handler /* Reserved */
mbed_official 525:c320967f86b9 86 .long PendSV_Handler /* PendSV Handler */
mbed_official 525:c320967f86b9 87 .long SysTick_Handler /* SysTick Handler */
mbed_official 525:c320967f86b9 88
mbed_official 525:c320967f86b9 89 /* External interrupts */
mbed_official 525:c320967f86b9 90 .long DMA_IRQHandler /* 0 - DMA */
mbed_official 525:c320967f86b9 91 .long GPIO_EVEN_IRQHandler /* 1 - GPIO_EVEN */
mbed_official 525:c320967f86b9 92 .long TIMER0_IRQHandler /* 2 - TIMER0 */
mbed_official 525:c320967f86b9 93 .long ACMP0_IRQHandler /* 3 - ACMP0 */
mbed_official 525:c320967f86b9 94 .long ADC0_IRQHandler /* 4 - ADC0 */
mbed_official 525:c320967f86b9 95 .long I2C0_IRQHandler /* 5 - I2C0 */
mbed_official 525:c320967f86b9 96 .long GPIO_ODD_IRQHandler /* 6 - GPIO_ODD */
mbed_official 525:c320967f86b9 97 .long TIMER1_IRQHandler /* 7 - TIMER1 */
mbed_official 525:c320967f86b9 98 .long USART1_RX_IRQHandler /* 8 - USART1_RX */
mbed_official 525:c320967f86b9 99 .long USART1_TX_IRQHandler /* 9 - USART1_TX */
mbed_official 525:c320967f86b9 100 .long LEUART0_IRQHandler /* 10 - LEUART0 */
mbed_official 525:c320967f86b9 101 .long PCNT0_IRQHandler /* 11 - PCNT0 */
mbed_official 525:c320967f86b9 102 .long RTC_IRQHandler /* 12 - RTC */
mbed_official 525:c320967f86b9 103 .long CMU_IRQHandler /* 13 - CMU */
mbed_official 525:c320967f86b9 104 .long VCMP_IRQHandler /* 14 - VCMP */
mbed_official 525:c320967f86b9 105 .long MSC_IRQHandler /* 15 - MSC */
mbed_official 525:c320967f86b9 106 .long AES_IRQHandler /* 16 - AES */
mbed_official 525:c320967f86b9 107 .long USART0_RX_IRQHandler /* 17 - USART0_RX */
mbed_official 525:c320967f86b9 108 .long USART0_TX_IRQHandler /* 18 - USART0_TX */
mbed_official 525:c320967f86b9 109 .long USB_IRQHandler /* 19 - USB */
mbed_official 525:c320967f86b9 110 .long TIMER2_IRQHandler /* 20 - TIMER2 */
mbed_official 525:c320967f86b9 111
mbed_official 525:c320967f86b9 112
mbed_official 525:c320967f86b9 113 .size __isr_vector, . - __isr_vector
mbed_official 525:c320967f86b9 114
mbed_official 525:c320967f86b9 115 .text
mbed_official 525:c320967f86b9 116 .thumb
mbed_official 525:c320967f86b9 117 .thumb_func
mbed_official 525:c320967f86b9 118 .align 2
mbed_official 525:c320967f86b9 119 .globl Reset_Handler
mbed_official 525:c320967f86b9 120 .type Reset_Handler, %function
mbed_official 525:c320967f86b9 121 Reset_Handler:
mbed_official 525:c320967f86b9 122 /* Loop to copy data from read only memory to RAM. The ranges
mbed_official 525:c320967f86b9 123 * of copy from/to are specified by following symbols evaluated in
mbed_official 525:c320967f86b9 124 * linker script.
mbed_official 525:c320967f86b9 125 * __etext: End of code section, i.e., begin of data sections to copy from.
mbed_official 525:c320967f86b9 126 * __data_start__/__data_end__: RAM address range that data should be
mbed_official 525:c320967f86b9 127 * copied to. Both must be aligned to 4 bytes boundary. */
mbed_official 525:c320967f86b9 128 #ifndef __NO_SYSTEM_INIT
mbed_official 525:c320967f86b9 129 ldr r0, =SystemInit
mbed_official 525:c320967f86b9 130 blx r0
mbed_official 525:c320967f86b9 131 #endif
mbed_official 525:c320967f86b9 132 ldr r1, =__etext
mbed_official 525:c320967f86b9 133 ldr r2, =__data_start__
mbed_official 525:c320967f86b9 134 ldr r3, =__data_end__
mbed_official 525:c320967f86b9 135
mbed_official 525:c320967f86b9 136 subs r3, r2
mbed_official 525:c320967f86b9 137 ble .flash_to_ram_loop_end
mbed_official 525:c320967f86b9 138 .flash_to_ram_loop:
mbed_official 525:c320967f86b9 139 subs r3, #4
mbed_official 525:c320967f86b9 140 ldr r0, [r1, r3]
mbed_official 525:c320967f86b9 141 str r0, [r2, r3]
mbed_official 525:c320967f86b9 142 bgt .flash_to_ram_loop
mbed_official 525:c320967f86b9 143 .flash_to_ram_loop_end:
mbed_official 525:c320967f86b9 144
mbed_official 525:c320967f86b9 145 ldr r0, =_start
mbed_official 525:c320967f86b9 146 bx r0
mbed_official 525:c320967f86b9 147 .pool
mbed_official 525:c320967f86b9 148 .size Reset_Handler, . - Reset_Handler
mbed_official 525:c320967f86b9 149
mbed_official 525:c320967f86b9 150 /* Macro to define default handlers. Default handler
mbed_official 525:c320967f86b9 151 * will be weak symbol and just dead loops. They can be
mbed_official 525:c320967f86b9 152 * overwritten by other handlers */
mbed_official 525:c320967f86b9 153 .macro def_irq_handler handler_name
mbed_official 525:c320967f86b9 154 .align 1
mbed_official 525:c320967f86b9 155 .thumb_func
mbed_official 525:c320967f86b9 156 .weak \handler_name
mbed_official 525:c320967f86b9 157 .type \handler_name, %function
mbed_official 525:c320967f86b9 158 \handler_name:
mbed_official 525:c320967f86b9 159 b .
mbed_official 525:c320967f86b9 160 .size \handler_name, . - \handler_name
mbed_official 525:c320967f86b9 161 .endm
mbed_official 525:c320967f86b9 162
mbed_official 525:c320967f86b9 163 def_irq_handler Default_Handler
mbed_official 525:c320967f86b9 164
mbed_official 525:c320967f86b9 165 def_irq_handler NMI_Handler
mbed_official 525:c320967f86b9 166 def_irq_handler HardFault_Handler
mbed_official 525:c320967f86b9 167 def_irq_handler SVC_Handler
mbed_official 525:c320967f86b9 168 def_irq_handler PendSV_Handler
mbed_official 525:c320967f86b9 169 def_irq_handler SysTick_Handler
mbed_official 525:c320967f86b9 170
mbed_official 525:c320967f86b9 171 def_irq_handler DMA_IRQHandler
mbed_official 525:c320967f86b9 172 def_irq_handler GPIO_EVEN_IRQHandler
mbed_official 525:c320967f86b9 173 def_irq_handler TIMER0_IRQHandler
mbed_official 525:c320967f86b9 174 def_irq_handler ACMP0_IRQHandler
mbed_official 525:c320967f86b9 175 def_irq_handler ADC0_IRQHandler
mbed_official 525:c320967f86b9 176 def_irq_handler I2C0_IRQHandler
mbed_official 525:c320967f86b9 177 def_irq_handler GPIO_ODD_IRQHandler
mbed_official 525:c320967f86b9 178 def_irq_handler TIMER1_IRQHandler
mbed_official 525:c320967f86b9 179 def_irq_handler USART1_RX_IRQHandler
mbed_official 525:c320967f86b9 180 def_irq_handler USART1_TX_IRQHandler
mbed_official 525:c320967f86b9 181 def_irq_handler LEUART0_IRQHandler
mbed_official 525:c320967f86b9 182 def_irq_handler PCNT0_IRQHandler
mbed_official 525:c320967f86b9 183 def_irq_handler RTC_IRQHandler
mbed_official 525:c320967f86b9 184 def_irq_handler CMU_IRQHandler
mbed_official 525:c320967f86b9 185 def_irq_handler VCMP_IRQHandler
mbed_official 525:c320967f86b9 186 def_irq_handler MSC_IRQHandler
mbed_official 525:c320967f86b9 187 def_irq_handler AES_IRQHandler
mbed_official 525:c320967f86b9 188 def_irq_handler USART0_RX_IRQHandler
mbed_official 525:c320967f86b9 189 def_irq_handler USART0_TX_IRQHandler
mbed_official 525:c320967f86b9 190 def_irq_handler USB_IRQHandler
mbed_official 525:c320967f86b9 191 def_irq_handler TIMER2_IRQHandler
mbed_official 525:c320967f86b9 192
mbed_official 525:c320967f86b9 193
mbed_official 525:c320967f86b9 194 .end