[coreboot-gerrit] Change in coreboot[master]: arch/riscv: Document mprv_{read, write}_* functions

Jonathan Neuschäfer (Code Review) gerrit at coreboot.org
Sat Sep 2 13:31:56 CEST 2017


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 at 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)

-- 
To view, visit https://review.coreboot.org/21342
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iaf0cb241f0eb4de241f0983c0b32dbcc28f96480
Gerrit-Change-Number: 21342
Gerrit-PatchSet: 1
Gerrit-Owner: Jonathan Neuschäfer <j.neuschaefer at gmx.net>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170902/e4196f47/attachment.html>


More information about the coreboot-gerrit mailing list