From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55792) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6C4N-0000hz-UT for qemu-devel@nongnu.org; Fri, 09 Mar 2012 21:30:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S6C43-0001Wp-Bb for qemu-devel@nongnu.org; Fri, 09 Mar 2012 21:30:07 -0500 Received: from cantor2.suse.de ([195.135.220.15]:39862 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S6C42-0001WE-A1 for qemu-devel@nongnu.org; Fri, 09 Mar 2012 21:29:47 -0500 Received: from relay2.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 32D6F8FB75 for ; Sat, 10 Mar 2012 03:29:45 +0100 (CET) From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Sat, 10 Mar 2012 03:28:15 +0100 Message-Id: <1331346496-10736-44-git-send-email-afaerber@suse.de> In-Reply-To: <1331346496-10736-1-git-send-email-afaerber@suse.de> References: <1330893156-26569-1-git-send-email-afaerber@suse.de> <1331346496-10736-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH RFC v4 43/44] Rename CPUState -> CPUArchState List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Andreas=20F=C3=A4rber?= Signed-off-by: Andreas F=C3=A4rber --- bsd-user/main.c | 8 ++-- bsd-user/qemu.h | 12 +++--- bsd-user/signal.c | 2 +- cpu-all.h | 56 +++++++++++----------- cpu-defs.h | 2 +- cpu-exec.c | 16 +++--- cpus.c | 76 ++++++++++++++++---------------- darwin-user/main.c | 6 +- darwin-user/qemu.h | 6 +- darwin-user/signal.c | 4 +- def-helper.h | 2 +- disas.c | 4 +- disas.h | 2 +- dyngen-exec.h | 4 +- exec-all.h | 38 ++++++++-------- exec.c | 114 +++++++++++++++++++++++------------------= ----- gdbstub.c | 44 +++++++++--------- gdbstub.h | 16 +++--- gen-icount.h | 8 ++-- kvm-all.c | 54 +++++++++++----------- kvm-stub.c | 22 +++++----- kvm.h | 60 ++++++++++++------------ linux-user/elfload.c | 16 +++--- linux-user/main.c | 14 +++--- linux-user/qemu.h | 14 +++--- linux-user/signal.c | 16 +++--- linux-user/syscall.c | 28 ++++++------ monitor.c | 56 +++++++++++----------- poison.h | 2 +- softmmu-semi.h | 12 +++--- target-alpha/cpu.h | 2 +- target-arm/cpu.h | 2 +- target-cris/cpu.h | 2 +- target-i386/cpu.h | 2 +- target-lm32/cpu.h | 2 +- target-m68k/cpu.h | 2 +- target-microblaze/cpu.h | 2 +- target-mips/cpu.h | 2 +- target-ppc/cpu.h | 2 +- target-s390x/cpu.h | 2 +- target-sh4/cpu.h | 2 +- target-sparc/cpu.h | 2 +- target-unicore32/cpu.h | 2 +- target-xtensa/cpu.h | 2 +- tcg/arm/tcg-target.c | 22 +++++----- tcg/hppa/tcg-target.c | 8 ++-- tcg/i386/tcg-target.c | 2 +- tcg/ia64/tcg-target.c | 10 ++-- tcg/mips/tcg-target.c | 14 +++--- tcg/ppc/tcg-target.c | 4 +- tcg/ppc64/tcg-target.c | 4 +- tcg/s390/tcg-target.c | 8 ++-- tcg/sparc/tcg-target.c | 4 +- tcg/tci/tcg-target.c | 2 +- tcg/tci/tcg-target.h | 2 +- tci.c | 4 +- translate-all.c | 4 +- user-exec.c | 4 +- xen-all.c | 4 +- 59 files changed, 419 insertions(+), 419 deletions(-) diff --git a/bsd-user/main.c b/bsd-user/main.c index 78533d5..48cb715 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -70,11 +70,11 @@ int cpu_get_pic_interrupt(CPUX86State *env) #endif =20 /* These are no-ops because we are not threadsafe. */ -static inline void cpu_exec_start(CPUState *env) +static inline void cpu_exec_start(CPUArchState *env) { } =20 -static inline void cpu_exec_end(CPUState *env) +static inline void cpu_exec_end(CPUArchState *env) { } =20 @@ -713,7 +713,7 @@ static void usage(void) exit(1); } =20 -THREAD CPUState *thread_env; +THREAD CPUArchState *thread_env; =20 /* Assumes contents are already zeroed. */ void init_task_state(TaskState *ts) @@ -737,7 +737,7 @@ int main(int argc, char **argv) struct target_pt_regs regs1, *regs =3D ®s1; struct image_info info1, *info =3D &info1; TaskState ts1, *ts =3D &ts1; - CPUState *env; + CPUArchState *env; int optind; const char *r; int gdbstub_port =3D 0; diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h index 1ba2d08..8a5ee3d 100644 --- a/bsd-user/qemu.h +++ b/bsd-user/qemu.h @@ -139,8 +139,8 @@ abi_long do_openbsd_syscall(void *cpu_env, int num, a= bi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5, abi_long arg6); void gemu_log(const char *fmt, ...) GCC_FMT_ATTR(1, 2); -extern THREAD CPUState *thread_env; -void cpu_loop(CPUState *env); +extern THREAD CPUArchState *thread_env; +void cpu_loop(CPUArchState *env); char *target_strerror(int err); int get_osversion(void); void fork_start(void); @@ -167,13 +167,13 @@ void print_openbsd_syscall_ret(int num, abi_long re= t); extern int do_strace; =20 /* signal.c */ -void process_pending_signals(CPUState *cpu_env); +void process_pending_signals(CPUArchState *cpu_env); void signal_init(void); -//int queue_signal(CPUState *env, int sig, target_siginfo_t *info); +//int queue_signal(CPUArchState *env, int sig, target_siginfo_t *info); //void host_to_target_siginfo(target_siginfo_t *tinfo, const siginfo_t *= info); //void target_to_host_siginfo(siginfo_t *info, const target_siginfo_t *t= info); -long do_sigreturn(CPUState *env); -long do_rt_sigreturn(CPUState *env); +long do_sigreturn(CPUArchState *env); +long do_rt_sigreturn(CPUArchState *env); abi_long do_sigaltstack(abi_ulong uss_addr, abi_ulong uoss_addr, abi_ulo= ng sp); =20 /* mmap.c */ diff --git a/bsd-user/signal.c b/bsd-user/signal.c index 40313c8..445f69e 100644 --- a/bsd-user/signal.c +++ b/bsd-user/signal.c @@ -33,6 +33,6 @@ void signal_init(void) { } =20 -void process_pending_signals(CPUState *cpu_env) +void process_pending_signals(CPUArchState *cpu_env) { } diff --git a/cpu-all.h b/cpu-all.h index 7586c0d..f16e157 100644 --- a/cpu-all.h +++ b/cpu-all.h @@ -322,20 +322,20 @@ void page_set_flags(target_ulong start, target_ulon= g end, int flags); int page_check_range(target_ulong start, target_ulong len, int flags); #endif =20 -CPUState *cpu_copy(CPUState *env); -CPUState *qemu_get_cpu(int cpu); +CPUArchState *cpu_copy(CPUArchState *env); +CPUArchState *qemu_get_cpu(int cpu); =20 #define CPU_DUMP_CODE 0x00010000 =20 -void cpu_dump_state(CPUState *env, FILE *f, fprintf_function cpu_fprintf= , +void cpu_dump_state(CPUArchState *env, FILE *f, fprintf_function cpu_fpr= intf, int flags); -void cpu_dump_statistics(CPUState *env, FILE *f, fprintf_function cpu_fp= rintf, +void cpu_dump_statistics(CPUArchState *env, FILE *f, fprintf_function cp= u_fprintf, int flags); =20 -void QEMU_NORETURN cpu_abort(CPUState *env, const char *fmt, ...) +void QEMU_NORETURN cpu_abort(CPUArchState *env, const char *fmt, ...) GCC_FMT_ATTR(2, 3); -extern CPUState *first_cpu; -DECLARE_TLS(CPUState *,cpu_single_env); +extern CPUArchState *first_cpu; +DECLARE_TLS(CPUArchState *,cpu_single_env); #define cpu_single_env tls_var(cpu_single_env) =20 /* Flags for use in ENV->INTERRUPT_PENDING. @@ -389,23 +389,23 @@ DECLARE_TLS(CPUState *,cpu_single_env); | CPU_INTERRUPT_TGT_EXT_4) =20 #ifndef CONFIG_USER_ONLY -typedef void (*CPUInterruptHandler)(CPUState *, int); +typedef void (*CPUInterruptHandler)(CPUArchState *, int); =20 extern CPUInterruptHandler cpu_interrupt_handler; =20 -static inline void cpu_interrupt(CPUState *s, int mask) +static inline void cpu_interrupt(CPUArchState *s, int mask) { cpu_interrupt_handler(s, mask); } #else /* USER_ONLY */ -void cpu_interrupt(CPUState *env, int mask); +void cpu_interrupt(CPUArchState *env, int mask); #endif /* USER_ONLY */ =20 -void cpu_reset_interrupt(CPUState *env, int mask); +void cpu_reset_interrupt(CPUArchState *env, int mask); =20 -void cpu_exit(CPUState *s); +void cpu_exit(CPUArchState *s); =20 -bool qemu_cpu_has_work(CPUState *env); +bool qemu_cpu_has_work(CPUArchState *env); =20 /* Breakpoint/watchpoint flags */ #define BP_MEM_READ 0x01 @@ -416,26 +416,26 @@ bool qemu_cpu_has_work(CPUState *env); #define BP_GDB 0x10 #define BP_CPU 0x20 =20 -int cpu_breakpoint_insert(CPUState *env, target_ulong pc, int flags, +int cpu_breakpoint_insert(CPUArchState *env, target_ulong pc, int flags, CPUBreakpoint **breakpoint); -int cpu_breakpoint_remove(CPUState *env, target_ulong pc, int flags); -void cpu_breakpoint_remove_by_ref(CPUState *env, CPUBreakpoint *breakpoi= nt); -void cpu_breakpoint_remove_all(CPUState *env, int mask); -int cpu_watchpoint_insert(CPUState *env, target_ulong addr, target_ulong= len, +int cpu_breakpoint_remove(CPUArchState *env, target_ulong pc, int flags)= ; +void cpu_breakpoint_remove_by_ref(CPUArchState *env, CPUBreakpoint *brea= kpoint); +void cpu_breakpoint_remove_all(CPUArchState *env, int mask); +int cpu_watchpoint_insert(CPUArchState *env, target_ulong addr, target_u= long len, int flags, CPUWatchpoint **watchpoint); -int cpu_watchpoint_remove(CPUState *env, target_ulong addr, +int cpu_watchpoint_remove(CPUArchState *env, target_ulong addr, target_ulong len, int flags); -void cpu_watchpoint_remove_by_ref(CPUState *env, CPUWatchpoint *watchpoi= nt); -void cpu_watchpoint_remove_all(CPUState *env, int mask); +void cpu_watchpoint_remove_by_ref(CPUArchState *env, CPUWatchpoint *watc= hpoint); +void cpu_watchpoint_remove_all(CPUArchState *env, int mask); =20 #define SSTEP_ENABLE 0x1 /* Enable simulated HW single stepping */ #define SSTEP_NOIRQ 0x2 /* Do not use IRQ while single stepping */ #define SSTEP_NOTIMER 0x4 /* Do not Timers while single stepping */ =20 -void cpu_single_step(CPUState *env, int enabled); -void cpu_state_reset(CPUState *s); -int cpu_is_stopped(CPUState *env); -void run_on_cpu(CPUState *env, void (*func)(void *data), void *data); +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)= ; =20 #define CPU_LOG_TB_OUT_ASM (1 << 0) #define CPU_LOG_TB_IN_ASM (1 << 1) @@ -466,7 +466,7 @@ int cpu_str_to_log_mask(const char *str); /* Return the physical page corresponding to a virtual one. Use it only for debugging because no protection checks are done. Return -1 if no page found. */ -target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong a= ddr); +target_phys_addr_t cpu_get_phys_page_debug(CPUArchState *env, target_ulo= ng addr); =20 /* memory API */ =20 @@ -516,12 +516,12 @@ extern int mem_prealloc; /* Set if TLB entry is an IO callback. */ #define TLB_MMIO (1 << 5) =20 -void cpu_tlb_update_dirty(CPUState *env); +void cpu_tlb_update_dirty(CPUArchState *env); =20 void dump_exec_info(FILE *f, fprintf_function cpu_fprintf); #endif /* !CONFIG_USER_ONLY */ =20 -int cpu_memory_rw_debug(CPUState *env, target_ulong addr, +int cpu_memory_rw_debug(CPUArchState *env, target_ulong addr, uint8_t *buf, int len, int is_write); =20 #endif /* CPU_ALL_H */ diff --git a/cpu-defs.h b/cpu-defs.h index 4527cbf..3268968 100644 --- a/cpu-defs.h +++ b/cpu-defs.h @@ -202,7 +202,7 @@ typedef struct CPUWatchpoint { jmp_buf jmp_env; = \ int exception_index; = \ = \ - CPUState *next_cpu; /* next CPU sharing TB cache */ = \ + CPUArchState *next_cpu; /* next CPU sharing TB cache */ = \ int cpu_index; /* CPU index (informative) */ = \ uint32_t host_tid; /* host thread ID */ = \ int numa_node; /* NUMA node this cpu is belonging to */ = \ diff --git a/cpu-exec.c b/cpu-exec.c index 2bf1735..bd5791f 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -26,12 +26,12 @@ int tb_invalidated_flag; =20 //#define CONFIG_DEBUG_EXEC =20 -bool qemu_cpu_has_work(CPUState *env) +bool qemu_cpu_has_work(CPUArchState *env) { return cpu_has_work(env); } =20 -void cpu_loop_exit(CPUState *env) +void cpu_loop_exit(CPUArchState *env) { env->current_tb =3D NULL; longjmp(env->jmp_env, 1); @@ -41,7 +41,7 @@ void cpu_loop_exit(CPUState *env) restored in a state compatible with the CPU emulator */ #if defined(CONFIG_SOFTMMU) -void cpu_resume_from_signal(CPUState *env, void *puc) +void cpu_resume_from_signal(CPUArchState *env, void *puc) { /* XXX: restore cpu registers saved in host registers */ =20 @@ -52,7 +52,7 @@ void cpu_resume_from_signal(CPUState *env, void *puc) =20 /* Execute the code without caching the generated code. An interpreter could be used if available. */ -static void cpu_exec_nocache(CPUState *env, int max_cycles, +static void cpu_exec_nocache(CPUArchState *env, int max_cycles, TranslationBlock *orig_tb) { unsigned long next_tb; @@ -79,7 +79,7 @@ static void cpu_exec_nocache(CPUState *env, int max_cyc= les, tb_free(tb); } =20 -static TranslationBlock *tb_find_slow(CPUState *env, +static TranslationBlock *tb_find_slow(CPUArchState *env, target_ulong pc, target_ulong cs_base, uint64_t flags) @@ -135,7 +135,7 @@ static TranslationBlock *tb_find_slow(CPUState *env, return tb; } =20 -static inline TranslationBlock *tb_find_fast(CPUState *env) +static inline TranslationBlock *tb_find_fast(CPUArchState *env) { TranslationBlock *tb; target_ulong cs_base, pc; @@ -163,7 +163,7 @@ CPUDebugExcpHandler *cpu_set_debug_excp_handler(CPUDe= bugExcpHandler *handler) return old_handler; } =20 -static void cpu_handle_debug_exception(CPUState *env) +static void cpu_handle_debug_exception(CPUArchState *env) { CPUWatchpoint *wp; =20 @@ -181,7 +181,7 @@ static void cpu_handle_debug_exception(CPUState *env) =20 volatile sig_atomic_t exit_request; =20 -int cpu_exec(CPUState *env) +int cpu_exec(CPUArchState *env) { int ret, interrupt_request; TranslationBlock *tb; diff --git a/cpus.c b/cpus.c index 17b055f..25ba621 100644 --- a/cpus.c +++ b/cpus.c @@ -58,7 +58,7 @@ =20 #endif /* CONFIG_LINUX */ =20 -static CPUState *next_cpu; +static CPUArchState *next_cpu; =20 /***********************************************************/ /* guest cycle counter */ @@ -89,7 +89,7 @@ TimersState timers_state; int64_t cpu_get_icount(void) { int64_t icount; - CPUState *env =3D cpu_single_env; + CPUArchState *env =3D cpu_single_env; =20 icount =3D qemu_icount; if (env) { @@ -339,7 +339,7 @@ void configure_icount(const char *option) void hw_error(const char *fmt, ...) { va_list ap; - CPUState *env; + CPUArchState *env; =20 va_start(ap, fmt); fprintf(stderr, "qemu: hardware error: "); @@ -359,7 +359,7 @@ void hw_error(const char *fmt, ...) =20 void cpu_synchronize_all_states(void) { - CPUState *cpu; + CPUArchState *cpu; =20 for (cpu =3D first_cpu; cpu; cpu =3D cpu->next_cpu) { cpu_synchronize_state(cpu); @@ -368,7 +368,7 @@ void cpu_synchronize_all_states(void) =20 void cpu_synchronize_all_post_reset(void) { - CPUState *cpu; + CPUArchState *cpu; =20 for (cpu =3D first_cpu; cpu; cpu =3D cpu->next_cpu) { cpu_synchronize_post_reset(cpu); @@ -377,14 +377,14 @@ void cpu_synchronize_all_post_reset(void) =20 void cpu_synchronize_all_post_init(void) { - CPUState *cpu; + CPUArchState *cpu; =20 for (cpu =3D first_cpu; cpu; cpu =3D cpu->next_cpu) { cpu_synchronize_post_init(cpu); } } =20 -int cpu_is_stopped(CPUState *env) +int cpu_is_stopped(CPUArchState *env) { return !runstate_is_running() || env->stopped; } @@ -402,7 +402,7 @@ static void do_vm_stop(RunState state) } } =20 -static int cpu_can_run(CPUState *env) +static int cpu_can_run(CPUArchState *env) { if (env->stop) { return 0; @@ -413,7 +413,7 @@ static int cpu_can_run(CPUState *env) return 1; } =20 -static bool cpu_thread_is_idle(CPUState *env) +static bool cpu_thread_is_idle(CPUArchState *env) { if (env->stop || env->queued_work_first) { return false; @@ -430,7 +430,7 @@ static bool cpu_thread_is_idle(CPUState *env) =20 bool all_cpu_threads_idle(void) { - CPUState *env; + CPUArchState *env; =20 for (env =3D first_cpu; env !=3D NULL; env =3D env->next_cpu) { if (!cpu_thread_is_idle(env)) { @@ -440,7 +440,7 @@ bool all_cpu_threads_idle(void) return true; } =20 -static void cpu_handle_guest_debug(CPUState *env) +static void cpu_handle_guest_debug(CPUArchState *env) { gdb_set_stop_cpu(env); qemu_system_debug_request(); @@ -494,7 +494,7 @@ static void qemu_init_sigbus(void) prctl(PR_MCE_KILL, PR_MCE_KILL_SET, PR_MCE_KILL_EARLY, 0, 0); } =20 -static void qemu_kvm_eat_signals(CPUState *env) +static void qemu_kvm_eat_signals(CPUArchState *env) { struct timespec ts =3D { 0, 0 }; siginfo_t siginfo; @@ -537,7 +537,7 @@ static void qemu_init_sigbus(void) { } =20 -static void qemu_kvm_eat_signals(CPUState *env) +static void qemu_kvm_eat_signals(CPUArchState *env) { } #endif /* !CONFIG_LINUX */ @@ -547,7 +547,7 @@ static void dummy_signal(int sig) { } =20 -static void qemu_kvm_init_cpu_signals(CPUState *env) +static void qemu_kvm_init_cpu_signals(CPUArchState *env) { int r; sigset_t set; @@ -582,7 +582,7 @@ static void qemu_tcg_init_cpu_signals(void) } =20 #else /* _WIN32 */ -static void qemu_kvm_init_cpu_signals(CPUState *env) +static void qemu_kvm_init_cpu_signals(CPUArchState *env) { abort(); } @@ -619,7 +619,7 @@ void qemu_init_cpu_loop(void) qemu_thread_get_self(&io_thread); } =20 -void run_on_cpu(CPUState *env, void (*func)(void *data), void *data) +void run_on_cpu(CPUArchState *env, void (*func)(void *data), void *data) { struct qemu_work_item wi; =20 @@ -641,14 +641,14 @@ void run_on_cpu(CPUState *env, void (*func)(void *d= ata), void *data) =20 qemu_cpu_kick(env); while (!wi.done) { - CPUState *self_env =3D cpu_single_env; + CPUArchState *self_env =3D cpu_single_env; =20 qemu_cond_wait(&qemu_work_cond, &qemu_global_mutex); cpu_single_env =3D self_env; } } =20 -static void flush_queued_work(CPUState *env) +static void flush_queued_work(CPUArchState *env) { struct qemu_work_item *wi; =20 @@ -665,7 +665,7 @@ static void flush_queued_work(CPUState *env) qemu_cond_broadcast(&qemu_work_cond); } =20 -static void qemu_wait_io_event_common(CPUState *env) +static void qemu_wait_io_event_common(CPUArchState *env) { if (env->stop) { env->stop =3D 0; @@ -678,7 +678,7 @@ static void qemu_wait_io_event_common(CPUState *env) =20 static void qemu_tcg_wait_io_event(void) { - CPUState *env; + CPUArchState *env; =20 while (all_cpu_threads_idle()) { /* Start accounting real time to the virtual clock if the CPUs @@ -696,7 +696,7 @@ static void qemu_tcg_wait_io_event(void) } } =20 -static void qemu_kvm_wait_io_event(CPUState *env) +static void qemu_kvm_wait_io_event(CPUArchState *env) { while (cpu_thread_is_idle(env)) { qemu_cond_wait(env->halt_cond, &qemu_global_mutex); @@ -708,7 +708,7 @@ static void qemu_kvm_wait_io_event(CPUState *env) =20 static void *qemu_kvm_cpu_thread_fn(void *arg) { - CPUState *env =3D arg; + CPUArchState *env =3D arg; int r; =20 qemu_mutex_lock(&qemu_global_mutex); @@ -745,7 +745,7 @@ static void tcg_exec_all(void); =20 static void *qemu_tcg_cpu_thread_fn(void *arg) { - CPUState *env =3D arg; + CPUArchState *env =3D arg; =20 qemu_tcg_init_cpu_signals(); qemu_thread_get_self(env->thread); @@ -779,7 +779,7 @@ static void *qemu_tcg_cpu_thread_fn(void *arg) return NULL; } =20 -static void qemu_cpu_kick_thread(CPUState *env) +static void qemu_cpu_kick_thread(CPUArchState *env) { #ifndef _WIN32 int err; @@ -800,7 +800,7 @@ static void qemu_cpu_kick_thread(CPUState *env) =20 void qemu_cpu_kick(void *_env) { - CPUState *env =3D _env; + CPUArchState *env =3D _env; =20 qemu_cond_broadcast(env->halt_cond); if (kvm_enabled() && !env->thread_kicked) { @@ -825,7 +825,7 @@ void qemu_cpu_kick_self(void) =20 int qemu_cpu_is_self(void *_env) { - CPUState *env =3D _env; + CPUArchState *env =3D _env; =20 return qemu_thread_is_self(env->thread); } @@ -852,7 +852,7 @@ void qemu_mutex_unlock_iothread(void) =20 static int all_vcpus_paused(void) { - CPUState *penv =3D first_cpu; + CPUArchState *penv =3D first_cpu; =20 while (penv) { if (!penv->stopped) { @@ -866,7 +866,7 @@ static int all_vcpus_paused(void) =20 void pause_all_vcpus(void) { - CPUState *penv =3D first_cpu; + CPUArchState *penv =3D first_cpu; =20 qemu_clock_enable(vm_clock, false); while (penv) { @@ -899,7 +899,7 @@ void pause_all_vcpus(void) =20 void resume_all_vcpus(void) { - CPUState *penv =3D first_cpu; + CPUArchState *penv =3D first_cpu; =20 qemu_clock_enable(vm_clock, true); while (penv) { @@ -912,7 +912,7 @@ void resume_all_vcpus(void) =20 static void qemu_tcg_init_vcpu(void *_env) { - CPUState *env =3D _env; + CPUArchState *env =3D _env; =20 /* share a single thread for all cpus with TCG */ if (!tcg_cpu_thread) { @@ -935,7 +935,7 @@ static void qemu_tcg_init_vcpu(void *_env) } } =20 -static void qemu_kvm_start_vcpu(CPUState *env) +static void qemu_kvm_start_vcpu(CPUArchState *env) { env->thread =3D g_malloc0(sizeof(QemuThread)); env->halt_cond =3D g_malloc0(sizeof(QemuCond)); @@ -949,7 +949,7 @@ static void qemu_kvm_start_vcpu(CPUState *env) =20 void qemu_init_vcpu(void *_env) { - CPUState *env =3D _env; + CPUArchState *env =3D _env; =20 env->nr_cores =3D smp_cores; env->nr_threads =3D smp_threads; @@ -996,7 +996,7 @@ void vm_stop_force_state(RunState state) } } =20 -static int tcg_cpu_exec(CPUState *env) +static int tcg_cpu_exec(CPUArchState *env) { int ret; #ifdef CONFIG_PROFILER @@ -1045,7 +1045,7 @@ static void tcg_exec_all(void) next_cpu =3D first_cpu; } for (; next_cpu !=3D NULL && !exit_request; next_cpu =3D next_cpu->n= ext_cpu) { - CPUState *env =3D next_cpu; + CPUArchState *env =3D next_cpu; =20 qemu_clock_enable(vm_clock, (env->singlestep_enabled & SSTEP_NOTIMER) =3D=3D= 0); @@ -1065,7 +1065,7 @@ static void tcg_exec_all(void) =20 void set_numa_modes(void) { - CPUState *env; + CPUArchState *env; int i; =20 for (env =3D first_cpu; env !=3D NULL; env =3D env->next_cpu) { @@ -1111,7 +1111,7 @@ void list_cpus(FILE *f, fprintf_function cpu_fprint= f, const char *optarg) CpuInfoList *qmp_query_cpus(Error **errp) { CpuInfoList *head =3D NULL, *cur_item =3D NULL; - CPUState *env; + CPUArchState *env; =20 for(env =3D first_cpu; env !=3D NULL; env =3D env->next_cpu) { CpuInfoList *info; @@ -1157,7 +1157,7 @@ void qmp_memsave(int64_t addr, int64_t size, const = char *filename, { FILE *f; uint32_t l; - CPUState *env; + CPUArchState *env; uint8_t buf[1024]; =20 if (!has_cpu) { @@ -1232,7 +1232,7 @@ exit: void qmp_inject_nmi(Error **errp) { #if defined(TARGET_I386) - CPUState *env; + CPUArchState *env; =20 for (env =3D first_cpu; env !=3D NULL; env =3D env->next_cpu) { if (!env->apic_state) { diff --git a/darwin-user/main.c b/darwin-user/main.c index f5cadc7..544e219 100644 --- a/darwin-user/main.c +++ b/darwin-user/main.c @@ -71,7 +71,7 @@ void gemu_log(const char *fmt, ...) va_end(ap); } =20 -int cpu_get_pic_interrupt(CPUState *env) +int cpu_get_pic_interrupt(CPUArchState *env) { return -1; } @@ -729,7 +729,7 @@ static void usage(void) } =20 /* XXX: currently only used for async signals (see signal.c) */ -CPUState *global_env; +CPUArchState *global_env; =20 /* used to free thread contexts */ TaskState *first_task_state; @@ -741,7 +741,7 @@ int main(int argc, char **argv) const char *log_mask =3D NULL; struct target_pt_regs regs1, *regs =3D ®s1; TaskState ts1, *ts =3D &ts1; - CPUState *env; + CPUArchState *env; int optind; short use_gdbstub =3D 0; const char *r; diff --git a/darwin-user/qemu.h b/darwin-user/qemu.h index b6d3e6c..9e16c8e 100644 --- a/darwin-user/qemu.h +++ b/darwin-user/qemu.h @@ -104,8 +104,8 @@ void qerror(const char *fmt, ...) GCC_FMT_ATTR(1, 2); =20 void write_dt(void *ptr, unsigned long addr, unsigned long limit, int fl= ags); =20 -extern CPUState *global_env; -void cpu_loop(CPUState *env); +extern CPUArchState *global_env; +void cpu_loop(CPUArchState *env); void init_paths(const char *prefix); const char *path(const char *pathname); =20 @@ -122,7 +122,7 @@ void signal_init(void); int queue_signal(int sig, target_siginfo_t *info); void host_to_target_siginfo(target_siginfo_t *tinfo, const siginfo_t *in= fo); void target_to_host_siginfo(siginfo_t *info, const target_siginfo_t *tin= fo); -long do_sigreturn(CPUState *env, int num); +long do_sigreturn(CPUArchState *env, int num); =20 /* machload.c */ int mach_exec(const char * filename, char ** argv, char ** envp, diff --git a/darwin-user/signal.c b/darwin-user/signal.c index 8f9705d..489cb64 100644 --- a/darwin-user/signal.c +++ b/darwin-user/signal.c @@ -377,12 +377,12 @@ long do_sigreturn(CPUX86State *env, int num) #else =20 static void setup_frame(int sig, struct emulated_sigaction *ka, - void *set, CPUState *env) + void *set, CPUArchState *env) { fprintf(stderr, "setup_frame: not implemented\n"); } =20 -long do_sigreturn(CPUState *env, int num) +long do_sigreturn(CPUArchState *env, int num) { int i =3D 0; struct target_sigcontext *scp =3D get_int_arg(&i, env); diff --git a/def-helper.h b/def-helper.h index 8a822c7..5d057d6 100644 --- a/def-helper.h +++ b/def-helper.h @@ -52,7 +52,7 @@ #define dh_ctype_tl target_ulong #define dh_ctype_ptr void * #define dh_ctype_void void -#define dh_ctype_env CPUState * +#define dh_ctype_env CPUArchState * #define dh_ctype(t) dh_ctype_##t =20 /* We can't use glue() here because it falls foul of C preprocessor diff --git a/disas.c b/disas.c index 3b1fd97..4945c44 100644 --- a/disas.c +++ b/disas.c @@ -339,7 +339,7 @@ const char *lookup_symbol(target_ulong orig_addr) #include "monitor.h" =20 static int monitor_disas_is_physical; -static CPUState *monitor_disas_env; +static CPUArchState *monitor_disas_env; =20 static int monitor_read_memory (bfd_vma memaddr, bfd_byte *myaddr, int length, @@ -363,7 +363,7 @@ monitor_fprintf(FILE *stream, const char *fmt, ...) return 0; } =20 -void monitor_disas(Monitor *mon, CPUState *env, +void monitor_disas(Monitor *mon, CPUArchState *env, target_ulong pc, int nb_insn, int is_physical, int fl= ags) { int count, i; diff --git a/disas.h b/disas.h index f9287f7..3ab42af 100644 --- a/disas.h +++ b/disas.h @@ -8,7 +8,7 @@ void disas(FILE *out, void *code, unsigned long size); void target_disas(FILE *out, target_ulong code, target_ulong size, int f= lags); =20 -void monitor_disas(Monitor *mon, CPUState *env, +void monitor_disas(Monitor *mon, CPUArchState *env, target_ulong pc, int nb_insn, int is_physical, int fl= ags); =20 /* Look up symbol for debugging purpose. Returns "" if unknown. */ diff --git a/dyngen-exec.h b/dyngen-exec.h index 09be9ea..083e20b 100644 --- a/dyngen-exec.h +++ b/dyngen-exec.h @@ -61,10 +61,10 @@ #endif =20 #if defined(AREG0) -register CPUState *env asm(AREG0); +register CPUArchState *env asm(AREG0); #else /* TODO: Try env =3D cpu_single_env. */ -extern CPUState *env; +extern CPUArchState *env; #endif =20 #endif /* !defined(__DYNGEN_EXEC_H__) */ diff --git a/exec-all.h b/exec-all.h index 51d01f2..0fcdaf0 100644 --- a/exec-all.h +++ b/exec-all.h @@ -76,30 +76,30 @@ extern uint16_t gen_opc_icount[OPC_BUF_SIZE]; =20 #include "qemu-log.h" =20 -void gen_intermediate_code(CPUState *env, struct TranslationBlock *tb); -void gen_intermediate_code_pc(CPUState *env, struct TranslationBlock *tb= ); -void restore_state_to_opc(CPUState *env, struct TranslationBlock *tb, +void gen_intermediate_code(CPUArchState *env, struct TranslationBlock *t= b); +void gen_intermediate_code_pc(CPUArchState *env, struct TranslationBlock= *tb); +void restore_state_to_opc(CPUArchState *env, struct TranslationBlock *tb= , int pc_pos); =20 void cpu_gen_init(void); -int cpu_gen_code(CPUState *env, struct TranslationBlock *tb, +int cpu_gen_code(CPUArchState *env, struct TranslationBlock *tb, int *gen_code_size_ptr); int cpu_restore_state(struct TranslationBlock *tb, - CPUState *env, unsigned long searched_pc); -void cpu_resume_from_signal(CPUState *env1, void *puc); -void cpu_io_recompile(CPUState *env, void *retaddr); -TranslationBlock *tb_gen_code(CPUState *env,=20 + CPUArchState *env, unsigned long searched_pc); +void cpu_resume_from_signal(CPUArchState *env1, void *puc); +void cpu_io_recompile(CPUArchState *env, void *retaddr); +TranslationBlock *tb_gen_code(CPUArchState *env,=20 target_ulong pc, target_ulong cs_base, int= flags, int cflags); -void cpu_exec_init(CPUState *env); -void QEMU_NORETURN cpu_loop_exit(CPUState *env1); +void cpu_exec_init(CPUArchState *env); +void QEMU_NORETURN cpu_loop_exit(CPUArchState *env1); int page_unprotect(target_ulong address, unsigned long pc, void *puc); void tb_invalidate_phys_page_range(tb_page_addr_t start, tb_page_addr_t = end, int is_cpu_write_access); -void tlb_flush_page(CPUState *env, target_ulong addr); -void tlb_flush(CPUState *env, int flush_global); +void tlb_flush_page(CPUArchState *env, target_ulong addr); +void tlb_flush(CPUArchState *env, int flush_global); #if !defined(CONFIG_USER_ONLY) -void tlb_set_page(CPUState *env, target_ulong vaddr, +void tlb_set_page(CPUArchState *env, target_ulong vaddr, target_phys_addr_t paddr, int prot, int mmu_idx, target_ulong size); #endif @@ -182,7 +182,7 @@ static inline unsigned int tb_phys_hash_func(tb_page_= addr_t pc) } =20 void tb_free(TranslationBlock *tb); -void tb_flush(CPUState *env); +void tb_flush(CPUArchState *env); void tb_link_page(TranslationBlock *tb, tb_page_addr_t phys_pc, tb_page_addr_t phys_page2); void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr); @@ -304,7 +304,7 @@ void io_mem_write(int index, target_phys_addr_t addr,= uint64_t value, unsigned size); extern struct MemoryRegion *io_mem_region[IO_MEM_NB_ENTRIES]; =20 -void tlb_fill(CPUState *env1, target_ulong addr, int is_write, int mmu_i= dx, +void tlb_fill(CPUArchState *env1, target_ulong addr, int is_write, int m= mu_idx, void *retaddr); =20 #include "softmmu_defs.h" @@ -332,15 +332,15 @@ void tlb_fill(CPUState *env1, target_ulong addr, in= t is_write, int mmu_idx, #endif =20 #if defined(CONFIG_USER_ONLY) -static inline tb_page_addr_t get_page_addr_code(CPUState *env1, target_u= long addr) +static inline tb_page_addr_t get_page_addr_code(CPUArchState *env1, targ= et_ulong addr) { return addr; } #else -tb_page_addr_t get_page_addr_code(CPUState *env1, target_ulong addr); +tb_page_addr_t get_page_addr_code(CPUArchState *env1, target_ulong addr)= ; #endif =20 -typedef void (CPUDebugExcpHandler)(CPUState *env); +typedef void (CPUDebugExcpHandler)(CPUArchState *env); =20 CPUDebugExcpHandler *cpu_set_debug_excp_handler(CPUDebugExcpHandler *han= dler); =20 @@ -352,7 +352,7 @@ extern volatile sig_atomic_t exit_request; =20 /* Deterministic execution requires that IO only be performed on the las= t instruction of a TB so that interrupts take effect immediately. */ -static inline int can_do_io(CPUState *env) +static inline int can_do_io(CPUArchState *env) { if (!use_icount) { return 1; diff --git a/exec.c b/exec.c index 1e5bbd6..e95c377 100644 --- a/exec.c +++ b/exec.c @@ -123,10 +123,10 @@ static MemoryRegion io_mem_subpage_ram; =20 #endif =20 -CPUState *first_cpu; +CPUArchState *first_cpu; /* current CPU in the current thread. It is only valid inside cpu_exec() */ -DEFINE_TLS(CPUState *,cpu_single_env); +DEFINE_TLS(CPUArchState *,cpu_single_env); /* 0 =3D Do not count executed instructions. 1 =3D Precise instruction counting. 2 =3D Adaptive rate instruction counting. */ @@ -511,7 +511,7 @@ not_found: } =20 static void tlb_protect_code(ram_addr_t ram_addr); -static void tlb_unprotect_code_phys(CPUState *env, ram_addr_t ram_addr, +static void tlb_unprotect_code_phys(CPUArchState *env, ram_addr_t ram_ad= dr, target_ulong vaddr); #define mmap_lock() do { } while(0) #define mmap_unlock() do { } while(0) @@ -663,7 +663,7 @@ void cpu_exec_init_all(void) =20 static int cpu_common_post_load(void *opaque, int version_id) { - CPUState *env =3D opaque; + CPUArchState *env =3D opaque; =20 /* 0x01 was CPU_INTERRUPT_EXIT. This line can be removed when the version_id is increased. */ @@ -680,16 +680,16 @@ static const VMStateDescription vmstate_cpu_common = =3D { .minimum_version_id_old =3D 1, .post_load =3D cpu_common_post_load, .fields =3D (VMStateField []) { - VMSTATE_UINT32(halted, CPUState), - VMSTATE_UINT32(interrupt_request, CPUState), + VMSTATE_UINT32(halted, CPUArchState), + VMSTATE_UINT32(interrupt_request, CPUArchState), VMSTATE_END_OF_LIST() } }; #endif =20 -CPUState *qemu_get_cpu(int cpu) +CPUArchState *qemu_get_cpu(int cpu) { - CPUState *env =3D first_cpu; + CPUArchState *env =3D first_cpu; =20 while (env) { if (env->cpu_index =3D=3D cpu) @@ -700,9 +700,9 @@ CPUState *qemu_get_cpu(int cpu) return env; } =20 -void cpu_exec_init(CPUState *env) +void cpu_exec_init(CPUArchState *env) { - CPUState **penv; + CPUArchState **penv; int cpu_index; =20 #if defined(CONFIG_USER_ONLY) @@ -801,9 +801,9 @@ static void page_flush_tb(void) =20 /* flush all the translation blocks */ /* XXX: tb_flush is currently not thread safe */ -void tb_flush(CPUState *env1) +void tb_flush(CPUArchState *env1) { - CPUState *env; + CPUArchState *env; #if defined(DEBUG_FLUSH) printf("qemu: flush code_size=3D%ld nb_tbs=3D%d avg_tb_size=3D%ld\n"= , (unsigned long)(code_gen_ptr - code_gen_buffer), @@ -936,7 +936,7 @@ static inline void tb_reset_jump(TranslationBlock *tb= , int n) =20 void tb_phys_invalidate(TranslationBlock *tb, tb_page_addr_t page_addr) { - CPUState *env; + CPUArchState *env; PageDesc *p; unsigned int h, n1; tb_page_addr_t phys_pc; @@ -1045,7 +1045,7 @@ static void build_page_bitmap(PageDesc *p) } } =20 -TranslationBlock *tb_gen_code(CPUState *env, +TranslationBlock *tb_gen_code(CPUArchState *env, target_ulong pc, target_ulong cs_base, int flags, int cflags) { @@ -1092,7 +1092,7 @@ void tb_invalidate_phys_page_range(tb_page_addr_t s= tart, tb_page_addr_t end, int is_cpu_write_access) { TranslationBlock *tb, *tb_next, *saved_tb; - CPUState *env =3D cpu_single_env; + CPUArchState *env =3D cpu_single_env; tb_page_addr_t tb_start, tb_end; PageDesc *p; int n; @@ -1229,7 +1229,7 @@ static void tb_invalidate_phys_page(tb_page_addr_t = addr, int n; #ifdef TARGET_HAS_PRECISE_SMC TranslationBlock *current_tb =3D NULL; - CPUState *env =3D cpu_single_env; + CPUArchState *env =3D cpu_single_env; int current_tb_modified =3D 0; target_ulong current_pc =3D 0; target_ulong current_cs_base =3D 0; @@ -1459,12 +1459,12 @@ static void tb_reset_jump_recursive(TranslationBl= ock *tb) =20 #if defined(TARGET_HAS_ICE) #if defined(CONFIG_USER_ONLY) -static void breakpoint_invalidate(CPUState *env, target_ulong pc) +static void breakpoint_invalidate(CPUArchState *env, target_ulong pc) { tb_invalidate_phys_page_range(pc, pc + 1, 0); } #else -static void breakpoint_invalidate(CPUState *env, target_ulong pc) +static void breakpoint_invalidate(CPUArchState *env, target_ulong pc) { target_phys_addr_t addr; ram_addr_t ram_addr; @@ -1485,19 +1485,19 @@ static void breakpoint_invalidate(CPUState *env, = target_ulong pc) #endif /* TARGET_HAS_ICE */ =20 #if defined(CONFIG_USER_ONLY) -void cpu_watchpoint_remove_all(CPUState *env, int mask) +void cpu_watchpoint_remove_all(CPUArchState *env, int mask) =20 { } =20 -int cpu_watchpoint_insert(CPUState *env, target_ulong addr, target_ulong= len, +int cpu_watchpoint_insert(CPUArchState *env, target_ulong addr, target_u= long len, int flags, CPUWatchpoint **watchpoint) { return -ENOSYS; } #else /* Add a watchpoint. */ -int cpu_watchpoint_insert(CPUState *env, target_ulong addr, target_ulong= len, +int cpu_watchpoint_insert(CPUArchState *env, target_ulong addr, target_u= long len, int flags, CPUWatchpoint **watchpoint) { target_ulong len_mask =3D ~(len - 1); @@ -1530,7 +1530,7 @@ int cpu_watchpoint_insert(CPUState *env, target_ulo= ng addr, target_ulong len, } =20 /* Remove a specific watchpoint. */ -int cpu_watchpoint_remove(CPUState *env, target_ulong addr, target_ulong= len, +int cpu_watchpoint_remove(CPUArchState *env, target_ulong addr, target_u= long len, int flags) { target_ulong len_mask =3D ~(len - 1); @@ -1547,7 +1547,7 @@ int cpu_watchpoint_remove(CPUState *env, target_ulo= ng addr, target_ulong len, } =20 /* Remove a specific watchpoint by reference. */ -void cpu_watchpoint_remove_by_ref(CPUState *env, CPUWatchpoint *watchpoi= nt) +void cpu_watchpoint_remove_by_ref(CPUArchState *env, CPUWatchpoint *watc= hpoint) { QTAILQ_REMOVE(&env->watchpoints, watchpoint, entry); =20 @@ -1557,7 +1557,7 @@ void cpu_watchpoint_remove_by_ref(CPUState *env, CP= UWatchpoint *watchpoint) } =20 /* Remove all matching watchpoints. */ -void cpu_watchpoint_remove_all(CPUState *env, int mask) +void cpu_watchpoint_remove_all(CPUArchState *env, int mask) { CPUWatchpoint *wp, *next; =20 @@ -1569,7 +1569,7 @@ void cpu_watchpoint_remove_all(CPUState *env, int m= ask) #endif =20 /* Add a breakpoint. */ -int cpu_breakpoint_insert(CPUState *env, target_ulong pc, int flags, +int cpu_breakpoint_insert(CPUArchState *env, target_ulong pc, int flags, CPUBreakpoint **breakpoint) { #if defined(TARGET_HAS_ICE) @@ -1597,7 +1597,7 @@ int cpu_breakpoint_insert(CPUState *env, target_ulo= ng pc, int flags, } =20 /* Remove a specific breakpoint. */ -int cpu_breakpoint_remove(CPUState *env, target_ulong pc, int flags) +int cpu_breakpoint_remove(CPUArchState *env, target_ulong pc, int flags) { #if defined(TARGET_HAS_ICE) CPUBreakpoint *bp; @@ -1615,7 +1615,7 @@ int cpu_breakpoint_remove(CPUState *env, target_ulo= ng pc, int flags) } =20 /* Remove a specific breakpoint by reference. */ -void cpu_breakpoint_remove_by_ref(CPUState *env, CPUBreakpoint *breakpoi= nt) +void cpu_breakpoint_remove_by_ref(CPUArchState *env, CPUBreakpoint *brea= kpoint) { #if defined(TARGET_HAS_ICE) QTAILQ_REMOVE(&env->breakpoints, breakpoint, entry); @@ -1627,7 +1627,7 @@ void cpu_breakpoint_remove_by_ref(CPUState *env, CP= UBreakpoint *breakpoint) } =20 /* Remove all matching breakpoints. */ -void cpu_breakpoint_remove_all(CPUState *env, int mask) +void cpu_breakpoint_remove_all(CPUArchState *env, int mask) { #if defined(TARGET_HAS_ICE) CPUBreakpoint *bp, *next; @@ -1641,7 +1641,7 @@ void cpu_breakpoint_remove_all(CPUState *env, int m= ask) =20 /* enable or disable single step mode. EXCP_DEBUG is returned by the CPU loop after each instruction */ -void cpu_single_step(CPUState *env, int enabled) +void cpu_single_step(CPUArchState *env, int enabled) { #if defined(TARGET_HAS_ICE) if (env->singlestep_enabled !=3D enabled) { @@ -1697,7 +1697,7 @@ void cpu_set_log_filename(const char *filename) cpu_set_log(loglevel); } =20 -static void cpu_unlink_tb(CPUState *env) +static void cpu_unlink_tb(CPUArchState *env) { /* FIXME: TB unchaining isn't SMP safe. For now just ignore the problem and hope the cpu will stop of its own accord. For usersp= ace @@ -1719,7 +1719,7 @@ static void cpu_unlink_tb(CPUState *env) =20 #ifndef CONFIG_USER_ONLY /* mask must never be zero, except for A20 change call */ -static void tcg_handle_interrupt(CPUState *env, int mask) +static void tcg_handle_interrupt(CPUArchState *env, int mask) { int old_mask; =20 @@ -1750,19 +1750,19 @@ CPUInterruptHandler cpu_interrupt_handler =3D tcg= _handle_interrupt; =20 #else /* CONFIG_USER_ONLY */ =20 -void cpu_interrupt(CPUState *env, int mask) +void cpu_interrupt(CPUArchState *env, int mask) { env->interrupt_request |=3D mask; cpu_unlink_tb(env); } #endif /* CONFIG_USER_ONLY */ =20 -void cpu_reset_interrupt(CPUState *env, int mask) +void cpu_reset_interrupt(CPUArchState *env, int mask) { env->interrupt_request &=3D ~mask; } =20 -void cpu_exit(CPUState *env) +void cpu_exit(CPUArchState *env) { env->exit_request =3D 1; cpu_unlink_tb(env); @@ -1840,7 +1840,7 @@ int cpu_str_to_log_mask(const char *str) return mask; } =20 -void cpu_abort(CPUState *env, const char *fmt, ...) +void cpu_abort(CPUArchState *env, const char *fmt, ...) { va_list ap; va_list ap2; @@ -1880,17 +1880,17 @@ void cpu_abort(CPUState *env, const char *fmt, ..= .) abort(); } =20 -CPUState *cpu_copy(CPUState *env) +CPUArchState *cpu_copy(CPUArchState *env) { - CPUState *new_env =3D cpu_init(env->cpu_model_str); - CPUState *next_cpu =3D new_env->next_cpu; + CPUArchState *new_env =3D cpu_init(env->cpu_model_str); + CPUArchState *next_cpu =3D new_env->next_cpu; int cpu_index =3D new_env->cpu_index; #if defined(TARGET_HAS_ICE) CPUBreakpoint *bp; CPUWatchpoint *wp; #endif =20 - memcpy(new_env, env, sizeof(CPUState)); + memcpy(new_env, env, sizeof(CPUArchState)); =20 /* Preserve chaining and index. */ new_env->next_cpu =3D next_cpu; @@ -1916,7 +1916,7 @@ CPUState *cpu_copy(CPUState *env) =20 #if !defined(CONFIG_USER_ONLY) =20 -static inline void tlb_flush_jmp_cache(CPUState *env, target_ulong addr) +static inline void tlb_flush_jmp_cache(CPUArchState *env, target_ulong a= ddr) { unsigned int i; =20 @@ -1950,7 +1950,7 @@ static CPUTLBEntry s_cputlb_empty_entry =3D { * entries from the TLB at any time, so flushing more entries than * required is only an efficiency issue, not a correctness issue. */ -void tlb_flush(CPUState *env, int flush_global) +void tlb_flush(CPUArchState *env, int flush_global) { int i; =20 @@ -1987,7 +1987,7 @@ static inline void tlb_flush_entry(CPUTLBEntry *tlb= _entry, target_ulong addr) } } =20 -void tlb_flush_page(CPUState *env, target_ulong addr) +void tlb_flush_page(CPUArchState *env, target_ulong addr) { int i; int mmu_idx; @@ -2028,7 +2028,7 @@ static void tlb_protect_code(ram_addr_t ram_addr) =20 /* update the TLB so that writes in physical page 'phys_addr' are no lon= ger tested for self modifying code */ -static void tlb_unprotect_code_phys(CPUState *env, ram_addr_t ram_addr, +static void tlb_unprotect_code_phys(CPUArchState *env, ram_addr_t ram_ad= dr, target_ulong vaddr) { cpu_physical_memory_set_dirty_flags(ram_addr, CODE_DIRTY_FLAG); @@ -2050,7 +2050,7 @@ static inline void tlb_reset_dirty_range(CPUTLBEntr= y *tlb_entry, void cpu_physical_memory_reset_dirty(ram_addr_t start, ram_addr_t end, int dirty_flags) { - CPUState *env; + CPUArchState *env; unsigned long length, start1; int i; =20 @@ -2105,7 +2105,7 @@ static inline void tlb_update_dirty(CPUTLBEntry *tl= b_entry) } =20 /* update the TLB according to the current state of the dirty bits */ -void cpu_tlb_update_dirty(CPUState *env) +void cpu_tlb_update_dirty(CPUArchState *env) { int i; int mmu_idx; @@ -2123,7 +2123,7 @@ static inline void tlb_set_dirty1(CPUTLBEntry *tlb_= entry, target_ulong vaddr) =20 /* update the TLB corresponding to virtual page vaddr so that it is no longer dirty */ -static inline void tlb_set_dirty(CPUState *env, target_ulong vaddr) +static inline void tlb_set_dirty(CPUArchState *env, target_ulong vaddr) { int i; int mmu_idx; @@ -2136,7 +2136,7 @@ static inline void tlb_set_dirty(CPUState *env, tar= get_ulong vaddr) =20 /* Our TLB does not support large pages, so remember the area covered by large pages and trigger a full TLB flush if these are invalidated. *= / -static void tlb_add_large_page(CPUState *env, target_ulong vaddr, +static void tlb_add_large_page(CPUArchState *env, target_ulong vaddr, target_ulong size) { target_ulong mask =3D ~(size - 1); @@ -2177,7 +2177,7 @@ static bool is_ram_rom_romd(MemoryRegionSection *s) /* Add a new TLB entry. At most one entry for a given virtual address is permitted. Only a single TARGET_PAGE_SIZE region is mapped, the supplied size is only used by tlb_flush_page. */ -void tlb_set_page(CPUState *env, target_ulong vaddr, +void tlb_set_page(CPUArchState *env, target_ulong vaddr, target_phys_addr_t paddr, int prot, int mmu_idx, target_ulong size) { @@ -2280,11 +2280,11 @@ void tlb_set_page(CPUState *env, target_ulong vad= dr, =20 #else =20 -void tlb_flush(CPUState *env, int flush_global) +void tlb_flush(CPUArchState *env, int flush_global) { } =20 -void tlb_flush_page(CPUState *env, target_ulong addr) +void tlb_flush_page(CPUArchState *env, target_ulong addr) { } =20 @@ -2545,7 +2545,7 @@ int page_unprotect(target_ulong address, unsigned l= ong pc, void *puc) return 0; } =20 -static inline void tlb_set_dirty(CPUState *env, +static inline void tlb_set_dirty(CPUArchState *env, unsigned long addr, target_ulong vaddr) { } @@ -3302,7 +3302,7 @@ static const MemoryRegionOps notdirty_mem_ops =3D { /* Generate a debug exception if a watchpoint has been hit. */ static void check_watchpoint(int offset, int len_mask, int flags) { - CPUState *env =3D cpu_single_env; + CPUArchState *env =3D cpu_single_env; target_ulong pc, cs_base; TranslationBlock *tb; target_ulong vaddr; @@ -3593,7 +3593,7 @@ static void core_begin(MemoryListener *listener) =20 static void core_commit(MemoryListener *listener) { - CPUState *env; + CPUArchState *env; =20 /* since each CPU stores ram addresses in its TLB cache, we must reset the modified entries */ @@ -3783,7 +3783,7 @@ MemoryRegion *get_system_io(void) =20 /* physical memory access (slow version, mainly for debug) */ #if defined(CONFIG_USER_ONLY) -int cpu_memory_rw_debug(CPUState *env, target_ulong addr, +int cpu_memory_rw_debug(CPUArchState *env, target_ulong addr, uint8_t *buf, int len, int is_write) { int l, flags; @@ -4528,7 +4528,7 @@ void stq_be_phys(target_phys_addr_t addr, uint64_t = val) } =20 /* virtual memory access for debug (includes writing to ROM) */ -int cpu_memory_rw_debug(CPUState *env, target_ulong addr, +int cpu_memory_rw_debug(CPUArchState *env, target_ulong addr, uint8_t *buf, int len, int is_write) { int l; @@ -4559,7 +4559,7 @@ int cpu_memory_rw_debug(CPUState *env, target_ulong= addr, =20 /* in deterministic execution mode, instructions doing device I/Os must be at the end of the TB */ -void cpu_io_recompile(CPUState *env, void *retaddr) +void cpu_io_recompile(CPUArchState *env, void *retaddr) { TranslationBlock *tb; uint32_t n, cflags; @@ -4673,7 +4673,7 @@ void dump_exec_info(FILE *f, fprintf_function cpu_f= printf) /* NOTE: this function can trigger an exception */ /* NOTE2: the returned address is not exactly the physical address: it is the offset relative to phys_ram_base */ -tb_page_addr_t get_page_addr_code(CPUState *env1, target_ulong addr) +tb_page_addr_t get_page_addr_code(CPUArchState *env1, target_ulong addr) { int mmu_idx, page_index, pd; void *p; diff --git a/gdbstub.c b/gdbstub.c index 054e16c..b48464d 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -42,7 +42,7 @@ #include "kvm.h" =20 #ifndef TARGET_CPU_MEMORY_RW_DEBUG -static inline int target_memory_rw_debug(CPUState *env, target_ulong add= r, +static inline int target_memory_rw_debug(CPUArchState *env, target_ulong= addr, uint8_t *buf, int len, int is_w= rite) { return cpu_memory_rw_debug(env, addr, buf, len, is_write); @@ -287,9 +287,9 @@ enum RSState { RS_SYSCALL, }; typedef struct GDBState { - CPUState *c_cpu; /* current CPU for step/continue ops */ - CPUState *g_cpu; /* current CPU for other ops */ - CPUState *query_cpu; /* for q{f|s}ThreadInfo */ + CPUArchState *c_cpu; /* current CPU for step/continue ops */ + CPUArchState *g_cpu; /* current CPU for other ops */ + CPUArchState *query_cpu; /* for q{f|s}ThreadInfo */ enum RSState state; /* parsing state */ char line_buf[MAX_PACKET_LENGTH]; int line_buf_index; @@ -1655,12 +1655,12 @@ static int cpu_gdb_write_register(CPUXtensaState = *env, uint8_t *mem_buf, int n) =20 #define NUM_CORE_REGS 0 =20 -static int cpu_gdb_read_register(CPUState *env, uint8_t *mem_buf, int n) +static int cpu_gdb_read_register(CPUArchState *env, uint8_t *mem_buf, in= t n) { return 0; } =20 -static int cpu_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n= ) +static int cpu_gdb_write_register(CPUArchState *env, uint8_t *mem_buf, i= nt n) { return 0; } @@ -1736,7 +1736,7 @@ static const char *get_feature_xml(const char *p, c= onst char **newp) } #endif =20 -static int gdb_read_register(CPUState *env, uint8_t *mem_buf, int reg) +static int gdb_read_register(CPUArchState *env, uint8_t *mem_buf, int re= g) { GDBRegisterState *r; =20 @@ -1751,7 +1751,7 @@ static int gdb_read_register(CPUState *env, uint8_t= *mem_buf, int reg) return 0; } =20 -static int gdb_write_register(CPUState *env, uint8_t *mem_buf, int reg) +static int gdb_write_register(CPUArchState *env, uint8_t *mem_buf, int r= eg) { GDBRegisterState *r; =20 @@ -1773,7 +1773,7 @@ static int gdb_write_register(CPUState *env, uint8_= t *mem_buf, int reg) gdb reading a CPU register, and set_reg is gdb modifying a CPU regist= er. */ =20 -void gdb_register_coprocessor(CPUState * env, +void gdb_register_coprocessor(CPUArchState * env, gdb_reg_cb get_reg, gdb_reg_cb set_reg, int num_regs, const char *xml, int g_pos) { @@ -1820,7 +1820,7 @@ static const int xlat_gdb_type[] =3D { =20 static int gdb_breakpoint_insert(target_ulong addr, target_ulong len, in= t type) { - CPUState *env; + CPUArchState *env; int err =3D 0; =20 if (kvm_enabled()) @@ -1854,7 +1854,7 @@ static int gdb_breakpoint_insert(target_ulong addr,= target_ulong len, int type) =20 static int gdb_breakpoint_remove(target_ulong addr, target_ulong len, in= t type) { - CPUState *env; + CPUArchState *env; int err =3D 0; =20 if (kvm_enabled()) @@ -1887,7 +1887,7 @@ static int gdb_breakpoint_remove(target_ulong addr,= target_ulong len, int type) =20 static void gdb_breakpoint_remove_all(void) { - CPUState *env; + CPUArchState *env; =20 if (kvm_enabled()) { kvm_remove_all_breakpoints(gdbserver_state->c_cpu); @@ -1939,7 +1939,7 @@ static void gdb_set_cpu_pc(GDBState *s, target_ulon= g pc) #endif } =20 -static inline int gdb_id(CPUState *env) +static inline int gdb_id(CPUArchState *env) { #if defined(CONFIG_USER_ONLY) && defined(CONFIG_USE_NPTL) return env->host_tid; @@ -1948,9 +1948,9 @@ static inline int gdb_id(CPUState *env) #endif } =20 -static CPUState *find_cpu(uint32_t thread_id) +static CPUArchState *find_cpu(uint32_t thread_id) { - CPUState *env; + CPUArchState *env; =20 for (env =3D first_cpu; env !=3D NULL; env =3D env->next_cpu) { if (gdb_id(env) =3D=3D thread_id) { @@ -1963,7 +1963,7 @@ static CPUState *find_cpu(uint32_t thread_id) =20 static int gdb_handle_packet(GDBState *s, const char *line_buf) { - CPUState *env; + CPUArchState *env; const char *p; uint32_t thread; int ch, reg_size, type, res; @@ -2381,7 +2381,7 @@ static int gdb_handle_packet(GDBState *s, const cha= r *line_buf) return RS_IDLE; } =20 -void gdb_set_stop_cpu(CPUState *env) +void gdb_set_stop_cpu(CPUArchState *env) { gdbserver_state->c_cpu =3D env; gdbserver_state->g_cpu =3D env; @@ -2391,7 +2391,7 @@ void gdb_set_stop_cpu(CPUState *env) static void gdb_vm_state_change(void *opaque, int running, RunState stat= e) { GDBState *s =3D gdbserver_state; - CPUState *env =3D s->c_cpu; + CPUArchState *env =3D s->c_cpu; char buf[256]; const char *type; int ret; @@ -2600,7 +2600,7 @@ static void gdb_read_byte(GDBState *s, int ch) } =20 /* Tell the remote gdb that the process has exited. */ -void gdb_exit(CPUState *env, int code) +void gdb_exit(CPUArchState *env, int code) { GDBState *s; char buf[4]; @@ -2640,7 +2640,7 @@ gdb_queuesig (void) } =20 int -gdb_handlesig (CPUState *env, int sig) +gdb_handlesig (CPUArchState *env, int sig) { GDBState *s; char buf[256]; @@ -2689,7 +2689,7 @@ gdb_handlesig (CPUState *env, int sig) } =20 /* Tell the remote gdb that the process has exited due to SIG. */ -void gdb_signalled(CPUState *env, int sig) +void gdb_signalled(CPUArchState *env, int sig) { GDBState *s; char buf[4]; @@ -2785,7 +2785,7 @@ int gdbserver_start(int port) } =20 /* Disable gdb stub for child processes. */ -void gdbserver_fork(CPUState *env) +void gdbserver_fork(CPUArchState *env) { GDBState *s =3D gdbserver_state; if (gdbserver_fd < 0 || s->fd < 0) diff --git a/gdbstub.h b/gdbstub.h index d82334f..b44e275 100644 --- a/gdbstub.h +++ b/gdbstub.h @@ -11,22 +11,22 @@ #define GDB_WATCHPOINT_ACCESS 4 =20 #ifdef NEED_CPU_H -typedef void (*gdb_syscall_complete_cb)(CPUState *env, +typedef void (*gdb_syscall_complete_cb)(CPUArchState *env, target_ulong ret, target_ulong e= rr); =20 void gdb_do_syscall(gdb_syscall_complete_cb cb, const char *fmt, ...); int use_gdb_syscalls(void); -void gdb_set_stop_cpu(CPUState *env); -void gdb_exit(CPUState *, int); +void gdb_set_stop_cpu(CPUArchState *env); +void gdb_exit(CPUArchState *, int); #ifdef CONFIG_USER_ONLY int gdb_queuesig (void); -int gdb_handlesig (CPUState *, int); -void gdb_signalled(CPUState *, int); -void gdbserver_fork(CPUState *); +int gdb_handlesig (CPUArchState *, int); +void gdb_signalled(CPUArchState *, int); +void gdbserver_fork(CPUArchState *); #endif /* Get or set a register. Returns the size of the register. */ -typedef int (*gdb_reg_cb)(CPUState *env, uint8_t *buf, int reg); -void gdb_register_coprocessor(CPUState *env, +typedef int (*gdb_reg_cb)(CPUArchState *env, uint8_t *buf, int reg); +void gdb_register_coprocessor(CPUArchState *env, gdb_reg_cb get_reg, gdb_reg_cb set_reg, int num_regs, const char *xml, int g_pos); =20 diff --git a/gen-icount.h b/gen-icount.h index 5fb3829..430cb44 100644 --- a/gen-icount.h +++ b/gen-icount.h @@ -14,13 +14,13 @@ static inline void gen_icount_start(void) =20 icount_label =3D gen_new_label(); count =3D tcg_temp_local_new_i32(); - tcg_gen_ld_i32(count, cpu_env, offsetof(CPUState, icount_decr.u32)); + tcg_gen_ld_i32(count, cpu_env, offsetof(CPUArchState, icount_decr.u3= 2)); /* This is a horrid hack to allow fixing up the value later. */ icount_arg =3D gen_opparam_ptr + 1; tcg_gen_subi_i32(count, count, 0xdeadbeef); =20 tcg_gen_brcondi_i32(TCG_COND_LT, count, 0, icount_label); - tcg_gen_st16_i32(count, cpu_env, offsetof(CPUState, icount_decr.u16.= low)); + tcg_gen_st16_i32(count, cpu_env, offsetof(CPUArchState, icount_decr.= u16.low)); tcg_temp_free_i32(count); } =20 @@ -36,13 +36,13 @@ static void gen_icount_end(TranslationBlock *tb, int = num_insns) static inline void gen_io_start(void) { TCGv_i32 tmp =3D tcg_const_i32(1); - tcg_gen_st_i32(tmp, cpu_env, offsetof(CPUState, can_do_io)); + tcg_gen_st_i32(tmp, cpu_env, offsetof(CPUArchState, can_do_io)); tcg_temp_free_i32(tmp); } =20 static inline void gen_io_end(void) { TCGv_i32 tmp =3D tcg_const_i32(0); - tcg_gen_st_i32(tmp, cpu_env, offsetof(CPUState, can_do_io)); + tcg_gen_st_i32(tmp, cpu_env, offsetof(CPUArchState, can_do_io)); tcg_temp_free_i32(tmp); } diff --git a/kvm-all.c b/kvm-all.c index 3c6b4f0..42e5e23 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -190,7 +190,7 @@ static int kvm_set_user_memory_region(KVMState *s, KV= MSlot *slot) =20 static void kvm_reset_vcpu(void *opaque) { - CPUState *env =3D opaque; + CPUArchState *env =3D opaque; =20 kvm_arch_reset_vcpu(env); } @@ -200,7 +200,7 @@ int kvm_pit_in_kernel(void) return kvm_state->pit_in_kernel; } =20 -int kvm_init_vcpu(CPUState *env) +int kvm_init_vcpu(CPUArchState *env) { KVMState *s =3D kvm_state; long mmap_size; @@ -830,7 +830,7 @@ static MemoryListener kvm_memory_listener =3D { .priority =3D 10, }; =20 -static void kvm_handle_interrupt(CPUState *env, int mask) +static void kvm_handle_interrupt(CPUArchState *env, int mask) { env->interrupt_request |=3D mask; =20 @@ -1135,7 +1135,7 @@ static void kvm_handle_io(uint16_t port, void *data= , int direction, int size, } } =20 -static int kvm_handle_internal_error(CPUState *env, struct kvm_run *run) +static int kvm_handle_internal_error(CPUArchState *env, struct kvm_run *= run) { fprintf(stderr, "KVM internal error."); if (kvm_check_extension(kvm_state, KVM_CAP_INTERNAL_ERROR_DATA)) { @@ -1190,7 +1190,7 @@ void kvm_flush_coalesced_mmio_buffer(void) =20 static void do_kvm_cpu_synchronize_state(void *_env) { - CPUState *env =3D _env; + CPUArchState *env =3D _env; =20 if (!env->kvm_vcpu_dirty) { kvm_arch_get_registers(env); @@ -1198,26 +1198,26 @@ static void do_kvm_cpu_synchronize_state(void *_e= nv) } } =20 -void kvm_cpu_synchronize_state(CPUState *env) +void kvm_cpu_synchronize_state(CPUArchState *env) { if (!env->kvm_vcpu_dirty) { run_on_cpu(env, do_kvm_cpu_synchronize_state, env); } } =20 -void kvm_cpu_synchronize_post_reset(CPUState *env) +void kvm_cpu_synchronize_post_reset(CPUArchState *env) { kvm_arch_put_registers(env, KVM_PUT_RESET_STATE); env->kvm_vcpu_dirty =3D 0; } =20 -void kvm_cpu_synchronize_post_init(CPUState *env) +void kvm_cpu_synchronize_post_init(CPUArchState *env) { kvm_arch_put_registers(env, KVM_PUT_FULL_STATE); env->kvm_vcpu_dirty =3D 0; } =20 -int kvm_cpu_exec(CPUState *env) +int kvm_cpu_exec(CPUArchState *env) { struct kvm_run *run =3D env->kvm_run; int ret, run_ret; @@ -1350,7 +1350,7 @@ int kvm_vm_ioctl(KVMState *s, int type, ...) return ret; } =20 -int kvm_vcpu_ioctl(CPUState *env, int type, ...) +int kvm_vcpu_ioctl(CPUArchState *env, int type, ...) { int ret; void *arg; @@ -1439,7 +1439,7 @@ void kvm_setup_guest_memory(void *start, size_t siz= e) } =20 #ifdef KVM_CAP_SET_GUEST_DEBUG -struct kvm_sw_breakpoint *kvm_find_sw_breakpoint(CPUState *env, +struct kvm_sw_breakpoint *kvm_find_sw_breakpoint(CPUArchState *env, target_ulong pc) { struct kvm_sw_breakpoint *bp; @@ -1452,26 +1452,26 @@ struct kvm_sw_breakpoint *kvm_find_sw_breakpoint(= CPUState *env, return NULL; } =20 -int kvm_sw_breakpoints_active(CPUState *env) +int kvm_sw_breakpoints_active(CPUArchState *env) { return !QTAILQ_EMPTY(&env->kvm_state->kvm_sw_breakpoints); } =20 struct kvm_set_guest_debug_data { struct kvm_guest_debug dbg; - CPUState *env; + CPUArchState *env; int err; }; =20 static void kvm_invoke_set_guest_debug(void *data) { struct kvm_set_guest_debug_data *dbg_data =3D data; - CPUState *env =3D dbg_data->env; + CPUArchState *env =3D dbg_data->env; =20 dbg_data->err =3D kvm_vcpu_ioctl(env, KVM_SET_GUEST_DEBUG, &dbg_data= ->dbg); } =20 -int kvm_update_guest_debug(CPUState *env, unsigned long reinject_trap) +int kvm_update_guest_debug(CPUArchState *env, unsigned long reinject_tra= p) { struct kvm_set_guest_debug_data data; =20 @@ -1487,11 +1487,11 @@ int kvm_update_guest_debug(CPUState *env, unsigne= d long reinject_trap) return data.err; } =20 -int kvm_insert_breakpoint(CPUState *current_env, target_ulong addr, +int kvm_insert_breakpoint(CPUArchState *current_env, target_ulong addr, target_ulong len, int type) { struct kvm_sw_breakpoint *bp; - CPUState *env; + CPUArchState *env; int err; =20 if (type =3D=3D GDB_BREAKPOINT_SW) { @@ -1532,11 +1532,11 @@ int kvm_insert_breakpoint(CPUState *current_env, = target_ulong addr, return 0; } =20 -int kvm_remove_breakpoint(CPUState *current_env, target_ulong addr, +int kvm_remove_breakpoint(CPUArchState *current_env, target_ulong addr, target_ulong len, int type) { struct kvm_sw_breakpoint *bp; - CPUState *env; + CPUArchState *env; int err; =20 if (type =3D=3D GDB_BREAKPOINT_SW) { @@ -1573,11 +1573,11 @@ int kvm_remove_breakpoint(CPUState *current_env, = target_ulong addr, return 0; } =20 -void kvm_remove_all_breakpoints(CPUState *current_env) +void kvm_remove_all_breakpoints(CPUArchState *current_env) { struct kvm_sw_breakpoint *bp, *next; KVMState *s =3D current_env->kvm_state; - CPUState *env; + CPUArchState *env; =20 QTAILQ_FOREACH_SAFE(bp, &s->kvm_sw_breakpoints, entry, next) { if (kvm_arch_remove_sw_breakpoint(current_env, bp) !=3D 0) { @@ -1598,29 +1598,29 @@ void kvm_remove_all_breakpoints(CPUState *current= _env) =20 #else /* !KVM_CAP_SET_GUEST_DEBUG */ =20 -int kvm_update_guest_debug(CPUState *env, unsigned long reinject_trap) +int kvm_update_guest_debug(CPUArchState *env, unsigned long reinject_tra= p) { return -EINVAL; } =20 -int kvm_insert_breakpoint(CPUState *current_env, target_ulong addr, +int kvm_insert_breakpoint(CPUArchState *current_env, target_ulong addr, target_ulong len, int type) { return -EINVAL; } =20 -int kvm_remove_breakpoint(CPUState *current_env, target_ulong addr, +int kvm_remove_breakpoint(CPUArchState *current_env, target_ulong addr, target_ulong len, int type) { return -EINVAL; } =20 -void kvm_remove_all_breakpoints(CPUState *current_env) +void kvm_remove_all_breakpoints(CPUArchState *current_env) { } #endif /* !KVM_CAP_SET_GUEST_DEBUG */ =20 -int kvm_set_signal_mask(CPUState *env, const sigset_t *sigset) +int kvm_set_signal_mask(CPUArchState *env, const sigset_t *sigset) { struct kvm_signal_mask *sigmask; int r; @@ -1690,7 +1690,7 @@ int kvm_set_ioeventfd_pio_word(int fd, uint16_t add= r, uint16_t val, bool assign) return 0; } =20 -int kvm_on_sigbus_vcpu(CPUState *env, int code, void *addr) +int kvm_on_sigbus_vcpu(CPUArchState *env, int code, void *addr) { return kvm_arch_on_sigbus_vcpu(env, code, addr); } diff --git a/kvm-stub.c b/kvm-stub.c index 1f1c686..69a1228 100644 --- a/kvm-stub.c +++ b/kvm-stub.c @@ -22,7 +22,7 @@ int kvm_pit_in_kernel(void) } =20 =20 -int kvm_init_vcpu(CPUState *env) +int kvm_init_vcpu(CPUArchState *env) { return -ENOSYS; } @@ -46,19 +46,19 @@ void kvm_flush_coalesced_mmio_buffer(void) { } =20 -void kvm_cpu_synchronize_state(CPUState *env) +void kvm_cpu_synchronize_state(CPUArchState *env) { } =20 -void kvm_cpu_synchronize_post_reset(CPUState *env) +void kvm_cpu_synchronize_post_reset(CPUArchState *env) { } =20 -void kvm_cpu_synchronize_post_init(CPUState *env) +void kvm_cpu_synchronize_post_init(CPUArchState *env) { } =20 -int kvm_cpu_exec(CPUState *env) +int kvm_cpu_exec(CPUArchState *env) { abort (); } @@ -87,29 +87,29 @@ void kvm_setup_guest_memory(void *start, size_t size) { } =20 -int kvm_update_guest_debug(CPUState *env, unsigned long reinject_trap) +int kvm_update_guest_debug(CPUArchState *env, unsigned long reinject_tra= p) { return -ENOSYS; } =20 -int kvm_insert_breakpoint(CPUState *current_env, target_ulong addr, +int kvm_insert_breakpoint(CPUArchState *current_env, target_ulong addr, target_ulong len, int type) { return -EINVAL; } =20 -int kvm_remove_breakpoint(CPUState *current_env, target_ulong addr, +int kvm_remove_breakpoint(CPUArchState *current_env, target_ulong addr, target_ulong len, int type) { return -EINVAL; } =20 -void kvm_remove_all_breakpoints(CPUState *current_env) +void kvm_remove_all_breakpoints(CPUArchState *current_env) { } =20 #ifndef _WIN32 -int kvm_set_signal_mask(CPUState *env, const sigset_t *sigset) +int kvm_set_signal_mask(CPUArchState *env, const sigset_t *sigset) { abort(); } @@ -125,7 +125,7 @@ int kvm_set_ioeventfd_mmio_long(int fd, uint32_t adr,= uint32_t val, bool assign) return -ENOSYS; } =20 -int kvm_on_sigbus_vcpu(CPUState *env, int code, void *addr) +int kvm_on_sigbus_vcpu(CPUArchState *env, int code, void *addr) { return 1; } diff --git a/kvm.h b/kvm.h index 8ef4476..330f17b 100644 --- a/kvm.h +++ b/kvm.h @@ -61,9 +61,9 @@ int kvm_has_gsi_routing(void); int kvm_allows_irq0_override(void); =20 #ifdef NEED_CPU_H -int kvm_init_vcpu(CPUState *env); +int kvm_init_vcpu(CPUArchState *env); =20 -int kvm_cpu_exec(CPUState *env); +int kvm_cpu_exec(CPUArchState *env); =20 #if !defined(CONFIG_USER_ONLY) void kvm_setup_guest_memory(void *start, size_t size); @@ -73,19 +73,19 @@ int kvm_uncoalesce_mmio_region(target_phys_addr_t sta= rt, ram_addr_t size); void kvm_flush_coalesced_mmio_buffer(void); #endif =20 -int kvm_insert_breakpoint(CPUState *current_env, target_ulong addr, +int kvm_insert_breakpoint(CPUArchState *current_env, target_ulong addr, target_ulong len, int type); -int kvm_remove_breakpoint(CPUState *current_env, target_ulong addr, +int kvm_remove_breakpoint(CPUArchState *current_env, target_ulong addr, target_ulong len, int type); -void kvm_remove_all_breakpoints(CPUState *current_env); -int kvm_update_guest_debug(CPUState *env, unsigned long reinject_trap); +void kvm_remove_all_breakpoints(CPUArchState *current_env); +int kvm_update_guest_debug(CPUArchState *env, unsigned long reinject_tra= p); #ifndef _WIN32 -int kvm_set_signal_mask(CPUState *env, const sigset_t *sigset); +int kvm_set_signal_mask(CPUArchState *env, const sigset_t *sigset); #endif =20 int kvm_pit_in_kernel(void); =20 -int kvm_on_sigbus_vcpu(CPUState *env, int code, void *addr); +int kvm_on_sigbus_vcpu(CPUArchState *env, int code, void *addr); int kvm_on_sigbus(int code, void *addr); =20 /* internal API */ @@ -98,20 +98,20 @@ int kvm_ioctl(KVMState *s, int type, ...); =20 int kvm_vm_ioctl(KVMState *s, int type, ...); =20 -int kvm_vcpu_ioctl(CPUState *env, int type, ...); +int kvm_vcpu_ioctl(CPUArchState *env, int type, ...); =20 /* Arch specific hooks */ =20 extern const KVMCapabilityInfo kvm_arch_required_capabilities[]; =20 -void kvm_arch_pre_run(CPUState *env, struct kvm_run *run); -void kvm_arch_post_run(CPUState *env, struct kvm_run *run); +void kvm_arch_pre_run(CPUArchState *env, struct kvm_run *run); +void kvm_arch_post_run(CPUArchState *env, struct kvm_run *run); =20 -int kvm_arch_handle_exit(CPUState *env, struct kvm_run *run); +int kvm_arch_handle_exit(CPUArchState *env, struct kvm_run *run); =20 -int kvm_arch_process_async_events(CPUState *env); +int kvm_arch_process_async_events(CPUArchState *env); =20 -int kvm_arch_get_registers(CPUState *env); +int kvm_arch_get_registers(CPUArchState *env); =20 /* state subset only touched by the VCPU itself during runtime */ #define KVM_PUT_RUNTIME_STATE 1 @@ -120,15 +120,15 @@ int kvm_arch_get_registers(CPUState *env); /* full state set, modified during initialization or on vmload */ #define KVM_PUT_FULL_STATE 3 =20 -int kvm_arch_put_registers(CPUState *env, int level); +int kvm_arch_put_registers(CPUArchState *env, int level); =20 int kvm_arch_init(KVMState *s); =20 -int kvm_arch_init_vcpu(CPUState *env); +int kvm_arch_init_vcpu(CPUArchState *env); =20 -void kvm_arch_reset_vcpu(CPUState *env); +void kvm_arch_reset_vcpu(CPUArchState *env); =20 -int kvm_arch_on_sigbus_vcpu(CPUState *env, int code, void *addr); +int kvm_arch_on_sigbus_vcpu(CPUArchState *env, int code, void *addr); int kvm_arch_on_sigbus(int code, void *addr); =20 void kvm_arch_init_irq_routing(KVMState *s); @@ -153,14 +153,14 @@ struct kvm_sw_breakpoint { =20 QTAILQ_HEAD(kvm_sw_breakpoint_head, kvm_sw_breakpoint); =20 -struct kvm_sw_breakpoint *kvm_find_sw_breakpoint(CPUState *env, +struct kvm_sw_breakpoint *kvm_find_sw_breakpoint(CPUArchState *env, target_ulong pc); =20 -int kvm_sw_breakpoints_active(CPUState *env); +int kvm_sw_breakpoints_active(CPUArchState *env); =20 -int kvm_arch_insert_sw_breakpoint(CPUState *current_env, +int kvm_arch_insert_sw_breakpoint(CPUArchState *current_env, struct kvm_sw_breakpoint *bp); -int kvm_arch_remove_sw_breakpoint(CPUState *current_env, +int kvm_arch_remove_sw_breakpoint(CPUArchState *current_env, struct kvm_sw_breakpoint *bp); int kvm_arch_insert_hw_breakpoint(target_ulong addr, target_ulong len, int type); @@ -168,35 +168,35 @@ int kvm_arch_remove_hw_breakpoint(target_ulong addr= , target_ulong len, int type); void kvm_arch_remove_all_hw_breakpoints(void); =20 -void kvm_arch_update_guest_debug(CPUState *env, struct kvm_guest_debug *= dbg); +void kvm_arch_update_guest_debug(CPUArchState *env, struct kvm_guest_deb= ug *dbg); =20 -bool kvm_arch_stop_on_emulation_error(CPUState *env); +bool kvm_arch_stop_on_emulation_error(CPUArchState *env); =20 int kvm_check_extension(KVMState *s, unsigned int extension); =20 uint32_t kvm_arch_get_supported_cpuid(KVMState *env, uint32_t function, uint32_t index, int reg); -void kvm_cpu_synchronize_state(CPUState *env); -void kvm_cpu_synchronize_post_reset(CPUState *env); -void kvm_cpu_synchronize_post_init(CPUState *env); +void kvm_cpu_synchronize_state(CPUArchState *env); +void kvm_cpu_synchronize_post_reset(CPUArchState *env); +void kvm_cpu_synchronize_post_init(CPUArchState *env); =20 /* generic hooks - to be moved/refactored once there are more users */ =20 -static inline void cpu_synchronize_state(CPUState *env) +static inline void cpu_synchronize_state(CPUArchState *env) { if (kvm_enabled()) { kvm_cpu_synchronize_state(env); } } =20 -static inline void cpu_synchronize_post_reset(CPUState *env) +static inline void cpu_synchronize_post_reset(CPUArchState *env) { if (kvm_enabled()) { kvm_cpu_synchronize_post_reset(env); } } =20 -static inline void cpu_synchronize_post_init(CPUState *env) +static inline void cpu_synchronize_post_init(CPUArchState *env) { if (kvm_enabled()) { kvm_cpu_synchronize_post_init(env); diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 48e3232..e502b39 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -1044,7 +1044,7 @@ static inline void bswap_sym(struct elf_sym *sym) {= } #endif =20 #ifdef USE_ELF_CORE_DUMP -static int elf_core_dump(int, const CPUState *); +static int elf_core_dump(int, const CPUArchState *); #endif /* USE_ELF_CORE_DUMP */ static void load_symbols(struct elfhdr *hdr, int fd, abi_ulong load_bias= ); =20 @@ -1930,7 +1930,7 @@ int load_elf_binary(struct linux_binprm * bprm, str= uct target_pt_regs * regs, * from given cpu into just specified register set. Prototype is: * * static void elf_core_copy_regs(taret_elf_gregset_t *regs, - * const CPUState *env); + * const CPUArchState *env); * * Parameters: * regs - copy register values into here (allocated and zeroed by ca= ller) @@ -2054,8 +2054,8 @@ static void fill_auxv_note(struct memelfnote *, con= st TaskState *); static void fill_elf_note_phdr(struct elf_phdr *, int, off_t); static size_t note_size(const struct memelfnote *); static void free_note_info(struct elf_note_info *); -static int fill_note_info(struct elf_note_info *, long, const CPUState *= ); -static void fill_thread_info(struct elf_note_info *, const CPUState *); +static int fill_note_info(struct elf_note_info *, long, const CPUArchSta= te *); +static void fill_thread_info(struct elf_note_info *, const CPUArchState = *); static int core_dump_filename(const TaskState *, char *, size_t); =20 static int dump_write(int, const void *, size_t); @@ -2448,7 +2448,7 @@ static int write_note(struct memelfnote *men, int f= d) return (0); } =20 -static void fill_thread_info(struct elf_note_info *info, const CPUState = *env) +static void fill_thread_info(struct elf_note_info *info, const CPUArchSt= ate *env) { TaskState *ts =3D (TaskState *)env->opaque; struct elf_thread_status *ets; @@ -2466,10 +2466,10 @@ static void fill_thread_info(struct elf_note_info= *info, const CPUState *env) } =20 static int fill_note_info(struct elf_note_info *info, - long signr, const CPUState *env) + long signr, const CPUArchState *env) { #define NUMNOTES 3 - CPUState *cpu =3D NULL; + CPUArchState *cpu =3D NULL; TaskState *ts =3D (TaskState *)env->opaque; int i; =20 @@ -2595,7 +2595,7 @@ static int write_note_info(struct elf_note_info *in= fo, int fd) * handler (provided that target process haven't registered * handler for that) that does the dump when signal is received. */ -static int elf_core_dump(int signr, const CPUState *env) +static int elf_core_dump(int signr, const CPUArchState *env) { const TaskState *ts =3D (const TaskState *)env->opaque; struct vm_area_struct *vma =3D NULL; diff --git a/linux-user/main.c b/linux-user/main.c index 3b48882..962677e 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -146,7 +146,7 @@ static inline void exclusive_idle(void) Must only be called from outside cpu_arm_exec. */ static inline void start_exclusive(void) { - CPUState *other; + CPUArchState *other; pthread_mutex_lock(&exclusive_lock); exclusive_idle(); =20 @@ -172,7 +172,7 @@ static inline void end_exclusive(void) } =20 /* Wait for exclusive ops to finish, and begin cpu execution. */ -static inline void cpu_exec_start(CPUState *env) +static inline void cpu_exec_start(CPUArchState *env) { pthread_mutex_lock(&exclusive_lock); exclusive_idle(); @@ -181,7 +181,7 @@ static inline void cpu_exec_start(CPUState *env) } =20 /* Mark cpu as not executing, and release pending exclusive ops. */ -static inline void cpu_exec_end(CPUState *env) +static inline void cpu_exec_end(CPUArchState *env) { pthread_mutex_lock(&exclusive_lock); env->running =3D 0; @@ -206,11 +206,11 @@ void cpu_list_unlock(void) } #else /* if !CONFIG_USE_NPTL */ /* These are no-ops because we are not threadsafe. */ -static inline void cpu_exec_start(CPUState *env) +static inline void cpu_exec_start(CPUArchState *env) { } =20 -static inline void cpu_exec_end(CPUState *env) +static inline void cpu_exec_end(CPUArchState *env) { } =20 @@ -2888,7 +2888,7 @@ void cpu_loop(CPUS390XState *env) =20 #endif /* TARGET_S390X */ =20 -THREAD CPUState *thread_env; +THREAD CPUArchState *thread_env; =20 void task_settid(TaskState *ts) { @@ -3277,7 +3277,7 @@ int main(int argc, char **argv, char **envp) struct image_info info1, *info =3D &info1; struct linux_binprm bprm; TaskState *ts; - CPUState *env; + CPUArchState *env; int optind; char **target_environ, **wrk; char **target_argv; diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 308dbc0..6889567 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -171,7 +171,7 @@ struct linux_binprm { char **argv; char **envp; char * filename; /* Name of binary */ - int (*core_dump)(int, const CPUState *); /* coredump routine */ + int (*core_dump)(int, const CPUArchState *); /* coredump routine= */ }; =20 void do_init_thread(struct target_pt_regs *regs, struct image_info *info= p); @@ -196,8 +196,8 @@ abi_long do_syscall(void *cpu_env, int num, abi_long = arg1, abi_long arg5, abi_long arg6, abi_long arg7, abi_long arg8); void gemu_log(const char *fmt, ...) GCC_FMT_ATTR(1, 2); -extern THREAD CPUState *thread_env; -void cpu_loop(CPUState *env); +extern THREAD CPUArchState *thread_env; +void cpu_loop(CPUArchState *env); char *target_strerror(int err); int get_osversion(void); void fork_start(void); @@ -219,15 +219,15 @@ void print_syscall_ret(int num, abi_long arg1); extern int do_strace; =20 /* signal.c */ -void process_pending_signals(CPUState *cpu_env); +void process_pending_signals(CPUArchState *cpu_env); void signal_init(void); -int queue_signal(CPUState *env, int sig, target_siginfo_t *info); +int queue_signal(CPUArchState *env, int sig, target_siginfo_t *info); void host_to_target_siginfo(target_siginfo_t *tinfo, const siginfo_t *in= fo); void target_to_host_siginfo(siginfo_t *info, const target_siginfo_t *tin= fo); int target_to_host_signal(int sig); int host_to_target_signal(int sig); -long do_sigreturn(CPUState *env); -long do_rt_sigreturn(CPUState *env); +long do_sigreturn(CPUArchState *env); +long do_rt_sigreturn(CPUArchState *env); abi_long do_sigaltstack(abi_ulong uss_addr, abi_ulong uoss_addr, abi_ulo= ng sp); =20 #ifdef TARGET_I386 diff --git a/linux-user/signal.c b/linux-user/signal.c index f44f78e..fca51e2 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -347,7 +347,7 @@ void signal_init(void) =20 /* signal queue handling */ =20 -static inline struct sigqueue *alloc_sigqueue(CPUState *env) +static inline struct sigqueue *alloc_sigqueue(CPUArchState *env) { TaskState *ts =3D env->opaque; struct sigqueue *q =3D ts->first_free; @@ -357,7 +357,7 @@ static inline struct sigqueue *alloc_sigqueue(CPUStat= e *env) return q; } =20 -static inline void free_sigqueue(CPUState *env, struct sigqueue *q) +static inline void free_sigqueue(CPUArchState *env, struct sigqueue *q) { TaskState *ts =3D env->opaque; q->next =3D ts->first_free; @@ -415,7 +415,7 @@ static void QEMU_NORETURN force_sig(int target_sig) =20 /* queue a signal so that it will be send to the virtual CPU as soon as possible */ -int queue_signal(CPUState *env, int sig, target_siginfo_t *info) +int queue_signal(CPUArchState *env, int sig, target_siginfo_t *info) { TaskState *ts =3D env->opaque; struct emulated_sigtable *k; @@ -5214,25 +5214,25 @@ long do_rt_sigreturn(CPUAlphaState *env) #else =20 static void setup_frame(int sig, struct target_sigaction *ka, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUArchState *env) { fprintf(stderr, "setup_frame: not implemented\n"); } =20 static void setup_rt_frame(int sig, struct target_sigaction *ka, target_siginfo_t *info, - target_sigset_t *set, CPUState *env) + target_sigset_t *set, CPUArchState *env) { fprintf(stderr, "setup_rt_frame: not implemented\n"); } =20 -long do_sigreturn(CPUState *env) +long do_sigreturn(CPUArchState *env) { fprintf(stderr, "do_sigreturn: not implemented\n"); return -TARGET_ENOSYS; } =20 -long do_rt_sigreturn(CPUState *env) +long do_rt_sigreturn(CPUArchState *env) { fprintf(stderr, "do_rt_sigreturn: not implemented\n"); return -TARGET_ENOSYS; @@ -5240,7 +5240,7 @@ long do_rt_sigreturn(CPUState *env) =20 #endif =20 -void process_pending_signals(CPUState *cpu_env) +void process_pending_signals(CPUArchState *cpu_env) { int sig; abi_ulong handler; diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 29888bd..9f5e53a 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -3955,7 +3955,7 @@ static abi_long do_arch_prctl(CPUX86State *env, int= code, abi_ulong addr) =20 static pthread_mutex_t clone_lock =3D PTHREAD_MUTEX_INITIALIZER; typedef struct { - CPUState *env; + CPUArchState *env; pthread_mutex_t mutex; pthread_cond_t cond; pthread_t thread; @@ -3968,7 +3968,7 @@ typedef struct { static void *clone_func(void *arg) { new_thread_info *info =3D arg; - CPUState *env; + CPUArchState *env; TaskState *ts; =20 env =3D info->env; @@ -3998,7 +3998,7 @@ static void *clone_func(void *arg) =20 static int clone_func(void *arg) { - CPUState *env =3D arg; + CPUArchState *env =3D arg; cpu_loop(env); /* never exits */ return 0; @@ -4007,13 +4007,13 @@ static int clone_func(void *arg) =20 /* do_fork() Must return host values and target errnos (unlike most do_*() functions). */ -static int do_fork(CPUState *env, unsigned int flags, abi_ulong newsp, +static int do_fork(CPUArchState *env, unsigned int flags, abi_ulong news= p, abi_ulong parent_tidptr, target_ulong newtls, abi_ulong child_tidptr) { int ret; TaskState *ts; - CPUState *new_env; + CPUArchState *new_env; #if defined(CONFIG_USE_NPTL) unsigned int nptl_flags; sigset_t sigmask; @@ -4640,7 +4640,7 @@ int get_osversion(void) =20 static int open_self_maps(void *cpu_env, int fd) { - TaskState *ts =3D ((CPUState *)cpu_env)->opaque; + TaskState *ts =3D ((CPUArchState *)cpu_env)->opaque; =20 dprintf(fd, "%08llx-%08llx rw-p %08llx 00:00 0 [stack]\n", (unsigned long long)ts->info->stack_limit, @@ -4653,7 +4653,7 @@ static int open_self_maps(void *cpu_env, int fd) =20 static int open_self_stat(void *cpu_env, int fd) { - TaskState *ts =3D ((CPUState *)cpu_env)->opaque; + TaskState *ts =3D ((CPUArchState *)cpu_env)->opaque; abi_ulong start_stack =3D ts->info->start_stack; int i; =20 @@ -4678,7 +4678,7 @@ static int open_self_stat(void *cpu_env, int fd) =20 static int open_self_auxv(void *cpu_env, int fd) { - TaskState *ts =3D ((CPUState *)cpu_env)->opaque; + TaskState *ts =3D ((CPUArchState *)cpu_env)->opaque; abi_ulong auxv =3D ts->info->saved_auxv; abi_ulong len =3D ts->info->auxv_len; char *ptr; @@ -4784,13 +4784,13 @@ abi_long do_syscall(void *cpu_env, int num, abi_l= ong arg1, be disabling signals. */ if (first_cpu->next_cpu) { TaskState *ts; - CPUState **lastp; - CPUState *p; + CPUArchState **lastp; + CPUArchState *p; =20 cpu_list_lock(); lastp =3D &first_cpu; p =3D first_cpu; - while (p && p !=3D (CPUState *)cpu_env) { + while (p && p !=3D (CPUArchState *)cpu_env) { lastp =3D &p->next_cpu; p =3D p->next_cpu; } @@ -4801,7 +4801,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_lon= g arg1, /* Remove the CPU from the list. */ *lastp =3D p->next_cpu; cpu_list_unlock(); - ts =3D ((CPUState *)cpu_env)->opaque; + ts =3D ((CPUArchState *)cpu_env)->opaque; if (ts->child_tidptr) { put_user_u32(0, ts->child_tidptr); sys_futex(g2h(ts->child_tidptr), FUTEX_WAKE, INT_MAX, @@ -6091,7 +6091,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_lon= g arg1, break; case TARGET_NR_mprotect: { - TaskState *ts =3D ((CPUState *)cpu_env)->opaque; + TaskState *ts =3D ((CPUArchState *)cpu_env)->opaque; /* Special hack to detect libc making the stack executable. = */ if ((arg3 & PROT_GROWSDOWN) && arg1 >=3D ts->info->stack_limit @@ -7076,7 +7076,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_lon= g arg1, #if defined(TARGET_I386) || defined(TARGET_ARM) || defined(TARGET_MIPS) = || \ defined(TARGET_SPARC) || defined(TARGET_PPC) || defined(TARGET_ALPHA= ) || \ defined(TARGET_M68K) || defined(TARGET_S390X) - ret =3D do_sigaltstack(arg1, arg2, get_sp_from_cpustate((CPUStat= e *)cpu_env)); + ret =3D do_sigaltstack(arg1, arg2, get_sp_from_cpustate((CPUArch= State *)cpu_env)); break; #else goto unimplemented; diff --git a/monitor.c b/monitor.c index e3b72ff..d57e7bf 100644 --- a/monitor.c +++ b/monitor.c @@ -156,7 +156,7 @@ struct Monitor { int outbuf_index; ReadLineState *rs; MonitorControl *mc; - CPUState *mon_cpu; + CPUArchState *mon_cpu; BlockDriverCompletionFunc *password_completion_cb; void *password_opaque; #ifdef CONFIG_DEBUG_MONITOR @@ -742,7 +742,7 @@ CommandInfoList *qmp_query_commands(Error **errp) /* set the current CPU defined by the user */ int monitor_set_cpu(int cpu_index) { - CPUState *env; + CPUArchState *env; =20 for(env =3D first_cpu; env !=3D NULL; env =3D env->next_cpu) { if (env->cpu_index =3D=3D cpu_index) { @@ -753,7 +753,7 @@ int monitor_set_cpu(int cpu_index) return -1; } =20 -static CPUState *mon_get_cpu(void) +static CPUArchState *mon_get_cpu(void) { if (!cur_mon->mon_cpu) { monitor_set_cpu(0); @@ -769,7 +769,7 @@ int monitor_get_cpu_index(void) =20 static void do_info_registers(Monitor *mon) { - CPUState *env; + CPUArchState *env; env =3D mon_get_cpu(); #ifdef TARGET_I386 cpu_dump_state(env, (FILE *)mon, monitor_fprintf, @@ -806,7 +806,7 @@ static void do_info_history(Monitor *mon) /* XXX: not implemented in other targets */ static void do_info_cpu_stats(Monitor *mon) { - CPUState *env; + CPUArchState *env; =20 env =3D mon_get_cpu(); cpu_dump_statistics(env, (FILE *)mon, &monitor_fprintf, 0); @@ -987,7 +987,7 @@ static void monitor_printc(Monitor *mon, int c) static void memory_dump(Monitor *mon, int count, int format, int wsize, target_phys_addr_t addr, int is_physical) { - CPUState *env; + CPUArchState *env; int l, line_size, i, max_digits, len; uint8_t buf[16]; uint64_t v; @@ -1547,7 +1547,7 @@ static void print_pte(Monitor *mon, target_phys_add= r_t addr, pte & PG_RW_MASK ? 'W' : '-'); } =20 -static void tlb_info_32(Monitor *mon, CPUState *env) +static void tlb_info_32(Monitor *mon, CPUArchState *env) { unsigned int l1, l2; uint32_t pgd, pde, pte; @@ -1575,7 +1575,7 @@ static void tlb_info_32(Monitor *mon, CPUState *env= ) } } =20 -static void tlb_info_pae32(Monitor *mon, CPUState *env) +static void tlb_info_pae32(Monitor *mon, CPUArchState *env) { unsigned int l1, l2, l3; uint64_t pdpe, pde, pte; @@ -1615,7 +1615,7 @@ static void tlb_info_pae32(Monitor *mon, CPUState *= env) } =20 #ifdef TARGET_X86_64 -static void tlb_info_64(Monitor *mon, CPUState *env) +static void tlb_info_64(Monitor *mon, CPUArchState *env) { uint64_t l1, l2, l3, l4; uint64_t pml4e, pdpe, pde, pte; @@ -1674,7 +1674,7 @@ static void tlb_info_64(Monitor *mon, CPUState *env= ) =20 static void tlb_info(Monitor *mon) { - CPUState *env; + CPUArchState *env; =20 env =3D mon_get_cpu(); =20 @@ -1719,7 +1719,7 @@ static void mem_print(Monitor *mon, target_phys_add= r_t *pstart, } } =20 -static void mem_info_32(Monitor *mon, CPUState *env) +static void mem_info_32(Monitor *mon, CPUArchState *env) { unsigned int l1, l2; int prot, last_prot; @@ -1760,7 +1760,7 @@ static void mem_info_32(Monitor *mon, CPUState *env= ) mem_print(mon, &start, &last_prot, (target_phys_addr_t)1 << 32, 0); } =20 -static void mem_info_pae32(Monitor *mon, CPUState *env) +static void mem_info_pae32(Monitor *mon, CPUArchState *env) { unsigned int l1, l2, l3; int prot, last_prot; @@ -1817,7 +1817,7 @@ static void mem_info_pae32(Monitor *mon, CPUState *= env) =20 =20 #ifdef TARGET_X86_64 -static void mem_info_64(Monitor *mon, CPUState *env) +static void mem_info_64(Monitor *mon, CPUArchState *env) { int prot, last_prot; uint64_t l1, l2, l3, l4; @@ -1897,7 +1897,7 @@ static void mem_info_64(Monitor *mon, CPUState *env= ) =20 static void mem_info(Monitor *mon) { - CPUState *env; + CPUArchState *env; =20 env =3D mon_get_cpu(); =20 @@ -1936,7 +1936,7 @@ static void print_tlb(Monitor *mon, int idx, tlb_t = *tlb) =20 static void tlb_info(Monitor *mon) { - CPUState *env =3D mon_get_cpu(); + CPUArchState *env =3D mon_get_cpu(); int i; =20 monitor_printf (mon, "ITLB:\n"); @@ -1952,7 +1952,7 @@ static void tlb_info(Monitor *mon) #if defined(TARGET_SPARC) || defined(TARGET_PPC) || defined(TARGET_XTENS= A) static void tlb_info(Monitor *mon) { - CPUState *env1 =3D mon_get_cpu(); + CPUArchState *env1 =3D mon_get_cpu(); =20 dump_mmu((FILE*)mon, (fprintf_function)monitor_printf, env1); } @@ -1966,7 +1966,7 @@ static void do_info_mtree(Monitor *mon) static void do_info_numa(Monitor *mon) { int i; - CPUState *env; + CPUArchState *env; =20 monitor_printf(mon, "%d nodes\n", nb_numa_nodes); for (i =3D 0; i < nb_numa_nodes; i++) { @@ -2173,7 +2173,7 @@ static void do_acl_remove(Monitor *mon, const QDict= *qdict) #if defined(TARGET_I386) static void do_inject_mce(Monitor *mon, const QDict *qdict) { - CPUState *cenv; + CPUArchState *cenv; int cpu_index =3D qdict_get_int(qdict, "cpu_index"); int bank =3D qdict_get_int(qdict, "bank"); uint64_t status =3D qdict_get_int(qdict, "status"); @@ -2625,7 +2625,7 @@ typedef struct MonitorDef { #if defined(TARGET_I386) static target_long monitor_get_pc (const struct MonitorDef *md, int val) { - CPUState *env =3D mon_get_cpu(); + CPUArchState *env =3D mon_get_cpu(); return env->eip + env->segs[R_CS].base; } #endif @@ -2633,7 +2633,7 @@ static target_long monitor_get_pc (const struct Mon= itorDef *md, int val) #if defined(TARGET_PPC) static target_long monitor_get_ccr (const struct MonitorDef *md, int val= ) { - CPUState *env =3D mon_get_cpu(); + CPUArchState *env =3D mon_get_cpu(); unsigned int u; int i; =20 @@ -2646,31 +2646,31 @@ static target_long monitor_get_ccr (const struct = MonitorDef *md, int val) =20 static target_long monitor_get_msr (const struct MonitorDef *md, int val= ) { - CPUState *env =3D mon_get_cpu(); + CPUArchState *env =3D mon_get_cpu(); return env->msr; } =20 static target_long monitor_get_xer (const struct MonitorDef *md, int val= ) { - CPUState *env =3D mon_get_cpu(); + CPUArchState *env =3D mon_get_cpu(); return env->xer; } =20 static target_long monitor_get_decr (const struct MonitorDef *md, int va= l) { - CPUState *env =3D mon_get_cpu(); + CPUArchState *env =3D mon_get_cpu(); return cpu_ppc_load_decr(env); } =20 static target_long monitor_get_tbu (const struct MonitorDef *md, int val= ) { - CPUState *env =3D mon_get_cpu(); + CPUArchState *env =3D mon_get_cpu(); return cpu_ppc_load_tbu(env); } =20 static target_long monitor_get_tbl (const struct MonitorDef *md, int val= ) { - CPUState *env =3D mon_get_cpu(); + CPUArchState *env =3D mon_get_cpu(); return cpu_ppc_load_tbl(env); } #endif @@ -2679,7 +2679,7 @@ static target_long monitor_get_tbl (const struct Mo= nitorDef *md, int val) #ifndef TARGET_SPARC64 static target_long monitor_get_psr (const struct MonitorDef *md, int val= ) { - CPUState *env =3D mon_get_cpu(); + CPUArchState *env =3D mon_get_cpu(); =20 return cpu_get_psr(env); } @@ -2687,7 +2687,7 @@ static target_long monitor_get_psr (const struct Mo= nitorDef *md, int val) =20 static target_long monitor_get_reg(const struct MonitorDef *md, int val) { - CPUState *env =3D mon_get_cpu(); + CPUArchState *env =3D mon_get_cpu(); return env->regwptr[val]; } #endif @@ -3019,7 +3019,7 @@ static int get_monitor_def(target_long *pval, const= char *name) if (md->get_value) { *pval =3D md->get_value(md, md->offset); } else { - CPUState *env =3D mon_get_cpu(); + CPUArchState *env =3D mon_get_cpu(); ptr =3D (uint8_t *)env + md->offset; switch(md->type) { case MD_I32: diff --git a/poison.h b/poison.h index 5354e77..d396f20 100644 --- a/poison.h +++ b/poison.h @@ -34,7 +34,7 @@ #pragma GCC poison TARGET_PAGE_BITS #pragma GCC poison TARGET_PAGE_ALIGN =20 -#pragma GCC poison CPUState +#pragma GCC poison CPUArchState #pragma GCC poison env =20 #pragma GCC poison lduw_phys diff --git a/softmmu-semi.h b/softmmu-semi.h index 86a9f8a..648cb95 100644 --- a/softmmu-semi.h +++ b/softmmu-semi.h @@ -7,14 +7,14 @@ * This code is licensed under the GPL */ =20 -static inline uint32_t softmmu_tget32(CPUState *env, uint32_t addr) +static inline uint32_t softmmu_tget32(CPUArchState *env, uint32_t addr) { uint32_t val; =20 cpu_memory_rw_debug(env, addr, (uint8_t *)&val, 4, 0); return tswap32(val); } -static inline uint32_t softmmu_tget8(CPUState *env, uint32_t addr) +static inline uint32_t softmmu_tget8(CPUArchState *env, uint32_t addr) { uint8_t val; =20 @@ -26,7 +26,7 @@ static inline uint32_t softmmu_tget8(CPUState *env, uin= t32_t addr) #define get_user_u8(arg, p) ({ arg =3D softmmu_tget8(env, p) ; 0; }) #define get_user_ual(arg, p) get_user_u32(arg, p) =20 -static inline void softmmu_tput32(CPUState *env, uint32_t addr, uint32_t= val) +static inline void softmmu_tput32(CPUArchState *env, uint32_t addr, uint= 32_t val) { val =3D tswap32(val); cpu_memory_rw_debug(env, addr, (uint8_t *)&val, 4, 1); @@ -34,7 +34,7 @@ static inline void softmmu_tput32(CPUState *env, uint32= _t addr, uint32_t val) #define put_user_u32(arg, p) ({ softmmu_tput32(env, p, arg) ; 0; }) #define put_user_ual(arg, p) put_user_u32(arg, p) =20 -static void *softmmu_lock_user(CPUState *env, uint32_t addr, uint32_t le= n, +static void *softmmu_lock_user(CPUArchState *env, uint32_t addr, uint32_= t len, int copy) { uint8_t *p; @@ -45,7 +45,7 @@ static void *softmmu_lock_user(CPUState *env, uint32_t = addr, uint32_t len, return p; } #define lock_user(type, p, len, copy) softmmu_lock_user(env, p, len, cop= y) -static char *softmmu_lock_user_string(CPUState *env, uint32_t addr) +static char *softmmu_lock_user_string(CPUArchState *env, uint32_t addr) { char *p; char *s; @@ -60,7 +60,7 @@ static char *softmmu_lock_user_string(CPUState *env, ui= nt32_t addr) return s; } #define lock_user_string(p) softmmu_lock_user_string(env, p) -static void softmmu_unlock_user(CPUState *env, void *p, target_ulong add= r, +static void softmmu_unlock_user(CPUArchState *env, void *p, target_ulong= addr, target_ulong len) { if (len) diff --git a/target-alpha/cpu.h b/target-alpha/cpu.h index ecc2a35..48c0fdc 100644 --- a/target-alpha/cpu.h +++ b/target-alpha/cpu.h @@ -25,7 +25,7 @@ =20 #define TARGET_LONG_BITS 64 =20 -#define CPUState struct CPUAlphaState +#define CPUArchState struct CPUAlphaState =20 #include "cpu-defs.h" =20 diff --git a/target-arm/cpu.h b/target-arm/cpu.h index 2bbb5d1..26c114b 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -23,7 +23,7 @@ =20 #define ELF_MACHINE EM_ARM =20 -#define CPUState struct CPUARMState +#define CPUArchState struct CPUARMState =20 #include "config.h" #include "qemu-common.h" diff --git a/target-cris/cpu.h b/target-cris/cpu.h index f38393a..31899c2 100644 --- a/target-cris/cpu.h +++ b/target-cris/cpu.h @@ -25,7 +25,7 @@ =20 #define TARGET_LONG_BITS 32 =20 -#define CPUState struct CPUCRISState +#define CPUArchState struct CPUCRISState =20 #include "cpu-defs.h" =20 diff --git a/target-i386/cpu.h b/target-i386/cpu.h index f337dd0..aacccb6 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -42,7 +42,7 @@ #define ELF_MACHINE EM_386 #endif =20 -#define CPUState struct CPUX86State +#define CPUArchState struct CPUX86State =20 #include "cpu-defs.h" =20 diff --git a/target-lm32/cpu.h b/target-lm32/cpu.h index 684b2fa..0902a24 100644 --- a/target-lm32/cpu.h +++ b/target-lm32/cpu.h @@ -22,7 +22,7 @@ =20 #define TARGET_LONG_BITS 32 =20 -#define CPUState struct CPULM32State +#define CPUArchState struct CPULM32State =20 #include "config.h" #include "qemu-common.h" diff --git a/target-m68k/cpu.h b/target-m68k/cpu.h index 2c83b89..6696e30 100644 --- a/target-m68k/cpu.h +++ b/target-m68k/cpu.h @@ -22,7 +22,7 @@ =20 #define TARGET_LONG_BITS 32 =20 -#define CPUState struct CPUM68KState +#define CPUArchState struct CPUM68KState =20 #include "config.h" #include "qemu-common.h" diff --git a/target-microblaze/cpu.h b/target-microblaze/cpu.h index 6ae5649..3b52421 100644 --- a/target-microblaze/cpu.h +++ b/target-microblaze/cpu.h @@ -24,7 +24,7 @@ =20 #define TARGET_LONG_BITS 32 =20 -#define CPUState struct CPUMBState +#define CPUArchState struct CPUMBState =20 #include "cpu-defs.h" #include "softfloat.h" diff --git a/target-mips/cpu.h b/target-mips/cpu.h index 94381ec..7430aa5 100644 --- a/target-mips/cpu.h +++ b/target-mips/cpu.h @@ -7,7 +7,7 @@ =20 #define ELF_MACHINE EM_MIPS =20 -#define CPUState struct CPUMIPSState +#define CPUArchState struct CPUMIPSState =20 #include "config.h" #include "qemu-common.h" diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h index 3508d8a..ad09cbe 100644 --- a/target-ppc/cpu.h +++ b/target-ppc/cpu.h @@ -71,7 +71,7 @@ =20 #endif /* defined (TARGET_PPC64) */ =20 -#define CPUState struct CPUPPCState +#define CPUArchState struct CPUPPCState =20 #include "cpu-defs.h" =20 diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h index af6cc4e..ea849fc 100644 --- a/target-s390x/cpu.h +++ b/target-s390x/cpu.h @@ -26,7 +26,7 @@ =20 #define ELF_MACHINE EM_S390 =20 -#define CPUState struct CPUS390XState +#define CPUArchState struct CPUS390XState =20 #include "cpu-defs.h" #define TARGET_PAGE_BITS 12 diff --git a/target-sh4/cpu.h b/target-sh4/cpu.h index b45e54f..965536d 100644 --- a/target-sh4/cpu.h +++ b/target-sh4/cpu.h @@ -37,7 +37,7 @@ #define SH_CPU_SH7750_ALL (SH_CPU_SH7750 | SH_CPU_SH7750S | SH_CPU_SH775= 0R) #define SH_CPU_SH7751_ALL (SH_CPU_SH7751 | SH_CPU_SH7751R) =20 -#define CPUState struct CPUSH4State +#define CPUArchState struct CPUSH4State =20 #include "cpu-defs.h" =20 diff --git a/target-sparc/cpu.h b/target-sparc/cpu.h index 2c2cea7..86f9de6 100644 --- a/target-sparc/cpu.h +++ b/target-sparc/cpu.h @@ -23,7 +23,7 @@ # endif #endif =20 -#define CPUState struct CPUSPARCState +#define CPUArchState struct CPUSPARCState =20 #include "cpu-defs.h" =20 diff --git a/target-unicore32/cpu.h b/target-unicore32/cpu.h index 171f0a9..a3f8589 100644 --- a/target-unicore32/cpu.h +++ b/target-unicore32/cpu.h @@ -18,7 +18,7 @@ =20 #define ELF_MACHINE EM_UNICORE32 =20 -#define CPUState struct CPUUniCore32State +#define CPUArchState struct CPUUniCore32State =20 #include "config.h" #include "qemu-common.h" diff --git a/target-xtensa/cpu.h b/target-xtensa/cpu.h index b7723ca..a7bcf52 100644 --- a/target-xtensa/cpu.h +++ b/target-xtensa/cpu.h @@ -31,7 +31,7 @@ #define TARGET_LONG_BITS 32 #define ELF_MACHINE EM_XTENSA =20 -#define CPUState struct CPUXtensaState +#define CPUArchState struct CPUXtensaState =20 #include "config.h" #include "qemu-common.h" diff --git a/tcg/arm/tcg-target.c b/tcg/arm/tcg-target.c index 5b233f5..5af21b3 100644 --- a/tcg/arm/tcg-target.c +++ b/tcg/arm/tcg-target.c @@ -990,10 +990,10 @@ static inline void tcg_out_qemu_ld(TCGContext *s, c= onst TCGArg *args, int opc) tcg_out_dat_reg(s, COND_AL, ARITH_ADD, TCG_REG_R0, TCG_AREG0, TCG_REG_R0, SHIFT_IMM_LSL(CPU_TLB_ENTRY_BITS)); /* In the - * ldr r1 [r0, #(offsetof(CPUState, tlb_table[mem_index][0].addr_re= ad))] + * ldr r1 [r0, #(offsetof(CPUArchState, tlb_table[mem_index][0].add= r_read))] * below, the offset is likely to exceed 12 bits if mem_index !=3D 0= and * not exceed otherwise, so use an - * add r0, r0, #(mem_index * sizeof *CPUState.tlb_table) + * add r0, r0, #(mem_index * sizeof *CPUArchState.tlb_table) * before. */ if (mem_index) @@ -1001,7 +1001,7 @@ static inline void tcg_out_qemu_ld(TCGContext *s, c= onst TCGArg *args, int opc) (mem_index << (TLB_SHIFT & 1)) | ((16 - (TLB_SHIFT >> 1)) << 8)); tcg_out_ld32_12(s, COND_AL, TCG_REG_R1, TCG_REG_R0, - offsetof(CPUState, tlb_table[0][0].addr_read)); + offsetof(CPUArchState, tlb_table[0][0].addr_read)); tcg_out_dat_reg(s, COND_AL, ARITH_CMP, 0, TCG_REG_R1, TCG_REG_R8, SHIFT_IMM_LSL(TARGET_PAGE_BITS)); /* Check alignment. */ @@ -1012,12 +1012,12 @@ static inline void tcg_out_qemu_ld(TCGContext *s,= const TCGArg *args, int opc) /* XXX: possibly we could use a block data load or writeback in * the first access. */ tcg_out_ld32_12(s, COND_EQ, TCG_REG_R1, TCG_REG_R0, - offsetof(CPUState, tlb_table[0][0].addr_read) + 4); + offsetof(CPUArchState, tlb_table[0][0].addr_read) + = 4); tcg_out_dat_reg(s, COND_EQ, ARITH_CMP, 0, TCG_REG_R1, addr_reg2, SHIFT_IMM_LSL(0)); # endif tcg_out_ld32_12(s, COND_EQ, TCG_REG_R1, TCG_REG_R0, - offsetof(CPUState, tlb_table[0][0].addend)); + offsetof(CPUArchState, tlb_table[0][0].addend)); =20 switch (opc) { case 0: @@ -1210,10 +1210,10 @@ static inline void tcg_out_qemu_st(TCGContext *s,= const TCGArg *args, int opc) tcg_out_dat_reg(s, COND_AL, ARITH_ADD, TCG_REG_R0, TCG_AREG0, TCG_REG_R0, SHIFT_IMM_LSL(CPU_TLB_ENTRY_B= ITS)); /* In the - * ldr r1 [r0, #(offsetof(CPUState, tlb_table[mem_index][0].addr_wr= ite))] + * ldr r1 [r0, #(offsetof(CPUArchState, tlb_table[mem_index][0].add= r_write))] * below, the offset is likely to exceed 12 bits if mem_index !=3D 0= and * not exceed otherwise, so use an - * add r0, r0, #(mem_index * sizeof *CPUState.tlb_table) + * add r0, r0, #(mem_index * sizeof *CPUArchState.tlb_table) * before. */ if (mem_index) @@ -1221,7 +1221,7 @@ static inline void tcg_out_qemu_st(TCGContext *s, c= onst TCGArg *args, int opc) (mem_index << (TLB_SHIFT & 1)) | ((16 - (TLB_SHIFT >> 1)) << 8)); tcg_out_ld32_12(s, COND_AL, TCG_REG_R1, TCG_REG_R0, - offsetof(CPUState, tlb_table[0][0].addr_write)); + offsetof(CPUArchState, tlb_table[0][0].addr_write)); tcg_out_dat_reg(s, COND_AL, ARITH_CMP, 0, TCG_REG_R1, TCG_REG_R8, SHIFT_IMM_LSL(TARGET_PAGE_BITS)); /* Check alignment. */ @@ -1232,12 +1232,12 @@ static inline void tcg_out_qemu_st(TCGContext *s,= const TCGArg *args, int opc) /* XXX: possibly we could use a block data load or writeback in * the first access. */ tcg_out_ld32_12(s, COND_EQ, TCG_REG_R1, TCG_REG_R0, - offsetof(CPUState, tlb_table[0][0].addr_write) + 4); + offsetof(CPUArchState, tlb_table[0][0].addr_write) += 4); tcg_out_dat_reg(s, COND_EQ, ARITH_CMP, 0, TCG_REG_R1, addr_reg2, SHIFT_IMM_LSL(0)); # endif tcg_out_ld32_12(s, COND_EQ, TCG_REG_R1, TCG_REG_R0, - offsetof(CPUState, tlb_table[0][0].addend)); + offsetof(CPUArchState, tlb_table[0][0].addend)); =20 switch (opc) { case 0: @@ -1797,7 +1797,7 @@ static void tcg_target_init(TCGContext *s) tcg_regset_set_reg(s->reserved_regs, TCG_REG_PC); =20 tcg_add_target_add_op_defs(arm_op_defs); - tcg_set_frame(s, TCG_AREG0, offsetof(CPUState, temp_buf), + tcg_set_frame(s, TCG_AREG0, offsetof(CPUArchState, temp_buf), CPU_TEMP_BUF_NLONGS * sizeof(long)); } =20 diff --git a/tcg/hppa/tcg-target.c b/tcg/hppa/tcg-target.c index 59d4d12..6a67a41 100644 --- a/tcg/hppa/tcg-target.c +++ b/tcg/hppa/tcg-target.c @@ -1040,13 +1040,13 @@ static void tcg_out_qemu_ld(TCGContext *s, const = TCGArg *args, int opc) lab1 =3D gen_new_label(); lab2 =3D gen_new_label(); =20 - offset =3D offsetof(CPUState, tlb_table[mem_index][0].addr_read); + offset =3D offsetof(CPUArchState, tlb_table[mem_index][0].addr_read)= ; offset =3D tcg_out_tlb_read(s, TCG_REG_R26, TCG_REG_R25, addrlo_reg,= addrhi_reg, opc & 3, lab1, offset); =20 /* TLB Hit. */ tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_R20, (offset ? TCG_REG_R1 : TCG_= REG_R25), - offsetof(CPUState, tlb_table[mem_index][0].addend) - offs= et); + offsetof(CPUArchState, tlb_table[mem_index][0].addend) - = offset); tcg_out_qemu_ld_direct(s, datalo_reg, datahi_reg, addrlo_reg, TCG_RE= G_R20, opc); tcg_out_branch(s, lab2, 1); =20 @@ -1155,13 +1155,13 @@ static void tcg_out_qemu_st(TCGContext *s, const = TCGArg *args, int opc) lab1 =3D gen_new_label(); lab2 =3D gen_new_label(); =20 - offset =3D offsetof(CPUState, tlb_table[mem_index][0].addr_write); + offset =3D offsetof(CPUArchState, tlb_table[mem_index][0].addr_write= ); offset =3D tcg_out_tlb_read(s, TCG_REG_R26, TCG_REG_R25, addrlo_reg,= addrhi_reg, opc, lab1, offset); =20 /* TLB Hit. */ tcg_out_ld(s, TCG_TYPE_PTR, TCG_REG_R20, (offset ? TCG_REG_R1 : TCG_= REG_R25), - offsetof(CPUState, tlb_table[mem_index][0].addend) - offs= et); + offsetof(CPUArchState, tlb_table[mem_index][0].addend) - = offset); =20 /* There are no indexed stores, so we must do this addition explitly= . Careful to avoid R20, which is used for the bswaps to follow. */ diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c index dc81572..424a56e 100644 --- a/tcg/i386/tcg-target.c +++ b/tcg/i386/tcg-target.c @@ -1031,7 +1031,7 @@ static inline void tcg_out_tlb_load(TCGContext *s, = int addrlo_idx, (CPU_TLB_SIZE - 1) << CPU_TLB_ENTRY_BITS, 0); =20 tcg_out_modrm_sib_offset(s, OPC_LEA + P_REXW, r1, TCG_AREG0, r1, 0, - offsetof(CPUState, tlb_table[mem_index][0]) + offsetof(CPUArchState, tlb_table[mem_index]= [0]) + which); =20 /* cmp 0(r1), r0 */ diff --git a/tcg/ia64/tcg-target.c b/tcg/ia64/tcg-target.c index e3de79f..f90252a 100644 --- a/tcg/ia64/tcg-target.c +++ b/tcg/ia64/tcg-target.c @@ -1479,8 +1479,8 @@ static inline void tcg_out_qemu_ld(TCGContext *s, c= onst TCGArg *args, int opc) =20 /* Read the TLB entry */ tcg_out_qemu_tlb(s, addr_reg, s_bits, - offsetof(CPUState, tlb_table[mem_index][0].addr_rea= d), - offsetof(CPUState, tlb_table[mem_index][0].addend))= ; + offsetof(CPUArchState, tlb_table[mem_index][0].addr= _read), + offsetof(CPUArchState, tlb_table[mem_index][0].adde= nd)); =20 /* P6 is the fast path, and P7 the slow path */ tcg_out_bundle(s, mLX, @@ -1570,8 +1570,8 @@ static inline void tcg_out_qemu_st(TCGContext *s, c= onst TCGArg *args, int opc) #endif =20 tcg_out_qemu_tlb(s, addr_reg, opc, - offsetof(CPUState, tlb_table[mem_index][0].addr_wri= te), - offsetof(CPUState, tlb_table[mem_index][0].addend))= ; + offsetof(CPUArchState, tlb_table[mem_index][0].addr= _write), + offsetof(CPUArchState, tlb_table[mem_index][0].adde= nd)); =20 /* P6 is the fast path, and P7 the slow path */ tcg_out_bundle(s, mLX, @@ -2368,6 +2368,6 @@ static void tcg_target_init(TCGContext *s) tcg_regset_set_reg(s->reserved_regs, TCG_REG_R6); =20 tcg_add_target_add_op_defs(ia64_op_defs); - tcg_set_frame(s, TCG_AREG0, offsetof(CPUState, temp_buf), + tcg_set_frame(s, TCG_AREG0, offsetof(CPUArchState, temp_buf), CPU_TEMP_BUF_NLONGS * sizeof(long)); } diff --git a/tcg/mips/tcg-target.c b/tcg/mips/tcg-target.c index c5c3282..c6aa5bc 100644 --- a/tcg/mips/tcg-target.c +++ b/tcg/mips/tcg-target.c @@ -827,7 +827,7 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGA= rg *args, tcg_out_opc_imm(s, OPC_ANDI, TCG_REG_A0, TCG_REG_A0, (CPU_TLB_SIZE -= 1) << CPU_TLB_ENTRY_BITS); tcg_out_opc_reg(s, OPC_ADDU, TCG_REG_A0, TCG_REG_A0, TCG_AREG0); tcg_out_opc_imm(s, OPC_LW, TCG_REG_AT, TCG_REG_A0, - offsetof(CPUState, tlb_table[mem_index][0].addr_read= ) + addr_meml); + offsetof(CPUArchState, tlb_table[mem_index][0].addr_= read) + addr_meml); tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_T0, TARGET_PAGE_MASK | ((1 << = s_bits) - 1)); tcg_out_opc_reg(s, OPC_AND, TCG_REG_T0, TCG_REG_T0, addr_regl); =20 @@ -837,7 +837,7 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGA= rg *args, tcg_out_nop(s); =20 tcg_out_opc_imm(s, OPC_LW, TCG_REG_AT, TCG_REG_A0, - offsetof(CPUState, tlb_table[mem_index][0].addr_read= ) + addr_memh); + offsetof(CPUArchState, tlb_table[mem_index][0].addr_= read) + addr_memh); =20 label1_ptr =3D s->code_ptr; tcg_out_opc_br(s, OPC_BEQ, addr_regh, TCG_REG_AT); @@ -893,7 +893,7 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGA= rg *args, reloc_pc16(label1_ptr, (tcg_target_long) s->code_ptr); =20 tcg_out_opc_imm(s, OPC_LW, TCG_REG_A0, TCG_REG_A0, - offsetof(CPUState, tlb_table[mem_index][0].addend)); + offsetof(CPUArchState, tlb_table[mem_index][0].adden= d)); tcg_out_opc_reg(s, OPC_ADDU, TCG_REG_V0, TCG_REG_A0, addr_regl); #else if (GUEST_BASE =3D=3D (int16_t)GUEST_BASE) { @@ -1013,7 +1013,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TC= GArg *args, tcg_out_opc_imm(s, OPC_ANDI, TCG_REG_A0, TCG_REG_A0, (CPU_TLB_SIZE -= 1) << CPU_TLB_ENTRY_BITS); tcg_out_opc_reg(s, OPC_ADDU, TCG_REG_A0, TCG_REG_A0, TCG_AREG0); tcg_out_opc_imm(s, OPC_LW, TCG_REG_AT, TCG_REG_A0, - offsetof(CPUState, tlb_table[mem_index][0].addr_writ= e) + addr_meml); + offsetof(CPUArchState, tlb_table[mem_index][0].addr_= write) + addr_meml); tcg_out_movi(s, TCG_TYPE_I32, TCG_REG_T0, TARGET_PAGE_MASK | ((1 << = s_bits) - 1)); tcg_out_opc_reg(s, OPC_AND, TCG_REG_T0, TCG_REG_T0, addr_regl); =20 @@ -1023,7 +1023,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TC= GArg *args, tcg_out_nop(s); =20 tcg_out_opc_imm(s, OPC_LW, TCG_REG_AT, TCG_REG_A0, - offsetof(CPUState, tlb_table[mem_index][0].addr_writ= e) + addr_memh); + offsetof(CPUArchState, tlb_table[mem_index][0].addr_= write) + addr_memh); =20 label1_ptr =3D s->code_ptr; tcg_out_opc_br(s, OPC_BEQ, addr_regh, TCG_REG_AT); @@ -1080,7 +1080,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TC= GArg *args, reloc_pc16(label1_ptr, (tcg_target_long) s->code_ptr); =20 tcg_out_opc_imm(s, OPC_LW, TCG_REG_A0, TCG_REG_A0, - offsetof(CPUState, tlb_table[mem_index][0].addend)); + offsetof(CPUArchState, tlb_table[mem_index][0].adden= d)); tcg_out_opc_reg(s, OPC_ADDU, TCG_REG_A0, TCG_REG_A0, addr_regl); #else if (GUEST_BASE =3D=3D (int16_t)GUEST_BASE) { @@ -1529,6 +1529,6 @@ static void tcg_target_init(TCGContext *s) tcg_regset_set_reg(s->reserved_regs, TCG_REG_SP); /* stack pointer= */ =20 tcg_add_target_add_op_defs(mips_op_defs); - tcg_set_frame(s, TCG_AREG0, offsetof(CPUState, temp_buf), + tcg_set_frame(s, TCG_AREG0, offsetof(CPUArchState, temp_buf), CPU_TEMP_BUF_NLONGS * sizeof(long)); } diff --git a/tcg/ppc/tcg-target.c b/tcg/ppc/tcg-target.c index f5d9bf3..6a34cab 100644 --- a/tcg/ppc/tcg-target.c +++ b/tcg/ppc/tcg-target.c @@ -564,7 +564,7 @@ static void tcg_out_qemu_ld (TCGContext *s, const TCG= Arg *args, int opc) tcg_out32 (s, (LWZU | RT (r1) | RA (r0) - | offsetof (CPUState, tlb_table[mem_index][0].addr_re= ad) + | offsetof (CPUArchState, tlb_table[mem_index][0].add= r_read) ) ); tcg_out32 (s, (RLWINM @@ -760,7 +760,7 @@ static void tcg_out_qemu_st (TCGContext *s, const TCG= Arg *args, int opc) tcg_out32 (s, (LWZU | RT (r1) | RA (r0) - | offsetof (CPUState, tlb_table[mem_index][0].addr_wr= ite) + | offsetof (CPUArchState, tlb_table[mem_index][0].add= r_write) ) ); tcg_out32 (s, (RLWINM diff --git a/tcg/ppc64/tcg-target.c b/tcg/ppc64/tcg-target.c index 4419378..7f723b5 100644 --- a/tcg/ppc64/tcg-target.c +++ b/tcg/ppc64/tcg-target.c @@ -635,7 +635,7 @@ static void tcg_out_qemu_ld (TCGContext *s, const TCG= Arg *args, int opc) rbase =3D 0; =20 tcg_out_tlb_read (s, r0, r1, r2, addr_reg, s_bits, - offsetof (CPUState, tlb_table[mem_index][0].addr_r= ead)); + offsetof (CPUArchState, tlb_table[mem_index][0].ad= dr_read)); =20 tcg_out32 (s, CMP | BF (7) | RA (r2) | RB (r1) | CMP_L); =20 @@ -782,7 +782,7 @@ static void tcg_out_qemu_st (TCGContext *s, const TCG= Arg *args, int opc) rbase =3D 0; =20 tcg_out_tlb_read (s, r0, r1, r2, addr_reg, opc, - offsetof (CPUState, tlb_table[mem_index][0].addr_w= rite)); + offsetof (CPUArchState, tlb_table[mem_index][0].ad= dr_write)); =20 tcg_out32 (s, CMP | BF (7) | RA (r2) | RB (r1) | CMP_L); =20 diff --git a/tcg/s390/tcg-target.c b/tcg/s390/tcg-target.c index 9317fe8..47ffcc1 100644 --- a/tcg/s390/tcg-target.c +++ b/tcg/s390/tcg-target.c @@ -1439,9 +1439,9 @@ static void tcg_prepare_qemu_ldst(TCGContext* s, TC= GReg data_reg, tgen64_andi_tmp(s, arg1, (CPU_TLB_SIZE - 1) << CPU_TLB_ENTRY_BITS); =20 if (is_store) { - ofs =3D offsetof(CPUState, tlb_table[mem_index][0].addr_write); + ofs =3D offsetof(CPUArchState, tlb_table[mem_index][0].addr_writ= e); } else { - ofs =3D offsetof(CPUState, tlb_table[mem_index][0].addr_read); + ofs =3D offsetof(CPUArchState, tlb_table[mem_index][0].addr_read= ); } assert(ofs < 0x80000); =20 @@ -1515,7 +1515,7 @@ static void tcg_prepare_qemu_ldst(TCGContext* s, TC= GReg data_reg, *(label1_ptr + 1) =3D ((unsigned long)s->code_ptr - (unsigned long)label1_ptr) >> 1; =20 - ofs =3D offsetof(CPUState, tlb_table[mem_index][0].addend); + ofs =3D offsetof(CPUArchState, tlb_table[mem_index][0].addend); assert(ofs < 0x80000); =20 tcg_out_mem(s, 0, RXY_AG, arg0, arg1, TCG_AREG0, ofs); @@ -2293,7 +2293,7 @@ static void tcg_target_init(TCGContext *s) tcg_regset_set_reg(s->reserved_regs, TCG_REG_CALL_STACK); =20 tcg_add_target_add_op_defs(s390_op_defs); - tcg_set_frame(s, TCG_AREG0, offsetof(CPUState, temp_buf), + tcg_set_frame(s, TCG_AREG0, offsetof(CPUArchState, temp_buf), CPU_TEMP_BUF_NLONGS * sizeof(long)); } =20 diff --git a/tcg/sparc/tcg-target.c b/tcg/sparc/tcg-target.c index 5cd5a3b..d723f1b 100644 --- a/tcg/sparc/tcg-target.c +++ b/tcg/sparc/tcg-target.c @@ -776,7 +776,7 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGA= rg *args, tcg_out_andi(s, arg1, (CPU_TLB_SIZE - 1) << CPU_TLB_ENTRY_BITS); =20 /* add arg1, x, arg1 */ - tcg_out_addi(s, arg1, offsetof(CPUState, + tcg_out_addi(s, arg1, offsetof(CPUArchState, tlb_table[mem_index][0].addr_read)); =20 /* add env, arg1, arg1 */ @@ -988,7 +988,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGA= rg *args, tcg_out_andi(s, arg1, (CPU_TLB_SIZE - 1) << CPU_TLB_ENTRY_BITS); =20 /* add arg1, x, arg1 */ - tcg_out_addi(s, arg1, offsetof(CPUState, + tcg_out_addi(s, arg1, offsetof(CPUArchState, tlb_table[mem_index][0].addr_write)); =20 /* add env, arg1, arg1 */ diff --git a/tcg/tci/tcg-target.c b/tcg/tci/tcg-target.c index fc0880c..bd85073 100644 --- a/tcg/tci/tcg-target.c +++ b/tcg/tci/tcg-target.c @@ -891,7 +891,7 @@ static void tcg_target_init(TCGContext *s) tcg_regset_clear(s->reserved_regs); tcg_regset_set_reg(s->reserved_regs, TCG_REG_CALL_STACK); tcg_add_target_add_op_defs(tcg_target_op_defs); - tcg_set_frame(s, TCG_AREG0, offsetof(CPUState, temp_buf), + tcg_set_frame(s, TCG_AREG0, offsetof(CPUArchState, temp_buf), CPU_TEMP_BUF_NLONGS * sizeof(long)); } =20 diff --git a/tcg/tci/tcg-target.h b/tcg/tci/tcg-target.h index 81fcc0f..b61e99a 100644 --- a/tcg/tci/tcg-target.h +++ b/tcg/tci/tcg-target.h @@ -154,7 +154,7 @@ typedef enum { =20 void tci_disas(uint8_t opc); =20 -unsigned long tcg_qemu_tb_exec(CPUState *env, uint8_t *tb_ptr); +unsigned long tcg_qemu_tb_exec(CPUArchState *env, uint8_t *tb_ptr); #define tcg_qemu_tb_exec tcg_qemu_tb_exec =20 static inline void flush_icache_range(tcg_target_ulong start, diff --git a/tci.c b/tci.c index a20a714..fb9ebef 100644 --- a/tci.c +++ b/tci.c @@ -52,7 +52,7 @@ typedef uint64_t (*helper_function)(tcg_target_ulong, t= cg_target_ulong, =20 /* TCI can optionally use a global register variable for env. */ #if !defined(AREG0) -CPUState *env; +CPUArchState *env; #endif =20 /* Targets which don't use GETPC also don't need tci_tb_ptr @@ -429,7 +429,7 @@ static bool tci_compare64(uint64_t u0, uint64_t u1, T= CGCond condition) } =20 /* Interpret pseudo code in tb. */ -unsigned long tcg_qemu_tb_exec(CPUState *cpustate, uint8_t *tb_ptr) +unsigned long tcg_qemu_tb_exec(CPUArchState *cpustate, uint8_t *tb_ptr) { unsigned long next_tb =3D 0; =20 diff --git a/translate-all.c b/translate-all.c index 041c108..8c7d303 100644 --- a/translate-all.c +++ b/translate-all.c @@ -51,7 +51,7 @@ void cpu_gen_init(void) '*gen_code_size_ptr' contains the size of the generated code (host code). */ -int cpu_gen_code(CPUState *env, TranslationBlock *tb, int *gen_code_size= _ptr) +int cpu_gen_code(CPUArchState *env, TranslationBlock *tb, int *gen_code_= size_ptr) { TCGContext *s =3D &tcg_ctx; uint8_t *gen_code_buf; @@ -109,7 +109,7 @@ int cpu_gen_code(CPUState *env, TranslationBlock *tb,= int *gen_code_size_ptr) /* The cpu state corresponding to 'searched_pc' is restored. */ int cpu_restore_state(TranslationBlock *tb, - CPUState *env, unsigned long searched_pc) + CPUArchState *env, unsigned long searched_pc) { TCGContext *s =3D &tcg_ctx; int j; diff --git a/user-exec.c b/user-exec.c index abf6885..cd905ff 100644 --- a/user-exec.c +++ b/user-exec.c @@ -38,7 +38,7 @@ =20 //#define DEBUG_SIGNAL =20 -static void exception_action(CPUState *env1) +static void exception_action(CPUArchState *env1) { #if defined(TARGET_I386) raise_exception_err_env(env1, env1->exception_index, env1->error_cod= e); @@ -50,7 +50,7 @@ static void exception_action(CPUState *env1) /* exit the current TB from a signal handler. The host registers are restored in a state compatible with the CPU emulator */ -void cpu_resume_from_signal(CPUState *env1, void *puc) +void cpu_resume_from_signal(CPUArchState *env1, void *puc) { #ifdef __linux__ struct ucontext *uc =3D puc; diff --git a/xen-all.c b/xen-all.c index 6cef506..493112b 100644 --- a/xen-all.c +++ b/xen-all.c @@ -530,14 +530,14 @@ static MemoryListener xen_memory_listener =3D { =20 static void xen_reset_vcpu(void *opaque) { - CPUState *env =3D opaque; + CPUArchState *env =3D opaque; =20 env->halted =3D 1; } =20 void xen_vcpu_init(void) { - CPUState *first_cpu; + CPUArchState *first_cpu; =20 if ((first_cpu =3D qemu_get_cpu(0))) { qemu_register_reset(xen_reset_vcpu, first_cpu); --=20 1.7.7