RTC auf true
cmsis/TARGET_CORTEX_M/TOOLCHAIN_IAR/cmain.S@0:38ceb79fef03, 2018-11-28 (annotated)
- Committer:
- kevman
- Date:
- Wed Nov 28 15:10:15 2018 +0000
- Revision:
- 0:38ceb79fef03
RTC modified
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kevman | 0:38ceb79fef03 | 1 | /************************************************** |
kevman | 0:38ceb79fef03 | 2 | * |
kevman | 0:38ceb79fef03 | 3 | * Part two of the system initialization code, contains C-level |
kevman | 0:38ceb79fef03 | 4 | * initialization, thumb-2 only variant. |
kevman | 0:38ceb79fef03 | 5 | * |
kevman | 0:38ceb79fef03 | 6 | * $Revision: 59783 $ |
kevman | 0:38ceb79fef03 | 7 | * |
kevman | 0:38ceb79fef03 | 8 | **************************************************/ |
kevman | 0:38ceb79fef03 | 9 | /* Copyright 2008-2017, IAR Systems AB. |
kevman | 0:38ceb79fef03 | 10 | This source code is the property of IAR Systems. The source code may only |
kevman | 0:38ceb79fef03 | 11 | be used together with the IAR Embedded Workbench. Redistribution and use |
kevman | 0:38ceb79fef03 | 12 | in source and binary forms, with or without modification, is permitted |
kevman | 0:38ceb79fef03 | 13 | provided that the following conditions are met: |
kevman | 0:38ceb79fef03 | 14 | - Redistributions of source code, in whole or in part, must retain the |
kevman | 0:38ceb79fef03 | 15 | above copyright notice, this list of conditions and the disclaimer below. |
kevman | 0:38ceb79fef03 | 16 | - IAR Systems name may not be used to endorse or promote products |
kevman | 0:38ceb79fef03 | 17 | derived from this software without specific prior written permission. |
kevman | 0:38ceb79fef03 | 18 | |
kevman | 0:38ceb79fef03 | 19 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
kevman | 0:38ceb79fef03 | 20 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
kevman | 0:38ceb79fef03 | 21 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
kevman | 0:38ceb79fef03 | 22 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
kevman | 0:38ceb79fef03 | 23 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
kevman | 0:38ceb79fef03 | 24 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
kevman | 0:38ceb79fef03 | 25 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
kevman | 0:38ceb79fef03 | 26 | */ |
kevman | 0:38ceb79fef03 | 27 | |
kevman | 0:38ceb79fef03 | 28 | ; -------------------------------------------------- |
kevman | 0:38ceb79fef03 | 29 | ; Module ?cmain, C-level initialization. |
kevman | 0:38ceb79fef03 | 30 | ; |
kevman | 0:38ceb79fef03 | 31 | |
kevman | 0:38ceb79fef03 | 32 | |
kevman | 0:38ceb79fef03 | 33 | SECTION SHT$$PREINIT_ARRAY:CONST:NOROOT(2) |
kevman | 0:38ceb79fef03 | 34 | SECTION SHT$$INIT_ARRAY:CONST:NOROOT(2) |
kevman | 0:38ceb79fef03 | 35 | |
kevman | 0:38ceb79fef03 | 36 | SECTION .text:CODE:NOROOT(2) |
kevman | 0:38ceb79fef03 | 37 | |
kevman | 0:38ceb79fef03 | 38 | PUBLIC __cmain |
kevman | 0:38ceb79fef03 | 39 | ;; Keep ?main for legacy reasons, it is accessed in countless instances of cstartup.s around the world... |
kevman | 0:38ceb79fef03 | 40 | PUBLIC ?main |
kevman | 0:38ceb79fef03 | 41 | EXTWEAK __iar_data_init3 |
kevman | 0:38ceb79fef03 | 42 | EXTWEAK __iar_argc_argv |
kevman | 0:38ceb79fef03 | 43 | EXTERN __low_level_init |
kevman | 0:38ceb79fef03 | 44 | EXTERN __call_ctors |
kevman | 0:38ceb79fef03 | 45 | EXTERN main |
kevman | 0:38ceb79fef03 | 46 | EXTERN exit |
kevman | 0:38ceb79fef03 | 47 | EXTERN __iar_dynamic_initialization |
kevman | 0:38ceb79fef03 | 48 | EXTERN mbed_sdk_init |
kevman | 0:38ceb79fef03 | 49 | EXTERN mbed_main |
kevman | 0:38ceb79fef03 | 50 | EXTERN SystemInit |
kevman | 0:38ceb79fef03 | 51 | |
kevman | 0:38ceb79fef03 | 52 | THUMB |
kevman | 0:38ceb79fef03 | 53 | __cmain: |
kevman | 0:38ceb79fef03 | 54 | ?main: |
kevman | 0:38ceb79fef03 | 55 | |
kevman | 0:38ceb79fef03 | 56 | ; Initialize segments. |
kevman | 0:38ceb79fef03 | 57 | ; __segment_init and __low_level_init are assumed to use the same |
kevman | 0:38ceb79fef03 | 58 | ; instruction set and to be reachable by BL from the ICODE segment |
kevman | 0:38ceb79fef03 | 59 | ; (it is safest to link them in segment ICODE). |
kevman | 0:38ceb79fef03 | 60 | |
kevman | 0:38ceb79fef03 | 61 | FUNCALL __cmain, __low_level_init |
kevman | 0:38ceb79fef03 | 62 | bl __low_level_init |
kevman | 0:38ceb79fef03 | 63 | cmp r0,#0 |
kevman | 0:38ceb79fef03 | 64 | beq ?l1 |
kevman | 0:38ceb79fef03 | 65 | FUNCALL __cmain, __iar_data_init3 |
kevman | 0:38ceb79fef03 | 66 | bl __iar_data_init3 |
kevman | 0:38ceb79fef03 | 67 | MOVS r0,#0 ; No parameters |
kevman | 0:38ceb79fef03 | 68 | FUNCALL __cmain, mbed_sdk_init |
kevman | 0:38ceb79fef03 | 69 | BL mbed_sdk_init |
kevman | 0:38ceb79fef03 | 70 | MOVS r0,#0 ; No parameters |
kevman | 0:38ceb79fef03 | 71 | FUNCALL __cmain, __iar_dynamic_initialization |
kevman | 0:38ceb79fef03 | 72 | BL __iar_dynamic_initialization ; C++ dynamic initialization |
kevman | 0:38ceb79fef03 | 73 | |
kevman | 0:38ceb79fef03 | 74 | ?l1: |
kevman | 0:38ceb79fef03 | 75 | REQUIRE ?l3 |
kevman | 0:38ceb79fef03 | 76 | |
kevman | 0:38ceb79fef03 | 77 | SECTION .text:CODE:NOROOT(2) |
kevman | 0:38ceb79fef03 | 78 | |
kevman | 0:38ceb79fef03 | 79 | PUBLIC _main |
kevman | 0:38ceb79fef03 | 80 | PUBLIC _call_main |
kevman | 0:38ceb79fef03 | 81 | THUMB |
kevman | 0:38ceb79fef03 | 82 | |
kevman | 0:38ceb79fef03 | 83 | __iar_init$$done: ; Copy initialization is done |
kevman | 0:38ceb79fef03 | 84 | |
kevman | 0:38ceb79fef03 | 85 | ?l3: |
kevman | 0:38ceb79fef03 | 86 | _call_main: |
kevman | 0:38ceb79fef03 | 87 | MOVS r0,#0 ; No parameters |
kevman | 0:38ceb79fef03 | 88 | FUNCALL __cmain, __iar_argc_argv |
kevman | 0:38ceb79fef03 | 89 | BL __iar_argc_argv ; Maybe setup command line |
kevman | 0:38ceb79fef03 | 90 | |
kevman | 0:38ceb79fef03 | 91 | MOVS r0,#0 ; No parameters |
kevman | 0:38ceb79fef03 | 92 | FUNCALL __cmain, mbed_main |
kevman | 0:38ceb79fef03 | 93 | BL mbed_main |
kevman | 0:38ceb79fef03 | 94 | |
kevman | 0:38ceb79fef03 | 95 | FUNCALL __cmain, main |
kevman | 0:38ceb79fef03 | 96 | BL main |
kevman | 0:38ceb79fef03 | 97 | _main: |
kevman | 0:38ceb79fef03 | 98 | FUNCALL __cmain, exit |
kevman | 0:38ceb79fef03 | 99 | BL exit |
kevman | 0:38ceb79fef03 | 100 | |
kevman | 0:38ceb79fef03 | 101 | END |