source: rtems/bsps/mips/csb350/start/start.S @ ff081aee

Last change on this file since ff081aee was ff081aee, checked in by Sebastian Huber <sebastian.huber@…>, on Nov 6, 2018 at 3:58:02 PM

score: Rename interrupt stack symbols

Rename

  • _Configuration_Interrupt_stack_area_begin in _ISR_Stack_area_begin,
  • _Configuration_Interrupt_stack_area_end in _ISR_Stack_area_end, and
  • _Configuration_Interrupt_stack_size in _ISR_Stack_size.

Move definitions to <rtems/score/isr.h>. The new names are considerable
shorter and in the right namespace.

Update #3459.

  • Property mode set to 100644
File size: 3.0 KB
Line 
1/*
2 * start.S -- startup file for Cogent CSB350 Au1100 based board
3 *
4 *  Copyright (c) 2005 by Cogent Computer Systems
5 *  Written by Jay Monkman <jtm@lopingdog.com>
6 *
7 *  The license and distribution terms for this file may be
8 *  found in the file LICENSE in this distribution or at
9 *  http://www.rtems.org/license/LICENSE.
10 *
11 */
12
13#include <rtems/asm.h>
14#include <bsp/regs.h>
15
16        .text
17        .align  2
18
19/* Without the following nop, GDB thinks _start is a data variable.
20 * This is probably a bug in GDB in handling a symbol that is at the
21 * start of the .text section.
22 */
23        nop
24
25        .globl  _start
26        .ent    _start
27_start:
28        .set    noreorder
29
30        /* Get the address of start into $5 in a position independent
31         * fashion. This lets us know whether we have been relocated or not.
32         */
33        $LF1 = . + 8
34        bal     $LF1
35        nop
36_branch:
37        move    $5, $31                 /* $5 == where are we */
38        li      $6, 0x8800000c          /* $6 == where we want to be */
39
40        li      v0, SR_CU1|SR_PE|SR_FR|SR_KX|SR_SX|SR_UX
41        mtc0    v0, C0_SR
42        mtc0    zero, C0_CAUSE
43
441:
45        li      v0, SR_PE|SR_FR|SR_KX|SR_SX|SR_UX
46        mtc0    v0, C0_SR
472:
48/* Fix high bits, if any, of the PC so that exception handling
49   doesn't get confused.  */
50        la v0, 3f
51        jr      v0
52        nop
533:
54        la gp, _gp                      /* set the global data pointer */
55        .end _start
56
57/*
58 * zero out the bss section.
59 */
60        .globl  zerobss
61        .ent    zerobss
62zerobss:
63        la v0, _fbss
64        la v1, _end
653:
66        sw      zero,0(v0)
67        bltu    v0,v1,3b
68        addiu   v0,v0,4                 /* executed in delay slot */
69
70        la      t0, _ISR_Stack_area_end /* initialize stack so we */
71        /* We must subtract 24 bytes for the 3 8 byte arguments to main, in
72           case main wants to write them back to the stack.  The caller is
73           supposed to allocate stack space for parameters in registers in
74           the old MIPS ABIs.  We must do this even though we aren't passing
75           arguments, because main might be declared to have them.
76
77           Some ports need a larger alignment for the stack, so we subtract
78           32, which satisifes the stack for the arguments and keeps the
79           stack pointer better aligned.  */
80        subu    t0,t0,32
81        move    sp,t0                   /* set stack pointer */
82        .end    zerobss
83
84        .globl  exit .text
85        .globl  init
86        .ent    init
87init:
88
89        move    a0,zero                 /* set command line to 0 */
90        jal     boot_card               /* call the program start function */
91        nop
92
93        /* fall through to the "exit" routine */
94        jal     _sys_exit               /* call libc exit to run the G++ */
95                                        /* destructors */
96        move    a0,v0                   /* pass through the exit code */
97        .end    init
98
99/*
100 * _sys_exit -- Exit from the application. Normally we cause a user trap
101 *          to return to the ROM monitor for another run. NOTE: This is
102 *          the only other routine we provide in the crt0.o object, since
103 *          it may be tied to the "_start" routine. It also allows
104 *          executables that contain a complete world to be linked with
105 *          just the crt0.o object.
106 */
107        .globl  _sys_exit
108        .ent _sys_exit
109_sys_exit:
1107:
111#ifdef GCRT0
112        jal     _mcleanup
113        nop
114#endif
115        /* break inst. can cope with 0xfffff, but GAS limits the range: */
116        break   1023
117        nop
118        b       7b                      /* but loop back just in-case */
119        nop
120        .end _sys_exit
121
122/* EOF crt0.S */
Note: See TracBrowser for help on using the repository browser.