OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [newlib-1.17.0/] [libgloss/] [sparc/] [crt0-701.S] - Diff between revs 158 and 816

Only display areas with differences | Details | Blame | View Log

Rev 158 Rev 816
/* crt0.S for the sparclet 701.
/* crt0.S for the sparclet 701.
   At the moment, all the necessary syscalls are here.
   At the moment, all the necessary syscalls are here.
   Convention has them in a separate file but libgloss is still in
   Convention has them in a separate file but libgloss is still in
   too much flux.  */
   too much flux.  */
        .text
        .text
        .global start
        .global start
start:
start:
! zero bss
! zero bss
        sethi %hi(_end), %o1
        sethi %hi(_end), %o1
        or %o1, %lo(_end), %o1
        or %o1, %lo(_end), %o1
        sethi %hi(_edata), %o0
        sethi %hi(_edata), %o0
        or %o0, %lo (_edata), %o0
        or %o0, %lo (_edata), %o0
        sub %o1, %o0, %o1
        sub %o1, %o0, %o1
Lzero_bss:
Lzero_bss:
        subcc %o1, 4, %o1
        subcc %o1, 4, %o1
        clr [%o0]
        clr [%o0]
        bne Lzero_bss
        bne Lzero_bss
        add %o0, 4, %o0
        add %o0, 4, %o0
! set up argc, argv, envp (?)
! set up argc, argv, envp (?)
        ld [%sp+64], %o0
        ld [%sp+64], %o0
        sll %o0, 2, %o2
        sll %o0, 2, %o2
        add %o2, 4, %o2
        add %o2, 4, %o2
        add %sp, 68, %o1
        add %sp, 68, %o1
        add %o1, %o2, %o2
        add %o1, %o2, %o2
        sethi %hi(_environ), %o3
        sethi %hi(_environ), %o3
        st %o2, [%o3+%lo(_environ)]
        st %o2, [%o3+%lo(_environ)]
! call main, exit
! call main, exit
        call _main
        call _main
        sub %sp, 32, %sp
        sub %sp, 32, %sp
        call _exit
        call _exit
        nop
        nop
! void _exit (int rc)
! void _exit (int rc)
        .global __exit
        .global __exit
__exit:
__exit:
        mov 1, %g1
        mov 1, %g1
        ta 0
        ta 0
! If that does not work, just loop forever.
! If that does not work, just loop forever.
Lloop_forever:
Lloop_forever:
        b Lloop_forever
        b Lloop_forever
        nop
        nop
! int _open (char *, int)
! int _open (char *, int)
        .global _open
        .global _open
_open:
_open:
        mov 5, %g1
        mov 5, %g1
        ta 0
        ta 0
        bcc Lnoerr
        bcc Lnoerr
        nop
        nop
        b Lcerror
        b Lcerror
        nop
        nop
! int _close (int)
! int _close (int)
        .global _close
        .global _close
_close:
_close:
        mov 6, %g1
        mov 6, %g1
        ta 0
        ta 0
        bcc Lnoerr
        bcc Lnoerr
        nop
        nop
        b Lcerror
        b Lcerror
        nop
        nop
! int read (int, char *, int)
! int read (int, char *, int)
        .global _read
        .global _read
_read:
_read:
        mov 3, %g1
        mov 3, %g1
        ta 0
        ta 0
        bcc Lnoerr
        bcc Lnoerr
        nop
        nop
        b Lcerror
        b Lcerror
        nop
        nop
! int write (int, char *, int)
! int write (int, char *, int)
        .global _write
        .global _write
_write:
_write:
        mov 4, %g1
        mov 4, %g1
        ta 0
        ta 0
        bcc Lnoerr
        bcc Lnoerr
        nop
        nop
        b Lcerror
        b Lcerror
        nop
        nop
Lnoerr:
Lnoerr:
        retl
        retl
        nop
        nop
Lcerror:
Lcerror:
        sethi %hi(__impure_ptr), %g1
        sethi %hi(__impure_ptr), %g1
        st %o0, [%g1+%lo(__impure_ptr)]
        st %o0, [%g1+%lo(__impure_ptr)]
        retl
        retl
        mov -1, %o0
        mov -1, %o0
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.