diff options
author | Christopher Faylor <me@cgf.cx> | 2000-02-17 22:39:52 +0300 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2000-02-17 22:39:52 +0300 |
commit | 8a0efa53e44919bcf5ccb1d3353618a82afdf8bc (patch) | |
tree | 68c3dbf3f2c6fd5d49777def9914d77b5cd4589d /newlib/libc/sys/sh/crt0.S | |
parent | 1fd5e000ace55b323124c7e556a7a864b972a5c4 (diff) |
import newlib-2000-02-17 snapshot
Diffstat (limited to 'newlib/libc/sys/sh/crt0.S')
-rw-r--r-- | newlib/libc/sys/sh/crt0.S | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/newlib/libc/sys/sh/crt0.S b/newlib/libc/sys/sh/crt0.S new file mode 100644 index 000000000..5ad67806a --- /dev/null +++ b/newlib/libc/sys/sh/crt0.S @@ -0,0 +1,55 @@ + .section .text + .global start +start: + mov.l stack_k,r15 + + ! zero out bss + mov.l edata_k,r0 + mov.l end_k,r1 + mov #0,r2 +start_l: + mov.l r2,@r0 + add #4,r0 + cmp/ge r0,r1 + bt start_l + +#if defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY) + mov.l set_fpscr_k, r1 + jsr @r1 + mov #0,r4 + lds r3,fpscr +#endif /* defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) */ + + ! call the mainline + mov.l main_k,r0 + jsr @r0 + or r0,r0 + + ! call exit + mov r0,r4 + mov.l exit_k,r0 + jsr @r0 + or r0,r0 + + .align 2 +#if defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) +set_fpscr_k: + .long ___set_fpscr +#endif /* defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(SH4_SINGLE_ONLY) */ +stack_k: + .long _stack +edata_k: + .long _edata +end_k: + .long _end +main_k: + .long _main +exit_k: + .long _exit + +#ifdef __ELF__ + .section .stack,"aw" +#else + .section .stack +#endif +_stack: .long 0xdeaddead |