mirror of https://github.com/proxmox/mirror_qemu
target-s390x: QOM'ify CPU reset
Move code from cpu_state_reset() to s390_cpu_reset(). Signed-off-by: Andreas Färber <afaerber@suse.de> Tested-by: Christian Borntraeger <borntraeger@de.ibm.com>master
parent
29e4bcb26b
commit
1ac1a7499b
|
@ -1,6 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* QEMU S/390 CPU
|
* QEMU S/390 CPU
|
||||||
*
|
*
|
||||||
|
* Copyright (c) 2009 Ulrich Hecht
|
||||||
|
* Copyright (c) 2011 Alexander Graf
|
||||||
* Copyright (c) 2012 SUSE LINUX Products GmbH
|
* Copyright (c) 2012 SUSE LINUX Products GmbH
|
||||||
*
|
*
|
||||||
* This library is free software; you can redistribute it and/or
|
* This library is free software; you can redistribute it and/or
|
||||||
|
@ -23,15 +25,24 @@
|
||||||
#include "qemu-timer.h"
|
#include "qemu-timer.h"
|
||||||
|
|
||||||
|
|
||||||
|
/* CPUClass::reset() */
|
||||||
static void s390_cpu_reset(CPUState *s)
|
static void s390_cpu_reset(CPUState *s)
|
||||||
{
|
{
|
||||||
S390CPU *cpu = S390_CPU(s);
|
S390CPU *cpu = S390_CPU(s);
|
||||||
S390CPUClass *scc = S390_CPU_GET_CLASS(cpu);
|
S390CPUClass *scc = S390_CPU_GET_CLASS(cpu);
|
||||||
CPUS390XState *env = &cpu->env;
|
CPUS390XState *env = &cpu->env;
|
||||||
|
|
||||||
|
if (qemu_loglevel_mask(CPU_LOG_RESET)) {
|
||||||
|
qemu_log("CPU Reset (CPU %d)\n", env->cpu_index);
|
||||||
|
log_cpu_state(env, 0);
|
||||||
|
}
|
||||||
|
|
||||||
scc->parent_reset(s);
|
scc->parent_reset(s);
|
||||||
|
|
||||||
cpu_state_reset(env);
|
memset(env, 0, offsetof(CPUS390XState, breakpoints));
|
||||||
|
/* FIXME: reset vector? */
|
||||||
|
tlb_flush(env, 1);
|
||||||
|
s390_add_running_cpu(env);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void s390_cpu_class_init(ObjectClass *oc, void *data)
|
static void s390_cpu_class_init(ObjectClass *oc, void *data)
|
||||||
|
|
|
@ -97,7 +97,7 @@ CPUS390XState *cpu_s390x_init(const char *cpu_model)
|
||||||
env->cpu_model_str = cpu_model;
|
env->cpu_model_str = cpu_model;
|
||||||
env->cpu_num = cpu_num++;
|
env->cpu_num = cpu_num++;
|
||||||
env->ext_index = -1;
|
env->ext_index = -1;
|
||||||
cpu_state_reset(env);
|
cpu_reset(CPU(cpu));
|
||||||
qemu_init_vcpu(env);
|
qemu_init_vcpu(env);
|
||||||
return env;
|
return env;
|
||||||
}
|
}
|
||||||
|
@ -123,15 +123,7 @@ int cpu_s390x_handle_mmu_fault (CPUS390XState *env, target_ulong address, int rw
|
||||||
|
|
||||||
void cpu_state_reset(CPUS390XState *env)
|
void cpu_state_reset(CPUS390XState *env)
|
||||||
{
|
{
|
||||||
if (qemu_loglevel_mask(CPU_LOG_RESET)) {
|
cpu_reset(ENV_GET_CPU(env));
|
||||||
qemu_log("CPU Reset (CPU %d)\n", env->cpu_index);
|
|
||||||
log_cpu_state(env, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(env, 0, offsetof(CPUS390XState, breakpoints));
|
|
||||||
/* FIXME: reset vector? */
|
|
||||||
tlb_flush(env, 1);
|
|
||||||
s390_add_running_cpu(env);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef CONFIG_USER_ONLY
|
#ifndef CONFIG_USER_ONLY
|
||||||
|
|
Loading…
Reference in New Issue