riscv: Fix argc
Subsystems (3)
PATCH 1/1 riscv: Fix argc
__argc is 32 bits so even rv64 should load it with lw, not just rv32. This fixes odd behavior such as getting false when testing argc < 2 even though we know argc should be 1. argc < 2 being false comes from the register comparison using the full register width and the upper 32 bits being loaded with junk.
Fixes bd744d465910 ("riscv: Initial port, hello world")
Signed-off-by Andrew Jones <[email protected]>
--- riscv/cstart.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
riscv/cstart.S +1 -1
@@ -93,7 +93,7 @@ start: /* run the test */ la a0, __argc - REG_L a0, 0(a0) + lw a0, 0(a0) la a1, __argv la a2, __environ call main
Signature · 1 line
2.45.2
Quoted 27 lines · Andrew Jones
__argcis 32 bits so even rv64 should load it with lw, not just rv32. This fixes odd behavior such as getting false when testing argc < 2 even though we know argc should be 1. argc < 2 being false comes from the register comparison using the full register width and the upper 32 bits being loaded with junk.Fixes bd744d465910 ("riscv: Initial port, hello world")Signed-off-by Andrew Jones <[email protected]>--- riscv/cstart.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)riscv/cstart.S +1
-1@@ -93,7 +93,7 @@ start: /* run the test */ la a0, __argc - REG_L a0, 0(a0) + lw a0, 0(a0) la a1, __argv la a2, __environ call mainSignature · 1 line
2.45.2
Merged.
Thanks,
drew