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 04/29/14 at 06:43:04

bsps/bfin: Fix bsp_specs

  • Property mode set to 100644
File size: 1.4 KB
RevLine 
[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
[fac2a48]13#if (BFIN_ON_SKYEYE)
14    .section .init
15#else
[018008cc]16    .section .l1code
[fac2a48]17#endif
[018008cc]18    .align  4
[8d41236]19
20    .global __start
21__start:
22
23    /* Start by setting up a stack */
24    sp.h = 0xFFB0;
25    sp.l = 0x0F00;
[3495c57]26
[8d41236]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);
[3495c57]34
[8d41236]35    [P1] = P0;
[3495c57]36
[8d41236]37    P0.h = HI(IMASK);
38    P0.l = LO(IMASK);
39    R0 = [P0];
40    /* R1.l = EVT_IVG15 & 0xFFFF; */
41    R1.l = 0x8000;
[3495c57]42
[8d41236]43    R0 = R0 | R1;
[3495c57]44
[8d41236]45    [P0] = R0;
46
47    RAISE 15;
[3495c57]48
[2154cd3]49    P0.l = WAIT;
[8d41236]50    P0.h = WAIT;
51
52    RETI = P0;
53    RTI;
[3495c57]54
[8d41236]55    /* endless loop to wait */
[3495c57]56    WAIT:
[8d41236]57    jump WAIT;
[3495c57]58
[8d41236]59    START:
60    [--SP] = RETI;
[3495c57]61
[018008cc]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;
[3495c57]69    p1 = r1;
[018008cc]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
[3923700e]77    /* call boot_card( 0, 0 ) */
78    r0 = 0;
79    r1 = 0;
[8d41236]80    p0.l = _boot_card;
81    p0.h = _boot_card;
82
83    call (p0);
84
[fa47ade]85    HLT
[8d41236]86    p0.l = _exit;
[3495c57]87    p0.h = _exit;
88    P3 = P4;
[8d41236]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.