arch/riscv: Align trap_entry to 4 bytes, as required by spec

The RISC-V Privileged Architecture spec 1.10 requires that the address part of
mtvec is four-byte aligned. The lower two bits encode a "mode" flag and should
be zero for now.

Add the necessary alignment directive before trap_entry.

Change-Id: I83ea23e2c8f984775985ae7d61f80ad75286baaa
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer@gmx.net>
Reviewed-on: https://review.coreboot.org/23173
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
This commit is contained in:
Jonathan Neuschäfer 2018-01-08 18:31:42 +01:00 committed by Martin Roth
parent 601197c768
commit 27d3402258
1 changed files with 1 additions and 0 deletions

View File

@ -109,6 +109,7 @@
.text .text
.global trap_entry .global trap_entry
.align 2 # four byte alignment, as required by mtvec
trap_entry: trap_entry:
csrw mscratch, sp csrw mscratch, sp