source: rtems/c/src/lib/libbsp/bfin/bf537Stamp/start/start.S @ 9b4422a2

4.115
Last change on this file since 9b4422a2 was 9b4422a2, checked in by Joel Sherrill <joel.sherrill@…>, on 05/03/12 at 15:09:24

Remove All CVS Id Strings Possible Using a Script

Script does what is expected and tries to do it as
smartly as possible.

+ remove occurrences of two blank comment lines

next to each other after Id string line removed.

+ remove entire comment blocks which only exited to

contain CVS Ids

+ If the processing left a blank line at the top of

a file, it was removed.

  • Property mode set to 100644
File size: 1.9 KB
RevLine 
[61f8fb0e]1#include <libcpu/bf537.h>
2#include <libcpu/sicRegs.h>
3#include <libcpu/cecRegs.h>
[543f17b3]4#include <libcpu/dmaRegs.h>
[61f8fb0e]5#include <libcpu/coreTimerRegs.h>
6
7#ifndef LO
8#define LO(con32) ((con32) & 0xFFFF)
9#endif
10#ifndef HI
11#define HI(con32) (((con32) >> 16) & 0xFFFF)
12#endif
13
14
15        .section .init
16        .globl  __init
17        .type   __init,@function
18__init:
19        .section .fini
20        .globl  __fini
21        .type   __fini,@function
22__fini:
23
24
25        .section .start
26        .align  4
27
28        .global __start
29__start:
30        cli r0;
31
32        /* setup an initial stack */
33        sp.h = 0xFFB0;
34        sp.l = 0x0F00;
35
36        /* disable timer interrupts */
37        p0.h = HI(TCNTL);
38        p0.l = LO(TCNTL);
39        r0 = 0;
40        [p0] = r0;
41
42        /* disable all interrupts routed through sic */
43        p0.h = HI(SIC_IMASK);
44        p0.l = LO(SIC_IMASK);
45        [p0] = r0;
46
[a319ab04]47        /* clear any pending interrupts */
48        p0.h = HI(CEC_ILAT);
49        p0.l = LO(CEC_ILAT);
50        r0 = 0xffff (z);
51        [p0] = r0;
52
[543f17b3]53        /* disable all dma channels */
54        p0.h = HI(DMA0_BASE_ADDRESS + DMA_CONFIG_OFFSET);
55        p0.l = LO(DMA0_BASE_ADDRESS + DMA_CONFIG_OFFSET);
56        p1 = DMA_PITCH;
57        p2 = DMA_CHANNELS;
58        r0 = ~DMA_CONFIG_DMAEN;
59        lsetup(loop1,loop2) lc0 = p2;
60loop1:  r1 = w[p0];
61        r1 = r0 & r1;
62loop2:  w[p0 ++ p1] = r1.l;
63
[61f8fb0e]64        /* this is so we can stay in supervisor mode and still be able to
65           accept interrupts later. */
66        p0.h = start;
67        p0.l = start;
68        p1.h = HI(CEC_EVT15);
69        p1.l = LO(CEC_EVT15);
[3495c57]70
[61f8fb0e]71        [p1] = p0;
72
73        r0 = 0x8000 (z);
74        sti r0;
75
76        raise 15;
[3495c57]77
[61f8fb0e]78        p0.h = wait;
79        p0.l = wait;
80
81        reti = p0;
82        rti;
[3495c57]83
[61f8fb0e]84        /* wait for event 15 */
85wait:
86        jump wait;
[3495c57]87
[61f8fb0e]88start:
89        [--sp] = reti; /* allow us to process interrupts later */
90
91        /* mask interrupts for now */
92        cli r0;
[3495c57]93
[61f8fb0e]94        p0.h = _bss_start;
95        p0.l = _bss_start;
96        p1.h = _end;
97        p1.l = _end;
98        r0 = p0;
99        r1 = p1;
100        r1 = r1 - r0;
[3495c57]101        p1 = r1;
[61f8fb0e]102        r0 = 0;
103
104        /* Set _bss_start until _end to zero */
[543f17b3]105        lsetup(loop3,loop4) lc0 = p1;
106loop3:  b[p0] = r0;
107loop4:  p0 +=1;
[61f8fb0e]108
[a319ab04]109        l0 = 0;
110        l1 = 0;
111        l2 = 0;
112        l3 = 0;
113        sp += -12;
114        /* r0 == const char *cmdline (currently null) */
[61f8fb0e]115        p0.h = _boot_card;
116        p0.l = _boot_card;
117        call (p0);
[a319ab04]118        sp += 12;
[61f8fb0e]119
[edd19da3]120        HLT
[61f8fb0e]121        p0.h = _exit;
122        p0.l = _exit;
123        jump (p0);
124
Note: See TracBrowser for help on using the repository browser.