1 /* Copyright (C) 1994 Free Software Foundation, Inc.
2 Contributed by Joel Sherrill (jsherril@redstone-emh2.army.mil),
3 On-Line Applications Research Corporation.
5 This file is part of the GNU C Library.
7 The GNU C Library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Library General Public License as
9 published by the Free Software Foundation; either version 2 of the
10 License, or (at your option) any later version.
12 The GNU C Library is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 Library General Public License for more details.
17 You should have received a copy of the GNU Library General Public
18 License along with the GNU C Library; see the file COPYING.LIB. If
19 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
20 Cambridge, MA 02139, USA. */
24 * This file contains the entry point for the application.
25 * The name of this entry point is compiler dependent.
26 * It jumps to the BSP which is responsible for performing
32 .globl start # GNU960 default entry point
36 modpc r12, r12, r12 # enable tracing/trace faults
38 mov 0, g14 # initialize constant for C
41 * zero out uninitialized data area
44 lda _end, r4 /* find end of .bss */
45 lda _bss_start, r5 /* find beginning of .bss */
48 loop: st r6, (r5) /* to zero out uninitialized */
49 addo 4, r5, r5 /* data area */
50 cmpobl r5, r4, loop /* loop until _end reached */
53 lda heap_memory, r12 /* tell C lib where heap is */
54 st r12,___C_heap_start
55 lda heap_size, r12 /* tell C lib how big heap is */
57 lda stack_memory,r12 /* set up stack pointer: */
59 mov 0, g14 /* initialize constant for C */
62 ret /* return to monitor */
65 ldconst 0x3b001000, g0
66 ldconst 0x00009107, g1
67 modac g1, g0, g0 /* set AC controls */
70 * Call application mainline.
71 * Someday, real values of argc and argv will be set up.
72 * For now, they are set to 0.
75 callx __Board_Initialize /* Initialize the board */
80 callx ___libc_init /* initialize the library and */
83 * if we return from main, we have "fallen" off the end
84 * of the program, therefore status is 0
85 * so move 0 to g0 (exit parameter)
94 * Data Declarations. Start with a macro which helps declare space.
97 #define DECLARE_SPACE(_name,_space,_align) \
102 #define DECLARE_LABEL(_name) \
106 #define DECLARE_PTR(_name) DECLARE_SPACE(_name,4,2)
107 #define DECLARE_U32(_name) DECLARE_SPACE(_name,4,2)
108 #define DECLARE_U16(_name) DECLARE_SPACE(_name,2,1)
111 * Require environment stuff
114 DECLARE_LABEL(_environ)
117 DECLARE_LABEL(_errno)
121 * Stack Size and Space
124 .set stack_size, 0x20000
126 DECLARE_SPACE(stack_memory,stack_size,4)
127 DECLARE_LABEL(stack_end)
130 * Heap Size and Space
133 .set heap_size, 0x20000
135 DECLARE_SPACE(heap_memory,heap_size,4)
136 DECLARE_LABEL(heap_end)