-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
start_ssm.s
63 lines (54 loc) · 1.34 KB
/
start_ssm.s
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
! For Subaru ECUs.
! Apparently they're always loaded at a fixed address in RAM : no need to move the payload
! TODO : remove auto-copy; make sure entry point is correct vs .ld file
! (c) copyright fenugrec 2022
! GPLv3
!
! This program is free software: you can redistribute it and/or modify
! it under the terms of the GNU General Public License as published by
! the Free Software Foundation, either version 3 of the License, or
! (at your option) any later version.
!
! This program is distributed in the hope that it will be useful,
! but WITHOUT ANY WARRANTY; without even the implied warranty of
! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
! GNU General Public License for more details.
!
! You should have received a copy of the GNU General Public License
! along with this program. If not, see <http://www.gnu.org/licenses/>.
!
.list
.section .rja
.global RAMjump_entry
.extern _main !user code
.extern _ebss
.extern _bss
.extern _stackinit
RAMjump_entry:
.BALIGN 2
! these end up at ffff3000, in case ramjump lands here instead of ffff3004
nop
nop
zero_bss:
mov.l ebss, r1
mov.l bss, r0
mov #0, r2
zero_top:
cmp/eq r0, r1
bt zero_end
bra zero_top
mov.b r2,@-r1
zero_end:
mov.l main,r1
mov.l stack,r15
jsr @r1
nop
.BALIGN 4
stack:
.long _stackinit
main:
.long _main
bss:
.long _sbss
ebss:
.long _ebss