entry.s
916 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include <regdef.h>
#include <asm.h>
#include <PR/R4300.h>
#include <PR/bcp.h>
#include <PR/bbsim.h>
#define APP_STACK_SIZE 8192
/* reserve space for the stack pointer */
.bss
.align 4
.comm __stack, APP_STACK_SIZE
.text
.align 2
.set reorder
.ent __start
.globl __start
__start:
la sp, __stack + APP_STACK_SIZE
.set noreorder
la t0, __bss_start
la t1, _end - 4
zero_bss:
sw zero, (t0)
bge t1, t0, zero_bss
add t0, 4
.set reorder
#ifdef BIG_APP
/* make app big for testing */
.set noreorder
.rept (1024*16)/4
nop
.endr
.set reorder
#endif
jal boot
/* simulator off */
sh zero, PHYS_TO_K1(PI_IDE3_SIM_HALT)
lw t0, PHYS_TO_K1(PI_IDE_FC_BASE_REG)
power_down_loop:
beq zero, zero, power_down_loop
.end __start