source:
rtems/c/src/lib/libbsp/bfin/shared/start/start.S
@
9b4422a2
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24 | |
---|---|
|
|
File size: 1.6 KB |
Rev | Line | |
---|---|---|
[8d41236] | 1 | |
[3495c57] | 2 | #include <rtems/bfin/bfin.h> |
[f6f79332] | 3 | |
[fac2a48] | 4 | #include <bspopts.h> |
5 | ||
[f6f79332] | 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 | ||
[8d41236] | 14 | .section .init |
15 | .globl __init | |
16 | .type __init,@function | |
17 | __init: | |
18 | .section .fini | |
19 | .globl __fini | |
20 | .type __fini,@function | |
21 | __fini: | |
22 | ||
23 | ||
[fac2a48] | 24 | #if (BFIN_ON_SKYEYE) |
25 | .section .init | |
26 | #else | |
[018008cc] | 27 | .section .l1code |
[fac2a48] | 28 | #endif |
[018008cc] | 29 | .align 4 |
[8d41236] | 30 | |
31 | .global __start | |
32 | __start: | |
33 | ||
34 | /* Start by setting up a stack */ | |
35 | sp.h = 0xFFB0; | |
36 | sp.l = 0x0F00; | |
[3495c57] | 37 | |
[8d41236] | 38 | /* Maybe we should zero the memory in the .bss section. */ |
39 | ||
40 | /* This changes to the supervisor mode */ | |
41 | p0.l = START; | |
42 | p0.h = START; | |
43 | p1.l = LO(EVT15); | |
44 | p1.h = HI(EVT15); | |
[3495c57] | 45 | |
[8d41236] | 46 | [P1] = P0; |
[3495c57] | 47 | |
[8d41236] | 48 | P0.h = HI(IMASK); |
49 | P0.l = LO(IMASK); | |
50 | R0 = [P0]; | |
51 | /* R1.l = EVT_IVG15 & 0xFFFF; */ | |
52 | R1.l = 0x8000; | |
[3495c57] | 53 | |
[8d41236] | 54 | R0 = R0 | R1; |
[3495c57] | 55 | |
[8d41236] | 56 | [P0] = R0; |
57 | ||
58 | RAISE 15; | |
[3495c57] | 59 | |
[2154cd3] | 60 | P0.l = WAIT; |
[8d41236] | 61 | P0.h = WAIT; |
62 | ||
63 | RETI = P0; | |
64 | RTI; | |
[3495c57] | 65 | |
[8d41236] | 66 | /* endless loop to wait */ |
[3495c57] | 67 | WAIT: |
[8d41236] | 68 | jump WAIT; |
[3495c57] | 69 | |
[8d41236] | 70 | START: |
71 | [--SP] = RETI; | |
[3495c57] | 72 | |
[018008cc] | 73 | p0.h = _bss_start; |
74 | p0.l = _bss_start; | |
75 | p1.h = _end; | |
76 | p1.l = _end; | |
77 | r0 = p0; | |
78 | r1 = p1; | |
79 | r1 = r1 - r0; | |
[3495c57] | 80 | p1 = r1; |
[018008cc] | 81 | r0 = 0; |
82 | ||
83 | /* Set _bss_start until _end to zero */ | |
84 | lsetup(loop1,loop2) LC0 = p1; | |
85 | loop1: b[p0] = r0; | |
86 | loop2: p0 +=1; | |
87 | ||
[3923700e] | 88 | /* call boot_card( 0, 0 ) */ |
89 | r0 = 0; | |
90 | r1 = 0; | |
[8d41236] | 91 | p0.l = _boot_card; |
92 | p0.h = _boot_card; | |
93 | ||
94 | call (p0); | |
95 | ||
[fa47ade] | 96 | HLT |
[8d41236] | 97 | p0.l = _exit; |
[3495c57] | 98 | p0.h = _exit; |
99 | P3 = P4; | |
[8d41236] | 100 | jump (p0) /* Should not return. */ |
101 | ||
102 | .global _null_isr | |
103 | _null_isr: | |
104 | rti; | |
105 |
Note: See TracBrowser
for help on using the repository browser.