diff options
Diffstat (limited to 'c/src/lib/libbsp/bfin/shared/start/start.S')
-rw-r--r-- | c/src/lib/libbsp/bfin/shared/start/start.S | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/bfin/shared/start/start.S b/c/src/lib/libbsp/bfin/shared/start/start.S new file mode 100644 index 0000000000..7cf479fb5c --- /dev/null +++ b/c/src/lib/libbsp/bfin/shared/start/start.S @@ -0,0 +1,71 @@ + + +#include <rtems/score/bfin.h> + .section .init + .globl __init + .type __init,@function +__init: + .section .fini + .globl __fini + .type __fini,@function +__fini: + + + .text + .align 2 + + .global __start +__start: + + /* Start by setting up a stack */ + sp.h = 0xFFB0; + sp.l = 0x0F00; + + /* Maybe we should zero the memory in the .bss section. */ + + /* This changes to the supervisor mode */ + p0.l = START; + p0.h = START; + p1.l = LO(EVT15); + p1.h = HI(EVT15); + + [P1] = P0; + + P0.h = HI(IMASK); + P0.l = LO(IMASK); + R0 = [P0]; + /* R1.l = EVT_IVG15 & 0xFFFF; */ + R1.l = 0x8000; + + R0 = R0 | R1; + + [P0] = R0; + + RAISE 15; + + PO.l = WAIT; + P0.h = WAIT; + + RETI = P0; + RTI; + + /* endless loop to wait */ + WAIT: + jump WAIT; + + START: + [--SP] = RETI; + p0.l = _boot_card; + p0.h = _boot_card; + + call (p0); + + p0.l = _exit; + p0.h = _exit; + P3 = P4; + jump (p0) /* Should not return. */ + +.global _null_isr +_null_isr: + rti; + |