3
3
#include <asm/regs.h>
4
4
#include <asm/asmmacro.h>
5
5
#include <asm/cacheasm.h>
6
+ #include <asm/processor.h>
6
7
/ *
7
8
* RB - Data: RedBoot data/bss
8
9
* P: Boot - Parameters
36
37
.globl __start
37
38
/ * this must be the first byte of the loader! * /
38
39
__start:
39
- entry sp , 32 # we do not intend to return
40
+ abi_entry( 32 ) # we do not intend to return
40
41
_call0 _start
41
42
__start_a0:
42
43
. align 4
@@ -62,10 +63,12 @@ _start:
62
63
wsr a4 , windowstart
63
64
rsync
64
65
65
- movi a4 , 0x00040000
66
+ movi a4 , KERNEL_PS_WOE_MASK
66
67
wsr a4 , ps
67
68
rsync
68
69
70
+ KABI_C0 mov abi_saved0 , abi_arg0
71
+
69
72
/ * copy the loader to its address
70
73
* Note: The loader itself is a very small piece , so we assume we
71
74
* don't partially overlap. We also assume (even more important)
@@ -168,52 +171,52 @@ _reloc:
168
171
169
172
movi a3 , __image_load
170
173
sub a4 , a3 , a4
171
- add a8 , a0 , a4
174
+ add abi_arg2 , a0 , a4
172
175
173
176
# a1 Stack
174
177
# a8(a4) Load address of the image
175
178
176
- movi a6 , _image_start
177
- movi a10 , _image_end
178
- movi a7 , 0x1000000
179
- sub a11 , a10 , a6
180
- movi a9 , complen
181
- s32i a11 , a9 , 0
179
+ movi abi_arg0 , _image_start
180
+ movi abi_arg4 , _image_end
181
+ movi abi_arg1 , 0x1000000
182
+ sub abi_tmp0 , abi_arg4 , abi_arg0
183
+ movi abi_arg3 , complen
184
+ s32i abi_tmp0 , abi_arg3 , 0
182
185
183
186
movi a0 , 0
184
187
185
- # a6 destination
186
- # a7 maximum size of destination
187
- # a8 source
188
- # a9 ptr to length
188
+ # abi_arg0 destination
189
+ # abi_arg1 maximum size of destination
190
+ # abi_arg2 source
191
+ # abi_arg3 ptr to length
189
192
190
193
. extern gunzip
191
- movi a4 , gunzip
192
- beqz a4 , 1f
194
+ movi abi_tmp0 , gunzip
195
+ beqz abi_tmp0 , 1f
193
196
194
- callx4 a4
197
+ abi_callx abi_tmp0
195
198
196
199
j 2f
197
200
198
201
199
- # a6 destination start
200
- # a7 maximum size of destination
201
- # a8 source start
202
- # a9 ptr to length
203
- # a10 destination end
202
+ # abi_arg0 destination start
203
+ # abi_arg1 maximum size of destination
204
+ # abi_arg2 source start
205
+ # abi_arg3 ptr to length
206
+ # abi_arg4 destination end
204
207
205
208
1 :
206
- l32i a9 , a8 , 0
207
- l32i a11 , a8 , 4
208
- s32i a9 , a6 , 0
209
- s32i a11 , a6 , 4
210
- l32i a9 , a8 , 8
211
- l32i a11 , a8 , 12
212
- s32i a9 , a6 , 8
213
- s32i a11 , a6 , 12
214
- addi a6 , a6 , 16
215
- addi a8 , a8 , 16
216
- blt a6 , a10 , 1b
209
+ l32i abi_tmp0 , abi_arg2 , 0
210
+ l32i abi_tmp1 , abi_arg2 , 4
211
+ s32i abi_tmp0 , abi_arg0 , 0
212
+ s32i abi_tmp1 , abi_arg0 , 4
213
+ l32i abi_tmp0 , abi_arg2 , 8
214
+ l32i abi_tmp1 , abi_arg2 , 12
215
+ s32i abi_tmp0 , abi_arg0 , 8
216
+ s32i abi_tmp1 , abi_arg0 , 12
217
+ addi abi_arg0 , abi_arg0 , 16
218
+ addi abi_arg2 , abi_arg2 , 16
219
+ blt abi_arg0 , abi_arg4 , 1b
217
220
218
221
219
222
/ * jump to the kernel * /
@@ -230,6 +233,7 @@ _reloc:
230
233
231
234
# a2 Boot parameter list
232
235
236
+ KABI_C0 mov abi_arg0 , abi_saved0
233
237
movi a0 , _image_start
234
238
jx a0
235
239
0 commit comments