Back to home page

LXR

 
 

    


File indexing completed on 2025-05-11 08:23:50

0001 /* SPDX-License-Identifier: BSD-3-Clause */
0002 
0003 /* Copyright (c) 2001, 2009 Xilinx, Inc.  All rights reserved.
0004 
0005    Redistribution and use in source and binary forms, with or without
0006    modification, are permitted provided that the following conditions are
0007    met:
0008 
0009    1.  Redistributions source code must retain the above copyright notice,
0010    this list of conditions and the following disclaimer.
0011 
0012    2.  Redistributions in binary form must reproduce the above copyright
0013    notice, this list of conditions and the following disclaimer in the
0014    documentation and/or other materials provided with the distribution.
0015 
0016    3.  Neither the name of Xilinx nor the names of its contributors may be
0017    used to endorse or promote products derived from this software without
0018    specific prior written permission.
0019 
0020    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
0021    IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
0022    TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
0023    PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
0024    HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
0025    SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
0026    TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
0027    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
0028    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
0029    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
0030    SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0031 
0032 
0033         XMD load *.elf error:
0034         MicroBlaze Vector Map for standalone executables
0035 
0036          Address                Vector type                 Label
0037          -------                -----------                 ------
0038 
0039         # 0x00 #                (-- IMM --)
0040         # 0x04 #                Reset                       _start1
0041 
0042         # 0x08 #                (-- IMM --)
0043         # 0x0c #                Software Exception          _exception_handler
0044 
0045         # 0x10 #                (-- IMM --)
0046         # 0x14 #                Hardware Interrupt          _interrupt_handler
0047 
0048         # 0x18 #                (-- IMM --)
0049         # 0x1C #                Breakpoint Exception        _debug_sw_break_handler
0050 
0051         # 0x20 #                (-- IMM --)
0052         # 0x24 #                Hardware Exception          _hw_exception_handler
0053 
0054 */
0055 
0056 
0057     .globl _start
0058     .section .vectors.reset, "ax"
0059     .align 2
0060     .ent _start
0061     .type _start, @function
0062 _start:
0063     brai _start1
0064     .end _start
0065 
0066     .section .vectors.sw_exception, "ax"
0067     .align 2
0068 _vector_sw_exception:
0069     brai _exception_handler
0070 
0071     .section .vectors.interrupt, "ax"
0072     .align 2
0073 _vector_interrupt:
0074     brai _interrupt_handler
0075 
0076     .section .vectors.debug_sw_break, "ax"
0077     .align 2
0078 _vector_debug_sw_break:
0079     brai _debug_sw_break_handler
0080 
0081     .section .vectors.hw_exception, "ax"
0082     .align 2
0083 _vector_hw_exception:
0084 /*
0085  * Hardware and software exceptions are handled identically with the MSR[EiP]
0086  * bit differentiating them and determining which register should be used for
0087  * return.
0088  */
0089     brai _exception_handler
0090 
0091     .section .text
0092     .globl _start1
0093     .align 2
0094     .ent _start1
0095     .type _start1, @function
0096 _start1:
0097     //la r13, r0, _SDA_BASE_         /* Set the Small Data Anchors and the stack pointer */
0098     //la r2, r0, _SDA2_BASE_
0099     la r1, r0, _ISR_Stack_area_end-16           /* 16 bytes (4 words are needed by crtinit for args and link reg */
0100 
0101     brlid r15, _crtinit               /* Initialize BSS and run program */
0102     nop
0103 
0104 #ifndef __rtems__
0105     brlid   r15, exit                   /* Call exit with the return value of main */
0106     addik   r5, r3, 0
0107 #endif /* __rtems__ */
0108 
0109     /* Control does not reach here */
0110     .end _start1
0111 
0112 #ifndef __rtems__
0113 /*
0114     _exit
0115     Our simple _exit
0116 */
0117     .globl _exit
0118     .align 2
0119     .ent _exit
0120     .type _exit, @function
0121 _exit:
0122     bri     0
0123     .end _exit
0124 #endif /* __rtems__ */