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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [rtems/] [c/] [src/] [lib/] [libbsp/] [i960/] [cvme961/] [start/] [start.S] - Blame information for rev 778

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 unneback
/*  entry.s
2
 *
3
 *  This file contains the entry point for the application.
4
 *  The name of this entry point is compiler dependent.
5
 *  It jumps to the BSP which is responsible for performing
6
 *  all initialization.
7
 *
8
 *  COPYRIGHT (c) 1989-1999.
9
 *  On-Line Applications Research Corporation (OAR).
10
 *
11
 *  The license and distribution terms for this file may be
12
 *  found in the file LICENSE in this distribution or at
13
 *  http://www.OARcorp.com/rtems/license.html.
14
 *
15
 *  $Id: start.S,v 1.2 2001-09-27 11:59:56 chris Exp $
16
 */
17
 
18
#include "asm.h"
19
 
20
        BEGIN_CODE
21
        PUBLIC(start)                 # GNU960 default entry point
22
 
23
SYM(start):
24
        mov     3, r12
25
        modpc   r12, r12, r12         # enable tracing/trace faults
26
        mov     g5, g5                # NOP
27
        mov     0, g14                # initialize constant for C
28
 
29
        /*
30
         * zero out uninitialized data area
31
         */
32
zerobss:
33
        lda     _end, r4        /* find end of .bss */
34
        lda     _bss_start, r5  /* find beginning of .bss */
35
        ldconst 0, r6
36
 
37
loop:   st      r6, (r5)        /* to zero out uninitialized */
38
        addo    4, r5, r5       /* data area                 */
39
        cmpobl  r5, r4, loop    /* loop until _end reached   */
40
 
41
/* set up stack pointer:
42
 *   The heap will begin at '_end';  its length is 'heap_size'
43
 *   bytes.  The stack will begin at the first 64-byte-aligned
44
 *   block after the heap.
45
 *
46
 *   A default value of 'heap_size' is set by linking with libnindy.a
47
 *   The default can be overridden by redefining this symbol at link
48
 *   time (with a line of the form 'heap_size=XXXX;' in the lnk960
49
 *   linker specification file; or one of the form
50
 *   "-defsym heap_size=XXXX" on the gld960 invocation line).
51
 */
52
 
53
        ldconst _end, sp         /* set sp = address of end of heap */
54
        lda     heap_size(sp),sp
55
        lda     64(sp), sp       /* Now round up to 64-byte boundary */
56
        ldconst 0xffffffc0, r12
57
        and     r12, sp, sp
58
        st      sp, _stack_start /* Save for brk() routine */
59
 
60
        call    init_frames
61
        ret                      /* return to monitor */
62
 
63
init_frames:
64
        mov     0, g14           /* initialize constant for C */
65
        ldconst 0x3b001000, g0
66
        ldconst 0x00009107, g1
67
        modac   g1, g0, g0       /* set AC controls */
68
 
69
        /*
70
         * remember the frame, so that we can set it up if necessary
71
         */
72
 
73
        st      fp, _start_frame
74
 
75
        /*
76
         * Call application boot_card.
77
         *      Someday, real values of argc and argv will be set up.
78
         *      For now, they are set to 0.
79
         */
80
        ldconst 0,g0
81
        ldconst 0,g1
82
        ldconst 0,g2
83
        call    _boot_card
84
        ret
85
 
86
END_CODE
87
 
88
         BEGIN_DATA
89
 
90
        PUBLIC(_start_frame)
91
        PUBLIC(start_frame)
92
SYM (_start_frame):
93
SYM (start_frame):
94
        .word   0                  # addr of first user frame: for gdb960
95
 
96
        PUBLIC(_stack_start)
97
        PUBLIC(stack_start)
98
SYM (_stack_start):
99
SYM (stack_start):
100
        .word   0                  # addr of first user frame: for gdb960
101
 
102
END_DATA
103
 
104
BEGIN_BSS
105
        PUBLIC(heap_size)
106
        .set    heap_size,0x2000
107
END_BSS
108
 
109
END

powered by: WebSVN 2.1.0

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