mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
cpu: Turn cpu_dump_{state,statistics}() into CPUState hooks
Make cpustats monitor command available unconditionally. Prepares for changing kvm_handle_internal_error() and kvm_cpu_exec() arguments to CPUState. Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
+2
-1
@@ -511,6 +511,7 @@ static void flush_windows(CPUSPARCState *env)
|
||||
|
||||
void cpu_loop(CPUSPARCState *env)
|
||||
{
|
||||
CPUState *cs = CPU(sparc_env_get_cpu(env));
|
||||
int trapnr, ret, syscall_nr;
|
||||
//target_siginfo_t info;
|
||||
|
||||
@@ -659,7 +660,7 @@ void cpu_loop(CPUSPARCState *env)
|
||||
badtrap:
|
||||
#endif
|
||||
printf ("Unhandled trap: 0x%x\n", trapnr);
|
||||
cpu_dump_state(env, stderr, fprintf, 0);
|
||||
cpu_dump_state(cs, stderr, fprintf, 0);
|
||||
exit (1);
|
||||
}
|
||||
process_pending_signals (env);
|
||||
|
||||
@@ -397,7 +397,7 @@ void hw_error(const char *fmt, ...)
|
||||
for (env = first_cpu; env != NULL; env = env->next_cpu) {
|
||||
cpu = ENV_GET_CPU(env);
|
||||
fprintf(stderr, "CPU #%d:\n", cpu->cpu_index);
|
||||
cpu_dump_state(env, stderr, fprintf, CPU_DUMP_FPU);
|
||||
cpu_dump_state(cpu, stderr, fprintf, CPU_DUMP_FPU);
|
||||
}
|
||||
va_end(ap);
|
||||
abort();
|
||||
|
||||
@@ -600,6 +600,7 @@ void cpu_single_step(CPUArchState *env, int enabled)
|
||||
|
||||
void cpu_abort(CPUArchState *env, const char *fmt, ...)
|
||||
{
|
||||
CPUState *cpu = ENV_GET_CPU(env);
|
||||
va_list ap;
|
||||
va_list ap2;
|
||||
|
||||
@@ -608,7 +609,7 @@ void cpu_abort(CPUArchState *env, const char *fmt, ...)
|
||||
fprintf(stderr, "qemu: fatal: ");
|
||||
vfprintf(stderr, fmt, ap);
|
||||
fprintf(stderr, "\n");
|
||||
cpu_dump_state(env, stderr, fprintf, CPU_DUMP_FPU | CPU_DUMP_CCOP);
|
||||
cpu_dump_state(cpu, stderr, fprintf, CPU_DUMP_FPU | CPU_DUMP_CCOP);
|
||||
if (qemu_log_enabled()) {
|
||||
qemu_log("qemu: fatal: ");
|
||||
qemu_log_vprintf(fmt, ap2);
|
||||
|
||||
@@ -355,16 +355,6 @@ int page_check_range(target_ulong start, target_ulong len, int flags);
|
||||
|
||||
CPUArchState *cpu_copy(CPUArchState *env);
|
||||
|
||||
#define CPU_DUMP_CODE 0x00010000
|
||||
#define CPU_DUMP_FPU 0x00020000 /* dump FPU register state, not just integer */
|
||||
/* dump info about TCG QEMU's condition code optimization state */
|
||||
#define CPU_DUMP_CCOP 0x00040000
|
||||
|
||||
void cpu_dump_state(CPUArchState *env, FILE *f, fprintf_function cpu_fprintf,
|
||||
int flags);
|
||||
void cpu_dump_statistics(CPUArchState *env, FILE *f, fprintf_function cpu_fprintf,
|
||||
int flags);
|
||||
|
||||
void QEMU_NORETURN cpu_abort(CPUArchState *env, const char *fmt, ...)
|
||||
GCC_FMT_ATTR(2, 3);
|
||||
extern CPUArchState *first_cpu;
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ void GCC_FMT_ATTR(2, 3) qemu_log_mask(int mask, const char *fmt, ...);
|
||||
static inline void log_cpu_state(CPUArchState *env1, int flags)
|
||||
{
|
||||
if (qemu_log_enabled()) {
|
||||
cpu_dump_state(env1, qemu_logfile, fprintf, flags);
|
||||
cpu_dump_state(ENV_GET_CPU(env1), qemu_logfile, fprintf, flags);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,8 @@ typedef struct CPUState CPUState;
|
||||
* instantiatable CPU type.
|
||||
* @reset: Callback to reset the #CPUState to its initial state.
|
||||
* @do_interrupt: Callback for interrupt handling.
|
||||
* @dump_state: Callback for dumping state.
|
||||
* @dump_statistics: Callback for dumping statistics.
|
||||
* @get_arch_id: Callback for getting architecture-dependent CPU ID.
|
||||
* @get_paging_enabled: Callback for inquiring whether paging is enabled.
|
||||
* @get_memory_mapping: Callback for obtaining the memory mappings.
|
||||
@@ -64,6 +66,10 @@ typedef struct CPUClass {
|
||||
|
||||
void (*reset)(CPUState *cpu);
|
||||
void (*do_interrupt)(CPUState *cpu);
|
||||
void (*dump_state)(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
|
||||
int flags);
|
||||
void (*dump_statistics)(CPUState *cpu, FILE *f,
|
||||
fprintf_function cpu_fprintf, int flags);
|
||||
int64_t (*get_arch_id)(CPUState *cpu);
|
||||
bool (*get_paging_enabled)(const CPUState *cpu);
|
||||
void (*get_memory_mapping)(CPUState *cpu, MemoryMappingList *list,
|
||||
@@ -200,6 +206,42 @@ int cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cpu,
|
||||
int cpu_write_elf32_qemunote(WriteCoreDumpFunction f, CPUState *cpu,
|
||||
void *opaque);
|
||||
|
||||
/**
|
||||
* CPUDumpFlags:
|
||||
* @CPU_DUMP_CODE:
|
||||
* @CPU_DUMP_FPU: dump FPU register state, not just integer
|
||||
* @CPU_DUMP_CCOP: dump info about TCG QEMU's condition code optimization state
|
||||
*/
|
||||
enum CPUDumpFlags {
|
||||
CPU_DUMP_CODE = 0x00010000,
|
||||
CPU_DUMP_FPU = 0x00020000,
|
||||
CPU_DUMP_CCOP = 0x00040000,
|
||||
};
|
||||
|
||||
/**
|
||||
* cpu_dump_state:
|
||||
* @cpu: The CPU whose state is to be dumped.
|
||||
* @f: File to dump to.
|
||||
* @cpu_fprintf: Function to dump with.
|
||||
* @flags: Flags what to dump.
|
||||
*
|
||||
* Dumps CPU state.
|
||||
*/
|
||||
void cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
|
||||
int flags);
|
||||
|
||||
/**
|
||||
* cpu_dump_statistics:
|
||||
* @cpu: The CPU whose state is to be dumped.
|
||||
* @f: File to dump to.
|
||||
* @cpu_fprintf: Function to dump with.
|
||||
* @flags: Flags what to dump.
|
||||
*
|
||||
* Dumps CPU statistics.
|
||||
*/
|
||||
void cpu_dump_statistics(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
|
||||
int flags);
|
||||
|
||||
/**
|
||||
* cpu_reset:
|
||||
* @cpu: The CPU whose state is to be reset.
|
||||
|
||||
@@ -1544,7 +1544,7 @@ static int kvm_handle_internal_error(CPUArchState *env, struct kvm_run *run)
|
||||
if (run->internal.suberror == KVM_INTERNAL_ERROR_EMULATION) {
|
||||
fprintf(stderr, "emulation failure\n");
|
||||
if (!kvm_arch_stop_on_emulation_error(cpu)) {
|
||||
cpu_dump_state(env, stderr, fprintf, CPU_DUMP_CODE);
|
||||
cpu_dump_state(cpu, stderr, fprintf, CPU_DUMP_CODE);
|
||||
return EXCP_INTERRUPT;
|
||||
}
|
||||
}
|
||||
@@ -1700,7 +1700,7 @@ int kvm_cpu_exec(CPUArchState *env)
|
||||
} while (ret == 0);
|
||||
|
||||
if (ret < 0) {
|
||||
cpu_dump_state(env, stderr, fprintf, CPU_DUMP_CODE);
|
||||
cpu_dump_state(cpu, stderr, fprintf, CPU_DUMP_CODE);
|
||||
vm_stop(RUN_STATE_INTERNAL_ERROR);
|
||||
}
|
||||
|
||||
|
||||
+23
-15
@@ -901,7 +901,7 @@ void cpu_loop(CPUARMState *env)
|
||||
error:
|
||||
fprintf(stderr, "qemu: unhandled CPU exception 0x%x - aborting\n",
|
||||
trapnr);
|
||||
cpu_dump_state(env, stderr, fprintf, 0);
|
||||
cpu_dump_state(cs, stderr, fprintf, 0);
|
||||
abort();
|
||||
}
|
||||
process_pending_signals(env);
|
||||
@@ -985,7 +985,7 @@ void cpu_loop(CPUUniCore32State *env)
|
||||
|
||||
error:
|
||||
fprintf(stderr, "qemu: unhandled CPU exception 0x%x - aborting\n", trapnr);
|
||||
cpu_dump_state(env, stderr, fprintf, 0);
|
||||
cpu_dump_state(cs, stderr, fprintf, 0);
|
||||
abort();
|
||||
}
|
||||
#endif
|
||||
@@ -1115,6 +1115,7 @@ static void flush_windows(CPUSPARCState *env)
|
||||
|
||||
void cpu_loop (CPUSPARCState *env)
|
||||
{
|
||||
CPUState *cs = CPU(sparc_env_get_cpu(env));
|
||||
int trapnr;
|
||||
abi_long ret;
|
||||
target_siginfo_t info;
|
||||
@@ -1246,7 +1247,7 @@ void cpu_loop (CPUSPARCState *env)
|
||||
break;
|
||||
default:
|
||||
printf ("Unhandled trap: 0x%x\n", trapnr);
|
||||
cpu_dump_state(env, stderr, fprintf, 0);
|
||||
cpu_dump_state(cs, stderr, fprintf, 0);
|
||||
exit (1);
|
||||
}
|
||||
process_pending_signals (env);
|
||||
@@ -1304,7 +1305,7 @@ int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, uint32_t val)
|
||||
#define EXCP_DUMP(env, fmt, ...) \
|
||||
do { \
|
||||
fprintf(stderr, fmt , ## __VA_ARGS__); \
|
||||
cpu_dump_state(env, stderr, fprintf, 0); \
|
||||
cpu_dump_state(ENV_GET_CPU(env), stderr, fprintf, 0); \
|
||||
qemu_log(fmt, ## __VA_ARGS__); \
|
||||
if (qemu_log_enabled()) { \
|
||||
log_cpu_state(env, 0); \
|
||||
@@ -2391,7 +2392,7 @@ done_syscall:
|
||||
error:
|
||||
fprintf(stderr, "qemu: unhandled CPU exception 0x%x - aborting\n",
|
||||
trapnr);
|
||||
cpu_dump_state(env, stderr, fprintf, 0);
|
||||
cpu_dump_state(cs, stderr, fprintf, 0);
|
||||
abort();
|
||||
}
|
||||
process_pending_signals(env);
|
||||
@@ -2403,6 +2404,7 @@ error:
|
||||
|
||||
void cpu_loop(CPUOpenRISCState *env)
|
||||
{
|
||||
CPUState *cs = CPU(openrisc_env_get_cpu(env));
|
||||
int trapnr, gdbsig;
|
||||
|
||||
for (;;) {
|
||||
@@ -2420,7 +2422,7 @@ void cpu_loop(CPUOpenRISCState *env)
|
||||
break;
|
||||
case EXCP_DPF:
|
||||
case EXCP_IPF:
|
||||
cpu_dump_state(env, stderr, fprintf, 0);
|
||||
cpu_dump_state(cs, stderr, fprintf, 0);
|
||||
gdbsig = TARGET_SIGSEGV;
|
||||
break;
|
||||
case EXCP_TICK:
|
||||
@@ -2469,7 +2471,7 @@ void cpu_loop(CPUOpenRISCState *env)
|
||||
default:
|
||||
qemu_log("\nqemu: unhandled CPU exception %#x - aborting\n",
|
||||
trapnr);
|
||||
cpu_dump_state(env, stderr, fprintf, 0);
|
||||
cpu_dump_state(cs, stderr, fprintf, 0);
|
||||
gdbsig = TARGET_SIGILL;
|
||||
break;
|
||||
}
|
||||
@@ -2489,6 +2491,7 @@ void cpu_loop(CPUOpenRISCState *env)
|
||||
#ifdef TARGET_SH4
|
||||
void cpu_loop(CPUSH4State *env)
|
||||
{
|
||||
CPUState *cs = CPU(sh_env_get_cpu(env));
|
||||
int trapnr, ret;
|
||||
target_siginfo_t info;
|
||||
|
||||
@@ -2537,7 +2540,7 @@ void cpu_loop(CPUSH4State *env)
|
||||
|
||||
default:
|
||||
printf ("Unhandled trap: 0x%x\n", trapnr);
|
||||
cpu_dump_state(env, stderr, fprintf, 0);
|
||||
cpu_dump_state(cs, stderr, fprintf, 0);
|
||||
exit (1);
|
||||
}
|
||||
process_pending_signals (env);
|
||||
@@ -2548,6 +2551,7 @@ void cpu_loop(CPUSH4State *env)
|
||||
#ifdef TARGET_CRIS
|
||||
void cpu_loop(CPUCRISState *env)
|
||||
{
|
||||
CPUState *cs = CPU(cris_env_get_cpu(env));
|
||||
int trapnr, ret;
|
||||
target_siginfo_t info;
|
||||
|
||||
@@ -2595,7 +2599,7 @@ void cpu_loop(CPUCRISState *env)
|
||||
break;
|
||||
default:
|
||||
printf ("Unhandled trap: 0x%x\n", trapnr);
|
||||
cpu_dump_state(env, stderr, fprintf, 0);
|
||||
cpu_dump_state(cs, stderr, fprintf, 0);
|
||||
exit (1);
|
||||
}
|
||||
process_pending_signals (env);
|
||||
@@ -2606,6 +2610,7 @@ void cpu_loop(CPUCRISState *env)
|
||||
#ifdef TARGET_MICROBLAZE
|
||||
void cpu_loop(CPUMBState *env)
|
||||
{
|
||||
CPUState *cs = CPU(mb_env_get_cpu(env));
|
||||
int trapnr, ret;
|
||||
target_siginfo_t info;
|
||||
|
||||
@@ -2673,7 +2678,7 @@ void cpu_loop(CPUMBState *env)
|
||||
default:
|
||||
printf ("Unhandled hw-exception: 0x%x\n",
|
||||
env->sregs[SR_ESR] & ESR_EC_MASK);
|
||||
cpu_dump_state(env, stderr, fprintf, 0);
|
||||
cpu_dump_state(cs, stderr, fprintf, 0);
|
||||
exit (1);
|
||||
break;
|
||||
}
|
||||
@@ -2694,7 +2699,7 @@ void cpu_loop(CPUMBState *env)
|
||||
break;
|
||||
default:
|
||||
printf ("Unhandled trap: 0x%x\n", trapnr);
|
||||
cpu_dump_state(env, stderr, fprintf, 0);
|
||||
cpu_dump_state(cs, stderr, fprintf, 0);
|
||||
exit (1);
|
||||
}
|
||||
process_pending_signals (env);
|
||||
@@ -2706,6 +2711,7 @@ void cpu_loop(CPUMBState *env)
|
||||
|
||||
void cpu_loop(CPUM68KState *env)
|
||||
{
|
||||
CPUState *cs = CPU(m68k_env_get_cpu(env));
|
||||
int trapnr;
|
||||
unsigned int n;
|
||||
target_siginfo_t info;
|
||||
@@ -2787,7 +2793,7 @@ void cpu_loop(CPUM68KState *env)
|
||||
default:
|
||||
fprintf(stderr, "qemu: unhandled CPU exception 0x%x - aborting\n",
|
||||
trapnr);
|
||||
cpu_dump_state(env, stderr, fprintf, 0);
|
||||
cpu_dump_state(cs, stderr, fprintf, 0);
|
||||
abort();
|
||||
}
|
||||
process_pending_signals(env);
|
||||
@@ -2843,6 +2849,7 @@ static void do_store_exclusive(CPUAlphaState *env, int reg, int quad)
|
||||
|
||||
void cpu_loop(CPUAlphaState *env)
|
||||
{
|
||||
CPUState *cs = CPU(alpha_env_get_cpu(env));
|
||||
int trapnr;
|
||||
target_siginfo_t info;
|
||||
abi_long sysret;
|
||||
@@ -3017,7 +3024,7 @@ void cpu_loop(CPUAlphaState *env)
|
||||
break;
|
||||
default:
|
||||
printf ("Unhandled trap: 0x%x\n", trapnr);
|
||||
cpu_dump_state(env, stderr, fprintf, 0);
|
||||
cpu_dump_state(cs, stderr, fprintf, 0);
|
||||
exit (1);
|
||||
}
|
||||
process_pending_signals (env);
|
||||
@@ -3028,6 +3035,7 @@ void cpu_loop(CPUAlphaState *env)
|
||||
#ifdef TARGET_S390X
|
||||
void cpu_loop(CPUS390XState *env)
|
||||
{
|
||||
CPUState *cs = CPU(s390_env_get_cpu(env));
|
||||
int trapnr, n, sig;
|
||||
target_siginfo_t info;
|
||||
target_ulong addr;
|
||||
@@ -3118,7 +3126,7 @@ void cpu_loop(CPUS390XState *env)
|
||||
|
||||
default:
|
||||
fprintf(stderr, "Unhandled program exception: %#x\n", n);
|
||||
cpu_dump_state(env, stderr, fprintf, 0);
|
||||
cpu_dump_state(cs, stderr, fprintf, 0);
|
||||
exit(1);
|
||||
}
|
||||
break;
|
||||
@@ -3135,7 +3143,7 @@ void cpu_loop(CPUS390XState *env)
|
||||
|
||||
default:
|
||||
fprintf(stderr, "Unhandled trap: 0x%x\n", trapnr);
|
||||
cpu_dump_state(env, stderr, fprintf, 0);
|
||||
cpu_dump_state(cs, stderr, fprintf, 0);
|
||||
exit(1);
|
||||
}
|
||||
process_pending_signals (env);
|
||||
|
||||
@@ -921,9 +921,11 @@ int monitor_get_cpu_index(void)
|
||||
|
||||
static void do_info_registers(Monitor *mon, const QDict *qdict)
|
||||
{
|
||||
CPUState *cpu;
|
||||
CPUArchState *env;
|
||||
env = mon_get_cpu();
|
||||
cpu_dump_state(env, (FILE *)mon, monitor_fprintf, CPU_DUMP_FPU);
|
||||
cpu = ENV_GET_CPU(env);
|
||||
cpu_dump_state(cpu, (FILE *)mon, monitor_fprintf, CPU_DUMP_FPU);
|
||||
}
|
||||
|
||||
static void do_info_jit(Monitor *mon, const QDict *qdict)
|
||||
@@ -948,16 +950,15 @@ static void do_info_history(Monitor *mon, const QDict *qdict)
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(TARGET_PPC)
|
||||
/* XXX: not implemented in other targets */
|
||||
static void do_info_cpu_stats(Monitor *mon, const QDict *qdict)
|
||||
{
|
||||
CPUState *cpu;
|
||||
CPUArchState *env;
|
||||
|
||||
env = mon_get_cpu();
|
||||
cpu_dump_statistics(env, (FILE *)mon, &monitor_fprintf, 0);
|
||||
cpu = ENV_GET_CPU(env);
|
||||
cpu_dump_statistics(cpu, (FILE *)mon, &monitor_fprintf, 0);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void do_trace_print_events(Monitor *mon, const QDict *qdict)
|
||||
{
|
||||
@@ -2678,7 +2679,6 @@ static mon_cmd_t info_cmds[] = {
|
||||
.help = "show the current VM UUID",
|
||||
.mhandler.cmd = hmp_info_uuid,
|
||||
},
|
||||
#if defined(TARGET_PPC)
|
||||
{
|
||||
.name = "cpustats",
|
||||
.args_type = "",
|
||||
@@ -2686,7 +2686,6 @@ static mon_cmd_t info_cmds[] = {
|
||||
.help = "show CPU statistics",
|
||||
.mhandler.cmd = do_info_cpu_stats,
|
||||
},
|
||||
#endif
|
||||
#if defined(CONFIG_SLIRP)
|
||||
{
|
||||
.name = "usernet",
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
* <http://www.gnu.org/licenses/gpl-2.0.html>
|
||||
*/
|
||||
|
||||
#include "qom/cpu.h"
|
||||
#include "qemu-common.h"
|
||||
#include "qom/cpu.h"
|
||||
#include "sysemu/kvm.h"
|
||||
#include "qemu/notify.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
@@ -156,6 +156,26 @@ static int cpu_common_write_elf64_note(WriteCoreDumpFunction f,
|
||||
}
|
||||
|
||||
|
||||
void cpu_dump_state(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
|
||||
int flags)
|
||||
{
|
||||
CPUClass *cc = CPU_GET_CLASS(cpu);
|
||||
|
||||
if (cc->dump_state) {
|
||||
cc->dump_state(cpu, f, cpu_fprintf, flags);
|
||||
}
|
||||
}
|
||||
|
||||
void cpu_dump_statistics(CPUState *cpu, FILE *f, fprintf_function cpu_fprintf,
|
||||
int flags)
|
||||
{
|
||||
CPUClass *cc = CPU_GET_CLASS(cpu);
|
||||
|
||||
if (cc->dump_statistics) {
|
||||
cc->dump_statistics(cpu, f, cpu_fprintf, flags);
|
||||
}
|
||||
}
|
||||
|
||||
void cpu_reset(CPUState *cpu)
|
||||
{
|
||||
CPUClass *klass = CPU_GET_CLASS(cpu);
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include "qemu-common.h"
|
||||
#include "qom/cpu.h"
|
||||
|
||||
void cpu_resume(CPUState *cpu)
|
||||
|
||||
@@ -79,5 +79,7 @@ extern const struct VMStateDescription vmstate_alpha_cpu;
|
||||
#endif
|
||||
|
||||
void alpha_cpu_do_interrupt(CPUState *cpu);
|
||||
void alpha_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
|
||||
int flags);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -265,6 +265,7 @@ static void alpha_cpu_class_init(ObjectClass *oc, void *data)
|
||||
|
||||
cc->class_by_name = alpha_cpu_class_by_name;
|
||||
cc->do_interrupt = alpha_cpu_do_interrupt;
|
||||
cc->dump_state = alpha_cpu_dump_state;
|
||||
device_class_set_vmsd(dc, &vmstate_alpha_cpu);
|
||||
}
|
||||
|
||||
|
||||
@@ -464,8 +464,8 @@ void alpha_cpu_do_interrupt(CPUState *cs)
|
||||
#endif /* !USER_ONLY */
|
||||
}
|
||||
|
||||
void cpu_dump_state (CPUAlphaState *env, FILE *f, fprintf_function cpu_fprintf,
|
||||
int flags)
|
||||
void alpha_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
|
||||
int flags)
|
||||
{
|
||||
static const char *linux_reg_names[] = {
|
||||
"v0 ", "t0 ", "t1 ", "t2 ", "t3 ", "t4 ", "t5 ", "t6 ",
|
||||
@@ -473,6 +473,8 @@ void cpu_dump_state (CPUAlphaState *env, FILE *f, fprintf_function cpu_fprintf,
|
||||
"a0 ", "a1 ", "a2 ", "a3 ", "a4 ", "a5 ", "t8 ", "t9 ",
|
||||
"t10", "t11", "ra ", "t12", "at ", "gp ", "sp ", "zero",
|
||||
};
|
||||
AlphaCPU *cpu = ALPHA_CPU(cs);
|
||||
CPUAlphaState *env = &cpu->env;
|
||||
int i;
|
||||
|
||||
cpu_fprintf(f, " PC " TARGET_FMT_lx " PS %02x\n",
|
||||
|
||||
@@ -178,6 +178,7 @@ static void arm_semi_flen_cb(CPUARMState *env, target_ulong ret, target_ulong er
|
||||
#define SET_ARG(n, val) put_user_ual(val, args + (n) * 4)
|
||||
uint32_t do_arm_semihosting(CPUARMState *env)
|
||||
{
|
||||
ARMCPU *cpu = arm_env_get_cpu(env);
|
||||
target_ulong args;
|
||||
target_ulong arg0, arg1, arg2, arg3;
|
||||
char * s;
|
||||
@@ -549,7 +550,7 @@ uint32_t do_arm_semihosting(CPUARMState *env)
|
||||
exit(0);
|
||||
default:
|
||||
fprintf(stderr, "qemu: Unsupported SemiHosting SWI 0x%02x\n", nr);
|
||||
cpu_dump_state(env, stderr, fprintf, 0);
|
||||
cpu_dump_state(CPU(cpu), stderr, fprintf, 0);
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,4 +144,7 @@ void init_cpreg_list(ARMCPU *cpu);
|
||||
void arm_cpu_do_interrupt(CPUState *cpu);
|
||||
void arm_v7m_cpu_do_interrupt(CPUState *cpu);
|
||||
|
||||
void arm_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
|
||||
int flags);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -816,6 +816,7 @@ static void arm_cpu_class_init(ObjectClass *oc, void *data)
|
||||
|
||||
cc->class_by_name = arm_cpu_class_by_name;
|
||||
cc->do_interrupt = arm_cpu_do_interrupt;
|
||||
cc->dump_state = arm_cpu_dump_state;
|
||||
cpu_class_set_vmsd(cc, &vmstate_arm_cpu);
|
||||
}
|
||||
|
||||
|
||||
@@ -10085,9 +10085,11 @@ static const char *cpu_mode_names[16] = {
|
||||
"???", "???", "???", "und", "???", "???", "???", "sys"
|
||||
};
|
||||
|
||||
void cpu_dump_state(CPUARMState *env, FILE *f, fprintf_function cpu_fprintf,
|
||||
int flags)
|
||||
void arm_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
|
||||
int flags)
|
||||
{
|
||||
ARMCPU *cpu = ARM_CPU(cs);
|
||||
CPUARMState *env = &cpu->env;
|
||||
int i;
|
||||
uint32_t psr;
|
||||
|
||||
|
||||
@@ -76,4 +76,7 @@ static inline CRISCPU *cris_env_get_cpu(CPUCRISState *env)
|
||||
void cris_cpu_do_interrupt(CPUState *cpu);
|
||||
void crisv10_cpu_do_interrupt(CPUState *cpu);
|
||||
|
||||
void cris_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
|
||||
int flags);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -252,6 +252,7 @@ static void cris_cpu_class_init(ObjectClass *oc, void *data)
|
||||
|
||||
cc->class_by_name = cris_cpu_class_by_name;
|
||||
cc->do_interrupt = cris_cpu_do_interrupt;
|
||||
cc->dump_state = cris_cpu_dump_state;
|
||||
}
|
||||
|
||||
static const TypeInfo cris_cpu_type_info = {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user