newlib/libgloss/v850/crt0.S
Jeff Johnston c0c762e419 2010-07-23 Naveen.H.S <naveenh1@kpitcummins.com>
Gina Verlekar <gina.verlekar@kpitcummins.com>

        Moving files from libc/sys/sysnecv850 to libgloss/v850

        * libgloss/libnosys/configure: Regenerated.
        * libgloss/libnosys/configure.in: Compact v850 support to v850*-*-*.
        * libgloss/libnosys/configure: Regenerated.
        * libgloss/configure.in: Add libgloss support for v850.
        * libgloss/configure: Regenerated.
        * libgloss/v850/access.c: New file.
        * libgloss/v850/aclocal.m4: New.
        * libgloss/v850/chmod.c: New.
        * libgloss/v850/chown.c: New.
        * libgloss/v850/close.c: New.
        * libgloss/v850/configure: New.
        * libgloss/v850/configure.in: New.
        * libgloss/v850/crt0.S: New.
        * libgloss/v850/crt1.c: New.
        * libgloss/v850/execv.c: New.
        * libgloss/v850/execve.c: New.
        * libgloss/v850/_exit.c: New.
        * libgloss/v850/fork.c: New.
        * libgloss/v850/fstat.c: New.
        * libgloss/v850/getpid.c: New.
        * libgloss/v850/gettime.c: New.
        * libgloss/v850/isatty.c: New.
        * libgloss/v850/kill.c: New.
        * libgloss/v850/link.c: New.
        * libgloss/v850/lseek.c: New.
        * libgloss/v850/Makefile.in: New.
        * libgloss/v850/open.c: New.
        * libgloss/v850/pipe.c: New.
        * libgloss/v850/read.c: New.
        * libgloss/v850/sbrk.c: New.
        * libgloss/v850/sim.ld: New.
        * libgloss/v850/stat.c: New.
        * libgloss/v850/time.c: New.
        * libgloss/v850/times.c: New.
        * libgloss/v850/trap.S: New.
        * libgloss/v850/unlink.c: New.
        * libgloss/v850/utime.c: New.
        * libgloss/v850/wait.c: New.
        * libgloss/v850/write.c: New.
2010-07-23 17:52:37 +00:00

73 lines
1.3 KiB
ArmAsm

# NEC V850 startup code
.section .text
.global _start
_start:
#if defined(__v850e__) || defined(__v850e2__) || defined(__v850e2v3__)
movea 255, r0, r20
mov 65535, r21
mov hilo(_stack), sp
mov hilo(__ep), ep
mov hilo(__gp), gp
mov hilo(__ctbp), r6
ldsr r6, ctbp
mov hilo(_edata), r6
mov hilo(_end), r7
.L0:
st.w r0, 0[r6]
addi 4, r6, r6
cmp r7, r6
bl .L0
.L1:
jarl ___main, r31
addi -16, sp, sp
mov 0, r6
mov 0, r7
mov 0, r8
jarl _main, r31
mov r10, r6
jarl _exit, r31
# else
movea 255, r0, r20
mov r0, r21
ori 65535, r0, r21
movhi hi(_stack), r0, sp
movea lo(_stack), sp, sp
movhi hi(__ep), r0, ep
movea lo(__ep), ep, ep
movhi hi(__gp), r0, gp
movea lo(__gp), gp, gp
movhi hi(_edata), r0, r6
movea lo(_edata), r6, r6
movhi hi(_end), r0, r7
movea lo(_end), r7, r7
.L0:
st.b r0, 0[r6]
addi 1, r6, r6
cmp r7, r6
bl .L0
.L1:
jarl ___main, r31
addi -16, sp, sp
mov 0, r6
mov 0, r7
mov 0, r8
jarl _main, r31
mov r10, r6
jarl _exit, r31
# endif
.section .stack
_stack: .long 1
.section .data
.global ___dso_handle
.weak ___dso_handle
___dso_handle:
.long 0