annoying - call the TRAP() function in system.mdwn "sc" instruction.
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 18 Oct 2023 21:03:38 +0000 (22:03 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 18 Oct 2023 21:03:38 +0000 (22:03 +0100)
setting NIA and MSR is tricky, it involves reading some english text
that is very unclear (Book III section 4.3.1 which then in turn says
"go to section 7.5 page 1076").
given that we are not implementing hypervisor or LEV=1/2/3 it is just
simpler to call TRAP(0xc00)

openpower/isa/system.mdwn
src/openpower/decoder/isa/caller.py

index 74f06c50b1bfaacf1c8164a0b3a08f2a54db8bae..958502d3b606e98648f03882fb925930676797bf 100644 (file)
@@ -18,8 +18,7 @@ Pseudo-code:
     SRR1[0:32]  <- MSR[0:32]
     SRR1[37:41] <- MSR[37:41]
     SRR1[48:63] <- MSR[48:63]
-    MSR <- new_value
-    NIA <- 0x0000_0000_0000_0C00
+    TRAP(0xC00)
 
 Special Registers Altered:
 
index ce5a80acf102f62f6017d70f33f47e25b466d1eb..0e3296baeb44f2d824d7b3bb0b607eea22b26337 100644 (file)
@@ -1322,6 +1322,8 @@ class ISACaller(ISACallerHelper, ISAFPHelpers, StepLoop):
         hence the default arguments.  when calling from inside ISACaller
         it is best to use call_trap()
         """
+        if isinstance(trap_addr, SelectableInt):
+            trap_addr = trap_addr.value
         # https://bugs.libre-soc.org/show_bug.cgi?id=859
         kaivb = self.spr['KAIVB'].value
         msr = self.namespace['MSR'].value