Skip to content
This repository has been archived by the owner on Jan 4, 2024. It is now read-only.

Commit

Permalink
Pass a1 as received from OpenSBI to main (seL4#103)
Browse files Browse the repository at this point in the history
Signed-off-by: Marcelo Politzer <[email protected]>
  • Loading branch information
Marcelo Politzer Couto authored Sep 2, 2021
1 parent e36a7bf commit b372961
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion elfloader-tool/src/arch-riscv/crt0.S
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ _start:
addi gp, gp, %pcrel_lo(1b)
.option pop

/* a0 should have hart id, store it in s0 so as not to clobber from HSM calls */
/* a0 should have hart id, store it in s0 so as not to clobber from HSM calls
a1 should have the dtb, store it in s2 so as not to clobber it as well */
mv s0, a0
mv s2, a1

#ifdef CONFIG_IMAGE_BINARY
/* Clear the BSS before we get to do anything more specific */
Expand Down Expand Up @@ -83,6 +85,7 @@ _start1:

la sp, (elfloader_stack_alloc + BIT(12))

mv a1, s2 // restore dtb to main's second argument
la s0, main
jr s0

Expand Down

0 comments on commit b372961

Please sign in to comment.