Skip to content

Commit

Permalink
Kill off cpu_state_reset()
Browse files Browse the repository at this point in the history
In commit 1bba0dc cpu_reset()
was renamed to cpu_state_reset(), to allow introducing a new cpu_reset()
that would operate on QOM objects.

All callers have been updated except for one in target-mips, so drop all
implementations except for the one in target-mips and move the
declaration there until MIPSCPU reset can be fully QOM'ified.

Signed-off-by: Andreas Färber <[email protected]>
Acked-by: Michael Walle <[email protected]> (for lm32)
Acked-by: Max Filippov <[email protected]> (for xtensa)
Acked-by: Edgar E. Iglesias <[email protected]> (for mb + cris)
Acked-by: Alexander Graf <[email protected]> (for ppc)
Acked-by: Blue Swirl <[email protected]>
  • Loading branch information
afaerber committed Jun 4, 2012
1 parent ff18b76 commit b7e516c
Show file tree
Hide file tree
Showing 13 changed files with 4 additions and 61 deletions.
1 change: 0 additions & 1 deletion cpu-all.h
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,6 @@ void cpu_watchpoint_remove_all(CPUArchState *env, int mask);
#define SSTEP_NOTIMER 0x4 /* Do not Timers while single stepping */

void cpu_single_step(CPUArchState *env, int enabled);
void cpu_state_reset(CPUArchState *s);
int cpu_is_stopped(CPUArchState *env);
void run_on_cpu(CPUArchState *env, void (*func)(void *data), void *data);

Expand Down
5 changes: 0 additions & 5 deletions target-arm/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
#include "host-utils.h"
#include "sysemu.h"

void cpu_state_reset(CPUARMState *env)
{
cpu_reset(ENV_GET_CPU(env));
}

static int vfp_gdb_get_reg(CPUARMState *env, uint8_t *buf, int reg)
{
int nregs;
Expand Down
5 changes: 0 additions & 5 deletions target-cris/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -3576,11 +3576,6 @@ CRISCPU *cpu_cris_init(const char *cpu_model)
return cpu;
}

void cpu_state_reset(CPUCRISState *env)
{
cpu_reset(ENV_GET_CPU(env));
}

void restore_state_to_opc(CPUCRISState *env, TranslationBlock *tb, int pc_pos)
{
env->pc = gen_opc_pc[pc_pos];
Expand Down
6 changes: 0 additions & 6 deletions target-i386/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,6 @@

//#define DEBUG_MMU

/* NOTE: must be called outside the CPU execute loop */
void cpu_state_reset(CPUX86State *env)
{
cpu_reset(ENV_GET_CPU(env));
}

static void cpu_x86_version(CPUX86State *env, int *family, int *model)
{
int cpuver = env->cpuid_version;
Expand Down
6 changes: 0 additions & 6 deletions target-lm32/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,9 +233,3 @@ void cpu_lm32_set_phys_msb_ignore(CPULM32State *env, int value)
env->flags &= ~LM32_FLAG_IGNORE_MSB;
}
}

void cpu_state_reset(CPULM32State *env)
{
cpu_reset(ENV_GET_CPU(env));
}

5 changes: 0 additions & 5 deletions target-m68k/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,6 @@ static int fpu_gdb_set_reg(CPUM68KState *env, uint8_t *mem_buf, int n)
return 0;
}

void cpu_state_reset(CPUM68KState *env)
{
cpu_reset(ENV_GET_CPU(env));
}

CPUM68KState *cpu_m68k_init(const char *cpu_model)
{
M68kCPU *cpu;
Expand Down
5 changes: 0 additions & 5 deletions target-microblaze/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -2001,11 +2001,6 @@ MicroBlazeCPU *cpu_mb_init(const char *cpu_model)
return cpu;
}

void cpu_state_reset(CPUMBState *env)
{
cpu_reset(ENV_GET_CPU(env));
}

void restore_state_to_opc(CPUMBState *env, TranslationBlock *tb, int pc_pos)
{
env->sregs[SR_PC] = gen_opc_pc[pc_pos];
Expand Down
3 changes: 3 additions & 0 deletions target-mips/cpu.h
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,9 @@ static inline CPUMIPSState *cpu_init(const char *cpu_model)
return &cpu->env;
}

/* TODO QOM'ify CPU reset and remove */
void cpu_state_reset(CPUMIPSState *s);

/* mips_timer.c */
uint32_t cpu_mips_get_random (CPUMIPSState *env);
uint32_t cpu_mips_get_count (CPUMIPSState *env);
Expand Down
5 changes: 0 additions & 5 deletions target-ppc/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -3186,11 +3186,6 @@ void cpu_dump_rfi (target_ulong RA, target_ulong msr)
TARGET_FMT_lx "\n", RA, msr);
}

void cpu_state_reset(CPUPPCState *env)
{
cpu_reset(ENV_GET_CPU(env));
}

PowerPCCPU *cpu_ppc_init(const char *cpu_model)
{
PowerPCCPU *cpu;
Expand Down
9 changes: 1 addition & 8 deletions target-s390x/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,7 @@ int cpu_s390x_handle_mmu_fault (CPUS390XState *env, target_ulong address, int rw
return 1;
}

#endif /* CONFIG_USER_ONLY */

void cpu_state_reset(CPUS390XState *env)
{
cpu_reset(ENV_GET_CPU(env));
}

#ifndef CONFIG_USER_ONLY
#else /* !CONFIG_USER_ONLY */

/* Ensure to exit the TB after this call! */
static void trigger_pgm_exception(CPUS390XState *env, uint32_t code, uint32_t ilc)
Expand Down
5 changes: 0 additions & 5 deletions target-sh4/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,6 @@ void cpu_dump_state(CPUSH4State * env, FILE * f,
}
}

void cpu_state_reset(CPUSH4State *env)
{
cpu_reset(ENV_GET_CPU(env));
}

typedef struct {
const char *name;
int id;
Expand Down
5 changes: 0 additions & 5 deletions target-sparc/cpu.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@

static int cpu_sparc_find_by_name(sparc_def_t *cpu_def, const char *cpu_model);

void cpu_state_reset(CPUSPARCState *env)
{
cpu_reset(ENV_GET_CPU(env));
}

/* CPUClass::reset() */
static void sparc_cpu_reset(CPUState *s)
{
Expand Down
5 changes: 0 additions & 5 deletions target-xtensa/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@
#include "hw/loader.h"
#endif

void cpu_state_reset(CPUXtensaState *env)
{
cpu_reset(ENV_GET_CPU(env));
}

static struct XtensaConfigList *xtensa_cores;

void xtensa_register_core(XtensaConfigList *node)
Expand Down

0 comments on commit b7e516c

Please sign in to comment.