From: Luke Kenneth Casson Leighton Date: Wed, 18 Oct 2023 21:03:38 +0000 (+0100) Subject: annoying - call the TRAP() function in system.mdwn "sc" instruction. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c91aa3ee;p=openpower-isa.git annoying - call the TRAP() function in system.mdwn "sc" instruction. 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) --- diff --git a/openpower/isa/system.mdwn b/openpower/isa/system.mdwn index 74f06c50..958502d3 100644 --- a/openpower/isa/system.mdwn +++ b/openpower/isa/system.mdwn @@ -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: diff --git a/src/openpower/decoder/isa/caller.py b/src/openpower/decoder/isa/caller.py index ce5a80ac..0e3296ba 100644 --- a/src/openpower/decoder/isa/caller.py +++ b/src/openpower/decoder/isa/caller.py @@ -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