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

4.115
Last change on this file since ef26454 was ef26454, checked in by Sebastian Huber <sebastian.huber@…>, on Apr 29, 2014 at 6:43:04 AM

bsps/bfin: Fix bsp_specs

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