source: rtems/c/src/lib/libbsp/bfin/shared/start/start.S @ 018008cc

4.104.114.84.95
Last change on this file since 018008cc was 018008cc, checked in by Joel Sherrill <joel.sherrill@…>, on Sep 10, 2007 at 1:55:25 PM

2007-09-10 Alain Schaefer <alani@…>

  • shared/start/start.S: Initialize bss to zero.
  • Property mode set to 100644
File size: 1.5 KB
Line 
1
2
3#include <rtems/bfin/bfin.h>   
4
5#ifndef LO
6#define LO(con32) ((con32) & 0xFFFF)
7#endif
8#ifndef HI
9#define HI(con32) (((con32) >> 16) & 0xFFFF)
10#endif
11
12
13        .section .init
14        .globl  __init
15        .type   __init,@function
16__init:
17        .section .fini
18        .globl  __fini
19        .type   __fini,@function
20__fini:
21
22
23    .section .l1code
24    .align  4
25
26    .global __start
27__start:
28
29    /* Start by setting up a stack */
30    sp.h = 0xFFB0;
31    sp.l = 0x0F00;
32   
33    /* Maybe we should zero the memory in the .bss section.  */
34
35    /* This changes to the supervisor mode */
36    p0.l = START;
37    p0.h = START;
38    p1.l = LO(EVT15);
39    p1.h = HI(EVT15);
40   
41    [P1] = P0;
42   
43    P0.h = HI(IMASK);
44    P0.l = LO(IMASK);
45    R0 = [P0];
46    /* R1.l = EVT_IVG15 & 0xFFFF; */
47    R1.l = 0x8000;
48   
49    R0 = R0 | R1;
50   
51    [P0] = R0;
52
53    RAISE 15;
54   
55    P0.l = WAIT;
56    P0.h = WAIT;
57
58    RETI = P0;
59    RTI;
60   
61    /* endless loop to wait */
62    WAIT:   
63    jump WAIT;
64   
65    START:
66    [--SP] = RETI;
67   
68    p0.h = _bss_start;
69    p0.l = _bss_start;
70    p1.h = _end;
71    p1.l = _end;
72    r0 = p0;
73    r1 = p1;
74    r1 = r1 - r0;
75    p1 = r1;   
76    r0 = 0;
77
78    /* Set _bss_start until _end to zero */
79    lsetup(loop1,loop2) LC0 = p1;
80    loop1:     b[p0] = r0;
81    loop2:  p0 +=1;
82
83    p0.l = _boot_card;
84    p0.h = _boot_card;
85
86    call (p0);
87
88    p0.l = _exit;
89    p0.h = _exit;
90    P3 = P4;
91    jump    (p0)        /* Should not return.  */
92
93.global _null_isr
94_null_isr:
95    rti;
96
Note: See TracBrowser for help on using the repository browser.