Upgrade to privileged architecture 1.7
[riscv-isa-sim.git] / riscv / insns / scall.h
index 5cf5b6ab72019e2a4fcab51a972b705dd3bc3d76..e8a055556c4cb24b067a0e118463ce2eaad02171 100644 (file)
@@ -1 +1,7 @@
-throw trap_ecall();
+switch (get_field(STATE.mstatus, MSTATUS_PRV))
+{
+  case PRV_U: throw trap_user_ecall();
+  case PRV_S: throw trap_supervisor_ecall();
+  case PRV_H: throw trap_hypervisor_ecall();
+  case PRV_M: throw trap_machine_ecall();
+}