Jonathan Neuschäfer has uploaded this change for review. ( https://review.coreboot.org/21342
Change subject: arch/riscv: Document mprv_{read,write}_* functions ......................................................................
arch/riscv: Document mprv_{read,write}_* functions
Change-Id: Iaf0cb241f0eb4de241f0983c0b32dbcc28f96480 Signed-off-by: Jonathan Neuschäfer j.neuschaefer@gmx.net --- M src/arch/riscv/include/vm.h 1 file changed, 11 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/21342/1
diff --git a/src/arch/riscv/include/vm.h b/src/arch/riscv/include/vm.h index a65aba9..dadfecd 100644 --- a/src/arch/riscv/include/vm.h +++ b/src/arch/riscv/include/vm.h @@ -91,6 +91,17 @@ ); \ }
+/* + * mprv_{read,write}_* - Modified privilege memory access functions. + * + * These inline functions perform a read or write memory operation with the + * mstatus.MPRV bit set. This causes the memory protections and translation of + * the previous mode (e.g. U-mode, if we're handling a trap from U-mode) to be + * applied. + * + * The user of these functions must make sure to avoid trap loops through + * unaligned memory accesses. + */ DEFINE_MPRV_READ(mprv_read_u8, uint8_t, lbu) DEFINE_MPRV_READ(mprv_read_u16, uint16_t, lhu) DEFINE_MPRV_READ(mprv_read_u32, uint32_t, lwu)