123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250 |
-
-
-
- .section .start, "ax"
- .globl __start
-
- __start:
- entry sp, 32
- _call0 _start
- __start_a0:
- .align 4
- .section .text, "ax"
- .begin literal_prefix .text
-
- .globl _start
- _start:
-
- movi a4, 1
- wsr a4, ps
- rsync
- rsr a5, windowbase
- ssl a5
- sll a4, a4
- wsr a4, windowstart
- rsync
- movi a4, 0x00040000
- wsr a4, ps
- rsync
-
-
-
-
- movi a4, __start
- movi a5, __start_a0
- add a4, a0, a4
- sub a0, a4, a5
- movi a4, __start
- movi a5, __reloc_end
-
-
-
- mov.n a7, a0
- mov.n a8, a4
- 1:
- l32i a10, a7, 0
- l32i a11, a7, 4
- s32i a10, a8, 0
- s32i a11, a8, 4
- l32i a10, a7, 8
- l32i a11, a7, 12
- s32i a10, a8, 8
- s32i a11, a8, 12
- addi a8, a8, 16
- addi a7, a7, 16
- blt a8, a5, 1b
-
- ___flush_dcache_all a5 a6
- ___invalidate_icache_all a5 a6
- isync
- movi a11, _reloc
- jx a11
- .globl _reloc
- _reloc:
-
-
-
-
-
-
- movi a6, _param_start
- add a3, a2, a3
- 2:
- l32i a8, a2, 0
- s32i a8, a6, 0
- addi a2, a2, 4
- addi a6, a6, 4
- blt a2, a3, 2b
-
- movi a6, __bss_start
- movi a7, __bss_end
- movi.n a5, 0
- 3:
- s32i a5, a6, 0
- addi a6, a6, 4
- blt a6, a7, 3b
- movi a5, -16
- movi a1, _stack + STACK_SIZE
- and a1, a1, a5
-
-
-
-
- movi a3, __image_load
- sub a4, a3, a4
- add a8, a0, a4
-
-
- movi a6, _image_start
- movi a10, _image_end
- movi a7, 0x1000000
- sub a11, a10, a6
- movi a9, complen
- s32i a11, a9, 0
- movi a0, 0
-
-
-
-
- .extern gunzip
- movi a4, gunzip
- beqz a4, 1f
- callx4 a4
- j 2f
-
-
-
-
-
- 1:
- l32i a9, a8, 0
- l32i a11, a8, 4
- s32i a9, a6, 0
- s32i a11, a6, 4
- l32i a9, a8, 8
- l32i a11, a8, 12
- s32i a9, a6, 8
- s32i a11, a6, 12
- addi a6, a6, 16
- addi a8, a8, 16
- blt a6, a10, 1b
-
- 2:
- ___flush_dcache_all a5 a6
- ___invalidate_icache_all a5 a6
- isync
-
- movi a0, _image_start
- jx a0
- .align 16
- .data
- .globl avail_ram
- avail_ram:
- .long _heap
- .globl end_avail
- end_avail:
- .long _heap + HEAP_SIZE
- .comm _stack, STACK_SIZE
- .comm _heap, HEAP_SIZE
- .globl end_avail
- .comm complen, 4
- .end literal_prefix
|