summaryrefslogtreecommitdiff
path: root/cheri
diff options
context:
space:
mode:
authorRobert Norton2016-04-28 14:54:57 +0100
committerRobert Norton2016-04-28 14:55:04 +0100
commitef3deb63b3eead7e3b3ec826fd3d4f5695d642df (patch)
tree1898b9877ef98523925dfcf155b718626f1622e2 /cheri
parentebea637489446114fb95863db861accf14a6b393 (diff)
implement (hopefully) correct exception behaviour wrt PCC/EPCC. Required shuffling function names and adding a hook in ERET.
Diffstat (limited to 'cheri')
-rw-r--r--cheri/cheri_prelude.sail17
1 files changed, 17 insertions, 0 deletions
diff --git a/cheri/cheri_prelude.sail b/cheri/cheri_prelude.sail
index 1ae3fa77..9c7e4d20 100644
--- a/cheri/cheri_prelude.sail
+++ b/cheri/cheri_prelude.sail
@@ -279,6 +279,23 @@ typedef CapCauseReg = register bits [15:0] {
register CapCauseReg CapCause
+function unit SignalException ((Exception) ex) =
+ {
+ C31 := PCC;
+ C31.offset := PC;
+ nextPCC := C29; (* KCC *)
+ delayedPCC := C29; (* always write delayedPCC together whether PCC so
+ that non-capability branches don't override PCC *)
+ SignalExceptionMIPS(ex);
+ }
+
+function unit ERETHook() =
+ {
+ nextPCC := C31;
+ delayedPCC := C31; (* always write delayedPCC together whether PCC so
+ that non-capability branches don't override PCC *)
+ }
+
function unit raise_c2_exception8((CapEx) capEx, (bit[8]) regnum) =
{
(CapCause.ExcCode) := CapExCode(capEx);