mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
target/s390x: Rework program_interrupt() and related functions
misc_helper.c won't be compiled with --disable-tcg anymore, but we still need the program_interrupt() function in that case. Move it to interrupt.c instead, and refactor it to re-use the code from trigger_pgm_exception() (for TCG) and enter_pgmcheck() (for KVM, which now got renamed to kvm_s390_program_interrupt() for clarity). Signed-off-by: Thomas Huth <thuth@redhat.com> Message-Id: <1500886370-14572-4-git-send-email-thuth@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
This commit is contained in:
parent
3d6722051b
commit
e3cfd926f7
5 changed files with 52 additions and 48 deletions
|
@ -8,10 +8,49 @@
|
|||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/log.h"
|
||||
#include "cpu.h"
|
||||
#include "exec/exec-all.h"
|
||||
#include "sysemu/kvm.h"
|
||||
#include "hw/s390x/ioinst.h"
|
||||
|
||||
/* Ensure to exit the TB after this call! */
|
||||
void trigger_pgm_exception(CPUS390XState *env, uint32_t code, uint32_t ilen)
|
||||
{
|
||||
CPUState *cs = CPU(s390_env_get_cpu(env));
|
||||
|
||||
cs->exception_index = EXCP_PGM;
|
||||
env->int_pgm_code = code;
|
||||
env->int_pgm_ilen = ilen;
|
||||
}
|
||||
|
||||
static void tcg_s390_program_interrupt(CPUS390XState *env, uint32_t code,
|
||||
int ilen)
|
||||
{
|
||||
#ifdef CONFIG_TCG
|
||||
trigger_pgm_exception(env, code, ilen);
|
||||
cpu_loop_exit(CPU(s390_env_get_cpu(env)));
|
||||
#else
|
||||
g_assert_not_reached();
|
||||
#endif
|
||||
}
|
||||
|
||||
void program_interrupt(CPUS390XState *env, uint32_t code, int ilen)
|
||||
{
|
||||
S390CPU *cpu = s390_env_get_cpu(env);
|
||||
|
||||
qemu_log_mask(CPU_LOG_INT, "program interrupt at %#" PRIx64 "\n",
|
||||
env->psw.addr);
|
||||
|
||||
if (kvm_enabled()) {
|
||||
kvm_s390_program_interrupt(cpu, code);
|
||||
} else if (tcg_enabled()) {
|
||||
tcg_s390_program_interrupt(env, code, ilen);
|
||||
} else {
|
||||
g_assert_not_reached();
|
||||
}
|
||||
}
|
||||
|
||||
#if !defined(CONFIG_USER_ONLY)
|
||||
void cpu_inject_ext(S390CPU *cpu, uint32_t code, uint32_t param,
|
||||
uint64_t param64)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue