File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -120,12 +120,12 @@ cfg_global_asm!(
120
120
// STORE A0..A2 IN THE STACK, AS THEY WILL BE NEEDED LATER BY main
121
121
cfg_global_asm ! (
122
122
#[ cfg( target_arch = "riscv32" ) ]
123
- "addi sp, sp, -4 * 3
123
+ "addi sp, sp, -4 * 4 // we must keep stack aligned to 16-bytes
124
124
sw a0, 4 * 0(sp)
125
125
sw a1, 4 * 1(sp)
126
126
sw a2, 4 * 2(sp)" ,
127
127
#[ cfg( target_arch = "riscv64" ) ]
128
- "addi sp, sp, -8 * 3
128
+ "addi sp, sp, -8 * 4 // we must keep stack aligned to 16-bytes
129
129
sd a0, 8 * 0(sp)
130
130
sd a1, 8 * 1(sp)
131
131
sd a2, 8 * 2(sp)" ,
@@ -210,12 +210,12 @@ cfg_global_asm!(
210
210
"lw a0, 4 * 0(sp)
211
211
lw a1, 4 * 1(sp)
212
212
lw a2, 4 * 2(sp)
213
- addi sp, sp, 4 * 3 " ,
213
+ addi sp, sp, 4 * 4 " ,
214
214
#[ cfg( target_arch = "riscv64" ) ]
215
215
"ld a0, 8 * 0(sp)
216
216
ld a1, 8 * 1(sp)
217
217
ld a2, 8 * 2(sp)
218
- addi sp, sp, 8 * 3 " ,
218
+ addi sp, sp, 8 * 4 " ,
219
219
"jal zero, main
220
220
.cfi_endproc" ,
221
221
) ;
You can’t perform that action at this time.
0 commit comments