diff options
Diffstat (limited to 'libgloss/msp430/crt0.S')
-rw-r--r-- | libgloss/msp430/crt0.S | 75 |
1 files changed, 3 insertions, 72 deletions
diff --git a/libgloss/msp430/crt0.S b/libgloss/msp430/crt0.S index c511959d0..388b67829 100644 --- a/libgloss/msp430/crt0.S +++ b/libgloss/msp430/crt0.S @@ -13,38 +13,18 @@ #include "memmodel.h" -;; The linker links all .crt_* sections in asciibetical order at the -;; same place. So, the four digits in .crt_NNNN determine the link -;; order, so, keep them in sequential order here. The first two -;; digits are set here, the second two allow users to insert code -;; between code fragments here. - -#if L0 .section ".resetvec", "a" __msp430_resetvec_hook: .word __start - .section ".crt_0000init", "ax", @progbits - .refsym __msp430_resetvec_hook -#ifdef MINRT - .refsym __crt0_call_just_main -#else - .refsym __crt0_call_init_then_main -#endif + .section ".lowtext", "ax", @progbits .global __start __start: mov_ #__stack, R1 ;; Disable watchdog timer. MOV #0x5a80, &0x15C -#endif -#if Lbss - .section ".crt_0100bss", "ax", @progbits - - .global __crt0_init_bss -__crt0_init_bss: - mov_ #__bssstart, R12 clr.w R13 mov.w #__bsssize, R14 @@ -52,32 +32,7 @@ __crt0_init_bss: clr.w R15 ; We assume that __bsssize is never > 64M #endif call_ #memset -#endif - -#ifdef __MSP430X_LARGE__ -#if Lhigh_bss -;; Note - this section is only included in the -;; startup code of the application if it is needed. - - .section ".crt_0150high_bss", "ax", @progbits - - .global __crt0_init_high_bss -__crt0_init_high_bss: - - mov_ #llo(__high_bssstart), R12 - mov_ #lhi(__high_bssstart), R13 - mov.w #llo(__high_bsssize), R14 - mov.w #lhi(__high_bsssize), R15 - call_ #memset -#endif /* Lhigh_bss */ -#endif /* __MSP430X_LARGE__ */ -#if Lmovedata - .section ".crt_0200movedata", "ax", @progbits - - .global __crt0_movedata -__crt0_movedata: - mov_ #__datastart, R12 mov_ #__romdatastart, R13 @@ -91,38 +46,17 @@ __crt0_movedata: #endif call_ #memmove 1: -#endif - -#if Lmain_minrt - .section ".crt_0300main", "ax", @progbits - .global __crt0_call_just_main -__crt0_call_just_main: - clr.w R12 ; Set argc == 0 - call_ #main -#endif - -#if Lmain - .section ".crt_0300main", "ax", @progbits - .global __crt0_call_init_then_main -__crt0_call_init_then_main: call_ #__msp430_init clr.w R12 ; Set argc == 0 call_ #main -#endif -#if Lcallexit - .section ".crt_0400main_exit", "ax", @progbits - .global __crt0_call_exit -__crt0_call_exit: call_ #_exit -#endif + + .word __msp430_resetvec_hook ;---------------------------------------- -#ifndef MINRT -#if L0 - .section ".crt_0500main_init", "ax", @progbits .global _msp430_run_init_array .type _msp430_run_init_array,@function _msp430_run_init_array: @@ -170,6 +104,3 @@ __msp430_init: .global __msp430_fini __msp430_fini: call_ #_msp430_run_fini_array - -#endif -#endif |