From f5bd3636dfa00b6e644203242e0ddf1e71f26a2e Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 18 Oct 2023 22:03:38 +0100 Subject: [PATCH] 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) --- openpower/isa/system.mdwn | 3 +-- src/openpower/decoder/isa/caller.py | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) 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 -- 2.30.2