1 /* Copyright (C) 1994, 1997 Free Software Foundation, Inc.
2 Contributed by Joel Sherrill (jsherril@redstone-emh2.army.mil),
3 On-Line Applications Research Corporation.
4 This file is part of the GNU C Library.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public License as
8 published by the Free Software Foundation; either version 2 of the
9 License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
16 You should have received a copy of the GNU Library General Public
17 License along with the GNU C Library; see the file COPYING.LIB. If not,
18 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
23 * This file contains the entry point for the application.
24 * The name of this entry point is compiler dependent.
25 * It jumps to the BSP which is responsible for performing
31 .globl start # GNU960 default entry point
35 modpc r12, r12, r12 # enable tracing/trace faults
37 mov 0, g14 # initialize constant for C
40 * zero out uninitialized data area
43 lda _end, r4 /* find end of .bss */
44 lda _bss_start, r5 /* find beginning of .bss */
47 loop: st r6, (r5) /* to zero out uninitialized */
48 addo 4, r5, r5 /* data area */
49 cmpobl r5, r4, loop /* loop until _end reached */
52 lda heap_memory, r12 /* tell C lib where heap is */
53 st r12,___C_heap_start
54 lda heap_size, r12 /* tell C lib how big heap is */
56 lda stack_memory,r12 /* set up stack pointer: */
58 mov 0, g14 /* initialize constant for C */
61 ret /* return to monitor */
64 ldconst 0x3b001000, g0
65 ldconst 0x00009107, g1
66 modac g1, g0, g0 /* set AC controls */
69 * Call application mainline.
70 * Someday, real values of argc and argv will be set up.
71 * For now, they are set to 0.
74 callx __Board_Initialize /* Initialize the board */
79 callx ___libc_init /* initialize the library and */
82 * if we return from main, we have "fallen" off the end
83 * of the program, therefore status is 0
84 * so move 0 to g0 (exit parameter)
93 * Data Declarations. Start with a macro which helps declare space.
96 #define DECLARE_SPACE(_name,_space,_align) \
101 #define DECLARE_LABEL(_name) \
105 #define DECLARE_PTR(_name) DECLARE_SPACE(_name,4,2)
106 #define DECLARE_U32(_name) DECLARE_SPACE(_name,4,2)
107 #define DECLARE_U16(_name) DECLARE_SPACE(_name,2,1)
110 * Require environment stuff
113 DECLARE_LABEL(_environ)
116 DECLARE_LABEL(_errno)
120 * Stack Size and Space
123 .set stack_size, 0x20000
125 DECLARE_SPACE(stack_memory,stack_size,4)
126 DECLARE_LABEL(stack_end)
129 * Heap Size and Space
132 .set heap_size, 0x20000
134 DECLARE_SPACE(heap_memory,heap_size,4)
135 DECLARE_LABEL(heap_end)