diff options
author | David Hildenbrand <david@redhat.com> | 2017-11-30 17:27:29 +0100 |
---|---|---|
committer | Cornelia Huck <cohuck@redhat.com> | 2017-12-14 17:56:54 +0100 |
commit | 8d2f850a5ab7579a852f23b28273940a47dfd7ff (patch) | |
tree | ee84f4d36dd39e1c75bf3c6758030e7fac8485d8 /target/s390x/interrupt.c | |
parent | 9879003bb82c1351fa84feb81aa1bbcf7442ca84 (diff) | |
download | qemu-8d2f850a5ab7579a852f23b28273940a47dfd7ff.zip qemu-8d2f850a5ab7579a852f23b28273940a47dfd7ff.tar.gz qemu-8d2f850a5ab7579a852f23b28273940a47dfd7ff.tar.bz2 |
s390x/tcg: introduce and use s390_program_interrupt()
Allows to easily convert more callers of program_interrupt() and to
easily introduce new exceptions without forgetting about the cpu state
reset.
Use s390_program_interrupt() in places where we already had the same
pattern. We will later get rid of program_interrupt().
RA != 0 checks are already done behind the scenes.
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20171130162744.25442-2-david@redhat.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Diffstat (limited to 'target/s390x/interrupt.c')
-rw-r--r-- | target/s390x/interrupt.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/target/s390x/interrupt.c b/target/s390x/interrupt.c index ce6177c..b07e75d 100644 --- a/target/s390x/interrupt.c +++ b/target/s390x/interrupt.c @@ -53,6 +53,19 @@ void program_interrupt(CPUS390XState *env, uint32_t code, int ilen) } } +void s390_program_interrupt(CPUS390XState *env, uint32_t code, int ilen, + uintptr_t ra) +{ +#ifdef CONFIG_TCG + S390CPU *cpu = s390_env_get_cpu(env); + + if (tcg_enabled()) { + cpu_restore_state(CPU(cpu), ra); + } +#endif + program_interrupt(env, code, ilen); +} + #if !defined(CONFIG_USER_ONLY) static void cpu_inject_service(S390CPU *cpu, uint32_t param) { |