Skip to content

Commit

Permalink
RISC-V: Add the directive for alignment of stvec's value
Browse files Browse the repository at this point in the history
The stvec's value must be 4 byte alignment by specification definition.
These directives avoid to stvec be set the non-alignment value.

Signed-off-by: Zong Li <zong@andestech.com>
Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
  • Loading branch information
Zong Li authored and Palmer Dabbelt committed Aug 13, 2018
1 parent 62b0194 commit 94f592f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/riscv/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ relocate:
or a0, a0, a1
sfence.vma
csrw sptbr, a0
.align 2
1:
/* Set trap vector to spin forever to help debug */
la a0, .Lsecondary_park
Expand Down Expand Up @@ -143,6 +144,7 @@ relocate:
tail smp_callin
#endif

.align 2
.Lsecondary_park:
/* We lack SMP support or have too many harts, so park this hart */
wfi
Expand Down

0 comments on commit 94f592f

Please sign in to comment.