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

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc1/] [libgloss/] [rx/] [crt0.S] - Diff between revs 207 and 345

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 207 Rev 345
/* Copyright (c) 2008, 2009 Red Hat Incorporated.
/* Copyright (c) 2008, 2009 Red Hat Incorporated.
   All rights reserved.
   All rights reserved.
   Redistribution and use in source and binary forms, with or without
   Redistribution and use in source and binary forms, with or without
   modification, are permitted provided that the following conditions
   modification, are permitted provided that the following conditions
   are met:
   are met:
     Redistributions of source code must retain the above copyright
     Redistributions of source code must retain the above copyright
     notice, this list of conditions and the following disclaimer.
     notice, this list of conditions and the following disclaimer.
     Redistributions in binary form must reproduce the above copyright
     Redistributions in binary form must reproduce the above copyright
     notice, this list of conditions and the following disclaimer in the
     notice, this list of conditions and the following disclaimer in the
     documentation and/or other materials provided with the distribution.
     documentation and/or other materials provided with the distribution.
     The name of Red Hat Incorporated may not be used to endorse
     The name of Red Hat Incorporated may not be used to endorse
     or promote products derived from this software without specific
     or promote products derived from this software without specific
     prior written permission.
     prior written permission.
   This software is provided by the copyright holders and contributors
   This software is provided by the copyright holders and contributors
   "AS IS" and any express or implied warranties, including, but not
   "AS IS" and any express or implied warranties, including, but not
   limited to, the implied warranties of merchantability and fitness for
   limited to, the implied warranties of merchantability and fitness for
   a particular purpose are disclaimed.  In no event shall Red Hat
   a particular purpose are disclaimed.  In no event shall Red Hat
   incorporated be liable for any direct, indirect, incidental, special,
   incorporated be liable for any direct, indirect, incidental, special,
   exemplary, or consequential damages (including, but not limited to,
   exemplary, or consequential damages (including, but not limited to,
   procurement of substitute goods or services; loss of use, data, or
   procurement of substitute goods or services; loss of use, data, or
   profits; or business interruption) however caused and on any theory of
   profits; or business interruption) however caused and on any theory of
   liability, whether in contract, strict liability, or tort (including
   liability, whether in contract, strict liability, or tort (including
   negligence or otherwise) arising in any way out of the use of this
   negligence or otherwise) arising in any way out of the use of this
   software, even if advised of the possibility of such damage.  */
   software, even if advised of the possibility of such damage.  */
        .text
        .text
        .global _start
        .global _start
_start:
_start:
.LFB2:
.LFB2:
        mvtc    #0, psw
        mvtc    #0, psw
        /* Enable the DN bit - this should have been done for us by
        /* Enable the DN bit - this should have been done for us by
           the CPU reset, but it is best to make sure for ourselves.  */
           the CPU reset, but it is best to make sure for ourselves.  */
        mvtc    #0x100, fpsw
        mvtc    #0x100, fpsw
        mov     #__stack, r0
        mov     #__stack, r0
        mvtc    #__vectors, intb
        mvtc    #__vectors, intb
        mov     #__datastart, r1
        mov     #__datastart, r1
        mov     #__romdatastart, r2
        mov     #__romdatastart, r2
        mov     #__romdatacopysize, r3
        mov     #__romdatacopysize, r3
        smovf
        smovf
        mov     #__bssstart, r1
        mov     #__bssstart, r1
        mov     #0, r2
        mov     #0, r2
        mov     #__bsssize, r3
        mov     #__bsssize, r3
        sstr.l
        sstr.l
        /* Initialise the small data area pointer.
        /* Initialise the small data area pointer.
           The register used here must agree with the definition of
           The register used here must agree with the definition of
           GP_BASE_REGNUM in gcc/config/rx/rx.h.  */
           GP_BASE_REGNUM in gcc/config/rx/rx.h.  */
        mov     #__gp, r13
        mov     #__gp, r13
        bsr.a   __rx_init
        bsr.a   __rx_init
#ifdef PROFILE_SUPPORT  /* Defined in gcrt0.S.  */
#ifdef PROFILE_SUPPORT  /* Defined in gcrt0.S.  */
        mov     # _start, r1
        mov     # _start, r1
        mov     # _etext, r2
        mov     # _etext, r2
        bsr.a   __monstartup
        bsr.a   __monstartup
#endif
#endif
        mov     #0, r1 /* argc */
        mov     #0, r1 /* argc */
        mov     #0, r2 /* argv */
        mov     #0, r2 /* argv */
        mov     #0, r3 /* envv */
        mov     #0, r3 /* envv */
        bsr.a   _main
        bsr.a   _main
.LFE2:
.LFE2:
#ifdef PROFILE_SUPPORT
#ifdef PROFILE_SUPPORT
        mov      r1, r13       ; Save return code.
        mov      r1, r13       ; Save return code.
        bsr.a   __mcleanup
        bsr.a   __mcleanup
        mov     r13, r1
        mov     r13, r1
#endif
#endif
        bsr.a   _exit
        bsr.a   _exit
        .global _rx_run_preinit_array
        .global _rx_run_preinit_array
        .type   _rx_run_preinit_array,@function
        .type   _rx_run_preinit_array,@function
_rx_run_preinit_array:
_rx_run_preinit_array:
        mov     #__preinit_array_start,r1
        mov     #__preinit_array_start,r1
        mov     #__preinit_array_end,r2
        mov     #__preinit_array_end,r2
        bra.a   _rx_run_inilist
        bra.a   _rx_run_inilist
        .global _rx_run_init_array
        .global _rx_run_init_array
        .type   _rx_run_init_array,@function
        .type   _rx_run_init_array,@function
_rx_run_init_array:
_rx_run_init_array:
        mov     #__init_array_start,r1
        mov     #__init_array_start,r1
        mov     #__init_array_end,r2
        mov     #__init_array_end,r2
        mov     #4, r3
        mov     #4, r3
        bra.a   _rx_run_inilist
        bra.a   _rx_run_inilist
        .global _rx_run_fini_array
        .global _rx_run_fini_array
        .type   _rx_run_fini_array,@function
        .type   _rx_run_fini_array,@function
_rx_run_fini_array:
_rx_run_fini_array:
        mov     #__fini_array_start,r2
        mov     #__fini_array_start,r2
        mov     #__fini_array_end,r1
        mov     #__fini_array_end,r1
        mov     #-4, r3
        mov     #-4, r3
        /* fall through */
        /* fall through */
_rx_run_inilist:
_rx_run_inilist:
next_inilist:
next_inilist:
        cmp     r1,r2
        cmp     r1,r2
        beq.b   done_inilist
        beq.b   done_inilist
        mov.l   [r1],r4
        mov.l   [r1],r4
        cmp     #-1, r4
        cmp     #-1, r4
        beq.b   skip_inilist
        beq.b   skip_inilist
        cmp     #0, r4
        cmp     #0, r4
        beq.b   skip_inilist
        beq.b   skip_inilist
        pushm   r1-r3
        pushm   r1-r3
        jsr     r4
        jsr     r4
        popm    r1-r3
        popm    r1-r3
skip_inilist:
skip_inilist:
        add     r3,r1
        add     r3,r1
        bra.b   next_inilist
        bra.b   next_inilist
done_inilist:
done_inilist:
        rts
        rts
        .section        .init,"ax"
        .section        .init,"ax"
        .global __rx_init
        .global __rx_init
__rx_init:
__rx_init:
        .section        .fini,"ax"
        .section        .fini,"ax"
        .global __rx_fini
        .global __rx_fini
__rx_fini:
__rx_fini:
        bsr.a   _rx_run_fini_array
        bsr.a   _rx_run_fini_array
        .section .sdata
        .section .sdata
        .balign 4
        .balign 4
        .global __gp
        .global __gp
        .weak   __gp
        .weak   __gp
__gp:
__gp:
        .section .data
        .section .data
        .global ___dso_handle
        .global ___dso_handle
        .weak   ___dso_handle
        .weak   ___dso_handle
___dso_handle:
___dso_handle:
        .long   0
        .long   0
;;; Provide Dwarf unwinding information that will help GDB stop
;;; Provide Dwarf unwinding information that will help GDB stop
;;; backtraces at the right place.  This is stolen from assembly
;;; backtraces at the right place.  This is stolen from assembly
;;; code generated by GCC with -dA.
;;; code generated by GCC with -dA.
        .section        .debug_frame,"",@progbits
        .section        .debug_frame,"",@progbits
.Lframe0:
.Lframe0:
        .4byte  .LECIE0-.LSCIE0 ; Length of Common Information Entry
        .4byte  .LECIE0-.LSCIE0 ; Length of Common Information Entry
.LSCIE0:
.LSCIE0:
        .4byte  0xffffffff      ; CIE Identifier Tag
        .4byte  0xffffffff      ; CIE Identifier Tag
        .byte   0x1     ; CIE Version
        .byte   0x1     ; CIE Version
        .ascii "\0"     ; CIE Augmentation
        .ascii "\0"     ; CIE Augmentation
        .uleb128 0x1    ; CIE Code Alignment Factor
        .uleb128 0x1    ; CIE Code Alignment Factor
        .sleb128 -1     ; CIE Data Alignment Factor
        .sleb128 -1     ; CIE Data Alignment Factor
        .byte   0xd     ; CIE RA Column
        .byte   0xd     ; CIE RA Column
        .byte   0xc     ; DW_CFA_def_cfa
        .byte   0xc     ; DW_CFA_def_cfa
        .uleb128 0xc
        .uleb128 0xc
        .uleb128 0x3
        .uleb128 0x3
        .byte   0x8d    ; DW_CFA_offset, column 0xd
        .byte   0x8d    ; DW_CFA_offset, column 0xd
        .uleb128 0x3
        .uleb128 0x3
        .p2align 2
        .p2align 2
.LECIE0:
.LECIE0:
.LSFDE0:
.LSFDE0:
        .4byte  .LEFDE0-.LASFDE0        ; FDE Length
        .4byte  .LEFDE0-.LASFDE0        ; FDE Length
.LASFDE0:
.LASFDE0:
        .4byte  .Lframe0        ; FDE CIE offset
        .4byte  .Lframe0        ; FDE CIE offset
        .4byte  .LFB2           ; FDE initial location
        .4byte  .LFB2           ; FDE initial location
        .4byte  .LFE2-.LFB2     ; FDE address range
        .4byte  .LFE2-.LFB2     ; FDE address range
        .byte   0xf             ; DW_CFA_def_cfa_expression
        .byte   0xf             ; DW_CFA_def_cfa_expression
        .uleb128 1              ; length of expression
        .uleb128 1              ; length of expression
        .byte   0x30            ; DW_OP_lit0
        .byte   0x30            ; DW_OP_lit0
        .p2align 2
        .p2align 2
.LEFDE0:
.LEFDE0:
        .text
        .text
 
 

powered by: WebSVN 2.1.0

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