Prepare QOM support for machines and CPU
Subsystems (5)
PATCH v4 1/3 kvmclock: Always register type
In reply to Andreas FärberCurrently, the "kvmclock" type is only registered when kvm_enabled().
This breaks when moving type registration to before command line parsing (so that QOM types can be used for CPU and machine).
Since the QOM classes are lazy-initialized anyway and kvmclock_create() has another kvm_enabled() check, simply drop the KVM check in kvmclock_register_types().
kvm-i8259, kvm-apic and kvm-ioapic do not suffer from such a check.
--- hw/kvm/clock.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
hw/kvm/clock.c +0 -2
@@ -121,9 +121,7 @@ void kvmclock_create(void)static void kvmclock_register_types (void ) { -if (kvm_enabled ()) {type_register_static (&kvmclock_info); - } }type_init (kvmclock_register_types)
Signature · 1 line
1.7.7
PATCH v4 2/3 qom: Register QOM infrastructure early
In reply to Andreas FärberThe constructors for QOM TYPE_INTERFACE were executed rather late in vl.c's main(). Call them very early so that QOM can safely be used for machines and CPUs.
--- vl.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
vl.c +2 -2
@@ -2299,6 +2299,8 @@ int main(int argc, char **argv, char **envp)#endif } +module_call_init (MODULE_INIT_QOM ); +runstate_init ();init_clocks ();
@@ -3460,8 +3462,6 @@ int main(int argc, char **argv, char **envp)if (foreach_device_config (DEV_DEBUGCON , debugcon_parse) <0 )exit (1 ); -module_call_init (MODULE_INIT_QOM ); -/* must be after qdev registration but before machine init */ if (vga_model) {select_vgahw (vga_model);
Signature · 1 line
1.7.7
v4 cover Prepare QOM support for machines and CPU
Hello Anthony,
This series prepares for QOM'ification of CPUs and machines by rearranging constructor calls and Makefile dependency rules. I've separated it out due to complaints about patch series length for conversion of all targets.
Patch 1 is a RESEND that avoids an abort after patch 2.
Patch 2 rearranges module init for QOM in the system emulators, so that objects can really be used beyond devices.
Patch 3 adds QOM support to the user emulators. As required by Anthony, they are now only built once.
Available at:
http://repo.or.cz/w/qemu/afaerber.git/shortlog/refs/heads/qom-user.v4
Regards,
Andreas
v3 -> v4:
* Fix kvmclock abort due to too early kvm_enabled() check.
* Introduce $(universal-obj-y) to build some objects only once.
* Fix GPLv2 license link.
v2 -> v3:
* Rebased against qom-upstream.14 branch (and that against master).
* Build common dependencies for user emulators in libuser/.
* New dependencies needed after moving properties into object.c.
* Add a qemu-user.c with stubs needed for successful linking.
v1 -> v2:
* Don't introduce extra early_init(), just relocate former MODULE_INIT_DEVICE.
* Provide new type_init() macro to be used instead of device_init().
Andreas Färber (3):
kvmclock: Always register type
qom: Register QOM infrastructure early
qom: Add QOM support to user emulators
Makefile | 6 +++--- Makefile.objs | 23 ++++++++++++++++++----- Makefile.target | 4 ++++ Makefile.user | 1 + bsd-user/main.c | 2 ++ darwin-user/main.c | 3 +++ hw/kvm/clock.c | 2 -- linux-user/main.c | 2 ++ qemu-user.c | 37 +++++++++++++++++++++++++++++++++++++ vl.c | 4 ++-- 10 files changed, 72 insertions(+), 12 deletions(-) create mode 100644 qemu-user.c
Signature · 1 line
1.7.7
PATCH v4 3/3 qom: Add QOM support to user emulators
Link the Object base class and the module infrastructure for class registration. Introduce $(universal-obj-y) for objects that are more common than $(common-obj-y), so that those only get built once.
Call QOM module init for type registration.
--- Makefile | 6 +++--- Makefile.objs | 23 ++++++++++++++++++----- Makefile.target | 4 ++++ Makefile.user | 1 + bsd-user/main.c | 2 ++ darwin-user/main.c | 3 +++ linux-user/main.c | 2 ++ qemu-user.c | 37 +++++++++++++++++++++++++++++++++++++ 8 files changed, 70 insertions(+), 8 deletions(-) create mode 100644 qemu-user.c
Makefile +3 -3
@@ -97,12 +97,12 @@ ifneq ($(wildcard config-host.mak),) include $(SRC_PATH)/Makefile.objs endif -$(common-obj-y): $(GENERATED_HEADERS) +$(universal-obj-y) $(common-obj-y): $(GENERATED_HEADERS) subdir-libcacard: $(oslib-obj-y) $(trace-obj-y) qemu-timer-common.o -$(filter %-softmmu,$(SUBDIR_RULES)): $(trace-obj-y) $(common-obj-y) subdir-libdis +$(filter %-softmmu,$(SUBDIR_RULES)): $(universal-obj-y) $(trace-obj-y) $(common-obj-y) subdir-libdis -$(filter %-user,$(SUBDIR_RULES)): $(GENERATED_HEADERS) $(trace-obj-y) subdir-libdis-user subdir-libuser +$(filter %-user,$(SUBDIR_RULES)): $(GENERATED_HEADERS) $(universal-obj-y) $(trace-obj-y) subdir-libdis-user subdir-libuser ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS)) romsubdir-%:
Makefile.objs +18 -5
@@ -1,9 +1,22 @@ ####################################################################### +# Target-independent parts used in system and user emulation +universal-obj-y = + +####################################################################### # QObject qobject-obj-y = qint.o qstring.o qdict.o qlist.o qfloat.o qbool.o qobject-obj-y += qjson.o json-lexer.o json-streamer.o json-parser.o qobject-obj-y += qerror.o error.o qemu-error.o +universal-obj-y += $(qobject-obj-y) + +####################################################################### +# QOM +include $(SRC_PATH)/qom/Makefile +qom-obj-y = $(addprefix qom/, $(qom-y)) + +universal-obj-y += $(qom-obj-y) + ####################################################################### # oslib-obj-y is code depending on the OS (win32 vs posix) oslib-obj-y = osdep.o
@@ -76,7 +89,6 @@ fsdev-obj-$(CONFIG_VIRTFS) += $(addprefix fsdev/, $(fsdev-nested-y)) common-obj-y = $(block-obj-y) blockdev.o common-obj-y += $(net-obj-y) -common-obj-y += $(qobject-obj-y) common-obj-$(CONFIG_LINUX) += $(fsdev-obj-$(CONFIG_LINUX)) common-obj-y += readline.o console.o cursor.o common-obj-y += $(oslib-obj-y)
@@ -124,9 +136,6 @@ common-obj-$(CONFIG_WIN32) += version.o common-obj-$(CONFIG_SPICE) += ui/spice-core.o ui/spice-input.o ui/spice-display.o spice-qemu-char.o -include $(SRC_PATH)/qom/Makefile -common-obj-y += $(addprefix qom/, $(qom-y)) - audio-obj-y = audio.o noaudio.o wavaudio.o mixeng.o audio-obj-$(CONFIG_SDL) += sdlaudio.o audio-obj-$(CONFIG_OSS) += ossaudio.o
@@ -182,6 +191,8 @@ user-obj-y = user-obj-y += envlist.o path.o user-obj-y += tcg-runtime.o host-utils.o user-obj-y += cutils.o cache-utils.o +user-obj-y += module.o +user-obj-y += qemu-user.o user-obj-y += $(trace-obj-y) ######################################################################
@@ -418,9 +429,11 @@ qapi-nested-y += qmp-output-visitor.o qmp-registry.o qmp-dispatch.o qapi-nested-y += string-input-visitor.o string-output-visitor.o qapi-obj-y = $(addprefix qapi/, $(qapi-nested-y)) -common-obj-y += qmp-marshal.o qapi-visit.o qapi-types.o $(qapi-obj-y) +common-obj-y += qmp-marshal.o qapi-visit.o qapi-types.o common-obj-y += qmp.o hmp.o +universal-obj-y += $(qapi-obj-y) + ###################################################################### # guest agent
Makefile.target +4 -0
@@ -136,6 +136,7 @@ obj-m68k-y += m68k-sim.o m68k-semi.o $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS) +obj-y += $(addprefix ../, $(universal-obj-y)) obj-y += $(addprefix ../libuser/, $(user-obj-y)) obj-y += $(addprefix ../libdis-user/, $(libdis-y)) obj-y += $(libobj-y)
@@ -163,6 +164,7 @@ obj-i386-y += ioport-user.o $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS) +obj-y += $(addprefix ../, $(universal-obj-y)) obj-y += $(addprefix ../libuser/, $(user-obj-y)) obj-y += $(addprefix ../libdis-user/, $(libdis-y)) obj-y += $(libobj-y)
@@ -185,6 +187,7 @@ obj-i386-y += ioport-user.o $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS) +obj-y += $(addprefix ../, $(universal-obj-y)) obj-y += $(addprefix ../libuser/, $(user-obj-y)) obj-y += $(addprefix ../libdis-user/, $(libdis-y)) obj-y += $(libobj-y)
@@ -401,6 +404,7 @@ monitor.o: hmp-commands.h qmp-commands-old.h $(obj-y) $(obj-$(TARGET_BASE_ARCH)-y): $(GENERATED_HEADERS) +obj-y += $(addprefix ../, $(universal-obj-y)) obj-y += $(addprefix ../, $(common-obj-y)) obj-y += $(addprefix ../libdis/, $(libdis-y)) obj-y += $(libobj-y)
Makefile.user +1 -0
@@ -9,6 +9,7 @@ include $(SRC_PATH)/rules.mak $(call set-vpath, $(SRC_PATH)) QEMU_CFLAGS+=-I.. +QEMU_CFLAGS += -I$(SRC_PATH)/include include $(SRC_PATH)/Makefile.objs
bsd-user/main.c +2 -0
@@ -748,6 +748,8 @@ int main(int argc, char **argv)if (argc <=1 )usage (); +module_call_init (MODULE_INIT_QOM ); +if ((envlist =envlist_create ()) ==NULL ) { (void )fprintf (stderr,"Unable to allocate envlist\n" );exit (1 );
darwin-user/main.c +3 -0
@@ -28,6 +28,7 @@#include <sys/mman.h> #include "qemu.h" +#include "qemu-common.h" #define DEBUG_LOGFILE "/tmp/qemu.log"
@@ -749,6 +750,8 @@ int main(int argc, char **argv)if (argc <=1 )usage (); +module_call_init (MODULE_INIT_QOM ); + optind =1 ;for (;;) {if (optind >= argc)
linux-user/main.c +2 -0
@@ -3285,6 +3285,8 @@ int main(int argc, char **argv, char **envp)int i;int ret; +module_call_init (MODULE_INIT_QOM ); +qemu_cache_utils_init (envp);if ((envlist =envlist_create ()) ==NULL ) {
qemu-user.c new file +37 -0
@@ -0,0 +1,37 @@ +/* +* Stubs for QEMU user emulation +* +* Copyright (c) 2012 SUSE LINUX Products GmbH +* +* This program is free software; you can redistribute it and/or +* modify it under the terms of the GNU General Public License +* as published by the Free Software Foundation; either version 2 +* of the License, or (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, see +* <http://www.gnu.org/licenses/gpl-2.0.html> +*/ + +#include "qemu-common.h" +#include "monitor.h" + +Monitor *cur_mon; + +int monitor_cur_is_qmp (void ) +{ +return 0 ; +} + +void monitor_vprintf (Monitor *mon,const char *fmt,va_list ap) +{ +} + +void monitor_set_error (Monitor *mon,QError *qerror) +{ +}
Signature · 1 line
1.7.7
Re: [Qemu-devel] [PATCH v4 1/3] kvmclock: Always register type
In reply to Andreas FärberQuoted 10 lines · Andreas Färber
Currently, the "kvmclock" type is only registered when
kvm_enabled().This breaks when moving type registration to before command line parsing (so that QOM types can be used for CPU and machine).
Since the QOM classes are lazy-initialized anyway and
kvmclock_create()has anotherkvm_enabled()check, simply drop the KVM check inkvmclock_register_types().kvm-i8259, kvm-apic and kvm-ioapic do not suffer from such a check.
Patch looks good.
Signature · 1 line
error compiling committee.c: too many arguments to function
Re: [Qemu-devel] [PATCH v4 3/3] qom: Add QOM support to user emulators
In reply to Andreas FärberQuoted 8 lines · On Sun, 4 Mar 2012 21:32:36 +0100 Andreas Färber <[email protected]> wrote:
Link the Object base class and the module infrastructure for class registration. Introduce $(universal-obj-y) for objects that are more common than $(common-obj-y), so that those only get built once.
Call QOM module init for type registration.
Signed-off-by Andreas Färber <[email protected]>Cc Anthony Liguori <[email protected]>
Never looked how user emulators work in detail, but looks good to me.
Re: [Qemu-devel] [PATCH v4 1/3] kvmclock: Always register type
In reply to Avi KivityAm 05.03.2012 10:23, schrieb Avi Kivity:
Quoted 6 lines · Andreas Färber
Quoted 5 lines
Currently, the "kvmclock" type is only registered when
kvm_enabled().This breaks when moving type registration to before command line parsing (so that QOM types can be used for CPU and machine).
Quoted 7 lines
Quoted 5 lines
Since the QOM classes are lazy-initialized anyway and
kvmclock_create()has anotherkvm_enabled()check, simply drop the KVM check inkvmclock_register_types().kvm-i8259, kvm-apic and kvm-ioapic do not suffer from such a check.
Patch looks good.
Ping for series.
Avi, do you want to sign this patch off through uq/master? Or should I make the above a Reviewed-by (and remove the Cc:) within this series?
Andreas
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
RFC PATCH v4 13/44 target-alpha: Don't overuse CPUState
In reply to Andreas FärberScripted conversion:
sed -i "s/CPUState/CPUAlphaState/g" target-alpha/*.[hc] sed -i "s/#define CPUAlphaState/#define CPUState/" target-alpha/cpu.h
--- target-alpha/cpu.h | 24 ++++++++++---------- target-alpha/helper.c | 18 +++++++------- target-alpha/machine.c | 44 ++++++++++++++++++------------------ target-alpha/op_helper.c | 6 ++-- target-alpha/translate.c | 56 +++++++++++++++++++++++----------------------- 5 files changed, 74 insertions(+), 74 deletions(-)
target-alpha/cpu.h +12 -12
@@ -375,7 +375,7 @@ enum { PS_USER_MODE = 8 }; -static inline int cpu_mmu_index (CPUState *env) +static inline int cpu_mmu_index (CPUAlphaState *env) {if (env->pal_mode) {return MMU_KERNEL_IDX ;
@@ -430,16 +430,16 @@ int cpu_alpha_exec(CPUAlphaState *s);is returned if the signal was handled by the virtual CPU. */ int cpu_alpha_signal_handler (int host_signum,void *pinfo,void *puc); -int cpu_alpha_handle_mmu_fault (CPUState *env,uint64_t address,int rw, +int cpu_alpha_handle_mmu_fault (CPUAlphaState *env,uint64_t address,int rw,int mmu_idx);#define cpu_handle_mmu_fault cpu_alpha_handle_mmu_fault -void do_interrupt (CPUState *env); +void do_interrupt (CPUAlphaState *env); -uint64_t cpu_alpha_load_fpcr (CPUState *env); -void cpu_alpha_store_fpcr (CPUState *env,uint64_t val); +uint64_t cpu_alpha_load_fpcr (CPUAlphaState *env); +void cpu_alpha_store_fpcr (CPUAlphaState *env,uint64_t val);#ifndef CONFIG_USER_ONLY -void swap_shadow_regs (CPUState *env); -QEMU_NORETURN void cpu_unassigned_access(CPUState *env1, +void swap_shadow_regs (CPUAlphaState *env); +QEMU_NORETURN void cpu_unassigned_access(CPUAlphaState *env1,target_phys_addr_t addr,int is_write,int is_exec,int unused,int size);#endif
@@ -459,7 +459,7 @@ enum { TB_FLAGS_AMASK_PREFETCH = AMASK_PREFETCH << TB_FLAGS_AMASK_SHIFT, }; -static inline void cpu_get_tb_cpu_state (CPUState *env,target_ulong *pc, +static inline void cpu_get_tb_cpu_state (CPUAlphaState *env,target_ulong *pc,target_ulong *cs_base,int *pflags) {int flags =0 ;
@@ -481,7 +481,7 @@ static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc, }#if defined(CONFIG_USER_ONLY ) -static inline void cpu_clone_regs (CPUState *env,target_ulong newsp) +static inline void cpu_clone_regs (CPUAlphaState *env,target_ulong newsp) {if (newsp) { env->ir[IR_SP ] = newsp;
@@ -490,13 +490,13 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp) env->ir[IR_A3] = 0; } -static inline void cpu_set_tls (CPUState *env,target_ulong newtls) +static inline void cpu_set_tls (CPUAlphaState *env,target_ulong newtls) { env->unique = newtls; }#endif -static inline bool cpu_has_work (CPUState *env) +static inline bool cpu_has_work (CPUAlphaState *env) {/* Here we are checking to see if the CPU should wake up from HALT. We will have gotten into this state only for WTINT from PALmode. */
@@ -513,7 +513,7 @@ static inline bool cpu_has_work(CPUState *env)#include "exec-all.h" -static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) +static inline void cpu_pc_from_tb (CPUAlphaState *env,TranslationBlock *tb) { env->pc = tb->pc; }
target-alpha/helper.c +9 -9
@@ -24,7 +24,7 @@#include "cpu.h" #include "softfloat.h" -uint64_t cpu_alpha_load_fpcr (CPUState *env) +uint64_t cpu_alpha_load_fpcr (CPUAlphaState *env) {uint64_t r =0 ;uint8_t t;
@@ -94,7 +94,7 @@ uint64_t cpu_alpha_load_fpcr (CPUState *env)return r; } -void cpu_alpha_store_fpcr (CPUState *env,uint64_t val) +void cpu_alpha_store_fpcr (CPUAlphaState *env,uint64_t val) {uint8_t t;
@@ -159,7 +159,7 @@ void cpu_alpha_store_fpcr (CPUState *env, uint64_t val) }#if defined(CONFIG_USER_ONLY ) -int cpu_alpha_handle_mmu_fault (CPUState *env,target_ulong address,int rw, +int cpu_alpha_handle_mmu_fault (CPUAlphaState *env,target_ulong address,int rw,int mmu_idx) { env->exception_index =EXCP_MMFAULT ;
@@ -167,7 +167,7 @@ int cpu_alpha_handle_mmu_fault (CPUState *env, target_ulong address, int rw, return 1; }#else -void swap_shadow_regs (CPUState *env) +void swap_shadow_regs (CPUAlphaState *env) {uint64_t i0, i1, i2, i3, i4, i5, i6, i7;
@@ -200,7 +200,7 @@ void swap_shadow_regs(CPUState *env) }/* Returns the OSF/1 entMM failure indication, or -1 on success. */ -static int get_physical_address (CPUState *env,target_ulong addr, +static int get_physical_address (CPUAlphaState *env,target_ulong addr,int prot_need,int mmu_idx,target_ulong *pphys,int *pprot) {
@@ -306,7 +306,7 @@ static int get_physical_address(CPUState *env, target_ulong addr,return ret; } -target_phys_addr_t cpu_get_phys_page_debug (CPUState *env,target_ulong addr) +target_phys_addr_t cpu_get_phys_page_debug (CPUAlphaState *env,target_ulong addr) {target_ulong phys;int prot, fail;
@@ -315,7 +315,7 @@ target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr)return (fail >=0 ?-1 : phys); } -int cpu_alpha_handle_mmu_fault (CPUState *env,target_ulong addr,int rw, +int cpu_alpha_handle_mmu_fault (CPUAlphaState *env,target_ulong addr,int rw,int mmu_idx) {target_ulong phys;
@@ -336,7 +336,7 @@ int cpu_alpha_handle_mmu_fault(CPUState *env, target_ulong addr, int rw, }#endif /* USER_ONLY */ -void do_interrupt (CPUState *env) +void do_interrupt (CPUAlphaState *env) {int i = env->exception_index;
@@ -453,7 +453,7 @@ void do_interrupt (CPUState *env)#endif /* !USER_ONLY */ } -void cpu_dump_state (CPUState *env,FILE *f,fprintf_function cpu_fprintf, +void cpu_dump_state (CPUAlphaState *env,FILE *f,fprintf_function cpu_fprintf,int flags) {static const char *linux_reg_names[] = {
target-alpha/machine.c +22 -22
63 lines not on this page · raw message
target-alpha/op_helper.c +3 -3
@@ -1329,7 +1329,7 @@ static void QEMU_NORETURN do_unaligned_access(target_ulong addr, int is_write,helper_excp (EXCP_UNALIGN ,0 ); } -void QEMU_NORETURN cpu_unassigned_access(CPUState *env1, +void QEMU_NORETURN cpu_unassigned_access(CPUAlphaState *env1,target_phys_addr_t addr,int is_write,int is_exec,int unused,int size) {
@@ -1360,10 +1360,10 @@ void QEMU_NORETURN cpu_unassigned_access(CPUState *env1,NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */ /* XXX: fix it to restore all registers */ -void tlb_fill (CPUState *env1,target_ulong addr,int is_write,int mmu_idx, +void tlb_fill (CPUAlphaState *env1,target_ulong addr,int is_write,int mmu_idx,void *retaddr) { -CPUState *saved_env; +CPUAlphaState *saved_env;int ret; saved_env = env;
target-alpha/translate.c +28 -28
189 lines not on this page · raw message
Signature · 1 line
1.7.7
PATCH v4 1/44 PPC: 405: Use proper CPU reset
In reply to Andreas FärberFrom: Alexander Graf <[email protected]>
On ppc405ep there is a register that allows for software to reset the core, but not the whole system. Implement this reset using a reset interrupt.
This gets rid of a bunch of #if 0'ed code.
--- cpu-exec.c | 2 -- hw/ppc.c | 13 ++----------- hw/ppc405_uc.c | 16 ++-------------- target-ppc/cpu.h | 3 +++ 4 files changed, 7 insertions(+), 27 deletions(-)
cpu-exec.c +0 -2
@@ -339,11 +339,9 @@ int cpu_exec(CPUState *env) } }#elif defined(TARGET_PPC) -#if 0 if ((interrupt_request &CPU_INTERRUPT_RESET )) {cpu_reset (env); } -#endif if (interrupt_request &CPU_INTERRUPT_HARD ) {ppc_hw_interrupt (env);if (env->pending_interrupts ==0 )
hw/ppc.c +2 -11
@@ -131,13 +131,7 @@ static void ppc6xx_set_irq (void *opaque, int pin, int level)/* Level sensitive - active low */ if (level) {LOG_IRQ ("%s: reset the CPU\n" , __func__); - env->interrupt_request |=CPU_INTERRUPT_EXITTB ; -/* XXX: TOFIX */ -#if 0 -cpu_reset (env); -#else -qemu_system_reset_request (); -#endif +cpu_interrupt (env,CPU_INTERRUPT_RESET ); }break ;case PPC6xx_INPUT_SRESET:
@@ -214,10 +208,7 @@ static void ppc970_set_irq (void *opaque, int pin, int level)case PPC970_INPUT_HRESET :/* Level sensitive - active low */ if (level) { -#if 0 // XXX: TOFIX -LOG_IRQ ("%s: reset the CPU\n" , __func__); -cpu_reset (env); -#endif +cpu_interrupt (env,CPU_INTERRUPT_RESET ); }break ;case PPC970_INPUT_SRESET :
hw/ppc405_uc.c +2 -14
@@ -1769,13 +1769,7 @@ void ppc40x_core_reset (CPUState *env)target_ulong dbsr;printf ("Reset PowerPC core\n" ); - env->interrupt_request |=CPU_INTERRUPT_EXITTB ; -/* XXX: TOFIX */ -#if 0 -cpu_reset (env); -#else -qemu_system_reset_request (); -#endif +cpu_interrupt (env,CPU_INTERRUPT_RESET ); dbsr = env->spr[SPR_40x_DBSR]; dbsr &= ~0x00000300 ; dbsr |=0x00000100 ;
@@ -1787,13 +1781,7 @@ void ppc40x_chip_reset (CPUState *env)target_ulong dbsr;printf ("Reset PowerPC chip\n" ); - env->interrupt_request |=CPU_INTERRUPT_EXITTB ; -/* XXX: TOFIX */ -#if 0 -cpu_reset (env); -#else -qemu_system_reset_request (); -#endif +cpu_interrupt (env,CPU_INTERRUPT_RESET );/* XXX: TODO reset all internal peripherals */ dbsr = env->spr[SPR_40x_DBSR]; dbsr &= ~0x00000300 ;
target-ppc/cpu.h +3 -0
@@ -2051,6 +2051,9 @@ enum { PPC_INTERRUPT_PERFM, /* Performance monitor interrupt */ }; +/* CPU should be reset next, restart from scratch afterwards */ +#define CPU_INTERRUPT_RESET CPU_INTERRUPT_TGT_INT_0 +/*****************************************************************************/ static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc,
Signature · 1 line
1.7.7
RFC PATCH v4 15/44 target-cris: Don't overuse CPUState
In reply to Andreas FärberScripted conversion:
sed -i "s/CPUState/CPUCRISState/g" target-cris/*.[hc] sed -i "s/#define CPUCRISState/#define CPUState/" target-cris/cpu.h
--- target-cris/cpu.h | 12 +++++----- target-cris/helper.c | 14 ++++++------ target-cris/mmu.c | 14 ++++++------ target-cris/mmu.h | 6 ++-- target-cris/op_helper.c | 6 ++-- target-cris/translate.c | 46 +++++++++++++++++++++--------------------- target-cris/translate_v10.c | 26 ++++++++++++------------ 7 files changed, 62 insertions(+), 62 deletions(-)
target-cris/cpu.h +6 -6
@@ -225,17 +225,17 @@ enum {#define MMU_MODE0_SUFFIX _kernel#define MMU_MODE1_SUFFIX _user#define MMU_USER_IDX 1 -static inline int cpu_mmu_index (CPUState *env) +static inline int cpu_mmu_index (CPUCRISState *env) {return !!(env->pregs[PR_CCS ] &U_FLAG ); } -int cpu_cris_handle_mmu_fault (CPUState *env,target_ulong address,int rw, +int cpu_cris_handle_mmu_fault (CPUCRISState *env,target_ulong address,int rw,int mmu_idx);#define cpu_handle_mmu_fault cpu_cris_handle_mmu_fault#if defined(CONFIG_USER_ONLY ) -static inline void cpu_clone_regs (CPUState *env,target_ulong newsp) +static inline void cpu_clone_regs (CPUCRISState *env,target_ulong newsp) {if (newsp) env->regs[14 ] = newsp;
@@ -260,7 +260,7 @@ static inline void cpu_set_tls(CPUCRISState *env, target_ulong newtls)#include "cpu-all.h" -static inline void cpu_get_tb_cpu_state (CPUState *env,target_ulong *pc, +static inline void cpu_get_tb_cpu_state (CPUCRISState *env,target_ulong *pc,target_ulong *cs_base,int *flags) { *pc = env->pc;
@@ -273,14 +273,14 @@ static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc,#define cpu_list cris_cpu_listvoid cris_cpu_list (FILE *f,fprintf_function cpu_fprintf); -static inline bool cpu_has_work (CPUState *env) +static inline bool cpu_has_work (CPUCRISState *env) {return env->interrupt_request & (CPU_INTERRUPT_HARD |CPU_INTERRUPT_NMI ); }#include "exec-all.h" -static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) +static inline void cpu_pc_from_tb (CPUCRISState *env,TranslationBlock *tb) { env->pc = tb->pc; }
target-cris/helper.c +7 -7
@@ -36,13 +36,13 @@#if defined(CONFIG_USER_ONLY ) -void do_interrupt (CPUState *env) +void do_interrupt (CPUCRISState *env) { env->exception_index =-1 ; env->pregs[PR_ERP ] = env->pc; } -int cpu_cris_handle_mmu_fault (CPUState * env,target_ulong address,int rw, +int cpu_cris_handle_mmu_fault (CPUCRISState * env,target_ulong address,int rw,int mmu_idx) { env->exception_index =0xaa ;
@@ -54,7 +54,7 @@ int cpu_cris_handle_mmu_fault(CPUState * env, target_ulong address, int rw,#else /* !CONFIG_USER_ONLY */ -static void cris_shift_ccs (CPUState *env) +static void cris_shift_ccs (CPUCRISState *env) {uint32_t ccs;/* Apply the ccs shift. */
@@ -63,7 +63,7 @@ static void cris_shift_ccs(CPUState *env) env->pregs[PR_CCS ] = ccs; } -int cpu_cris_handle_mmu_fault (CPUState *env,target_ulong address,int rw, +int cpu_cris_handle_mmu_fault (CPUCRISState *env,target_ulong address,int rw,int mmu_idx) {struct cris_mmu_result res;
@@ -106,7 +106,7 @@ int cpu_cris_handle_mmu_fault (CPUState *env, target_ulong address, int rw,return r; } -static void do_interruptv10 (CPUState *env) +static void do_interruptv10 (CPUCRISState *env) {int ex_vec =-1 ;
@@ -162,7 +162,7 @@ static void do_interruptv10(CPUState *env) env->pregs[PR_ERP]); } -void do_interrupt (CPUState *env) +void do_interrupt (CPUCRISState *env) {int ex_vec =-1 ;
@@ -246,7 +246,7 @@ void do_interrupt(CPUState *env) env->pregs[PR_ERP]); } -target_phys_addr_t cpu_get_phys_page_debug (CPUState * env,target_ulong addr) +target_phys_addr_t cpu_get_phys_page_debug (CPUCRISState * env,target_ulong addr) {uint32_t phy = addr;struct cris_mmu_result res;
target-cris/mmu.c +7 -7
@@ -31,7 +31,7 @@#define D_LOG (...) do { } while (0)#endif -void cris_mmu_init (CPUState *env) +void cris_mmu_init (CPUCRISState *env) { env->mmu_rand_lfsr =0xcccc ; }
@@ -49,7 +49,7 @@ static inline unsigned int compute_polynom(unsigned int sr)return f; } -static void cris_mmu_update_rand_lfsr (CPUState *env) +static void cris_mmu_update_rand_lfsr (CPUCRISState *env) {unsigned int f;
@@ -70,7 +70,7 @@ static inline int cris_mmu_segmented_addr(int seg, uint32_t rw_mm_cfg)return (1 << seg) & rw_mm_cfg; } -static uint32_t cris_mmu_translate_seg (CPUState *env,int seg) +static uint32_t cris_mmu_translate_seg (CPUCRISState *env,int seg) {uint32_t base;int i;
@@ -106,7 +106,7 @@ static inline void set_field(uint32_t *dst, unsigned int val, }#ifdef DEBUG -static void dump_tlb (CPUState *env,int mmu) +static void dump_tlb (CPUCRISState *env,int mmu) {int set;int idx;
@@ -128,7 +128,7 @@ static void dump_tlb(CPUState *env, int mmu)/* rw 0 = read, 1 = write, 2 = exec. */ static int cris_mmu_translate_page (struct cris_mmu_result *res, -CPUState *env,uint32_t vaddr, +CPUCRISState *env,uint32_t vaddr,int rw,int usermode,int debug) {unsigned int vpage;
@@ -288,7 +288,7 @@ static int cris_mmu_translate_page(struct cris_mmu_result *res,return !match; } -void cris_mmu_flush_pid (CPUState *env,uint32_t pid) +void cris_mmu_flush_pid (CPUCRISState *env,uint32_t pid) {target_ulong vaddr;unsigned int idx;
@@ -323,7 +323,7 @@ void cris_mmu_flush_pid(CPUState *env, uint32_t pid) }int cris_mmu_translate (struct cris_mmu_result *res, -CPUState *env,uint32_t vaddr, +CPUCRISState *env,uint32_t vaddr,int rw,int mmu_idx,int debug) {int seg;
target-cris/mmu.h +3 -3
@@ -10,8 +10,8 @@ struct cris_mmu_resultint bf_vec; }; -void cris_mmu_init (CPUState *env); -void cris_mmu_flush_pid (CPUState *env,uint32_t pid); +void cris_mmu_init (CPUCRISState *env); +void cris_mmu_flush_pid (CPUCRISState *env,uint32_t pid);int cris_mmu_translate (struct cris_mmu_result *res, -CPUState *env,uint32_t vaddr, +CPUCRISState *env,uint32_t vaddr,int rw,int mmu_idx,int debug);
target-cris/op_helper.c +3 -3
@@ -56,11 +56,11 @@NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */ /* XXX: fix it to restore all registers */ -void tlb_fill (CPUState *env1,target_ulong addr,int is_write,int mmu_idx, +void tlb_fill (CPUCRISState *env1,target_ulong addr,int is_write,int mmu_idx,void *retaddr) {TranslationBlock *tb; -CPUState *saved_env; +CPUCRISState *saved_env;unsigned long pc;int ret;
@@ -201,7 +201,7 @@ void helper_movl_reg_sreg (uint32_t reg, uint32_t sreg) env->regs[reg] = env->sregs[srs][sreg]; } -static void cris_ccs_rshift (CPUState *env) +static void cris_ccs_rshift (CPUCRISState *env) {uint32_t ccs;
target-cris/translate.c +23 -23
131 lines not on this page · raw message
target-cris/translate_v10.c +13 -13
@@ -1253,47 +1253,47 @@ static unsigned int crisv10_decoder(DisasContext *dc)return insn_len; } -static CPUCRISState *cpu_crisv10_init (CPUState *env) +static CPUCRISState *cpu_crisv10_init (CPUCRISState *env) {int i; cpu_env =tcg_global_reg_new_ptr (TCG_AREG0 ,"env" ); cc_x =tcg_global_mem_new (TCG_AREG0 , - offsetof(CPUState , cc_x),"cc_x" ); + offsetof(CPUCRISState , cc_x),"cc_x" ); cc_src =tcg_global_mem_new (TCG_AREG0 , - offsetof(CPUState , cc_src),"cc_src" ); + offsetof(CPUCRISState , cc_src),"cc_src" ); cc_dest =tcg_global_mem_new (TCG_AREG0 , - offsetof(CPUState , cc_dest), + offsetof(CPUCRISState , cc_dest),"cc_dest" ); cc_result =tcg_global_mem_new (TCG_AREG0 , - offsetof(CPUState , cc_result), + offsetof(CPUCRISState , cc_result),"cc_result" ); cc_op =tcg_global_mem_new (TCG_AREG0 , - offsetof(CPUState , cc_op),"cc_op" ); + offsetof(CPUCRISState , cc_op),"cc_op" ); cc_size =tcg_global_mem_new (TCG_AREG0 , - offsetof(CPUState , cc_size), + offsetof(CPUCRISState , cc_size),"cc_size" ); cc_mask =tcg_global_mem_new (TCG_AREG0 , - offsetof(CPUState , cc_mask), + offsetof(CPUCRISState , cc_mask),"cc_mask" ); env_pc =tcg_global_mem_new (TCG_AREG0 , - offsetof(CPUState , pc), + offsetof(CPUCRISState , pc),"pc" ); env_btarget =tcg_global_mem_new (TCG_AREG0 , - offsetof(CPUState , btarget), + offsetof(CPUCRISState , btarget),"btarget" ); env_btaken =tcg_global_mem_new (TCG_AREG0 , - offsetof(CPUState , btaken), + offsetof(CPUCRISState , btaken),"btaken" );for (i =0 ; i <16 ; i++) { cpu_R[i] =tcg_global_mem_new (TCG_AREG0 , - offsetof(CPUState, regs[i]), + offsetof(CPUCRISState, regs[i]), regnames_v10[i]); }for (i =0 ; i <16 ; i++) { cpu_PR[i] =tcg_global_mem_new (TCG_AREG0 , - offsetof(CPUState, pregs[i]), + offsetof(CPUCRISState, pregs[i]), pregnames_v10[i]); }
Signature · 1 line
1.7.7
RFC PATCH v4 11/44 darwin-user: Don't overuse CPUState
In reply to Andreas FärberUse CPU*State where applicable.
--- darwin-user/main.c | 14 +++++++------- darwin-user/signal.c | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-)
darwin-user/main.c +7 -7
@@ -77,38 +77,38 @@ int cpu_get_pic_interrupt(CPUState *env) }#ifdef TARGET_PPC -static inline uint64_t cpu_ppc_get_tb (CPUState *env) +static inline uint64_t cpu_ppc_get_tb (CPUPPCState *env) {/* TO FIX */ return 0 ; } -uint64_t cpu_ppc_load_tbl (CPUState *env) +uint64_t cpu_ppc_load_tbl (CPUPPCState *env) {return cpu_ppc_get_tb (env); } -uint32_t cpu_ppc_load_tbu (CPUState *env) +uint32_t cpu_ppc_load_tbu (CPUPPCState *env) {return cpu_ppc_get_tb (env) >>32 ; } -uint64_t cpu_ppc_load_atbl (CPUState *env) +uint64_t cpu_ppc_load_atbl (CPUPPCState *env) {return cpu_ppc_get_tb (env); } -uint32_t cpu_ppc_load_atbu (CPUState *env) +uint32_t cpu_ppc_load_atbu (CPUPPCState *env) {return cpu_ppc_get_tb (env) >>32 ; } -uint32_t cpu_ppc601_load_rtcu (CPUState *env) +uint32_t cpu_ppc601_load_rtcu (CPUPPCState *env) {cpu_ppc_load_tbu (env); } -uint32_t cpu_ppc601_load_rtcl (CPUState *env) +uint32_t cpu_ppc601_load_rtcl (CPUPPCState *env) {return cpu_ppc_load_tbl (env) &0x3FFFFF80 ; }
darwin-user/signal.c +2 -2
@@ -315,7 +315,7 @@ get_sigframe(struct emulated_sigaction *ka, CPUX86State *env, size_t frame_size) }static void setup_frame (int sig,struct emulated_sigaction *ka, -void *set,CPUState *env) +void *set,CPUX86State *env) {void *frame;
@@ -336,7 +336,7 @@ give_sigsegv:force_sig (SIGSEGV /* , current */ ); } -long do_sigreturn (CPUState *env,int num) +long do_sigreturn (CPUX86State *env,int num) {int i =0 ;struct target_sigcontext *scp =get_int_arg (&i, env);
Signature · 1 line
1.7.7
v4 cover Introduce QOM CPU
In reply to Andreas FärberHello,
This is a heavily rebased and redone series introducing a QOM CPU base class. It now avoids the name conflict between typedef struct CPU CPU and CPU(obj) by freeing the identifier CPUState.
Patch 1 is a patch by Alex that removes some unused occurrences of cpu_reset(). Patch 2 renames cpu_reset() to avoid workarounds such as previous cpu_do_reset(). These two have no dependency on the CPUState/CPU() issue under discussion and could be applied independently.
Patches 3-12 are hand-crafted patches converting CPUState uses to the appropriate CPU*State and prepare for mass conversion from CPUState to CPU*State.
Patches 13-43 are scripted conversions, separated by architecture, cf. below.
Patch 44 introduces CPUClass, CPU() and reintroduces a new CPUState.
Available at:
http://repo.or.cz/w/qemu/afaerber.git/shortlog/refs/heads/qom-cpu.v4
Regards,
Andreas
v3 -> v4:
* Rebased on top of type_init() v2, qom-user v4 and ppc405 cleanup.
* Rename cpu_reset() to cpu_state_reset(), so that cpu_reset() can be used for CPU class in place of cpu_do_reset() (suggested by Anthony).
* Use container_of() for CPUState -> CPU macros (suggested by Anthony).
* Resolve name conflict between struct CPU and CPU(obj) by renaming CPUState to CPUArchState and by restricting its use to places that must be replaced with new CPUState after all targets are converted.
v2 -> v3:
* Rebased against qom-upstream.14 branch (and that against master).
* Move cpu.c from hw/ to qom/ (built only once).
* Use proper GPL headers.
v1 -> v2:
* Drop processor_init() and MODULE_INIT_CPU in favor of MODULE_INIT_DEVICE.
* Prepare cast macros for CPU.
* Add documentation.
* Prepare reset callback.
---8<---
#!/bin/sh
for arch in find . -maxdepth 1 -name "target-*" | cut -d- -f2 | sort; do
case $arch in
"alpha") dest=CPUAlphaState ;;
"arm") dest=CPUARMState ;;
"cris") dest=CPUCRISState ;;
"i386") dest=CPUX86State ;;
"lm32") dest=CPULM32State ;;
"m68k") dest=CPUM68KState ;;
"microblaze") dest=CPUMBState ;;
"mips") dest=CPUMIPSState ;;
"ppc") dest=CPUPPCState ;;
"s390x") dest=CPUS390XState ;;
"sh4") dest=CPUSH4State ;;
"sparc") dest=CPUSPARCState ;;
"unicore32") dest=CPUUniCore32State ;;
"xtensa") dest=CPUXtensaState ;;
esac
sed --in-place "s/CPUState/$dest/g" target-$arch/*.[hc]
sed --in-place "s/#define $dest/#define CPUState/" target-$arch/cpu.h
git commit --all --signoff --no-verify --file=- <<EOMtarget-$arch: Don't overuse CPUState
Scripted conversion:
sed -i "s/CPUState/$dest/g" target-$arch/*.[hc]
sed -i "s/#define $dest/#define CPUState/" target-$arch/cpu.h
EOM
done
for arch in arm m68k xtensa; do
case $arch in
"arm") dest=CPUARMState ;;
"m68k") dest=CPUM68KState ;;
"xtensa") dest=CPUXtensaState ;;
esac
sed --in-place "s/CPUState/$dest/g" $arch-semi.c
git commit --all --signoff --no-verify --file=- <<EOM$arch-semi: Don't use CPUState
Scripted conversion:
sed -i "s/CPUState/$dest/g" $arch-semi.c
EOM
done
INPUTS="hw/alpha_*.[hc]"
sed --in-place "s/CPUState/CPUAlphaState/g" $INPUTS git commit --all --signoff --no-verify --file=- <<EOM alpha hw/: Don't use CPUState
Scripted conversion:
for file in $INPUTS; do
sed -i "s/CPUState/CPUAlphaState/g" \$file
done
EOM
INPUTS="hw/arm-misc.h hw/arm_boot.c hw/arm_pic.c"
INPUTS="$INPUTS hw/armv7m.c hw/exynos4210.h hw/highbank.c hw/integratorcp.c hw/musicpal.c" INPUTS="$INPUTS hw/omap.h hw/pxa.h hw/pxa2xx_gpio.c hw/pxa2xx_pic.c hw/realview.c" INPUTS="$INPUTS hw/strongarm.h hw/versatilepb.c hw/vexpress.c " INPUTS="$INPUTS hw/xilinx_zynq.c "
for file in $INPUTS; do
sed --in-place "s/CPUState/CPUARMState/g" $file
done
git commit --all --signoff --no-verify --file=- <<EOM arm hw/: Don't use CPUState
Scripted conversion:
for file in $INPUTS; do
sed -i "s/CPUState/CPUARMState/g" \$file
done
EOM
INPUTS="hw/cris-boot.[hc] hw/cris_pic_cpu.c hw/axis_dev88.c hw/etraxfs.h hw/etraxfs_ser.c"
for file in $INPUTS; do
sed --in-place "s/CPUState/CPUCRISState/g" $file
done
git commit --all --signoff --no-verify --file=- <<EOM cris hw/: Don't use CPUState
Scripted conversion:
for file in $INPUTS; do
sed -i "s/CPUState/CPUCRISState/g" \$file
done
EOM
INPUTS="hw/apic.h hw/kvm/apic.c hw/kvmvapic.c hw/pc.c hw/vmport.c hw/xen_machine_pv.c"
for file in $INPUTS; do
sed --in-place "s/CPUState/CPUX86State/g" $file
done
git commit --all --signoff --no-verify --file=- <<EOM i386 hw/: Don't use CPUState
Scripted conversion:
for file in $INPUTS; do
sed -i "s/CPUState/CPUX86State/g" \$file
done
EOM
INPUTS="hw/lm32_boards.c hw/milkymist.c"
for file in $INPUTS; do
sed --in-place "s/CPUState/CPULM32State/g" $file
done
git commit --all --signoff --no-verify --file=- <<EOM lm32 hw/: Don't use CPUState
Scripted conversion:
for file in $INPUTS; do
sed -i "s/CPUState/CPULM32State/g" \$file
done
EOM
INPUTS="hw/an5206.c hw/dummy_m68k.c hw/mcf.h hw/mcf5206.c hw/mcf5208.c hw/mcf_intc.c"
for file in $INPUTS; do
sed --in-place "s/CPUState/CPUM68KState/g" $file
done
git commit --all --signoff --no-verify --file=- <<EOM m68k hw/: Don't use CPUState
Scripted conversion:
for file in $INPUTS; do
sed -i "s/CPUState/CPUM68KState/g" \$file
done
EOM
INPUTS="hw/microblaze_*.[hc]"
INPUTS="$INPUTS hw/petalogix_ml605_mmu.c hw/petalogix_s3adsp1800_mmu.c"
for file in $INPUTS; do
sed --in-place "s/CPUState/CPUMBState/g" $file
done
git commit --all --signoff --no-verify --file=- <<EOM microblaze hw/: Don't use CPUState
Scripted conversion:
for file in $INPUTS; do
sed -i "s/CPUState/CPUMBState/g" \$file
done
EOM
INPUTS="hw/mips_*.[hc]"
for file in $INPUTS; do
sed --in-place "s/CPUState/CPUMIPSState/g" $file
done
git commit --all --signoff --no-verify --file=- <<EOM mips hw/: Don't use CPUState
Scripted conversion:
for file in $INPUTS; do
sed -i "s/CPUState/CPUMIPSState/g" \$file
done
EOM
INPUTS="hw/ppc*.[hc] hw/mpc8544_guts.c hw/spapr*.[hc] hw/virtex_ml507.c hw/xics.c"
for file in $INPUTS; do
sed --in-place "s/CPUState/CPUPPCState/g" $file
done
git commit --all --signoff --no-verify --file=- <<EOM ppc hw/: Don't use CPUState
Scripted conversion:
for file in $INPUTS; do
sed -i "s/CPUState/CPUPPCState/g" \$file
done
EOM
INPUTS="hw/s390-*.[hc]"
for file in $INPUTS; do
sed --in-place "s/CPUState/CPUS390XState/g" $file
done
git commit --all --signoff --no-verify --file=- <<EOM s390x hw/: Don't use CPUState
Scripted conversion:
for file in $INPUTS; do
sed -i "s/CPUState/CPUS390XState/g" \$file
done
EOM
INPUTS="hw/sh.h hw/shix.c hw/r2d.c"
for file in $INPUTS; do
sed --in-place "s/CPUState/CPUSH4State/g" $file
done
git commit --all --signoff --no-verify --file=- <<EOM sh4 hw/: Don't use CPUState
Scripted conversion:
for file in $INPUTS; do
sed -i "s/CPUState/CPUSH4State/g" \$file
done
EOM
INPUTS="hw/sun4m.c hw/sun4u.c hw/grlib.h hw/leon3.c"
for file in $INPUTS; do
sed --in-place "s/CPUState/CPUSPARCState/g" $file
done
git commit --all --signoff --no-verify --file=- <<EOM sparc hw/: Don't use CPUState
Scripted conversion:
for file in $INPUTS; do
sed -i "s/CPUState/CPUSPARCState/g" \$file
done
EOM
INPUTS="hw/xtensa_*.[hc]"
for file in $INPUTS; do
sed --in-place "s/CPUState/CPUXtensaState/g" $file
done
git commit --all --signoff --no-verify --file=- <<EOM xtensa hw/: Don't use CPUState
Scripted conversion:
for file in $INPUTS; do
sed -i "s/CPUState/CPUXtensaState/g" \$file
done
EOM
#exit
INPUTS="*.[hc] hw/*.[hc] hw/kvm/*.[hc]" INPUTS="$INPUTS linux-user/*.[hc] linux-user/m68k/*.[hc]" INPUTS="$INPUTS bsd-user/*.[hc]"
INPUTS="$INPUTS darwin-user/*.[hc]" INPUTS="$INPUTS tcg/*/*.[hc]"
INPUTS="$INPUTS target-*/cpu.h"
for input in $INPUTS; do
sed --in-place "s/CPUState/CPUArchState/g" $input
done
git commit --all --no-verify --signoff --file=- <<EOM Rename CPUState -> CPUArchState
EOM
---8<---
Alexander Graf (1):
PPC: 405: Use proper CPU reset
Andreas Färber (43):
Rename cpu_reset() to cpu_state_reset()
monitor: Don't access registers through CPUState
monitor: Avoid CPUState in read/write functions
target-lm32: Typedef struct CPULM32State
target-microblaze: Typedef struct CPUMBState
target-sparc: Typedef struct CPUSPARCState early
target-unicore32: Rename to CPUUniCore32State hw/mc146818: Drop unneeded #includes
linux-user: Don't overuse CPUState
darwin-user: Don't overuse CPUState
bsd-user: Don't overuse CPUState
target-alpha: Don't overuse CPUState
target-arm: Don't overuse CPUState
target-cris: Don't overuse CPUState
target-i386: Don't overuse CPUState
target-lm32: Don't overuse CPUState
target-m68k: Don't overuse CPUState
target-microblaze: Don't overuse CPUState
target-mips: Don't overuse CPUState
target-ppc: Don't overuse CPUState
target-s390x: Don't overuse CPUState
target-sh4: Don't overuse CPUState
target-sparc: Don't overuse CPUState
target-unicore32: Don't overuse CPUState
target-xtensa: Don't overuse CPUState
arm-semi: Don't use CPUState
m68k-semi: Don't use CPUState
xtensa-semi: Don't use CPUState
alpha hw/: Don't use CPUState
arm hw/: Don't use CPUState
cris hw/: Don't use CPUState
i386 hw/: Don't use CPUState
lm32 hw/: Don't use CPUState
m68k hw/: Don't use CPUState
microblaze hw/: Don't use CPUState
mips hw/: Don't use CPUState
ppc hw/: Don't use CPUState
s390x hw/: Don't use CPUState
sh4 hw/: Don't use CPUState
sparc hw/: Don't use CPUState
xtensa hw/: Don't use CPUState
Rename CPUState -> CPUArchState
qom: Introduce CPU class
Makefile.objs | 3 + arm-semi.c | 10 +- bsd-user/main.c | 14 +- bsd-user/qemu.h | 12 +- bsd-user/signal.c | 2 +- configure | 1 + cpu-all.h | 56 ++-- cpu-defs.h | 2 +- cpu-exec.c | 20 +- cpus.c | 76 +++--- darwin-user/main.c | 22 +- darwin-user/qemu.h | 6 +- darwin-user/signal.c | 8 +- def-helper.h | 2 +- disas.c | 4 +- disas.h | 2 +- dyngen-exec.h | 4 +- exec-all.h | 38 ++-- exec.c | 114 +++++----- gdbstub.c | 100 ++++---- gdbstub.h | 16 +- gen-icount.h | 8 +- hw/alpha_dp264.c | 2 +- hw/alpha_sys.h | 2 +- hw/alpha_typhoon.c | 14 +- hw/an5206.c | 2 +- hw/apic.h | 2 +- hw/arm-misc.h | 8 +- hw/arm_boot.c | 10 +- hw/arm_pic.c | 4 +- hw/armv7m.c | 4 +- hw/axis_dev88.c | 2 +- hw/cris-boot.c | 6 +- hw/cris-boot.h | 2 +- hw/cris_pic_cpu.c | 4 +- hw/dummy_m68k.c | 2 +- hw/etraxfs.h | 2 +- hw/etraxfs_ser.c | 4 +- hw/exynos4210.h | 2 +- hw/grlib.h | 2 +- hw/highbank.c | 8 +- hw/integratorcp.c | 2 +- hw/kvm/apic.c | 2 +- hw/kvmvapic.c | 22 +- hw/leon3.c | 10 +- hw/lm32_boards.c | 12 +- hw/mc146818rtc.c | 2 - hw/mcf.h | 4 +- hw/mcf5206.c | 4 +- hw/mcf5208.c | 2 +- hw/mcf_intc.c | 4 +- hw/microblaze_boot.c | 10 +- hw/microblaze_boot.h | 4 +- hw/microblaze_pic_cpu.c | 4 +- hw/microblaze_pic_cpu.h | 2 +- hw/milkymist.c | 10 +- hw/mips_cpudevs.h | 4 +- hw/mips_fulong2e.c | 12 +- hw/mips_int.c | 6 +- hw/mips_jazz.c | 8 +- hw/mips_malta.c | 12 +- hw/mips_mipssim.c | 8 +- hw/mips_r4k.c | 8 +- hw/mips_timer.c | 20 +- hw/mpc8544_guts.c | 2 +- hw/musicpal.c | 2 +- hw/omap.h | 2 +- hw/omap1.c | 2 +- hw/omap2.c | 2 +- hw/pc.c | 22 +- hw/petalogix_ml605_mmu.c | 4 +- hw/petalogix_s3adsp1800_mmu.c | 4 +- hw/ppc.c | 123 +++++----- hw/ppc.h | 28 +- hw/ppc405.h | 8 +- hw/ppc405_uc.c | 50 ++--- hw/ppc440_bamboo.c | 8 +- hw/ppc4xx.h | 8 +- hw/ppc4xx_devs.c | 17 +- hw/ppc_booke.c | 20 +- hw/ppc_newworld.c | 11 +- hw/ppc_oldworld.c | 11 +- hw/ppc_prep.c | 13 +- hw/ppce500_mpc8544ds.c | 16 +- hw/ppce500_spin.c | 8 +- hw/pxa.h | 6 +- hw/pxa2xx.c | 2 +- hw/pxa2xx_gpio.c | 4 +- hw/pxa2xx_pic.c | 4 +- hw/r2d.c | 8 +- hw/realview.c | 2 +- hw/s390-virtio-bus.c | 6 +- hw/s390-virtio.c | 16 +- hw/sh.h | 2 +- hw/shix.c | 2 +- hw/spapr.c | 17 +- hw/spapr.h | 4 +- hw/spapr_hcall.c | 42 ++-- hw/spapr_llan.c | 10 +- hw/spapr_rtas.c | 4 +- hw/spapr_vio.c | 12 +- hw/spapr_vty.c | 4 +- hw/strongarm.h | 2 +- hw/sun4m.c | 16 +- hw/sun4u.c | 26 +- hw/versatilepb.c | 2 +- hw/vexpress.c | 4 +- hw/virtex_ml507.c | 12 +- hw/vmport.c | 12 +- hw/xen_machine_pv.c | 2 +- hw/xics.c | 10 +- hw/xilinx_zynq.c | 2 +- hw/xtensa_lx60.c | 10 +- hw/xtensa_pic.c | 16 +- hw/xtensa_sim.c | 4 +- include/qemu/cpu.h | 75 ++++++ kvm-all.c | 54 ++-- kvm-stub.c | 22 +- kvm.h | 60 +++--- linux-user/elfload.c | 40 ++-- linux-user/m68k/syscall.h | 2 +- linux-user/main.c | 44 ++-- linux-user/qemu.h | 14 +- linux-user/signal.c | 217 +++++++++-------- linux-user/syscall.c | 30 ++-- m68k-semi.c | 4 +- monitor.c | 544 ++++++++++++++++++++-------------------- poison.h | 2 +- qom/Makefile | 1 + qom/cpu.c | 58 +++++ softmmu-semi.h | 12 +- target-alpha/cpu.h | 26 +- target-alpha/helper.c | 18 +- target-alpha/machine.c | 44 ++-- target-alpha/op_helper.c | 6 +- target-alpha/translate.c | 56 ++-- target-arm/cpu.h | 12 +- target-arm/helper.c | 120 +++++----- target-arm/iwmmxt_helper.c | 66 +++--- target-arm/neon_helper.c | 88 ++++---- target-arm/op_helper.c | 6 +- target-arm/translate.c | 104 ++++---- target-cris/cpu.h | 14 +- target-cris/helper.c | 14 +- target-cris/mmu.c | 14 +- target-cris/mmu.h | 6 +- target-cris/op_helper.c | 6 +- target-cris/translate.c | 50 ++-- target-cris/translate_v10.c | 26 +- target-i386/cpu.h | 36 ++-- target-i386/helper.c | 40 ++-- target-i386/kvm.c | 76 +++--- target-i386/machine.c | 172 +++++++------- target-i386/op_helper.c | 34 ++-- target-i386/translate.c | 82 +++--- target-lm32/cpu.h | 31 ++-- target-lm32/helper.c | 18 +- target-lm32/machine.c | 22 +- target-lm32/op_helper.c | 4 +- target-lm32/translate.c | 38 ++-- target-m68k/cpu.h | 18 +- target-m68k/helper.c | 82 +++--- target-m68k/op_helper.c | 20 +- target-m68k/translate.c | 16 +- target-microblaze/cpu.h | 33 ++-- target-microblaze/helper.c | 10 +- target-microblaze/mmu.c | 8 +- target-microblaze/mmu.h | 6 +- target-microblaze/op_helper.c | 8 +- target-microblaze/translate.c | 54 ++-- target-mips/cpu.h | 42 ++-- target-mips/helper.c | 26 +- target-mips/machine.c | 4 +- target-mips/op_helper.c | 124 +++++----- target-mips/translate.c | 360 ++++++++++++++-------------- target-ppc/cpu.h | 43 ++-- target-ppc/helper.c | 82 +++--- target-ppc/kvm.c | 38 ++-- target-ppc/kvm_ppc.h | 12 +- target-ppc/machine.c | 4 +- target-ppc/op_helper.c | 12 +- target-ppc/translate.c | 78 +++--- target-ppc/translate_init.c | 42 ++-- target-s390x/cpu.h | 48 ++-- target-s390x/helper.c | 42 ++-- target-s390x/kvm.c | 56 ++-- target-s390x/op_helper.c | 70 +++--- target-s390x/translate.c | 56 ++-- target-sh4/cpu.h | 12 +- target-sh4/helper.c | 28 +- target-sh4/op_helper.c | 4 +- target-sh4/translate.c | 50 ++-- target-sparc/cc_helper.c | 66 +++--- target-sparc/cpu.h | 64 +++--- target-sparc/cpu_init.c | 4 +- target-sparc/fop_helper.c | 68 +++--- target-sparc/helper.c | 16 +- target-sparc/int32_helper.c | 6 +- target-sparc/int64_helper.c | 12 +- target-sparc/ldst_helper.c | 16 +- target-sparc/machine.c | 4 +- target-sparc/mmu_helper.c | 28 +- target-sparc/op_helper.c | 4 +- target-sparc/translate.c | 80 +++--- target-sparc/win_helper.c | 58 +++--- target-unicore32/cpu.h | 32 ++-- target-unicore32/helper.c | 62 +++--- target-unicore32/op_helper.c | 8 +- target-unicore32/translate.c | 60 +++--- target-xtensa/cpu.h | 46 ++-- target-xtensa/helper.c | 42 ++-- target-xtensa/op_helper.c | 30 ++-- target-xtensa/translate.c | 22 +- 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 +- xtensa-semi.c | 2 +- 229 files changed, 3142 insertions(+), 2978 deletions(-) create mode 100644 include/qemu/cpu.h create mode 100644 qom/cpu.c
Signature · 1 line
1.7.7
RFC PATCH v4 19/44 target-microblaze: Don't overuse CPUState
Scripted conversion:
sed -i "s/CPUState/CPUMBState/g" target-microblaze/*.[hc] sed -i "s/#define CPUMBState/#define CPUState/" target-microblaze/cpu.h
--- target-microblaze/cpu.h | 30 +++++++++++----------- target-microblaze/helper.c | 10 ++++---- target-microblaze/mmu.c | 8 +++--- target-microblaze/mmu.h | 6 ++-- target-microblaze/op_helper.c | 8 +++--- target-microblaze/translate.c | 52 ++++++++++++++++++++-------------------- 6 files changed, 57 insertions(+), 57 deletions(-)
target-microblaze/cpu.h +15 -15
@@ -250,7 +250,7 @@ typedef struct CPUMBState {#define DRTE_FLAG (1 << 17)#define DRTB_FLAG (1 << 18)#define D_FLAG (1 << 19)/* Bit in ESR. */ -/* TB dependent CPUState. */ +/* TB dependent CPUMBState. */ #define IFLAGS_TB_MASK (D_FLAG | IMM_FLAG | DRTI_FLAG | DRTE_FLAG | DRTB_FLAG)uint32_t iflags;
@@ -266,10 +266,10 @@ typedef struct CPUMBState { CPU_COMMON } CPUMBState; -CPUState *cpu_mb_init (const char *cpu_model); -int cpu_mb_exec (CPUState *s); -void cpu_mb_close (CPUState *s); -void do_interrupt (CPUState *env); +CPUMBState *cpu_mb_init (const char *cpu_model); +int cpu_mb_exec (CPUMBState *s); +void cpu_mb_close (CPUMBState *s); +void do_interrupt (CPUMBState *env);/* you can call this signal handler from your SIGBUS and SIGSEGV signal handlers to inform the virtual CPU of exceptions. non zero is returned if the signal was handled by the virtual CPU. */
@@ -305,7 +305,7 @@ enum {#define MMU_USER_IDX 2/* See NB_MMU_MODES further up the file. */ -static inline int cpu_mmu_index (CPUState *env) +static inline int cpu_mmu_index (CPUMBState *env) {/* Are we in nommu mode?. */ if (!(env->sregs[SR_MSR ] &MSR_VM ))
@@ -316,12 +316,12 @@ static inline int cpu_mmu_index (CPUState *env)return MMU_KERNEL_IDX ; } -int cpu_mb_handle_mmu_fault (CPUState *env,target_ulong address,int rw, +int cpu_mb_handle_mmu_fault (CPUMBState *env,target_ulong address,int rw,int mmu_idx);#define cpu_handle_mmu_fault cpu_mb_handle_mmu_fault#if defined(CONFIG_USER_ONLY ) -static inline void cpu_clone_regs (CPUState *env,target_ulong newsp) +static inline void cpu_clone_regs (CPUMBState *env,target_ulong newsp) {if (newsp) env->regs[R_SP ] = newsp;
@@ -329,23 +329,23 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp) }#endif -static inline void cpu_set_tls (CPUState *env,target_ulong newtls) +static inline void cpu_set_tls (CPUMBState *env,target_ulong newtls) { } -static inline int cpu_interrupts_enabled (CPUState *env) +static inline int cpu_interrupts_enabled (CPUMBState *env) {return env->sregs[SR_MSR ] &MSR_IE ; }#include "cpu-all.h" -static inline target_ulong cpu_get_pc (CPUState *env) +static inline target_ulong cpu_get_pc (CPUMBState *env) {return env->sregs[SR_PC ]; } -static inline void cpu_get_tb_cpu_state (CPUState *env,target_ulong *pc, +static inline void cpu_get_tb_cpu_state (CPUMBState *env,target_ulong *pc,target_ulong *cs_base,int *flags) { *pc = env->sregs[SR_PC ];
@@ -355,18 +355,18 @@ static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc, }#if !defined(CONFIG_USER_ONLY ) -void cpu_unassigned_access (CPUState *env1,target_phys_addr_t addr, +void cpu_unassigned_access (CPUMBState *env1,target_phys_addr_t addr,int is_write,int is_exec,int is_asi,int size);#endif -static inline bool cpu_has_work (CPUState *env) +static inline bool cpu_has_work (CPUMBState *env) {return env->interrupt_request & (CPU_INTERRUPT_HARD |CPU_INTERRUPT_NMI ); }#include "exec-all.h" -static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) +static inline void cpu_pc_from_tb (CPUMBState *env,TranslationBlock *tb) { env->sregs[SR_PC ] = tb->pc; }
target-microblaze/helper.c +5 -5
@@ -25,13 +25,13 @@#if defined(CONFIG_USER_ONLY ) -void do_interrupt (CPUState *env) +void do_interrupt (CPUMBState *env) { env->exception_index =-1 ; env->regs[14 ] = env->sregs[SR_PC ]; } -int cpu_mb_handle_mmu_fault (CPUState * env,target_ulong address,int rw, +int cpu_mb_handle_mmu_fault (CPUMBState * env,target_ulong address,int rw,int mmu_idx) { env->exception_index =0xaa ;
@@ -41,7 +41,7 @@ int cpu_mb_handle_mmu_fault(CPUState * env, target_ulong address, int rw,#else /* !CONFIG_USER_ONLY */ -int cpu_mb_handle_mmu_fault (CPUState *env,target_ulong address,int rw, +int cpu_mb_handle_mmu_fault (CPUMBState *env,target_ulong address,int rw,int mmu_idx) {unsigned int hit;
@@ -107,7 +107,7 @@ int cpu_mb_handle_mmu_fault (CPUState *env, target_ulong address, int rw,return r; } -void do_interrupt (CPUState *env) +void do_interrupt (CPUMBState *env) {uint32_t t;
@@ -255,7 +255,7 @@ void do_interrupt(CPUState *env) } } -target_phys_addr_t cpu_get_phys_page_debug (CPUState * env,target_ulong addr) +target_phys_addr_t cpu_get_phys_page_debug (CPUMBState * env,target_ulong addr) {target_ulong vaddr, paddr =0 ;struct microblaze_mmu_lookup lu;
target-microblaze/mmu.c +4 -4
@@ -31,7 +31,7 @@ static unsigned int tlb_decode_size(unsigned int f)return sizes[f]; } -static void mmu_flush_idx (CPUState *env,unsigned int idx) +static void mmu_flush_idx (CPUMBState *env,unsigned int idx) {struct microblaze_mmu *mmu = &env->mmu;unsigned int tlb_size;
@@ -51,7 +51,7 @@ static void mmu_flush_idx(CPUState *env, unsigned int idx) } } -static void mmu_change_pid (CPUState *env,unsigned int newpid) +static void mmu_change_pid (CPUMBState *env,unsigned int newpid) {struct microblaze_mmu *mmu = &env->mmu;unsigned int i;
@@ -175,7 +175,7 @@ done: }/* Writes/reads to the MMU's special regs end up here. */ -uint32_t mmu_read (CPUState *env,uint32_t rn) +uint32_t mmu_read (CPUMBState *env,uint32_t rn) {unsigned int i;uint32_t r;
@@ -215,7 +215,7 @@ uint32_t mmu_read(CPUState *env, uint32_t rn)return r; } -void mmu_write (CPUState *env,uint32_t rn,uint32_t v) +void mmu_write (CPUMBState *env,uint32_t rn,uint32_t v) {unsigned int i;D (qemu_log ("%s rn=%d=%x old=%x\n" , __func__, rn, v, env->mmu.regs[rn]));
target-microblaze/mmu.h +3 -3
@@ -82,10 +82,10 @@ struct microblaze_mmu_lookup } err; }; -void mmu_flip_um (CPUState *env,unsigned int um); +void mmu_flip_um (CPUMBState *env,unsigned int um);unsigned int mmu_translate (struct microblaze_mmu *mmu,struct microblaze_mmu_lookup *lu,target_ulong vaddr,int rw,int mmu_idx); -uint32_t mmu_read (CPUState *env,uint32_t rn); -void mmu_write (CPUState *env,uint32_t rn,uint32_t v); +uint32_t mmu_read (CPUMBState *env,uint32_t rn); +void mmu_write (CPUMBState *env,uint32_t rn,uint32_t v);void mmu_init (struct microblaze_mmu *mmu);
target-microblaze/op_helper.c +4 -4
@@ -42,11 +42,11 @@NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */ /* XXX: fix it to restore all registers */ -void tlb_fill (CPUState *env1,target_ulong addr,int is_write,int mmu_idx, +void tlb_fill (CPUMBState *env1,target_ulong addr,int is_write,int mmu_idx,void *retaddr) {TranslationBlock *tb; -CPUState *saved_env; +CPUMBState *saved_env;unsigned long pc;int ret;
@@ -506,10 +506,10 @@ void helper_mmu_write(uint32_t rn, uint32_t v)mmu_write (env, rn, v); } -void cpu_unassigned_access (CPUState *env1,target_phys_addr_t addr, +void cpu_unassigned_access (CPUMBState *env1,target_phys_addr_t addr,int is_write,int is_exec,int is_asi,int size) { -CPUState *saved_env; +CPUMBState *saved_env; saved_env = env; env = env1;
target-microblaze/translate.c +26 -26
167 lines not on this page · raw message
Signature · 1 line
1.7.7
RFC PATCH v4 14/44 target-arm: Don't overuse CPUState
In reply to Andreas FärberScripted conversion:
sed -i "s/CPUState/CPUARMState/g" target-arm/*.[hc] sed -i "s/#define CPUARMState/#define CPUState/" target-arm/cpu.h
--- target-arm/cpu.h | 10 ++-- target-arm/helper.c | 116 ++++++++++++++++++++++---------------------- target-arm/iwmmxt_helper.c | 66 ++++++++++++------------ target-arm/neon_helper.c | 88 +++++++++++++++++----------------- target-arm/op_helper.c | 6 +- target-arm/translate.c | 104 ++++++++++++++++++++-------------------- 6 files changed, 195 insertions(+), 195 deletions(-)
target-arm/cpu.h +5 -5
@@ -461,13 +461,13 @@ void cpu_arm_set_cp_io(CPUARMState *env, int cpnum,#define MMU_MODE0_SUFFIX _kernel#define MMU_MODE1_SUFFIX _user#define MMU_USER_IDX 1 -static inline int cpu_mmu_index (CPUState *env) +static inline int cpu_mmu_index (CPUARMState *env) {return (env->uncached_cpsr &CPSR_M ) ==ARM_CPU_MODE_USR ?1 :0 ; }#if defined(CONFIG_USER_ONLY ) -static inline void cpu_clone_regs (CPUState *env,target_ulong newsp) +static inline void cpu_clone_regs (CPUARMState *env,target_ulong newsp) {if (newsp) env->regs[13 ] = newsp;
@@ -506,7 +506,7 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp)#define ARM_TBFLAG_CONDEXEC (F ) \ (((F) & ARM_TBFLAG_CONDEXEC_MASK) >> ARM_TBFLAG_CONDEXEC_SHIFT) -static inline void cpu_get_tb_cpu_state (CPUState *env,target_ulong *pc, +static inline void cpu_get_tb_cpu_state (CPUARMState *env,target_ulong *pc,target_ulong *cs_base,int *flags) {int privmode;
@@ -529,7 +529,7 @@ static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc, } } -static inline bool cpu_has_work (CPUState *env) +static inline bool cpu_has_work (CPUARMState *env) {return env->interrupt_request & (CPU_INTERRUPT_FIQ |CPU_INTERRUPT_HARD |CPU_INTERRUPT_EXITTB );
@@ -537,7 +537,7 @@ static inline bool cpu_has_work(CPUState *env)#include "exec-all.h" -static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) +static inline void cpu_pc_from_tb (CPUARMState *env,TranslationBlock *tb) { env->regs[15 ] = tb->pc; }
target-arm/helper.c +58 -58
445 lines not on this page · raw message
target-arm/iwmmxt_helper.c +33 -33
264 lines not on this page · raw message
target-arm/neon_helper.c +44 -44
352 lines not on this page · raw message
target-arm/op_helper.c +3 -3
@@ -75,11 +75,11 @@ uint32_t HELPER(neon_tbl)(uint32_t ireg, uint32_t def,NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */ /* XXX: fix it to restore all registers */ -void tlb_fill (CPUState *env1,target_ulong addr,int is_write,int mmu_idx, +void tlb_fill (CPUARMState *env1,target_ulong addr,int is_write,int mmu_idx,void *retaddr) {TranslationBlock *tb; -CPUState *saved_env; +CPUARMState *saved_env;unsigned long pc;int ret;
@@ -103,7 +103,7 @@ void tlb_fill(CPUState *env1, target_ulong addr, int is_write, int mmu_idx, }#endif -/* FIXME: Pass an axplicit pointer to QF to CPUState, and move saturating +/* FIXME: Pass an axplicit pointer to QF to CPUARMState, and move saturating instructions into helper.c */ uint32_t HELPER (add_setq )(uint32_t a,uint32_t b) {
target-arm/translate.c +52 -52
369 lines not on this page · raw message
Signature · 1 line
1.7.7
RFC PATCH v4 18/44 target-m68k: Don't overuse CPUState
In reply to Andreas FärberScripted conversion:
sed -i "s/CPUState/CPUM68KState/g" target-m68k/*.[hc] sed -i "s/#define CPUM68KState/#define CPUState/" target-m68k/cpu.h
--- target-m68k/cpu.h | 16 +++++----- target-m68k/helper.c | 78 +++++++++++++++++++++++----------------------- target-m68k/op_helper.c | 20 ++++++------ target-m68k/translate.c | 16 +++++----- 4 files changed, 65 insertions(+), 65 deletions(-)
target-m68k/cpu.h +8 -8
@@ -120,8 +120,8 @@ void m68k_tcg_init(void);CPUM68KState *cpu_m68k_init (const char *cpu_model);int cpu_m68k_exec (CPUM68KState *s);void cpu_m68k_close (CPUM68KState *s); -void do_interrupt (CPUState *env1); -void do_interrupt_m68k_hardirq (CPUState *env1); +void do_interrupt (CPUM68KState *env1); +void do_interrupt_m68k_hardirq (CPUM68KState *env1);/* you can call this signal handler from your SIGBUS and SIGSEGV signal handlers to inform the virtual CPU of exceptions. non zero is returned if the signal was handled by the virtual CPU. */
@@ -226,17 +226,17 @@ void register_m68k_insns (CPUM68KState *env);#define MMU_MODE0_SUFFIX _kernel#define MMU_MODE1_SUFFIX _user#define MMU_USER_IDX 1 -static inline int cpu_mmu_index (CPUState *env) +static inline int cpu_mmu_index (CPUM68KState *env) {return (env->sr &SR_S ) ==0 ?1 :0 ; } -int cpu_m68k_handle_mmu_fault (CPUState *env,target_ulong address,int rw, +int cpu_m68k_handle_mmu_fault (CPUM68KState *env,target_ulong address,int rw,int mmu_idx);#define cpu_handle_mmu_fault cpu_m68k_handle_mmu_fault#if defined(CONFIG_USER_ONLY ) -static inline void cpu_clone_regs (CPUState *env,target_ulong newsp) +static inline void cpu_clone_regs (CPUM68KState *env,target_ulong newsp) {if (newsp) env->aregs[7 ] = newsp;
@@ -246,7 +246,7 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp)#include "cpu-all.h" -static inline void cpu_get_tb_cpu_state (CPUState *env,target_ulong *pc, +static inline void cpu_get_tb_cpu_state (CPUM68KState *env,target_ulong *pc,target_ulong *cs_base,int *flags) { *pc = env->pc;
@@ -256,14 +256,14 @@ static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc, | ((env->macsr >> 4) & 0xf); /* Bits 0-3 */ } -static inline bool cpu_has_work (CPUState *env) +static inline bool cpu_has_work (CPUM68KState *env) {return env->interrupt_request &CPU_INTERRUPT_HARD ; }#include "exec-all.h" -static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) +static inline void cpu_pc_from_tb (CPUM68KState *env,TranslationBlock *tb) { env->pc = tb->pc; }
target-m68k/helper.c +39 -39
287 lines not on this page · raw message
target-m68k/op_helper.c +10 -10
@@ -22,12 +22,12 @@#if defined(CONFIG_USER_ONLY ) -void do_interrupt (CPUState *env1) +void do_interrupt (CPUM68KState *env1) { env1->exception_index =-1 ; } -void do_interrupt_m68k_hardirq (CPUState *env1) +void do_interrupt_m68k_hardirq (CPUM68KState *env1) { }
@@ -55,11 +55,11 @@ extern int semihosting_enabled;NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */ /* XXX: fix it to restore all registers */ -void tlb_fill (CPUState *env1,target_ulong addr,int is_write,int mmu_idx, +void tlb_fill (CPUM68KState *env1,target_ulong addr,int is_write,int mmu_idx,void *retaddr) {TranslationBlock *tb; -CPUState *saved_env; +CPUM68KState *saved_env;unsigned long pc;int ret;
@@ -161,9 +161,9 @@ static void do_interrupt_all(int is_hw) env->pc =ldl_kernel (env->vbr + vector); } -void do_interrupt (CPUState *env1) +void do_interrupt (CPUM68KState *env1) { -CPUState *saved_env; +CPUM68KState *saved_env; saved_env = env; env = env1;
@@ -171,9 +171,9 @@ void do_interrupt(CPUState *env1) env = saved_env; } -void do_interrupt_m68k_hardirq (CPUState *env1) +void do_interrupt_m68k_hardirq (CPUM68KState *env1) { -CPUState *saved_env; +CPUM68KState *saved_env; saved_env = env; env = env1;
@@ -193,7 +193,7 @@ void HELPER(raise_exception)(uint32_t tt)raise_exception (tt); } -void HELPER (divu )(CPUState *env,uint32_t word) +void HELPER (divu )(CPUM68KState *env,uint32_t word) {uint32_t num;uint32_t den;
@@ -223,7 +223,7 @@ void HELPER(divu)(CPUState *env, uint32_t word) env->cc_dest = flags; } -void HELPER (divs )(CPUState *env,uint32_t word) +void HELPER (divs )(CPUM68KState *env,uint32_t word) {int32_t num;int32_t den;
target-m68k/translate.c +8 -8
@@ -68,8 +68,8 @@ void m68k_tcg_init(void)char *p;int i; -#define DEFO32 (name, offset) QREG_##name = tcg_global_mem_new_i32(TCG_AREG0, offsetof(CPUState, offset), #name); -#define DEFO64 (name, offset) QREG_##name = tcg_global_mem_new_i64(TCG_AREG0, offsetof(CPUState, offset), #name); +#define DEFO32 (name, offset) QREG_##name = tcg_global_mem_new_i32(TCG_AREG0, offsetof(CPUM68KState, offset), #name); +#define DEFO64 (name, offset) QREG_##name = tcg_global_mem_new_i64(TCG_AREG0, offsetof(CPUM68KState, offset), #name);#define DEFF64 (name, offset) DEFO64(name, offset)#include "qregs.def" #undef DEFO32
@@ -2937,7 +2937,7 @@ void register_m68k_insns (CPUM68KState *env)/* ??? Some of this implementation is not exception safe. We should always write back the result to memory before setting the condition codes. */ -static void disas_m68k_insn (CPUState * env,DisasContext *s) +static void disas_m68k_insn (CPUM68KState * env,DisasContext *s) {uint16_t insn;
@@ -2949,7 +2949,7 @@ static void disas_m68k_insn(CPUState * env, DisasContext *s)/* generate intermediate code for basic block 'tb'. */ static inline void -gen_intermediate_code_internal (CPUState *env,TranslationBlock *tb, +gen_intermediate_code_internal (CPUM68KState *env,TranslationBlock *tb,int search_pc) {DisasContext dc1, *dc = &dc1;
@@ -3072,17 +3072,17 @@ gen_intermediate_code_internal(CPUState *env, TranslationBlock *tb,//expand_target_qops(); } -void gen_intermediate_code (CPUState *env,TranslationBlock *tb) +void gen_intermediate_code (CPUM68KState *env,TranslationBlock *tb) {gen_intermediate_code_internal (env, tb,0 ); } -void gen_intermediate_code_pc (CPUState *env,TranslationBlock *tb) +void gen_intermediate_code_pc (CPUM68KState *env,TranslationBlock *tb) {gen_intermediate_code_internal (env, tb,1 ); } -void cpu_dump_state (CPUState *env,FILE *f,fprintf_function cpu_fprintf, +void cpu_dump_state (CPUM68KState *env,FILE *f,fprintf_function cpu_fprintf,int flags) {int i;
@@ -3103,7 +3103,7 @@ void cpu_dump_state(CPUState *env, FILE *f, fprintf_function cpu_fprintf,cpu_fprintf (f,"FPRESULT = %12g\n" , *(double *)&env->fp_result); } -void restore_state_to_opc (CPUState *env,TranslationBlock *tb,int pc_pos) +void restore_state_to_opc (CPUM68KState *env,TranslationBlock *tb,int pc_pos) { env->pc = gen_opc_pc[pc_pos]; }
Signature · 1 line
1.7.7
RFC PATCH v4 4/44 monitor: Avoid CPUState in read/write functions
In reply to Andreas Färber--- gdbstub.c | 56 ++++++++++++++++++++++++++++---------------------------- 1 files changed, 28 insertions(+), 28 deletions(-)
gdbstub.c +28 -28
@@ -533,7 +533,7 @@ static const int gpr_map32[8] = { 0, 1, 2, 3, 4, 5, 6, 7 };#define IDX_XMM_REGS (IDX_FP_REGS + 16)#define IDX_MXCSR_REG (IDX_XMM_REGS + CPU_NB_REGS) -static int cpu_gdb_read_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_read_register (CPUX86State *env,uint8_t *mem_buf,int n) {if (n <CPU_NB_REGS ) {if (TARGET_LONG_BITS ==64 && env->hflags &HF_CS64_MASK ) {
@@ -590,7 +590,7 @@ static int cpu_gdb_read_register(CPUState *env, uint8_t *mem_buf, int n)return 0 ; } -static int cpu_x86_gdb_load_seg (CPUState *env,int sreg,uint8_t *mem_buf) +static int cpu_x86_gdb_load_seg (CPUX86State *env,int sreg,uint8_t *mem_buf) {uint16_t selector =ldl_p (mem_buf);
@@ -615,7 +615,7 @@ static int cpu_x86_gdb_load_seg(CPUState *env, int sreg, uint8_t *mem_buf)return 4 ; } -static int cpu_gdb_write_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_write_register (CPUX86State *env,uint8_t *mem_buf,int n) {uint32_t tmp;
@@ -703,7 +703,7 @@ static int cpu_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n)#define GDB_CORE_XML "power-core.xml"#endif -static int cpu_gdb_read_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_read_register (CPUPPCState *env,uint8_t *mem_buf,int n) {if (n <32 ) {/* gprs */
@@ -740,7 +740,7 @@ static int cpu_gdb_read_register(CPUState *env, uint8_t *mem_buf, int n)return 0 ; } -static int cpu_gdb_write_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_write_register (CPUPPCState *env,uint8_t *mem_buf,int n) {if (n <32 ) {/* gprs */
@@ -801,7 +801,7 @@ static int cpu_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n)#define GET_REGA (val) GET_REGL(val)#endif -static int cpu_gdb_read_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_read_register (CPUSPARCState *env,uint8_t *mem_buf,int n) {if (n <8 ) {/* g0..g7 */
@@ -860,7 +860,7 @@ static int cpu_gdb_read_register(CPUState *env, uint8_t *mem_buf, int n)return 0 ; } -static int cpu_gdb_write_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_write_register (CPUSPARCState *env,uint8_t *mem_buf,int n) {#if defined(TARGET_ABI32 )abi_ulong tmp;
@@ -944,7 +944,7 @@ static int cpu_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n)#define NUM_CORE_REGS 26#define GDB_CORE_XML "arm-core.xml" -static int cpu_gdb_read_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_read_register (CPUARMState *env,uint8_t *mem_buf,int n) {if (n <16 ) {/* Core integer register. */
@@ -971,7 +971,7 @@ static int cpu_gdb_read_register(CPUState *env, uint8_t *mem_buf, int n)return 0 ; } -static int cpu_gdb_write_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_write_register (CPUARMState *env,uint8_t *mem_buf,int n) {uint32_t tmp;
@@ -1014,7 +1014,7 @@ static int cpu_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n)#define GDB_CORE_XML "cf-core.xml" -static int cpu_gdb_read_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_read_register (CPUM68KState *env,uint8_t *mem_buf,int n) {if (n <8 ) {/* D0-D7 */
@@ -1033,7 +1033,7 @@ static int cpu_gdb_read_register(CPUState *env, uint8_t *mem_buf, int n)return 0 ; } -static int cpu_gdb_write_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_write_register (CPUM68KState *env,uint8_t *mem_buf,int n) {uint32_t tmp;
@@ -1058,7 +1058,7 @@ static int cpu_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n)#define NUM_CORE_REGS 73 -static int cpu_gdb_read_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_read_register (CPUMIPSState *env,uint8_t *mem_buf,int n) {if (n <32 ) {GET_REGL (env->active_tc.gpr[n]);
@@ -1104,7 +1104,7 @@ static unsigned int ieee_rm[] =#define RESTORE_ROUNDING_MODE \ set_float_rounding_mode(ieee_rm[env->active_fpu.fcr31 & 3], &env->active_fpu.fp_status) -static int cpu_gdb_write_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_write_register (CPUMIPSState *env,uint8_t *mem_buf,int n) {target_ulong tmp;
@@ -1163,7 +1163,7 @@ static int cpu_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n)#define NUM_CORE_REGS 59 -static int cpu_gdb_read_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_read_register (CPUSH4State *env,uint8_t *mem_buf,int n) {if (n <8 ) {if ((env->sr & (SR_MD |SR_RB )) == (SR_MD |SR_RB )) {
@@ -1197,7 +1197,7 @@ static int cpu_gdb_read_register(CPUState *env, uint8_t *mem_buf, int n)return 0 ; } -static int cpu_gdb_write_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_write_register (CPUSH4State *env,uint8_t *mem_buf,int n) {uint32_t tmp;
@@ -1244,7 +1244,7 @@ static int cpu_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n)#define NUM_CORE_REGS (32 + 5) -static int cpu_gdb_read_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_read_register (CPUMBState *env,uint8_t *mem_buf,int n) {if (n <32 ) {GET_REG32 (env->regs[n]);
@@ -1254,7 +1254,7 @@ static int cpu_gdb_read_register(CPUState *env, uint8_t *mem_buf, int n)return 0 ; } -static int cpu_gdb_write_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_write_register (CPUMBState *env,uint8_t *mem_buf,int n) {uint32_t tmp;
@@ -1275,7 +1275,7 @@ static int cpu_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n)#define NUM_CORE_REGS 49static int -read_register_crisv10 (CPUState *env,uint8_t *mem_buf,int n) +read_register_crisv10 (CPUCRISState *env,uint8_t *mem_buf,int n) {if (n <15 ) {GET_REG32 (env->regs[n]);
@@ -1307,7 +1307,7 @@ read_register_crisv10(CPUState *env, uint8_t *mem_buf, int n)return 0 ; } -static int cpu_gdb_read_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_read_register (CPUCRISState *env,uint8_t *mem_buf,int n) {uint8_t srs;
@@ -1337,7 +1337,7 @@ static int cpu_gdb_read_register(CPUState *env, uint8_t *mem_buf, int n)return 0 ; } -static int cpu_gdb_write_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_write_register (CPUCRISState *env,uint8_t *mem_buf,int n) {uint32_t tmp;
@@ -1370,7 +1370,7 @@ static int cpu_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n)#define NUM_CORE_REGS 67 -static int cpu_gdb_read_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_read_register (CPUAlphaState *env,uint8_t *mem_buf,int n) {uint64_t val;CPU_DoubleU d;
@@ -1404,7 +1404,7 @@ static int cpu_gdb_read_register(CPUState *env, uint8_t *mem_buf, int n)GET_REGL (val); } -static int cpu_gdb_write_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_write_register (CPUAlphaState *env,uint8_t *mem_buf,int n) {target_ulong tmp =ldtul_p (mem_buf);CPU_DoubleU d;
@@ -1440,7 +1440,7 @@ static int cpu_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n)#define NUM_CORE_REGS S390_NUM_TOTAL_REGS -static int cpu_gdb_read_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_read_register (CPUS390XState *env,uint8_t *mem_buf,int n) {switch (n) {case S390_PSWM_REGNUM :GET_REGL (env->psw.mask);break ;
@@ -1464,7 +1464,7 @@ static int cpu_gdb_read_register(CPUState *env, uint8_t *mem_buf, int n)return 0 ; } -static int cpu_gdb_write_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_write_register (CPUS390XState *env,uint8_t *mem_buf,int n) {target_ulong tmpl;uint32_t tmp32;
@@ -1494,7 +1494,7 @@ static int cpu_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n)#include "hw/lm32_pic.h" #define NUM_CORE_REGS (32 + 7) -static int cpu_gdb_read_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_read_register (CPULM32State *env,uint8_t *mem_buf,int n) {if (n <32 ) {GET_REG32 (env->regs[n]);
@@ -1527,7 +1527,7 @@ static int cpu_gdb_read_register(CPUState *env, uint8_t *mem_buf, int n)return 0 ; } -static int cpu_gdb_write_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_write_register (CPULM32State *env,uint8_t *mem_buf,int n) {uint32_t tmp;
@@ -1573,7 +1573,7 @@ static int cpu_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n)#define NUM_CORE_REGS (env->config->gdb_regmap.num_regs)#define num_g_regs NUM_CORE_REGS -static int cpu_gdb_read_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_read_register (CPUXtensaState *env,uint8_t *mem_buf,int n) {const XtensaGdbReg *reg = env->config->gdb_regmap.reg + n;
@@ -1610,7 +1610,7 @@ static int cpu_gdb_read_register(CPUState *env, uint8_t *mem_buf, int n) } } -static int cpu_gdb_write_register (CPUState *env,uint8_t *mem_buf,int n) +static int cpu_gdb_write_register (CPUXtensaState *env,uint8_t *mem_buf,int n) {uint32_t tmp;const XtensaGdbReg *reg = env->config->gdb_regmap.reg + n;
Signature · 1 line
1.7.7
RFC PATCH v4 12/44 bsd-user: Don't overuse CPUState
In reply to Andreas FärberUse CPU*State where applicable.
--- bsd-user/main.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
bsd-user/main.c +2 -2
@@ -63,7 +63,7 @@ void gemu_log(const char *fmt, ...) }#if defined(TARGET_I386 ) -int cpu_get_pic_interrupt (CPUState *env) +int cpu_get_pic_interrupt (CPUX86State *env) {return -1 ; }
@@ -109,7 +109,7 @@ void cpu_list_unlock(void)/***********************************************************/ /* CPUX86 core interface */ -void cpu_smm_update (CPUState *env) +void cpu_smm_update (CPUX86State *env) { }
Signature · 1 line
1.7.7
RFC PATCH v4 6/44 target-microblaze: Typedef struct CPUMBState
In reply to Andreas Färber--- target-microblaze/cpu.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
target-microblaze/cpu.h +1 -0
@@ -29,6 +29,7 @@#include "cpu-defs.h" #include "softfloat.h" struct CPUMBState ; +typedef struct CPUMBState CPUMBState ;#if !defined(CONFIG_USER_ONLY )#include "mmu.h" #endif
Signature · 1 line
1.7.7
RFC PATCH v4 7/44 target-sparc: Typedef struct CPUSPARCState early
In reply to Andreas FärberWill be needed for qemu_irq_ack callback.
--- target-sparc/cpu.h | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
target-sparc/cpu.h +4 -2
@@ -378,7 +378,9 @@ struct QEMUFile;void cpu_put_timer (struct QEMUFile *f,CPUTimer *s);void cpu_get_timer (struct QEMUFile *f,CPUTimer *s); -typedef struct CPUSPARCState { +typedef struct CPUSPARCState CPUSPARCState ; + +struct CPUSPARCState {target_ulong gregs[8 ];/* general registers */ target_ulong *regwptr;/* pointer to current register window */ target_ulong pc;/* program counter */
@@ -503,7 +505,7 @@ typedef struct CPUSPARCState {/* Leon3 cache control */ uint32_t cache_control; -} CPUSPARCState; +};#ifndef NO_CPU_IO_DEFS /* cpu_init.c */
Signature · 1 line
1.7.7
RFC PATCH v4 27/44 arm-semi: Don't use CPUState
In reply to Andreas FärberScripted conversion:
sed -i "s/CPUState/CPUARMState/g" arm-semi.c
--- arm-semi.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-)
arm-semi.c +5 -5
@@ -108,7 +108,7 @@ static inline uint32_t set_swi_errno(TaskState *ts, uint32_t code) return code; }#else -static inline uint32_t set_swi_errno (CPUState *env,uint32_t code) +static inline uint32_t set_swi_errno (CPUARMState *env,uint32_t code) {return code; }
@@ -122,7 +122,7 @@ static target_ulong arm_semi_syscall_len;static target_ulong syscall_err;#endif -static void arm_semi_cb (CPUState *env,target_ulong ret,target_ulong err) +static void arm_semi_cb (CPUARMState *env,target_ulong ret,target_ulong err) {#ifdef CONFIG_USER_ONLY TaskState *ts = env->opaque;
@@ -152,7 +152,7 @@ static void arm_semi_cb(CPUState *env, target_ulong ret, target_ulong err) } } -static void arm_semi_flen_cb (CPUState *env,target_ulong ret,target_ulong err) +static void arm_semi_flen_cb (CPUARMState *env,target_ulong ret,target_ulong err) {/* The size is always stored in big-endian order, extract the value. We assume the size always fit in 32 bits. */
@@ -174,7 +174,7 @@ static void arm_semi_flen_cb(CPUState *env, target_ulong ret, target_ulong err) __arg; \ })#define SET_ARG (n, val) put_user_ual(val, args + (n) * 4) -uint32_t do_arm_semihosting (CPUState *env) +uint32_t do_arm_semihosting (CPUARMState *env) {target_ulong args;char * s;
@@ -184,7 +184,7 @@ uint32_t do_arm_semihosting(CPUState *env)#ifdef CONFIG_USER_ONLY TaskState *ts = env->opaque;#else -CPUState *ts = env; +CPUARMState *ts = env;#endif nr = env->regs[0 ];
Signature · 1 line
1.7.7
RFC PATCH v4 5/44 target-lm32: Typedef struct CPULM32State
In reply to Andreas Färber--- target-lm32/cpu.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
target-lm32/cpu.h +1 -0
@@ -28,6 +28,7 @@#include "qemu-common.h" #include "cpu-defs.h" struct CPULM32State ; +typedef struct CPULM32State CPULM32State ;#define TARGET_HAS_ICE 1
Signature · 1 line
1.7.7
RFC PATCH v4 8/44 target-unicore32: Rename to CPUUniCore32State
In reply to Andreas FärberThis aids in refactoring CPUState by adopting the common naming scheme.
--- target-unicore32/cpu.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
target-unicore32/cpu.h +4 -4
@@ -18,7 +18,7 @@#define ELF_MACHINE EM_UNICORE32 -#define CPUState struct CPUState_UniCore32 +#define CPUState struct CPUUniCore32State#include "config.h" #include "qemu-common.h"
@@ -27,7 +27,7 @@#define NB_MMU_MODES 2 -typedef struct CPUState_UniCore32 { +typedef struct CPUUniCore32State { /* Regs for current mode. */ uint32_t regs[32]; /* Frequently accessed ASR bits are stored separately for efficiently.
@@ -71,7 +71,7 @@ typedef struct CPUState_UniCore32 {/* Internal CPU feature flags. */ uint32_t features; -} CPUState_UniCore32; +} CPUUniCore32State;#define ASR_M (0x1f)#define ASR_MODE_USER (0x10)
@@ -179,7 +179,7 @@ static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc,void uc32_translate_init (void );void do_interrupt (CPUState *); -void switch_mode (CPUState_UniCore32 *,int ); +void switch_mode (CPUUniCore32State *,int );static inline bool cpu_has_work (CPUState *env) {
Signature · 1 line
1.7.7
RFC PATCH v4 26/44 target-xtensa: Don't overuse CPUState
In reply to Andreas FärberScripted conversion:
sed -i "s/CPUState/CPUXtensaState/g" target-xtensa/*.[hc] sed -i "s/#define CPUXtensaState/#define CPUState/" target-xtensa/cpu.h
--- target-xtensa/cpu.h | 44 ++++++++++++++++++++++---------------------- target-xtensa/helper.c | 40 ++++++++++++++++++++-------------------- target-xtensa/op_helper.c | 30 +++++++++++++++--------------- target-xtensa/translate.c | 22 +++++++++++----------- 4 files changed, 68 insertions(+), 68 deletions(-)
target-xtensa/cpu.h +22 -22
@@ -356,27 +356,27 @@ int cpu_xtensa_exec(CPUXtensaState *s);void xtensa_register_core (XtensaConfigList *node);void do_interrupt (CPUXtensaState *s);void check_interrupts (CPUXtensaState *s); -void xtensa_irq_init (CPUState *env); -void *xtensa_get_extint (CPUState *env,unsigned extint); -void xtensa_advance_ccount (CPUState *env,uint32_t d); -void xtensa_timer_irq (CPUState *env,uint32_t id,uint32_t active); -void xtensa_rearm_ccompare_timer (CPUState *env); +void xtensa_irq_init (CPUXtensaState *env); +void *xtensa_get_extint (CPUXtensaState *env,unsigned extint); +void xtensa_advance_ccount (CPUXtensaState *env,uint32_t d); +void xtensa_timer_irq (CPUXtensaState *env,uint32_t id,uint32_t active); +void xtensa_rearm_ccompare_timer (CPUXtensaState *env);int cpu_xtensa_signal_handler (int host_signum,void *pinfo,void *puc);void xtensa_cpu_list (FILE *f,fprintf_function cpu_fprintf); -void xtensa_sync_window_from_phys (CPUState *env); -void xtensa_sync_phys_from_window (CPUState *env); -uint32_t xtensa_tlb_get_addr_mask (const CPUState *env,bool dtlb,uint32_t way); -void split_tlb_entry_spec_way (const CPUState *env,uint32_t v,bool dtlb, +void xtensa_sync_window_from_phys (CPUXtensaState *env); +void xtensa_sync_phys_from_window (CPUXtensaState *env); +uint32_t xtensa_tlb_get_addr_mask (const CPUXtensaState *env,bool dtlb,uint32_t way); +void split_tlb_entry_spec_way (const CPUXtensaState *env,uint32_t v,bool dtlb,uint32_t *vpn,uint32_t wi,uint32_t *ei); -int xtensa_tlb_lookup (const CPUState *env,uint32_t addr,bool dtlb, +int xtensa_tlb_lookup (const CPUXtensaState *env,uint32_t addr,bool dtlb,uint32_t *pwi,uint32_t *pei,uint8_t *pring); -void xtensa_tlb_set_entry (CPUState *env,bool dtlb, +void xtensa_tlb_set_entry (CPUXtensaState *env,bool dtlb,unsigned wi,unsigned ei,uint32_t vpn,uint32_t pte); -int xtensa_get_physical_addr (CPUState *env, +int xtensa_get_physical_addr (CPUXtensaState *env,uint32_t vaddr,int is_write,int mmu_idx,uint32_t *paddr,uint32_t *page_size,unsigned *access); -void dump_mmu (FILE *f,fprintf_function cpu_fprintf,CPUState *env); -void debug_exception_env (CPUState *new_env,uint32_t cause); +void dump_mmu (FILE *f,fprintf_function cpu_fprintf,CPUXtensaState *env); +void debug_exception_env (CPUXtensaState *new_env,uint32_t cause);#define XTENSA_OPTION_BIT (opt) (((uint64_t)1) << (opt))
@@ -392,7 +392,7 @@ static inline bool xtensa_option_enabled(const XtensaConfig *config, int opt)return xtensa_option_bits_enabled (config,XTENSA_OPTION_BIT (opt)); } -static inline int xtensa_get_cintlevel (const CPUState *env) +static inline int xtensa_get_cintlevel (const CPUXtensaState *env) {int level = (env->sregs[PS ] &PS_INTLEVEL ) >>PS_INTLEVEL_SHIFT ;if ((env->sregs[PS ] &PS_EXCM ) && env->config->excm_level > level) {
@@ -401,7 +401,7 @@ static inline int xtensa_get_cintlevel(const CPUState *env)return level; } -static inline int xtensa_get_ring (const CPUState *env) +static inline int xtensa_get_ring (const CPUXtensaState *env) {if (xtensa_option_enabled (env->config,XTENSA_OPTION_MMU )) {return (env->sregs[PS ] &PS_RING ) >>PS_RING_SHIFT ;
@@ -410,7 +410,7 @@ static inline int xtensa_get_ring(const CPUState *env) } } -static inline int xtensa_get_cring (const CPUState *env) +static inline int xtensa_get_cring (const CPUXtensaState *env) {if (xtensa_option_enabled (env->config,XTENSA_OPTION_MMU ) && (env->sregs[PS ] &PS_EXCM ) ==0 ) {
@@ -420,7 +420,7 @@ static inline int xtensa_get_cring(const CPUState *env) } } -static inline xtensa_tlb_entry *xtensa_tlb_get_entry (CPUState *env, +static inline xtensa_tlb_entry *xtensa_tlb_get_entry (CPUXtensaState *env,bool dtlb,unsigned wi,unsigned ei) { return dtlb ?
@@ -434,7 +434,7 @@ static inline xtensa_tlb_entry *xtensa_tlb_get_entry(CPUState *env,#define MMU_MODE2_SUFFIX _ring2#define MMU_MODE3_SUFFIX _ring3 -static inline int cpu_mmu_index (CPUState *env) +static inline int cpu_mmu_index (CPUXtensaState *env) {return xtensa_get_cring (env); }
@@ -445,7 +445,7 @@ static inline int cpu_mmu_index(CPUState *env)#define XTENSA_TBFLAG_DEBUG 0x10#define XTENSA_TBFLAG_ICOUNT 0x20 -static inline void cpu_get_tb_cpu_state (CPUState *env,target_ulong *pc, +static inline void cpu_get_tb_cpu_state (CPUXtensaState *env,target_ulong *pc,target_ulong *cs_base,int *flags) { *pc = env->pc;
@@ -472,12 +472,12 @@ static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc,#include "cpu-all.h" #include "exec-all.h" -static inline int cpu_has_work (CPUState *env) +static inline int cpu_has_work (CPUXtensaState *env) {return env->pending_irq_level; } -static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) +static inline void cpu_pc_from_tb (CPUXtensaState *env,TranslationBlock *tb) { env->pc = tb->pc; }
target-xtensa/helper.c +20 -20
@@ -33,7 +33,7 @@#include "hw/loader.h" #endif -static void reset_mmu (CPUState *env); +static void reset_mmu (CPUXtensaState *env);void cpu_state_reset (CPUXtensaState *env) {
@@ -57,7 +57,7 @@ void xtensa_register_core(XtensaConfigList *node) xtensa_cores = node; } -static uint32_t check_hw_breakpoints (CPUState *env) +static uint32_t check_hw_breakpoints (CPUXtensaState *env) {unsigned i;
@@ -72,7 +72,7 @@ static uint32_t check_hw_breakpoints(CPUState *env)static CPUDebugExcpHandler *prev_debug_excp_handler; -static void breakpoint_handler (CPUState *env) +static void breakpoint_handler (CPUXtensaState *env) {if (env->watchpoint_hit) {if (env->watchpoint_hit->flags &BP_CPU ) {
@@ -139,7 +139,7 @@ void xtensa_cpu_list(FILE *f, fprintf_function cpu_fprintf) } } -target_phys_addr_t cpu_get_phys_page_debug (CPUState *env,target_ulong addr) +target_phys_addr_t cpu_get_phys_page_debug (CPUXtensaState *env,target_ulong addr) {uint32_t paddr;uint32_t page_size;
@@ -156,7 +156,7 @@ target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr)return ~0 ; } -static uint32_t relocated_vector (CPUState *env,uint32_t vector) +static uint32_t relocated_vector (CPUXtensaState *env,uint32_t vector) {if (xtensa_option_enabled (env->config,XTENSA_OPTION_RELOCATABLE_VECTOR )) {
@@ -172,7 +172,7 @@ static uint32_t relocated_vector(CPUState *env, uint32_t vector)* For the level-1 interrupt convert it to either user, kernel or double * exception with the 'level-1 interrupt' exception cause. */ -static void handle_interrupt (CPUState *env) +static void handle_interrupt (CPUXtensaState *env) {int level = env->pending_irq_level;
@@ -209,7 +209,7 @@ static void handle_interrupt(CPUState *env) } } -void do_interrupt (CPUState *env) +void do_interrupt (CPUXtensaState *env) {if (env->exception_index ==EXC_IRQ ) { qemu_log_mask(CPU_LOG_INT,
@@ -260,7 +260,7 @@ void do_interrupt(CPUState *env)check_interrupts (env); } -static void reset_tlb_mmu_all_ways (CPUState *env, +static void reset_tlb_mmu_all_ways (CPUXtensaState *env,const xtensa_tlb *tlb,xtensa_tlb_entry entry[][MAX_TLB_WAY_SIZE ]) {unsigned wi, ei;
@@ -273,7 +273,7 @@ static void reset_tlb_mmu_all_ways(CPUState *env, } } -static void reset_tlb_mmu_ways56 (CPUState *env, +static void reset_tlb_mmu_ways56 (CPUXtensaState *env,const xtensa_tlb *tlb,xtensa_tlb_entry entry[][MAX_TLB_WAY_SIZE ]) {if (!tlb->varway56) {
@@ -320,7 +320,7 @@ static void reset_tlb_mmu_ways56(CPUState *env, } } -static void reset_tlb_region_way0 (CPUState *env, +static void reset_tlb_region_way0 (CPUXtensaState *env,xtensa_tlb_entry entry[][MAX_TLB_WAY_SIZE ]) {unsigned ei;
@@ -334,7 +334,7 @@ static void reset_tlb_region_way0(CPUState *env, } } -static void reset_mmu (CPUState *env) +static void reset_mmu (CPUXtensaState *env) {if (xtensa_option_enabled (env->config,XTENSA_OPTION_MMU )) { env->sregs[RASID ] =0x04030201 ;
@@ -351,7 +351,7 @@ static void reset_mmu(CPUState *env) } } -static unsigned get_ring (const CPUState *env,uint8_t asid) +static unsigned get_ring (const CPUXtensaState *env,uint8_t asid) {unsigned i;for (i =0 ; i <4 ; ++i) {
@@ -371,7 +371,7 @@ static unsigned get_ring(const CPUState *env, uint8_t asid)* \param pring: [out] access ring * \return 0 if ok, exception cause code otherwise */ -int xtensa_tlb_lookup (const CPUState *env,uint32_t addr,bool dtlb, +int xtensa_tlb_lookup (const CPUXtensaState *env,uint32_t addr,bool dtlb,uint32_t *pwi,uint32_t *pei,uint8_t *pring) { const xtensa_tlb *tlb = dtlb ?
@@ -458,10 +458,10 @@ static bool is_access_granted(unsigned access, int is_write) } } -static int autorefill_mmu (CPUState *env,uint32_t vaddr,bool dtlb, +static int autorefill_mmu (CPUXtensaState *env,uint32_t vaddr,bool dtlb,uint32_t *wi,uint32_t *ei,uint8_t *ring); -static int get_physical_addr_mmu (CPUState *env, +static int get_physical_addr_mmu (CPUXtensaState *env,uint32_t vaddr,int is_write,int mmu_idx,uint32_t *paddr,uint32_t *page_size,unsigned *access) {
@@ -504,7 +504,7 @@ static int get_physical_addr_mmu(CPUState *env,return 0 ; } -static int autorefill_mmu (CPUState *env,uint32_t vaddr,bool dtlb, +static int autorefill_mmu (CPUXtensaState *env,uint32_t vaddr,bool dtlb,uint32_t *wi,uint32_t *ei,uint8_t *ring) {uint32_t paddr;
@@ -532,7 +532,7 @@ static int autorefill_mmu(CPUState *env, uint32_t vaddr, bool dtlb,return ret; } -static int get_physical_addr_region (CPUState *env, +static int get_physical_addr_region (CPUXtensaState *env,uint32_t vaddr,int is_write,int mmu_idx,uint32_t *paddr,uint32_t *page_size,unsigned *access) {
@@ -563,7 +563,7 @@ static int get_physical_addr_region(CPUState *env,* * \return 0 if ok, exception cause code otherwise */ -int xtensa_get_physical_addr (CPUState *env, +int xtensa_get_physical_addr (CPUXtensaState *env,uint32_t vaddr,int is_write,int mmu_idx,uint32_t *paddr,uint32_t *page_size,unsigned *access) {
@@ -584,7 +584,7 @@ int xtensa_get_physical_addr(CPUState *env, }static void dump_tlb (FILE *f,fprintf_function cpu_fprintf, -CPUState *env,bool dtlb) +CPUXtensaState *env,bool dtlb) {unsigned wi, ei; const xtensa_tlb *conf =
@@ -634,7 +634,7 @@ static void dump_tlb(FILE *f, fprintf_function cpu_fprintf, } } -void dump_mmu (FILE *f,fprintf_function cpu_fprintf,CPUState *env) +void dump_mmu (FILE *f,fprintf_function cpu_fprintf,CPUXtensaState *env) { if (xtensa_option_bits_enabled(env->config, XTENSA_OPTION_BIT(XTENSA_OPTION_REGION_PROTECTION) |
target-xtensa/op_helper.c +15 -15
@@ -70,10 +70,10 @@ static void do_unaligned_access(target_ulong addr, int is_write, int is_user, } } -void tlb_fill (CPUState *env1,target_ulong vaddr,int is_write,int mmu_idx, +void tlb_fill (CPUXtensaState *env1,target_ulong vaddr,int is_write,int mmu_idx,void *retaddr) { -CPUState *saved_env = env; +CPUXtensaState *saved_env = env; env = env1; {
@@ -134,7 +134,7 @@ void HELPER(exception_cause_vaddr)(uint32_t pc, uint32_t cause, uint32_t vaddr)HELPER (exception_cause)(pc, cause); } -void debug_exception_env (CPUState *new_env,uint32_t cause) +void debug_exception_env (CPUXtensaState *new_env,uint32_t cause) {if (xtensa_get_cintlevel (new_env) < new_env->config->debug_level) { env = new_env;
@@ -168,7 +168,7 @@ uint32_t HELPER(nsau)(uint32_t v)return v ?clz32 (v) :32 ; } -static void copy_window_from_phys (CPUState *env, +static void copy_window_from_phys (CPUXtensaState *env,uint32_t window,uint32_t phys,uint32_t n) {assert (phys < env->config->nareg);
@@ -184,7 +184,7 @@ static void copy_window_from_phys(CPUState *env, } } -static void copy_phys_from_window (CPUState *env, +static void copy_phys_from_window (CPUXtensaState *env,uint32_t phys,uint32_t window,uint32_t n) {assert (phys < env->config->nareg);
@@ -201,22 +201,22 @@ static void copy_phys_from_window(CPUState *env, } -static inline unsigned windowbase_bound (unsigned a,const CPUState *env) +static inline unsigned windowbase_bound (unsigned a,const CPUXtensaState *env) {return a & (env->config->nareg /4 -1 ); } -static inline unsigned windowstart_bit (unsigned a,const CPUState *env) +static inline unsigned windowstart_bit (unsigned a,const CPUXtensaState *env) {return 1 <<windowbase_bound (a, env); } -void xtensa_sync_window_from_phys (CPUState *env) +void xtensa_sync_window_from_phys (CPUXtensaState *env) {copy_window_from_phys (env,0 , env->sregs[WINDOW_BASE ] *4 ,16 ); } -void xtensa_sync_phys_from_window (CPUState *env) +void xtensa_sync_phys_from_window (CPUXtensaState *env) {copy_phys_from_window (env, env->sregs[WINDOW_BASE ] *4 ,0 ,16 ); }
@@ -409,7 +409,7 @@ void HELPER(advance_ccount)(uint32_t d)xtensa_advance_ccount (env, d); } -void HELPER (check_interrupts )(CPUState *env) +void HELPER (check_interrupts )(CPUXtensaState *env) {check_interrupts (env); }
@@ -423,7 +423,7 @@ void HELPER(wsr_rasid)(uint32_t v) } } -static uint32_t get_page_size (const CPUState *env,bool dtlb,uint32_t way) +static uint32_t get_page_size (const CPUXtensaState *env,bool dtlb,uint32_t way) {uint32_t tlbcfg = env->sregs[dtlb ?DTLBCFG :ITLBCFG ];
@@ -445,7 +445,7 @@ static uint32_t get_page_size(const CPUState *env, bool dtlb, uint32_t way)/*! * Get bit mask for the virtual address bits translated by the TLB way */ -uint32_t xtensa_tlb_get_addr_mask (const CPUState *env,bool dtlb,uint32_t way) +uint32_t xtensa_tlb_get_addr_mask (const CPUXtensaState *env,bool dtlb,uint32_t way) {if (xtensa_option_enabled (env->config,XTENSA_OPTION_MMU )) { bool varway56 = dtlb ?
@@ -482,7 +482,7 @@ uint32_t xtensa_tlb_get_addr_mask(const CPUState *env, bool dtlb, uint32_t way)* Get bit mask for the 'VPN without index' field. * See ISA, 4.6.5.6, data format for RxTLB0 */ -static uint32_t get_vpn_mask (const CPUState *env,bool dtlb,uint32_t way) +static uint32_t get_vpn_mask (const CPUXtensaState *env,bool dtlb,uint32_t way) {if (way <4 ) { bool is32 = (dtlb ?
@@ -511,7 +511,7 @@ static uint32_t get_vpn_mask(const CPUState *env, bool dtlb, uint32_t way)* Split virtual address into VPN (with index) and entry index * for the given TLB way */ -void split_tlb_entry_spec_way (const CPUState *env,uint32_t v,bool dtlb, +void split_tlb_entry_spec_way (const CPUXtensaState *env,uint32_t v,bool dtlb,uint32_t *vpn,uint32_t wi,uint32_t *ei) { bool varway56 = dtlb ?
@@ -647,7 +647,7 @@ uint32_t HELPER(ptlb)(uint32_t v, uint32_t dtlb) } } -void xtensa_tlb_set_entry (CPUState *env,bool dtlb, +void xtensa_tlb_set_entry (CPUXtensaState *env,bool dtlb,unsigned wi,unsigned ei,uint32_t vpn,uint32_t pte) {xtensa_tlb_entry *entry =xtensa_tlb_get_entry (env, dtlb, wi, ei);
target-xtensa/translate.c +11 -11
@@ -159,18 +159,18 @@ void xtensa_translate_init(void) cpu_env =tcg_global_reg_new_ptr (TCG_AREG0 ,"env" ); cpu_pc =tcg_global_mem_new_i32 (TCG_AREG0 , - offsetof(CPUState , pc),"pc" ); + offsetof(CPUXtensaState , pc),"pc" );for (i =0 ; i <16 ; i++) { cpu_R[i] =tcg_global_mem_new_i32 (TCG_AREG0 , - offsetof(CPUState, regs[i]), + offsetof(CPUXtensaState, regs[i]), regnames[i]); }for (i =0 ; i <256 ; ++i) {if (sregnames[i]) { cpu_SR[i] =tcg_global_mem_new_i32 (TCG_AREG0 , - offsetof(CPUState, sregs[i]), + offsetof(CPUXtensaState, sregs[i]), sregnames[i]); } }
@@ -178,7 +178,7 @@ void xtensa_translate_init(void)for (i =0 ; i <256 ; ++i) {if (uregnames[i]) { cpu_UR[i] =tcg_global_mem_new_i32 (TCG_AREG0 , - offsetof(CPUState, uregs[i]), + offsetof(CPUXtensaState, uregs[i]), uregnames[i]); } }
@@ -2493,7 +2493,7 @@ invalid_opcode:#undef HAS_OPTION } -static void check_breakpoint (CPUState *env,DisasContext *dc) +static void check_breakpoint (CPUXtensaState *env,DisasContext *dc) {CPUBreakpoint *bp;
@@ -2508,7 +2508,7 @@ static void check_breakpoint(CPUState *env, DisasContext *dc) } } -static void gen_ibreak_check (CPUState *env,DisasContext *dc) +static void gen_ibreak_check (CPUXtensaState *env,DisasContext *dc) {unsigned i;
@@ -2522,7 +2522,7 @@ static void gen_ibreak_check(CPUState *env, DisasContext *dc) }static void gen_intermediate_code_internal ( -CPUState *env,TranslationBlock *tb,int search_pc) +CPUXtensaState *env,TranslationBlock *tb,int search_pc) {DisasContext dc;int insn_count =0 ;
@@ -2644,17 +2644,17 @@ static void gen_intermediate_code_internal( } } -void gen_intermediate_code (CPUState *env,TranslationBlock *tb) +void gen_intermediate_code (CPUXtensaState *env,TranslationBlock *tb) {gen_intermediate_code_internal (env, tb,0 ); } -void gen_intermediate_code_pc (CPUState *env,TranslationBlock *tb) +void gen_intermediate_code_pc (CPUXtensaState *env,TranslationBlock *tb) {gen_intermediate_code_internal (env, tb,1 ); } -void cpu_dump_state (CPUState *env,FILE *f,fprintf_function cpu_fprintf, +void cpu_dump_state (CPUXtensaState *env,FILE *f,fprintf_function cpu_fprintf,int flags) {int i, j;
@@ -2692,7 +2692,7 @@ void cpu_dump_state(CPUState *env, FILE *f, fprintf_function cpu_fprintf, } } -void restore_state_to_opc (CPUState *env,TranslationBlock *tb,int pc_pos) +void restore_state_to_opc (CPUXtensaState *env,TranslationBlock *tb,int pc_pos) { env->pc = gen_opc_pc[pc_pos]; }
Signature · 1 line
1.7.7
PATCH v4 2/44 Rename cpu_reset() to cpu_state_reset()
In reply to Andreas FärberFrees the identifier cpu_reset for QOM CPUs (manual rename).
Don't hide the parameter type behind explicit casts, use static functions with strongly typed argument to indirect.
--- bsd-user/main.c | 2 +- cpu-all.h | 2 +- cpu-exec.c | 2 +- darwin-user/main.c | 2 +- hw/arm_boot.c | 2 +- hw/armv7m.c | 2 +- hw/cris-boot.c | 2 +- hw/leon3.c | 2 +- hw/lm32_boards.c | 2 +- hw/microblaze_boot.c | 2 +- hw/milkymist.c | 2 +- hw/mips_fulong2e.c | 2 +- hw/mips_jazz.c | 2 +- hw/mips_malta.c | 2 +- hw/mips_mipssim.c | 2 +- hw/mips_r4k.c | 2 +- hw/omap1.c | 2 +- hw/omap2.c | 2 +- hw/pc.c | 2 +- hw/ppc440_bamboo.c | 2 +- hw/ppc4xx_devs.c | 9 ++++++++- hw/ppc_newworld.c | 9 ++++++++- hw/ppc_oldworld.c | 9 ++++++++- hw/ppc_prep.c | 9 ++++++++- hw/ppce500_mpc8544ds.c | 4 ++-- hw/pxa2xx.c | 2 +- hw/r2d.c | 2 +- hw/spapr.c | 9 ++++++++- hw/sun4m.c | 4 ++-- hw/sun4u.c | 2 +- hw/virtex_ml507.c | 2 +- hw/xtensa_lx60.c | 8 +++++--- hw/xtensa_sim.c | 2 +- linux-user/main.c | 2 +- linux-user/syscall.c | 2 +- target-arm/helper.c | 4 ++-- target-cris/translate.c | 4 ++-- target-i386/helper.c | 4 ++-- target-lm32/helper.c | 4 ++-- target-m68k/helper.c | 4 ++-- target-microblaze/translate.c | 4 ++-- target-mips/helper.c | 2 +- target-mips/translate.c | 4 ++-- target-ppc/helper.c | 2 +- target-s390x/helper.c | 4 ++-- target-sh4/translate.c | 4 ++-- target-sparc/cpu_init.c | 2 +- target-xtensa/helper.c | 2 +- 48 files changed, 98 insertions(+), 61 deletions(-)
bsd-user/main.c +1 -1
@@ -917,7 +917,7 @@ int main(int argc, char **argv)exit (1 ); }#if defined(TARGET_I386 ) || defined(TARGET_SPARC ) || defined(TARGET_PPC ) -cpu_reset (env); +cpu_state_reset (env);#endif thread_env = env;
cpu-all.h +1 -1
@@ -433,7 +433,7 @@ void cpu_watchpoint_remove_all(CPUState *env, int mask);#define SSTEP_NOTIMER 0x4/* Do not Timers while single stepping */ void cpu_single_step (CPUState *env,int enabled); -void cpu_reset (CPUState *s); +void cpu_state_reset (CPUState *s);int cpu_is_stopped (CPUState *env);void run_on_cpu (CPUState *env,void (*func)(void *data),void *data);
cpu-exec.c +1 -1
@@ -340,7 +340,7 @@ int cpu_exec(CPUState *env) }#elif defined(TARGET_PPC)if ((interrupt_request &CPU_INTERRUPT_RESET )) { -cpu_reset (env); +cpu_state_reset (env); }if (interrupt_request &CPU_INTERRUPT_HARD ) {ppc_hw_interrupt (env);
darwin-user/main.c +1 -1
@@ -858,7 +858,7 @@ int main(int argc, char **argv)/* NOTE: we need to init the CPU at this stage to get qemu_host_page_size */ env =cpu_init (cpu_model); -cpu_reset (env); +cpu_state_reset (env);printf ("Starting %s with qemu\n----------------\n" , filename);
hw/arm_boot.c +1 -1
@@ -277,7 +277,7 @@ static void do_cpu_reset(void *opaque)CPUState *env = opaque;const struct arm_boot_info *info = env->boot_info; -cpu_reset (env); +cpu_state_reset (env);if (info) {if (!info->is_linux) {/* Jump to the entry point. */
hw/armv7m.c +1 -1
@@ -149,7 +149,7 @@ static void armv7m_bitband_init(void)static void armv7m_reset (void *opaque) { -cpu_reset ((CPUState *)opaque); +cpu_state_reset ((CPUState *)opaque); }/* Init CPU and memory for a v7-M based board.
hw/cris-boot.c +1 -1
@@ -34,7 +34,7 @@ static void main_cpu_reset(void *opaque) li = env->load_info; -cpu_reset (env); +cpu_state_reset (env);if (!li) {/* nothing more to do. */
hw/leon3.c +1 -1
@@ -51,7 +51,7 @@ static void main_cpu_reset(void *opaque)ResetData *s = (ResetData *)opaque;CPUState *env = s->env; -cpu_reset (env); +cpu_state_reset (env); env->halted =0 ; env->pc = s->entry;
hw/lm32_boards.c +1 -1
@@ -56,7 +56,7 @@ static void main_cpu_reset(void *opaque)ResetInfo *reset_info = opaque;CPUState *env = reset_info->env; -cpu_reset (env); +cpu_state_reset (env);/* init defaults */ env->pc = (uint32_t )reset_info->bootstrap_pc;
hw/microblaze_boot.c +1 -1
@@ -45,7 +45,7 @@ static void main_cpu_reset(void *opaque) {CPUState *env = opaque; -cpu_reset (env); +cpu_state_reset (env); env->regs[5 ] = boot_info.cmdline; env->regs[7 ] = boot_info.fdt; env->sregs[SR_PC ] = boot_info.bootstrap_pc;
hw/milkymist.c +1 -1
@@ -61,7 +61,7 @@ static void main_cpu_reset(void *opaque)ResetInfo *reset_info = opaque;CPUState *env = reset_info->env; -cpu_reset (env); +cpu_state_reset (env);/* init defaults */ env->pc = reset_info->bootstrap_pc;
hw/mips_fulong2e.c +1 -1
@@ -201,7 +201,7 @@ static void main_cpu_reset(void *opaque) {CPUState *env = opaque; -cpu_reset (env); +cpu_state_reset (env);/* TODO: 2E reset stuff */ if (loaderparams.kernel_filename) { env->CP0_Status &= ~((1 << CP0St_BEV) | (1 << CP0St_ERL));
hw/mips_jazz.c +1 -1
@@ -51,7 +51,7 @@ enum jazz_model_estatic void main_cpu_reset (void *opaque) {CPUState *env = opaque; -cpu_reset (env); +cpu_state_reset (env); }static uint64_t rtc_read (void *opaque,target_phys_addr_t addr,unsigned size)
hw/mips_malta.c +1 -1
@@ -746,7 +746,7 @@ static void malta_mips_config(CPUState *env)static void main_cpu_reset (void *opaque) {CPUState *env = opaque; -cpu_reset (env); +cpu_state_reset (env);/* The bootloader does not need to be rewritten as it is located in a read only location. The kernel location and the arguments table
hw/mips_mipssim.c +1 -1
@@ -107,7 +107,7 @@ static void main_cpu_reset(void *opaque)ResetData *s = (ResetData *)opaque;CPUState *env = s->env; -cpu_reset (env); +cpu_state_reset (env); env->active_tc.PC = s->vector & ~(target_ulong )1 ;if (s->vector &1 ) { env->hflags |=MIPS_HFLAG_M16 ;
hw/mips_r4k.c +1 -1
@@ -145,7 +145,7 @@ static void main_cpu_reset(void *opaque)ResetData *s = (ResetData *)opaque;CPUState *env = s->env; -cpu_reset (env); +cpu_state_reset (env); env->active_tc.PC = s->vector; }
hw/omap1.c +1 -1
@@ -3702,7 +3702,7 @@ static void omap1_mpu_reset(void *opaque)omap_lpg_reset (mpu->led[0 ]);omap_lpg_reset (mpu->led[1 ]);omap_clkm_reset (mpu); -cpu_reset (mpu->env); +cpu_state_reset (mpu->env); } static const struct omap_map_s {
hw/omap2.c +1 -1
@@ -2224,7 +2224,7 @@ static void omap2_mpu_reset(void *opaque)omap_mcspi_reset (mpu->mcspi[1 ]);omap_i2c_reset (mpu->i2c[0 ]);omap_i2c_reset (mpu->i2c[1 ]); -cpu_reset (mpu->env); +cpu_state_reset (mpu->env); } static int omap2_validate_addr(struct omap_mpu_state_s *s,
hw/pc.c +1 -1
@@ -928,7 +928,7 @@ static void pc_cpu_reset(void *opaque) {CPUState *env = opaque; -cpu_reset (env); +cpu_state_reset (env); env->halted = !cpu_is_bsp (env); }
hw/ppc440_bamboo.c +1 -1
@@ -147,7 +147,7 @@ static void main_cpu_reset(void *opaque) {CPUState *env = opaque; -cpu_reset (env); +cpu_state_reset (env); env->gpr[1 ] = (16 <<20 ) -8 ; env->gpr[3 ] =FDT_ADDR ; env->nip = entry;
hw/ppc4xx_devs.c +8 -1
@@ -38,6 +38,13 @@# define LOG_UIC (...) do { } while (0)#endif +static void ppc4xx_reset (void *opaque) +{ +CPUState *env = opaque; + +cpu_state_reset (env); +} +/*****************************************************************************/ /* Generic PowerPC 4xx processor instantiation */ CPUState *ppc4xx_init (const char *cpu_model,
@@ -60,7 +67,7 @@ CPUState *ppc4xx_init (const char *cpu_model, tb_clk->opaque = env;ppc_dcr_init (env,NULL ,NULL );/* Register qemu callbacks */ -qemu_register_reset ((QEMUResetHandler *)&cpu_reset, env); +qemu_register_reset (ppc4xx_reset, env);return env; }
hw/ppc_newworld.c +8 -1
@@ -122,6 +122,13 @@ static target_phys_addr_t round_page(target_phys_addr_t addr)return (addr +TARGET_PAGE_SIZE -1 ) &TARGET_PAGE_MASK ; } +static void ppc_core99_reset (void *opaque) +{ +CPUState *env = opaque; + +cpu_state_reset (env); +} +/* PowerPC Mac99 hardware initialisation */ static void ppc_core99_init (ram_addr_t ram_size, const char *boot_device,
@@ -167,7 +174,7 @@ static void ppc_core99_init (ram_addr_t ram_size, }/* Set time-base frequency to 100 Mhz */ cpu_ppc_tb_init (env,100UL *1000UL *1000UL ); -qemu_register_reset ((QEMUResetHandler *)&cpu_reset, env); +qemu_register_reset (ppc_core99_reset, env); }/* allocate RAM */
hw/ppc_oldworld.c +8 -1
@@ -66,6 +66,13 @@ static target_phys_addr_t round_page(target_phys_addr_t addr)return (addr +TARGET_PAGE_SIZE -1 ) &TARGET_PAGE_MASK ; } +static void ppc_heathrow_reset (void *opaque) +{ +CPUState *env = opaque; + +cpu_state_reset (env); +} + static void ppc_heathrow_init (ram_addr_t ram_size, const char *boot_device, const char *kernel_filename,
@@ -105,7 +112,7 @@ static void ppc_heathrow_init (ram_addr_t ram_size, }/* Set time-base frequency to 16.6 Mhz */ cpu_ppc_tb_init (env,16600000UL ); -qemu_register_reset ((QEMUResetHandler *)&cpu_reset, env); +qemu_register_reset (ppc_heathrow_reset, env); }/* allocate RAM */
hw/ppc_prep.c +8 -1
@@ -471,6 +471,13 @@ static void cpu_request_exit(void *opaque, int irq, int level) } } +static void ppc_prep_reset (void *opaque) +{ +CPUState *env = opaque; + +cpu_state_reset (env); +} +/* PowerPC PREP hardware initialisation */ static void ppc_prep_init (ram_addr_t ram_size, const char *boot_device,
@@ -525,7 +532,7 @@ static void ppc_prep_init (ram_addr_t ram_size,/* Set time-base frequency to 100 Mhz */ cpu_ppc_tb_init (env,100UL *1000UL *1000UL ); } -qemu_register_reset ((QEMUResetHandler *)&cpu_reset, env); +qemu_register_reset (ppc_prep_reset, env); }/* allocate RAM */
hw/ppce500_mpc8544ds.c +2 -2
@@ -198,7 +198,7 @@ static void mpc8544ds_cpu_reset_sec(void *opaque) {CPUState *env = opaque; -cpu_reset (env); +cpu_state_reset (env);/* Secondary CPU starts in halted state for now. Needs to change when implementing non-kernel boot. */
@@ -211,7 +211,7 @@ static void mpc8544ds_cpu_reset(void *opaque)CPUState *env = opaque;struct boot_info *bi = env->load_info; -cpu_reset (env); +cpu_state_reset (env);/* Set initial guest state. */ env->halted =0 ;
hw/pxa2xx.c +1 -1
@@ -2045,7 +2045,7 @@ static void pxa2xx_reset(void *opaque, int line, int level)PXA2xxState *s = (PXA2xxState *) opaque;if (level && (s->pm_regs[PCFR >>2 ] &0x10 )) {/* GPR_EN */ -cpu_reset (s->env); +cpu_state_reset (s->env);/* TODO: reset peripherals */ } }
hw/r2d.c +1 -1
@@ -201,7 +201,7 @@ static void main_cpu_reset(void *opaque)ResetData *s = (ResetData *)opaque;CPUState *env = s->env; -cpu_reset (env); +cpu_state_reset (env); env->pc = s->vector; }
hw/spapr.c +8 -1
@@ -502,6 +502,13 @@ static void spapr_reset(void *opaque) } +static void spapr_cpu_reset (void *opaque) +{ +CPUState *env = opaque; + +cpu_state_reset (env); +} +/* pSeries LPAR / sPAPR hardware init */ static void ppc_spapr_init(ram_addr_t ram_size, const char *boot_device,
@@ -560,7 +567,7 @@ static void ppc_spapr_init(ram_addr_t ram_size, }/* Set time-base frequency to 512 MHz */ cpu_ppc_tb_init (env,TIMEBASE_FREQ ); -qemu_register_reset ((QEMUResetHandler *)&cpu_reset, env); +qemu_register_reset (spapr_cpu_reset, env); env->hreset_vector =0x60 ; env->hreset_excp_prefix =0 ;
hw/sun4m.c +2 -2
@@ -283,7 +283,7 @@ static void main_cpu_reset(void *opaque) {CPUState *env = opaque; -cpu_reset (env); +cpu_state_reset (env); env->halted =0 ; }
@@ -291,7 +291,7 @@ static void secondary_cpu_reset(void *opaque) {CPUState *env = opaque; -cpu_reset (env); +cpu_state_reset (env); env->halted =1 ; }
hw/sun4u.c +1 -1
@@ -376,7 +376,7 @@ static void main_cpu_reset(void *opaque)CPUState *env = s->env;static unsigned int nr_resets; -cpu_reset (env); +cpu_state_reset (env);cpu_timer_reset (env->tick);cpu_timer_reset (env->stick);
hw/virtex_ml507.c +1 -1
@@ -109,7 +109,7 @@ static void main_cpu_reset(void *opaque)CPUState *env = opaque;struct boot_info *bi = env->load_info; -cpu_reset (env); +cpu_state_reset (env);/* Linux Kernel Parameters (passing device tree): * r3: pointer to the fdt * r4: 0
hw/xtensa_lx60.c +5 -3
@@ -146,9 +146,11 @@ static uint64_t translate_phys_addr(void *env, uint64_t addr)return cpu_get_phys_page_debug (env, addr); } -static void lx60_reset (void *env) +static void lx60_reset (void *opaque) { -cpu_reset (env); +CPUState *env = opaque; + +cpu_state_reset (env); } static void lx_init(const LxBoardDesc *board,
@@ -183,7 +185,7 @@ static void lx_init(const LxBoardDesc *board,/* Need MMU initialized prior to ELF loading, * so that ELF gets loaded into virtual addresses */ -cpu_reset (env); +cpu_state_reset (env); } ram =g_malloc (sizeof (*ram));
hw/xtensa_sim.c +1 -1
@@ -39,7 +39,7 @@ static uint64_t translate_phys_addr(void *env, uint64_t addr)static void sim_reset (void *env) { -cpu_reset (env); +cpu_state_reset (env); } static void sim_init(ram_addr_t ram_size,
linux-user/main.c +1 -1
@@ -3375,7 +3375,7 @@ int main(int argc, char **argv, char **envp)exit (1 ); }#if defined(TARGET_I386 ) || defined(TARGET_SPARC ) || defined(TARGET_PPC ) -cpu_reset (env); +cpu_state_reset (env);#endif thread_env = env;
linux-user/syscall.c +1 -1
@@ -4036,7 +4036,7 @@ static int do_fork(CPUState *env, unsigned int flags, abi_ulong newsp,/* we create a new CPU instance. */ new_env =cpu_copy (env);#if defined(TARGET_I386 ) || defined(TARGET_SPARC ) || defined(TARGET_PPC ) -cpu_reset (new_env); +cpu_state_reset (new_env);#endif /* Init regs that differ from the parent. */ cpu_clone_regs (new_env, newsp);
target-arm/helper.c +2 -2
@@ -278,7 +278,7 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id) } } -void cpu_reset (CPUARMState *env) +void cpu_state_reset (CPUARMState *env) {uint32_t id;uint32_t tmp =0 ;
@@ -416,7 +416,7 @@ CPUARMState *cpu_arm_init(const char *cpu_model) env->cpu_model_str = cpu_model; env->cp15.c0_cpuid = id; -cpu_reset (env); +cpu_state_reset (env);if (arm_feature (env,ARM_FEATURE_NEON )) {gdb_register_coprocessor (env, vfp_gdb_get_reg, vfp_gdb_set_reg,51 ,"arm-neon.xml" ,0 );
target-cris/translate.c +2 -2
@@ -3513,7 +3513,7 @@ CPUCRISState *cpu_cris_init (const char *cpu_model) env->pregs[PR_VR ] =vr_by_name (cpu_model);cpu_exec_init (env); -cpu_reset (env); +cpu_state_reset (env);qemu_init_vcpu (env);if (tcg_initialized)
@@ -3573,7 +3573,7 @@ CPUCRISState *cpu_cris_init (const char *cpu_model)return env; } -void cpu_reset (CPUCRISState *env) +void cpu_state_reset (CPUCRISState *env) {uint32_t vr;
target-i386/helper.c +2 -2
@@ -27,7 +27,7 @@//#define DEBUG_MMU /* NOTE: must be called outside the CPU execute loop */ -void cpu_reset (CPUX86State *env) +void cpu_state_reset (CPUState *env) {int i;
@@ -1281,7 +1281,7 @@ void do_cpu_init(CPUState *env)int sipi = env->interrupt_request &CPU_INTERRUPT_SIPI ;uint64_t pat = env->pat; -cpu_reset (env); +cpu_state_reset (env); env->interrupt_request = sipi; env->pat = pat;apic_init_reset (env->apic_state);
target-lm32/helper.c +2 -2
@@ -212,7 +212,7 @@ CPUState *cpu_lm32_init(const char *cpu_model) env->flags =0 ;cpu_exec_init (env); -cpu_reset (env); +cpu_state_reset (env);qemu_init_vcpu (env);if (!tcg_initialized) {
@@ -235,7 +235,7 @@ void cpu_lm32_set_phys_msb_ignore(CPUState *env, int value) } } -void cpu_reset (CPUState *env) +void cpu_state_reset (CPUState *env) {if (qemu_loglevel_mask (CPU_LOG_RESET )) {qemu_log ("CPU Reset (CPU %d)\n" , env->cpu_index);
target-m68k/helper.c +2 -2
@@ -143,7 +143,7 @@ static int cpu_m68k_set_model(CPUM68KState *env, const char *name)return 0 ; } -void cpu_reset (CPUM68KState *env) +void cpu_state_reset (CPUM68KState *env) {if (qemu_loglevel_mask (CPU_LOG_RESET )) {qemu_log ("CPU Reset (CPU %d)\n" , env->cpu_index);
@@ -181,7 +181,7 @@ CPUM68KState *cpu_m68k_init(const char *cpu_model)return NULL ; } -cpu_reset (env); +cpu_state_reset (env);qemu_init_vcpu (env);return env; }
target-microblaze/translate.c +2 -2
@@ -1897,7 +1897,7 @@ CPUState *cpu_mb_init (const char *cpu_model) env =g_malloc0 (sizeof (CPUState));cpu_exec_init (env); -cpu_reset (env); +cpu_state_reset (env);qemu_init_vcpu (env);set_float_rounding_mode (float_round_nearest_even, &env->fp_status);
@@ -1939,7 +1939,7 @@ CPUState *cpu_mb_init (const char *cpu_model)return env; } -void cpu_reset (CPUState *env) +void cpu_state_reset (CPUState *env) {if (qemu_loglevel_mask (CPU_LOG_RESET )) {qemu_log ("CPU Reset (CPU %d)\n" , env->cpu_index);
target-mips/helper.c +1 -1
@@ -452,7 +452,7 @@ void do_interrupt (CPUState *env)set_hflags_for_handler (env);break ;case EXCP_RESET : -cpu_reset (env); +cpu_state_reset (env);break ;case EXCP_SRESET : env->CP0_Status |= (1 << CP0St_SR);
target-mips/translate.c +2 -2
@@ -12708,12 +12708,12 @@ CPUMIPSState *cpu_mips_init (const char *cpu_model)fpu_init (env, def);mvp_init (env, def);mips_tcg_init (); -cpu_reset (env); +cpu_state_reset (env);qemu_init_vcpu (env);return env; } -void cpu_reset (CPUMIPSState *env) +void cpu_state_reset (CPUMIPSState *env) {if (qemu_loglevel_mask (CPU_LOG_RESET )) {qemu_log ("CPU Reset (CPU %d)\n" , env->cpu_index);
target-ppc/helper.c +1 -1
@@ -3136,7 +3136,7 @@ void cpu_dump_rfi (target_ulong RA, target_ulong msr) TARGET_FMT_lx "\n", RA, msr); } -void cpu_reset (CPUPPCState *env) +void cpu_state_reset (CPUPPCState *env) {target_ulong msr;
target-s390x/helper.c +2 -2
@@ -95,7 +95,7 @@ CPUS390XState *cpu_s390x_init(const char *cpu_model) env->cpu_model_str = cpu_model; env->cpu_num = cpu_num++; env->ext_index =-1 ; -cpu_reset (env); +cpu_state_reset (env);qemu_init_vcpu (env);return env; }
@@ -119,7 +119,7 @@ int cpu_s390x_handle_mmu_fault (CPUState *env, target_ulong address, int rw,#endif /* CONFIG_USER_ONLY */ -void cpu_reset (CPUS390XState *env) +void cpu_state_reset (CPUS390XState *env) {if (qemu_loglevel_mask (CPU_LOG_RESET )) {qemu_log ("CPU Reset (CPU %d)\n" , env->cpu_index);
target-sh4/translate.c +2 -2
@@ -178,7 +178,7 @@ void cpu_dump_state(CPUState * env, FILE * f, } } -void cpu_reset (CPUSH4State * env) +void cpu_state_reset (CPUSH4State *env) {if (qemu_loglevel_mask (CPU_LOG_RESET )) {qemu_log ("CPU Reset (CPU %d)\n" , env->cpu_index);
@@ -279,7 +279,7 @@ CPUSH4State *cpu_sh4_init(const char *cpu_model) env->movcal_backup_tail = &(env->movcal_backup);sh4_translate_init (); env->cpu_model_str = cpu_model; -cpu_reset (env); +cpu_state_reset (env);cpu_register (env, def);qemu_init_vcpu (env);return env;
target-sparc/cpu_init.c +1 -1
@@ -23,7 +23,7 @@static int cpu_sparc_find_by_name (sparc_def_t *cpu_def,const char *cpu_model); -void cpu_reset (CPUSPARCState *env) +void cpu_state_reset (CPUSPARCState *env) {if (qemu_loglevel_mask (CPU_LOG_RESET )) {qemu_log ("CPU Reset (CPU %d)\n" , env->cpu_index);
target-xtensa/helper.c +1 -1
@@ -35,7 +35,7 @@static void reset_mmu (CPUState *env); -void cpu_reset (CPUXtensaState *env) +void cpu_state_reset (CPUXtensaState *env) { env->exception_taken =0 ; env->pc = env->config->exception_vector[EXC_RESET ];
Signature · 1 line
1.7.7
RFC PATCH v4 3/44 monitor: Don't access registers through CPUState
In reply to Andreas FärberUse CPUX86State etc. instead (hand-converted).
--- monitor.c | 488 ++++++++++++++++++++++++++++++------------------------------ 1 files changed, 244 insertions(+), 244 deletions(-)
monitor.c +244 -244
@@ -2696,30 +2696,30 @@ static const MonitorDef monitor_defs[] = { #ifdef TARGET_I386 #define SEG(name, seg) \ - { name, offsetof(CPUState, segs[seg].selector), NULL, MD_I32 },\ - { name ".base", offsetof(CPUState, segs[seg].base) },\ - { name ".limit", offsetof(CPUState, segs[seg].limit), NULL, MD_I32 }, + { name, offsetof(CPUX86State, segs[seg].selector), NULL, MD_I32 },\ + { name ".base", offsetof(CPUX86State, segs[seg].base) },\ + { name ".limit", offsetof(CPUX86State, segs[seg].limit), NULL, MD_I32 }, - { "eax", offsetof(CPUState, regs[0]) }, - { "ecx", offsetof(CPUState, regs[1]) }, - { "edx", offsetof(CPUState, regs[2]) }, - { "ebx", offsetof(CPUState, regs[3]) }, - { "esp|sp", offsetof(CPUState, regs[4]) }, - { "ebp|fp", offsetof(CPUState, regs[5]) }, - { "esi", offsetof(CPUState, regs[6]) }, - { "edi", offsetof(CPUState, regs[7]) }, + { "eax", offsetof(CPUX86State, regs[0]) }, + { "ecx", offsetof(CPUX86State, regs[1]) }, + { "edx", offsetof(CPUX86State, regs[2]) }, + { "ebx", offsetof(CPUX86State, regs[3]) }, + { "esp|sp", offsetof(CPUX86State, regs[4]) }, + { "ebp|fp", offsetof(CPUX86State, regs[5]) }, + { "esi", offsetof(CPUX86State, regs[6]) }, + { "edi", offsetof(CPUX86State, regs[7]) }, #ifdef TARGET_X86_64 - { "r8", offsetof(CPUState, regs[8]) }, - { "r9", offsetof(CPUState, regs[9]) }, - { "r10", offsetof(CPUState, regs[10]) }, - { "r11", offsetof(CPUState, regs[11]) }, - { "r12", offsetof(CPUState, regs[12]) }, - { "r13", offsetof(CPUState, regs[13]) }, - { "r14", offsetof(CPUState, regs[14]) }, - { "r15", offsetof(CPUState, regs[15]) }, + { "r8", offsetof(CPUX86State, regs[8]) }, + { "r9", offsetof(CPUX86State, regs[9]) }, + { "r10", offsetof(CPUX86State, regs[10]) }, + { "r11", offsetof(CPUX86State, regs[11]) }, + { "r12", offsetof(CPUX86State, regs[12]) }, + { "r13", offsetof(CPUX86State, regs[13]) }, + { "r14", offsetof(CPUX86State, regs[14]) }, + { "r15", offsetof(CPUX86State, regs[15]) }, #endif - { "eflags", offsetof(CPUState, eflags) }, - { "eip", offsetof(CPUState, eip) }, + { "eflags", offsetof(CPUX86State, eflags) }, + { "eip", offsetof(CPUX86State, eip) }, SEG("cs", R_CS) SEG("ds", R_DS) SEG("es", R_ES)
@@ -2729,76 +2729,76 @@ static const MonitorDef monitor_defs[] = { { "pc", 0, monitor_get_pc, }, #elif defined(TARGET_PPC) /* General purpose registers */ - { "r0", offsetof(CPUState, gpr[0]) }, - { "r1", offsetof(CPUState, gpr[1]) }, - { "r2", offsetof(CPUState, gpr[2]) }, - { "r3", offsetof(CPUState, gpr[3]) }, - { "r4", offsetof(CPUState, gpr[4]) }, - { "r5", offsetof(CPUState, gpr[5]) }, - { "r6", offsetof(CPUState, gpr[6]) }, - { "r7", offsetof(CPUState, gpr[7]) }, - { "r8", offsetof(CPUState, gpr[8]) }, - { "r9", offsetof(CPUState, gpr[9]) }, - { "r10", offsetof(CPUState, gpr[10]) }, - { "r11", offsetof(CPUState, gpr[11]) }, - { "r12", offsetof(CPUState, gpr[12]) }, - { "r13", offsetof(CPUState, gpr[13]) }, - { "r14", offsetof(CPUState, gpr[14]) }, - { "r15", offsetof(CPUState, gpr[15]) }, - { "r16", offsetof(CPUState, gpr[16]) }, - { "r17", offsetof(CPUState, gpr[17]) }, - { "r18", offsetof(CPUState, gpr[18]) }, - { "r19", offsetof(CPUState, gpr[19]) }, - { "r20", offsetof(CPUState, gpr[20]) }, - { "r21", offsetof(CPUState, gpr[21]) }, - { "r22", offsetof(CPUState, gpr[22]) }, - { "r23", offsetof(CPUState, gpr[23]) }, - { "r24", offsetof(CPUState, gpr[24]) }, - { "r25", offsetof(CPUState, gpr[25]) }, - { "r26", offsetof(CPUState, gpr[26]) }, - { "r27", offsetof(CPUState, gpr[27]) }, - { "r28", offsetof(CPUState, gpr[28]) }, - { "r29", offsetof(CPUState, gpr[29]) }, - { "r30", offsetof(CPUState, gpr[30]) }, - { "r31", offsetof(CPUState, gpr[31]) }, + { "r0", offsetof(CPUPPCState, gpr[0]) }, + { "r1", offsetof(CPUPPCState, gpr[1]) }, + { "r2", offsetof(CPUPPCState, gpr[2]) }, + { "r3", offsetof(CPUPPCState, gpr[3]) }, + { "r4", offsetof(CPUPPCState, gpr[4]) }, + { "r5", offsetof(CPUPPCState, gpr[5]) }, + { "r6", offsetof(CPUPPCState, gpr[6]) }, + { "r7", offsetof(CPUPPCState, gpr[7]) }, + { "r8", offsetof(CPUPPCState, gpr[8]) }, + { "r9", offsetof(CPUPPCState, gpr[9]) }, + { "r10", offsetof(CPUPPCState, gpr[10]) }, + { "r11", offsetof(CPUPPCState, gpr[11]) }, + { "r12", offsetof(CPUPPCState, gpr[12]) }, + { "r13", offsetof(CPUPPCState, gpr[13]) }, + { "r14", offsetof(CPUPPCState, gpr[14]) }, + { "r15", offsetof(CPUPPCState, gpr[15]) }, + { "r16", offsetof(CPUPPCState, gpr[16]) }, + { "r17", offsetof(CPUPPCState, gpr[17]) }, + { "r18", offsetof(CPUPPCState, gpr[18]) }, + { "r19", offsetof(CPUPPCState, gpr[19]) }, + { "r20", offsetof(CPUPPCState, gpr[20]) }, + { "r21", offsetof(CPUPPCState, gpr[21]) }, + { "r22", offsetof(CPUPPCState, gpr[22]) }, + { "r23", offsetof(CPUPPCState, gpr[23]) }, + { "r24", offsetof(CPUPPCState, gpr[24]) }, + { "r25", offsetof(CPUPPCState, gpr[25]) }, + { "r26", offsetof(CPUPPCState, gpr[26]) }, + { "r27", offsetof(CPUPPCState, gpr[27]) }, + { "r28", offsetof(CPUPPCState, gpr[28]) }, + { "r29", offsetof(CPUPPCState, gpr[29]) }, + { "r30", offsetof(CPUPPCState, gpr[30]) }, + { "r31", offsetof(CPUPPCState, gpr[31]) }, /* Floating point registers */ - { "f0", offsetof(CPUState, fpr[0]) }, - { "f1", offsetof(CPUState, fpr[1]) }, - { "f2", offsetof(CPUState, fpr[2]) }, - { "f3", offsetof(CPUState, fpr[3]) }, - { "f4", offsetof(CPUState, fpr[4]) }, - { "f5", offsetof(CPUState, fpr[5]) }, - { "f6", offsetof(CPUState, fpr[6]) }, - { "f7", offsetof(CPUState, fpr[7]) }, - { "f8", offsetof(CPUState, fpr[8]) }, - { "f9", offsetof(CPUState, fpr[9]) }, - { "f10", offsetof(CPUState, fpr[10]) }, - { "f11", offsetof(CPUState, fpr[11]) }, - { "f12", offsetof(CPUState, fpr[12]) }, - { "f13", offsetof(CPUState, fpr[13]) }, - { "f14", offsetof(CPUState, fpr[14]) }, - { "f15", offsetof(CPUState, fpr[15]) }, - { "f16", offsetof(CPUState, fpr[16]) }, - { "f17", offsetof(CPUState, fpr[17]) }, - { "f18", offsetof(CPUState, fpr[18]) }, - { "f19", offsetof(CPUState, fpr[19]) }, - { "f20", offsetof(CPUState, fpr[20]) }, - { "f21", offsetof(CPUState, fpr[21]) }, - { "f22", offsetof(CPUState, fpr[22]) }, - { "f23", offsetof(CPUState, fpr[23]) }, - { "f24", offsetof(CPUState, fpr[24]) }, - { "f25", offsetof(CPUState, fpr[25]) }, - { "f26", offsetof(CPUState, fpr[26]) }, - { "f27", offsetof(CPUState, fpr[27]) }, - { "f28", offsetof(CPUState, fpr[28]) }, - { "f29", offsetof(CPUState, fpr[29]) }, - { "f30", offsetof(CPUState, fpr[30]) }, - { "f31", offsetof(CPUState, fpr[31]) }, - { "fpscr", offsetof(CPUState, fpscr) }, + { "f0", offsetof(CPUPPCState, fpr[0]) }, + { "f1", offsetof(CPUPPCState, fpr[1]) }, + { "f2", offsetof(CPUPPCState, fpr[2]) }, + { "f3", offsetof(CPUPPCState, fpr[3]) }, + { "f4", offsetof(CPUPPCState, fpr[4]) }, + { "f5", offsetof(CPUPPCState, fpr[5]) }, + { "f6", offsetof(CPUPPCState, fpr[6]) }, + { "f7", offsetof(CPUPPCState, fpr[7]) }, + { "f8", offsetof(CPUPPCState, fpr[8]) }, + { "f9", offsetof(CPUPPCState, fpr[9]) }, + { "f10", offsetof(CPUPPCState, fpr[10]) }, + { "f11", offsetof(CPUPPCState, fpr[11]) }, + { "f12", offsetof(CPUPPCState, fpr[12]) }, + { "f13", offsetof(CPUPPCState, fpr[13]) }, + { "f14", offsetof(CPUPPCState, fpr[14]) }, + { "f15", offsetof(CPUPPCState, fpr[15]) }, + { "f16", offsetof(CPUPPCState, fpr[16]) }, + { "f17", offsetof(CPUPPCState, fpr[17]) }, + { "f18", offsetof(CPUPPCState, fpr[18]) }, + { "f19", offsetof(CPUPPCState, fpr[19]) }, + { "f20", offsetof(CPUPPCState, fpr[20]) }, + { "f21", offsetof(CPUPPCState, fpr[21]) }, + { "f22", offsetof(CPUPPCState, fpr[22]) }, + { "f23", offsetof(CPUPPCState, fpr[23]) }, + { "f24", offsetof(CPUPPCState, fpr[24]) }, + { "f25", offsetof(CPUPPCState, fpr[25]) }, + { "f26", offsetof(CPUPPCState, fpr[26]) }, + { "f27", offsetof(CPUPPCState, fpr[27]) }, + { "f28", offsetof(CPUPPCState, fpr[28]) }, + { "f29", offsetof(CPUPPCState, fpr[29]) }, + { "f30", offsetof(CPUPPCState, fpr[30]) }, + { "f31", offsetof(CPUPPCState, fpr[31]) }, + { "fpscr", offsetof(CPUPPCState, fpscr) }, /* Next instruction pointer */ - { "nip|pc", offsetof(CPUState, nip) }, - { "lr", offsetof(CPUState, lr) }, - { "ctr", offsetof(CPUState, ctr) }, + { "nip|pc", offsetof(CPUPPCState, nip) }, + { "lr", offsetof(CPUPPCState, lr) }, + { "ctr", offsetof(CPUPPCState, ctr) }, { "decr", 0, &monitor_get_decr, }, { "ccr", 0, &monitor_get_ccr, }, /* Machine state register */
@@ -2808,105 +2808,105 @@ static const MonitorDef monitor_defs[] = { { "tbl", 0, &monitor_get_tbl, }, #if defined(TARGET_PPC64) /* Address space register */ - { "asr", offsetof(CPUState, asr) }, + { "asr", offsetof(CPUPPCState, asr) }, #endif /* Segment registers */ - { "sdr1", offsetof(CPUState, spr[SPR_SDR1]) }, - { "sr0", offsetof(CPUState, sr[0]) }, - { "sr1", offsetof(CPUState, sr[1]) }, - { "sr2", offsetof(CPUState, sr[2]) }, - { "sr3", offsetof(CPUState, sr[3]) }, - { "sr4", offsetof(CPUState, sr[4]) }, - { "sr5", offsetof(CPUState, sr[5]) }, - { "sr6", offsetof(CPUState, sr[6]) }, - { "sr7", offsetof(CPUState, sr[7]) }, - { "sr8", offsetof(CPUState, sr[8]) }, - { "sr9", offsetof(CPUState, sr[9]) }, - { "sr10", offsetof(CPUState, sr[10]) }, - { "sr11", offsetof(CPUState, sr[11]) }, - { "sr12", offsetof(CPUState, sr[12]) }, - { "sr13", offsetof(CPUState, sr[13]) }, - { "sr14", offsetof(CPUState, sr[14]) }, - { "sr15", offsetof(CPUState, sr[15]) }, + { "sdr1", offsetof(CPUPPCState, spr[SPR_SDR1]) }, + { "sr0", offsetof(CPUPPCState, sr[0]) }, + { "sr1", offsetof(CPUPPCState, sr[1]) }, + { "sr2", offsetof(CPUPPCState, sr[2]) }, + { "sr3", offsetof(CPUPPCState, sr[3]) }, + { "sr4", offsetof(CPUPPCState, sr[4]) }, + { "sr5", offsetof(CPUPPCState, sr[5]) }, + { "sr6", offsetof(CPUPPCState, sr[6]) }, + { "sr7", offsetof(CPUPPCState, sr[7]) }, + { "sr8", offsetof(CPUPPCState, sr[8]) }, + { "sr9", offsetof(CPUPPCState, sr[9]) }, + { "sr10", offsetof(CPUPPCState, sr[10]) }, + { "sr11", offsetof(CPUPPCState, sr[11]) }, + { "sr12", offsetof(CPUPPCState, sr[12]) }, + { "sr13", offsetof(CPUPPCState, sr[13]) }, + { "sr14", offsetof(CPUPPCState, sr[14]) }, + { "sr15", offsetof(CPUPPCState, sr[15]) }, /* Too lazy to put BATs... */ - { "pvr", offsetof(CPUState, spr[SPR_PVR]) }, + { "pvr", offsetof(CPUPPCState, spr[SPR_PVR]) }, - { "srr0", offsetof(CPUState, spr[SPR_SRR0]) }, - { "srr1", offsetof(CPUState, spr[SPR_SRR1]) }, - { "sprg0", offsetof(CPUState, spr[SPR_SPRG0]) }, - { "sprg1", offsetof(CPUState, spr[SPR_SPRG1]) }, - { "sprg2", offsetof(CPUState, spr[SPR_SPRG2]) }, - { "sprg3", offsetof(CPUState, spr[SPR_SPRG3]) }, - { "sprg4", offsetof(CPUState, spr[SPR_SPRG4]) }, - { "sprg5", offsetof(CPUState, spr[SPR_SPRG5]) }, - { "sprg6", offsetof(CPUState, spr[SPR_SPRG6]) }, - { "sprg7", offsetof(CPUState, spr[SPR_SPRG7]) }, - { "pid", offsetof(CPUState, spr[SPR_BOOKE_PID]) }, - { "csrr0", offsetof(CPUState, spr[SPR_BOOKE_CSRR0]) }, - { "csrr1", offsetof(CPUState, spr[SPR_BOOKE_CSRR1]) }, - { "esr", offsetof(CPUState, spr[SPR_BOOKE_ESR]) }, - { "dear", offsetof(CPUState, spr[SPR_BOOKE_DEAR]) }, - { "mcsr", offsetof(CPUState, spr[SPR_BOOKE_MCSR]) }, - { "tsr", offsetof(CPUState, spr[SPR_BOOKE_TSR]) }, - { "tcr", offsetof(CPUState, spr[SPR_BOOKE_TCR]) }, - { "vrsave", offsetof(CPUState, spr[SPR_VRSAVE]) }, - { "pir", offsetof(CPUState, spr[SPR_BOOKE_PIR]) }, - { "mcsrr0", offsetof(CPUState, spr[SPR_BOOKE_MCSRR0]) }, - { "mcsrr1", offsetof(CPUState, spr[SPR_BOOKE_MCSRR1]) }, - { "decar", offsetof(CPUState, spr[SPR_BOOKE_DECAR]) }, - { "ivpr", offsetof(CPUState, spr[SPR_BOOKE_IVPR]) }, - { "epcr", offsetof(CPUState, spr[SPR_BOOKE_EPCR]) }, - { "sprg8", offsetof(CPUState, spr[SPR_BOOKE_SPRG8]) }, - { "ivor0", offsetof(CPUState, spr[SPR_BOOKE_IVOR0]) }, - { "ivor1", offsetof(CPUState, spr[SPR_BOOKE_IVOR1]) }, - { "ivor2", offsetof(CPUState, spr[SPR_BOOKE_IVOR2]) }, - { "ivor3", offsetof(CPUState, spr[SPR_BOOKE_IVOR3]) }, - { "ivor4", offsetof(CPUState, spr[SPR_BOOKE_IVOR4]) }, - { "ivor5", offsetof(CPUState, spr[SPR_BOOKE_IVOR5]) }, - { "ivor6", offsetof(CPUState, spr[SPR_BOOKE_IVOR6]) }, - { "ivor7", offsetof(CPUState, spr[SPR_BOOKE_IVOR7]) }, - { "ivor8", offsetof(CPUState, spr[SPR_BOOKE_IVOR8]) }, - { "ivor9", offsetof(CPUState, spr[SPR_BOOKE_IVOR9]) }, - { "ivor10", offsetof(CPUState, spr[SPR_BOOKE_IVOR10]) }, - { "ivor11", offsetof(CPUState, spr[SPR_BOOKE_IVOR11]) }, - { "ivor12", offsetof(CPUState, spr[SPR_BOOKE_IVOR12]) }, - { "ivor13", offsetof(CPUState, spr[SPR_BOOKE_IVOR13]) }, - { "ivor14", offsetof(CPUState, spr[SPR_BOOKE_IVOR14]) }, - { "ivor15", offsetof(CPUState, spr[SPR_BOOKE_IVOR15]) }, - { "ivor32", offsetof(CPUState, spr[SPR_BOOKE_IVOR32]) }, - { "ivor33", offsetof(CPUState, spr[SPR_BOOKE_IVOR33]) }, - { "ivor34", offsetof(CPUState, spr[SPR_BOOKE_IVOR34]) }, - { "ivor35", offsetof(CPUState, spr[SPR_BOOKE_IVOR35]) }, - { "ivor36", offsetof(CPUState, spr[SPR_BOOKE_IVOR36]) }, - { "ivor37", offsetof(CPUState, spr[SPR_BOOKE_IVOR37]) }, - { "mas0", offsetof(CPUState, spr[SPR_BOOKE_MAS0]) }, - { "mas1", offsetof(CPUState, spr[SPR_BOOKE_MAS1]) }, - { "mas2", offsetof(CPUState, spr[SPR_BOOKE_MAS2]) }, - { "mas3", offsetof(CPUState, spr[SPR_BOOKE_MAS3]) }, - { "mas4", offsetof(CPUState, spr[SPR_BOOKE_MAS4]) }, - { "mas6", offsetof(CPUState, spr[SPR_BOOKE_MAS6]) }, - { "mas7", offsetof(CPUState, spr[SPR_BOOKE_MAS7]) }, - { "mmucfg", offsetof(CPUState, spr[SPR_MMUCFG]) }, - { "tlb0cfg", offsetof(CPUState, spr[SPR_BOOKE_TLB0CFG]) }, - { "tlb1cfg", offsetof(CPUState, spr[SPR_BOOKE_TLB1CFG]) }, - { "epr", offsetof(CPUState, spr[SPR_BOOKE_EPR]) }, - { "eplc", offsetof(CPUState, spr[SPR_BOOKE_EPLC]) }, - { "epsc", offsetof(CPUState, spr[SPR_BOOKE_EPSC]) }, - { "svr", offsetof(CPUState, spr[SPR_E500_SVR]) }, - { "mcar", offsetof(CPUState, spr[SPR_Exxx_MCAR]) }, - { "pid1", offsetof(CPUState, spr[SPR_BOOKE_PID1]) }, - { "pid2", offsetof(CPUState, spr[SPR_BOOKE_PID2]) }, - { "hid0", offsetof(CPUState, spr[SPR_HID0]) }, + { "srr0", offsetof(CPUPPCState, spr[SPR_SRR0]) }, + { "srr1", offsetof(CPUPPCState, spr[SPR_SRR1]) }, + { "sprg0", offsetof(CPUPPCState, spr[SPR_SPRG0]) }, + { "sprg1", offsetof(CPUPPCState, spr[SPR_SPRG1]) }, + { "sprg2", offsetof(CPUPPCState, spr[SPR_SPRG2]) }, + { "sprg3", offsetof(CPUPPCState, spr[SPR_SPRG3]) }, + { "sprg4", offsetof(CPUPPCState, spr[SPR_SPRG4]) }, + { "sprg5", offsetof(CPUPPCState, spr[SPR_SPRG5]) }, + { "sprg6", offsetof(CPUPPCState, spr[SPR_SPRG6]) }, + { "sprg7", offsetof(CPUPPCState, spr[SPR_SPRG7]) }, + { "pid", offsetof(CPUPPCState, spr[SPR_BOOKE_PID]) }, + { "csrr0", offsetof(CPUPPCState, spr[SPR_BOOKE_CSRR0]) }, + { "csrr1", offsetof(CPUPPCState, spr[SPR_BOOKE_CSRR1]) }, + { "esr", offsetof(CPUPPCState, spr[SPR_BOOKE_ESR]) }, + { "dear", offsetof(CPUPPCState, spr[SPR_BOOKE_DEAR]) }, + { "mcsr", offsetof(CPUPPCState, spr[SPR_BOOKE_MCSR]) }, + { "tsr", offsetof(CPUPPCState, spr[SPR_BOOKE_TSR]) }, + { "tcr", offsetof(CPUPPCState, spr[SPR_BOOKE_TCR]) }, + { "vrsave", offsetof(CPUPPCState, spr[SPR_VRSAVE]) }, + { "pir", offsetof(CPUPPCState, spr[SPR_BOOKE_PIR]) }, + { "mcsrr0", offsetof(CPUPPCState, spr[SPR_BOOKE_MCSRR0]) }, + { "mcsrr1", offsetof(CPUPPCState, spr[SPR_BOOKE_MCSRR1]) }, + { "decar", offsetof(CPUPPCState, spr[SPR_BOOKE_DECAR]) }, + { "ivpr", offsetof(CPUPPCState, spr[SPR_BOOKE_IVPR]) }, + { "epcr", offsetof(CPUPPCState, spr[SPR_BOOKE_EPCR]) }, + { "sprg8", offsetof(CPUPPCState, spr[SPR_BOOKE_SPRG8]) }, + { "ivor0", offsetof(CPUPPCState, spr[SPR_BOOKE_IVOR0]) }, + { "ivor1", offsetof(CPUPPCState, spr[SPR_BOOKE_IVOR1]) }, + { "ivor2", offsetof(CPUPPCState, spr[SPR_BOOKE_IVOR2]) }, + { "ivor3", offsetof(CPUPPCState, spr[SPR_BOOKE_IVOR3]) }, + { "ivor4", offsetof(CPUPPCState, spr[SPR_BOOKE_IVOR4]) }, + { "ivor5", offsetof(CPUPPCState, spr[SPR_BOOKE_IVOR5]) }, + { "ivor6", offsetof(CPUPPCState, spr[SPR_BOOKE_IVOR6]) }, + { "ivor7", offsetof(CPUPPCState, spr[SPR_BOOKE_IVOR7]) }, + { "ivor8", offsetof(CPUPPCState, spr[SPR_BOOKE_IVOR8]) }, + { "ivor9", offsetof(CPUPPCState, spr[SPR_BOOKE_IVOR9]) }, + { "ivor10", offsetof(CPUPPCState, spr[SPR_BOOKE_IVOR10]) }, + { "ivor11", offsetof(CPUPPCState, spr[SPR_BOOKE_IVOR11]) }, + { "ivor12", offsetof(CPUPPCState, spr[SPR_BOOKE_IVOR12]) }, + { "ivor13", offsetof(CPUPPCState, spr[SPR_BOOKE_IVOR13]) }, + { "ivor14", offsetof(CPUPPCState, spr[SPR_BOOKE_IVOR14]) }, + { "ivor15", offsetof(CPUPPCState, spr[SPR_BOOKE_IVOR15]) }, + { "ivor32", offsetof(CPUPPCState, spr[SPR_BOOKE_IVOR32]) }, + { "ivor33", offsetof(CPUPPCState, spr[SPR_BOOKE_IVOR33]) }, + { "ivor34", offsetof(CPUPPCState, spr[SPR_BOOKE_IVOR34]) }, + { "ivor35", offsetof(CPUPPCState, spr[SPR_BOOKE_IVOR35]) }, + { "ivor36", offsetof(CPUPPCState, spr[SPR_BOOKE_IVOR36]) }, + { "ivor37", offsetof(CPUPPCState, spr[SPR_BOOKE_IVOR37]) }, + { "mas0", offsetof(CPUPPCState, spr[SPR_BOOKE_MAS0]) }, + { "mas1", offsetof(CPUPPCState, spr[SPR_BOOKE_MAS1]) }, + { "mas2", offsetof(CPUPPCState, spr[SPR_BOOKE_MAS2]) }, + { "mas3", offsetof(CPUPPCState, spr[SPR_BOOKE_MAS3]) }, + { "mas4", offsetof(CPUPPCState, spr[SPR_BOOKE_MAS4]) }, + { "mas6", offsetof(CPUPPCState, spr[SPR_BOOKE_MAS6]) }, + { "mas7", offsetof(CPUPPCState, spr[SPR_BOOKE_MAS7]) }, + { "mmucfg", offsetof(CPUPPCState, spr[SPR_MMUCFG]) }, + { "tlb0cfg", offsetof(CPUPPCState, spr[SPR_BOOKE_TLB0CFG]) }, + { "tlb1cfg", offsetof(CPUPPCState, spr[SPR_BOOKE_TLB1CFG]) }, + { "epr", offsetof(CPUPPCState, spr[SPR_BOOKE_EPR]) }, + { "eplc", offsetof(CPUPPCState, spr[SPR_BOOKE_EPLC]) }, + { "epsc", offsetof(CPUPPCState, spr[SPR_BOOKE_EPSC]) }, + { "svr", offsetof(CPUPPCState, spr[SPR_E500_SVR]) }, + { "mcar", offsetof(CPUPPCState, spr[SPR_Exxx_MCAR]) }, + { "pid1", offsetof(CPUPPCState, spr[SPR_BOOKE_PID1]) }, + { "pid2", offsetof(CPUPPCState, spr[SPR_BOOKE_PID2]) }, + { "hid0", offsetof(CPUPPCState, spr[SPR_HID0]) }, #elif defined(TARGET_SPARC) - { "g0", offsetof(CPUState, gregs[0]) }, - { "g1", offsetof(CPUState, gregs[1]) }, - { "g2", offsetof(CPUState, gregs[2]) }, - { "g3", offsetof(CPUState, gregs[3]) }, - { "g4", offsetof(CPUState, gregs[4]) }, - { "g5", offsetof(CPUState, gregs[5]) }, - { "g6", offsetof(CPUState, gregs[6]) }, - { "g7", offsetof(CPUState, gregs[7]) }, + { "g0", offsetof(CPUSPARCState, gregs[0]) }, + { "g1", offsetof(CPUSPARCState, gregs[1]) }, + { "g2", offsetof(CPUSPARCState, gregs[2]) }, + { "g3", offsetof(CPUSPARCState, gregs[3]) }, + { "g4", offsetof(CPUSPARCState, gregs[4]) }, + { "g5", offsetof(CPUSPARCState, gregs[5]) }, + { "g6", offsetof(CPUSPARCState, gregs[6]) }, + { "g7", offsetof(CPUSPARCState, gregs[7]) }, { "o0", 0, monitor_get_reg }, { "o1", 1, monitor_get_reg }, { "o2", 2, monitor_get_reg },
@@ -2931,72 +2931,72 @@ static const MonitorDef monitor_defs[] = { { "i5", 21, monitor_get_reg }, { "i6", 22, monitor_get_reg }, { "i7", 23, monitor_get_reg }, - { "pc", offsetof(CPUState, pc) }, - { "npc", offsetof(CPUState, npc) }, - { "y", offsetof(CPUState, y) }, + { "pc", offsetof(CPUSPARCState, pc) }, + { "npc", offsetof(CPUSPARCState, npc) }, + { "y", offsetof(CPUSPARCState, y) }, #ifndef TARGET_SPARC64 { "psr", 0, &monitor_get_psr, }, - { "wim", offsetof(CPUState, wim) }, + { "wim", offsetof(CPUSPARCState, wim) }, #endif - { "tbr", offsetof(CPUState, tbr) }, - { "fsr", offsetof(CPUState, fsr) }, - { "f0", offsetof(CPUState, fpr[0].l.upper) }, - { "f1", offsetof(CPUState, fpr[0].l.lower) }, - { "f2", offsetof(CPUState, fpr[1].l.upper) }, - { "f3", offsetof(CPUState, fpr[1].l.lower) }, - { "f4", offsetof(CPUState, fpr[2].l.upper) }, - { "f5", offsetof(CPUState, fpr[2].l.lower) }, - { "f6", offsetof(CPUState, fpr[3].l.upper) }, - { "f7", offsetof(CPUState, fpr[3].l.lower) }, - { "f8", offsetof(CPUState, fpr[4].l.upper) }, - { "f9", offsetof(CPUState, fpr[4].l.lower) }, - { "f10", offsetof(CPUState, fpr[5].l.upper) }, - { "f11", offsetof(CPUState, fpr[5].l.lower) }, - { "f12", offsetof(CPUState, fpr[6].l.upper) }, - { "f13", offsetof(CPUState, fpr[6].l.lower) }, - { "f14", offsetof(CPUState, fpr[7].l.upper) }, - { "f15", offsetof(CPUState, fpr[7].l.lower) }, - { "f16", offsetof(CPUState, fpr[8].l.upper) }, - { "f17", offsetof(CPUState, fpr[8].l.lower) }, - { "f18", offsetof(CPUState, fpr[9].l.upper) }, - { "f19", offsetof(CPUState, fpr[9].l.lower) }, - { "f20", offsetof(CPUState, fpr[10].l.upper) }, - { "f21", offsetof(CPUState, fpr[10].l.lower) }, - { "f22", offsetof(CPUState, fpr[11].l.upper) }, - { "f23", offsetof(CPUState, fpr[11].l.lower) }, - { "f24", offsetof(CPUState, fpr[12].l.upper) }, - { "f25", offsetof(CPUState, fpr[12].l.lower) }, - { "f26", offsetof(CPUState, fpr[13].l.upper) }, - { "f27", offsetof(CPUState, fpr[13].l.lower) }, - { "f28", offsetof(CPUState, fpr[14].l.upper) }, - { "f29", offsetof(CPUState, fpr[14].l.lower) }, - { "f30", offsetof(CPUState, fpr[15].l.upper) }, - { "f31", offsetof(CPUState, fpr[15].l.lower) }, + { "tbr", offsetof(CPUSPARCState, tbr) }, + { "fsr", offsetof(CPUSPARCState, fsr) }, + { "f0", offsetof(CPUSPARCState, fpr[0].l.upper) }, + { "f1", offsetof(CPUSPARCState, fpr[0].l.lower) }, + { "f2", offsetof(CPUSPARCState, fpr[1].l.upper) }, + { "f3", offsetof(CPUSPARCState, fpr[1].l.lower) }, + { "f4", offsetof(CPUSPARCState, fpr[2].l.upper) }, + { "f5", offsetof(CPUSPARCState, fpr[2].l.lower) }, + { "f6", offsetof(CPUSPARCState, fpr[3].l.upper) }, + { "f7", offsetof(CPUSPARCState, fpr[3].l.lower) }, + { "f8", offsetof(CPUSPARCState, fpr[4].l.upper) }, + { "f9", offsetof(CPUSPARCState, fpr[4].l.lower) }, + { "f10", offsetof(CPUSPARCState, fpr[5].l.upper) }, + { "f11", offsetof(CPUSPARCState, fpr[5].l.lower) }, + { "f12", offsetof(CPUSPARCState, fpr[6].l.upper) }, + { "f13", offsetof(CPUSPARCState, fpr[6].l.lower) }, + { "f14", offsetof(CPUSPARCState, fpr[7].l.upper) }, + { "f15", offsetof(CPUSPARCState, fpr[7].l.lower) }, + { "f16", offsetof(CPUSPARCState, fpr[8].l.upper) }, + { "f17", offsetof(CPUSPARCState, fpr[8].l.lower) }, + { "f18", offsetof(CPUSPARCState, fpr[9].l.upper) }, + { "f19", offsetof(CPUSPARCState, fpr[9].l.lower) }, + { "f20", offsetof(CPUSPARCState, fpr[10].l.upper) }, + { "f21", offsetof(CPUSPARCState, fpr[10].l.lower) }, + { "f22", offsetof(CPUSPARCState, fpr[11].l.upper) }, + { "f23", offsetof(CPUSPARCState, fpr[11].l.lower) }, + { "f24", offsetof(CPUSPARCState, fpr[12].l.upper) }, + { "f25", offsetof(CPUSPARCState, fpr[12].l.lower) }, + { "f26", offsetof(CPUSPARCState, fpr[13].l.upper) }, + { "f27", offsetof(CPUSPARCState, fpr[13].l.lower) }, + { "f28", offsetof(CPUSPARCState, fpr[14].l.upper) }, + { "f29", offsetof(CPUSPARCState, fpr[14].l.lower) }, + { "f30", offsetof(CPUSPARCState, fpr[15].l.upper) }, + { "f31", offsetof(CPUSPARCState, fpr[15].l.lower) }, #ifdef TARGET_SPARC64 - { "f32", offsetof(CPUState, fpr[16]) }, - { "f34", offsetof(CPUState, fpr[17]) }, - { "f36", offsetof(CPUState, fpr[18]) }, - { "f38", offsetof(CPUState, fpr[19]) }, - { "f40", offsetof(CPUState, fpr[20]) }, - { "f42", offsetof(CPUState, fpr[21]) }, - { "f44", offsetof(CPUState, fpr[22]) }, - { "f46", offsetof(CPUState, fpr[23]) }, - { "f48", offsetof(CPUState, fpr[24]) }, - { "f50", offsetof(CPUState, fpr[25]) }, - { "f52", offsetof(CPUState, fpr[26]) }, - { "f54", offsetof(CPUState, fpr[27]) }, - { "f56", offsetof(CPUState, fpr[28]) }, - { "f58", offsetof(CPUState, fpr[29]) }, - { "f60", offsetof(CPUState, fpr[30]) }, - { "f62", offsetof(CPUState, fpr[31]) }, - { "asi", offsetof(CPUState, asi) }, - { "pstate", offsetof(CPUState, pstate) }, - { "cansave", offsetof(CPUState, cansave) }, - { "canrestore", offsetof(CPUState, canrestore) }, - { "otherwin", offsetof(CPUState, otherwin) }, - { "wstate", offsetof(CPUState, wstate) }, - { "cleanwin", offsetof(CPUState, cleanwin) }, - { "fprs", offsetof(CPUState, fprs) }, + { "f32", offsetof(CPUSPARCState, fpr[16]) }, + { "f34", offsetof(CPUSPARCState, fpr[17]) }, + { "f36", offsetof(CPUSPARCState, fpr[18]) }, + { "f38", offsetof(CPUSPARCState, fpr[19]) }, + { "f40", offsetof(CPUSPARCState, fpr[20]) }, + { "f42", offsetof(CPUSPARCState, fpr[21]) }, + { "f44", offsetof(CPUSPARCState, fpr[22]) }, + { "f46", offsetof(CPUSPARCState, fpr[23]) }, + { "f48", offsetof(CPUSPARCState, fpr[24]) }, + { "f50", offsetof(CPUSPARCState, fpr[25]) }, + { "f52", offsetof(CPUSPARCState, fpr[26]) }, + { "f54", offsetof(CPUSPARCState, fpr[27]) }, + { "f56", offsetof(CPUSPARCState, fpr[28]) }, + { "f58", offsetof(CPUSPARCState, fpr[29]) }, + { "f60", offsetof(CPUSPARCState, fpr[30]) }, + { "f62", offsetof(CPUSPARCState, fpr[31]) }, + { "asi", offsetof(CPUSPARCState, asi) }, + { "pstate", offsetof(CPUSPARCState, pstate) }, + { "cansave", offsetof(CPUSPARCState, cansave) }, + { "canrestore", offsetof(CPUSPARCState, canrestore) }, + { "otherwin", offsetof(CPUSPARCState, otherwin) }, + { "wstate", offsetof(CPUSPARCState, wstate) }, + { "cleanwin", offsetof(CPUSPARCState, cleanwin) }, + { "fprs", offsetof(CPUSPARCState, fprs) }, #endif #endif { NULL },
Signature · 1 line
1.7.7
RFC PATCH v4 23/44 target-sh4: Don't overuse CPUState
In reply to Andreas FärberScripted conversion:
sed -i "s/CPUState/CPUSH4State/g" target-sh4/*.[hc] sed -i "s/#define CPUSH4State/#define CPUState/" target-sh4/cpu.h
--- target-sh4/cpu.h | 10 +++++----- target-sh4/helper.c | 28 ++++++++++++++-------------- target-sh4/op_helper.c | 4 ++-- target-sh4/translate.c | 46 +++++++++++++++++++++++----------------------- 4 files changed, 44 insertions(+), 44 deletions(-)
target-sh4/cpu.h +5 -5
@@ -240,13 +240,13 @@ void cpu_load_tlb(CPUSH4State * env);#define MMU_MODE0_SUFFIX _kernel#define MMU_MODE1_SUFFIX _user#define MMU_USER_IDX 1 -static inline int cpu_mmu_index (CPUState *env) +static inline int cpu_mmu_index (CPUSH4State *env) {return (env->sr &SR_MD ) ==0 ?1 :0 ; }#if defined(CONFIG_USER_ONLY ) -static inline void cpu_clone_regs (CPUState *env,target_ulong newsp) +static inline void cpu_clone_regs (CPUSH4State *env,target_ulong newsp) {if (newsp) env->gregs[15 ] = newsp;
@@ -348,7 +348,7 @@ static inline int cpu_ptel_pr (uint32_t ptel)#define TB_FLAG_PENDING_MOVCA (1 << 4) -static inline void cpu_get_tb_cpu_state (CPUState *env,target_ulong *pc, +static inline void cpu_get_tb_cpu_state (CPUSH4State *env,target_ulong *pc,target_ulong *cs_base,int *flags) { *pc = env->pc;
@@ -361,14 +361,14 @@ static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc, | (env->movcal_backup ? TB_FLAG_PENDING_MOVCA : 0); /* Bit 4 */ } -static inline bool cpu_has_work (CPUState *env) +static inline bool cpu_has_work (CPUSH4State *env) {return env->interrupt_request &CPU_INTERRUPT_HARD ; }#include "exec-all.h" -static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) +static inline void cpu_pc_from_tb (CPUSH4State *env,TranslationBlock *tb) { env->pc = tb->pc; env->flags = tb->flags;
target-sh4/helper.c +14 -14
@@ -31,12 +31,12 @@#if defined(CONFIG_USER_ONLY ) -void do_interrupt (CPUState *env) +void do_interrupt (CPUSH4State *env) { env->exception_index =-1 ; } -int cpu_sh4_handle_mmu_fault (CPUState * env,target_ulong address,int rw, +int cpu_sh4_handle_mmu_fault (CPUSH4State * env,target_ulong address,int rw,int mmu_idx) { env->tea = address;
@@ -78,7 +78,7 @@ int cpu_sh4_is_cached(CPUSH4State * env, target_ulong addr)#define MMU_DADDR_ERROR_READ (-12)#define MMU_DADDR_ERROR_WRITE (-13) -void do_interrupt (CPUState * env) +void do_interrupt (CPUSH4State * env) {int do_irq = env->interrupt_request &CPU_INTERRUPT_HARD ;int do_exp, irq_vector = env->exception_index;
@@ -202,7 +202,7 @@ void do_interrupt(CPUState * env) } } -static void update_itlb_use (CPUState * env,int itlbnb) +static void update_itlb_use (CPUSH4State * env,int itlbnb) {uint8_t or_mask =0 , and_mask = (uint8_t ) -1 ;
@@ -227,7 +227,7 @@ static void update_itlb_use(CPUState * env, int itlbnb) env->mmucr |= (or_mask <<24 ); } -static int itlb_replacement (CPUState * env) +static int itlb_replacement (CPUSH4State * env) {if ((env->mmucr &0xe0000000 ) ==0xe0000000 )return 0 ;
@@ -243,7 +243,7 @@ static int itlb_replacement(CPUState * env)/* Find the corresponding entry in the right TLB Return entry, MMU_DTLB_MISS or MMU_DTLB_MULTIPLE */ -static int find_tlb_entry (CPUState * env,target_ulong address, +static int find_tlb_entry (CPUSH4State * env,target_ulong address,tlb_t * entries,uint8_t nbtlb,int use_asid) {int match =MMU_DTLB_MISS ;
@@ -269,7 +269,7 @@ static int find_tlb_entry(CPUState * env, target_ulong address,return match; } -static void increment_urc (CPUState * env) +static void increment_urc (CPUSH4State * env) {uint8_t urb, urc;
@@ -285,7 +285,7 @@ static void increment_urc(CPUState * env)/* Copy and utlb entry into itlb Return entry */ -static int copy_utlb_entry_itlb (CPUState *env,int utlb) +static int copy_utlb_entry_itlb (CPUSH4State *env,int utlb) {int itlb;
@@ -303,7 +303,7 @@ static int copy_utlb_entry_itlb(CPUState *env, int utlb)/* Find itlb entry Return entry, MMU_ITLB_MISS, MMU_ITLB_MULTIPLE or MMU_DTLB_MULTIPLE */ -static int find_itlb_entry (CPUState * env,target_ulong address, +static int find_itlb_entry (CPUSH4State * env,target_ulong address,int use_asid) {int e;
@@ -321,7 +321,7 @@ static int find_itlb_entry(CPUState * env, target_ulong address,/* Find utlb entry Return entry, MMU_DTLB_MISS, MMU_DTLB_MULTIPLE */ -static int find_utlb_entry (CPUState * env,target_ulong address,int use_asid) +static int find_utlb_entry (CPUSH4State * env,target_ulong address,int use_asid) {/* per utlb access */ increment_urc (env);
@@ -337,7 +337,7 @@ static int find_utlb_entry(CPUState * env, target_ulong address, int use_asid)MMU_ITLB_MULTIPLE, MMU_ITLB_VIOLATION, MMU_IADDR_ERROR, MMU_DADDR_ERROR_READ, MMU_DADDR_ERROR_WRITE. */ -static int get_mmu_address (CPUState * env,target_ulong * physical, +static int get_mmu_address (CPUSH4State * env,target_ulong * physical,int *prot,target_ulong address,int rw,int access_type) {
@@ -403,7 +403,7 @@ static int get_mmu_address(CPUState * env, target_ulong * physical,return n; } -static int get_physical_address (CPUState * env,target_ulong * physical, +static int get_physical_address (CPUSH4State * env,target_ulong * physical,int *prot,target_ulong address,int rw,int access_type) {
@@ -442,7 +442,7 @@ static int get_physical_address(CPUState * env, target_ulong * physical,return get_mmu_address (env, physical, prot, address, rw, access_type); } -int cpu_sh4_handle_mmu_fault (CPUState * env,target_ulong address,int rw, +int cpu_sh4_handle_mmu_fault (CPUSH4State * env,target_ulong address,int rw,int mmu_idx) {target_ulong physical;
@@ -503,7 +503,7 @@ int cpu_sh4_handle_mmu_fault(CPUState * env, target_ulong address, int rw,return 0 ; } -target_phys_addr_t cpu_get_phys_page_debug (CPUState * env,target_ulong addr) +target_phys_addr_t cpu_get_phys_page_debug (CPUSH4State * env,target_ulong addr) {target_ulong physical;int prot;
target-sh4/op_helper.c +2 -2
@@ -55,10 +55,10 @@ static void cpu_restore_state_from_retaddr(void *retaddr)#define SHIFT 3#include "softmmu_template.h" -void tlb_fill (CPUState *env1,target_ulong addr,int is_write,int mmu_idx, +void tlb_fill (CPUSH4State *env1,target_ulong addr,int is_write,int mmu_idx,void *retaddr) { -CPUState *saved_env; +CPUSH4State *saved_env;int ret; saved_env = env;
target-sh4/translate.c +23 -23
101 lines not on this page · raw message
Signature · 1 line
1.7.7
RFC PATCH v4 25/44 target-unicore32: Don't overuse CPUState
In reply to Andreas FärberScripted conversion:
sed -i "s/CPUState/CPUUniCore32State/g" target-unicore32/*.[hc] sed -i "s/#define CPUUniCore32State/#define CPUState/" target-unicore32/cpu.h
--- target-unicore32/cpu.h | 24 ++++++++-------- target-unicore32/helper.c | 62 +++++++++++++++++++++--------------------- target-unicore32/op_helper.c | 8 +++--- target-unicore32/translate.c | 60 ++++++++++++++++++++-------------------- 4 files changed, 77 insertions(+), 77 deletions(-)
target-unicore32/cpu.h +12 -12
@@ -92,9 +92,9 @@ typedef struct CPUUniCore32State {#define UC32_EXCP_TRAP (ASR_MODE_TRAP)/* Return the current ASR value. */ -target_ulong cpu_asr_read (CPUState *env1); +target_ulong cpu_asr_read (CPUUniCore32State *env1);/* Set the ASR. Note that some bits of mask must be all-set or all-clear. */ -void cpu_asr_write (CPUState *env1,target_ulong val,target_ulong mask); +void cpu_asr_write (CPUUniCore32State *env1,target_ulong val,target_ulong mask);/* UniCore-F64 system registers. */ #define UC32_UCF64_FPSCR (31)
@@ -128,10 +128,10 @@ void cpu_asr_write(CPUState *env1, target_ulong val, target_ulong mask);#define cpu_signal_handler uc32_cpu_signal_handler#define cpu_handle_mmu_fault uc32_cpu_handle_mmu_fault -CPUState *uc32_cpu_init (const char *cpu_model); -int uc32_cpu_exec (CPUState *s); +CPUUniCore32State *uc32_cpu_init (const char *cpu_model); +int uc32_cpu_exec (CPUUniCore32State *s);int uc32_cpu_signal_handler (int host_signum,void *pinfo,void *puc); -int uc32_cpu_handle_mmu_fault (CPUState *env,target_ulong address,int rw, +int uc32_cpu_handle_mmu_fault (CPUUniCore32State *env,target_ulong address,int rw,int mmu_idx);#define CPU_SAVE_VERSION 2
@@ -140,12 +140,12 @@ int uc32_cpu_handle_mmu_fault(CPUState *env, target_ulong address, int rw,#define MMU_MODE0_SUFFIX _kernel#define MMU_MODE1_SUFFIX _user#define MMU_USER_IDX 1 -static inline int cpu_mmu_index (CPUState *env) +static inline int cpu_mmu_index (CPUUniCore32State *env) {return (env->uncached_asr &ASR_M ) ==ASR_MODE_USER ?1 :0 ; } -static inline void cpu_clone_regs (CPUState *env,target_ulong newsp) +static inline void cpu_clone_regs (CPUUniCore32State *env,target_ulong newsp) {if (newsp) { env->regs[29 ] = newsp;
@@ -153,7 +153,7 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp) env->regs[0 ] =0 ; } -static inline void cpu_set_tls (CPUState *env,target_ulong newtls) +static inline void cpu_set_tls (CPUUniCore32State *env,target_ulong newtls) { env->regs[16 ] = newtls; }
@@ -161,12 +161,12 @@ static inline void cpu_set_tls(CPUState *env, target_ulong newtls)#include "cpu-all.h" #include "exec-all.h" -static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) +static inline void cpu_pc_from_tb (CPUUniCore32State *env,TranslationBlock *tb) { env->regs[31 ] = tb->pc; } -static inline void cpu_get_tb_cpu_state (CPUState *env,target_ulong *pc, +static inline void cpu_get_tb_cpu_state (CPUUniCore32State *env,target_ulong *pc,target_ulong *cs_base,int *flags) { *pc = env->regs[31 ];
@@ -178,10 +178,10 @@ static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc, }void uc32_translate_init (void ); -void do_interrupt (CPUState *); +void do_interrupt (CPUUniCore32State *);void switch_mode (CPUUniCore32State *,int ); -static inline bool cpu_has_work (CPUState *env) +static inline bool cpu_has_work (CPUUniCore32State *env) {return env->interrupt_request & (CPU_INTERRUPT_HARD |CPU_INTERRUPT_EXITTB );
target-unicore32/helper.c +31 -31
211 lines not on this page · raw message
target-unicore32/op_helper.c +4 -4
@@ -28,9 +28,9 @@ static target_ulong asr_read(void) (env->CF <<29 ) | ((env->VF &0x80000000 ) >>3 ); } -target_ulong cpu_asr_read (CPUState *env1) +target_ulong cpu_asr_read (CPUUniCore32State *env1) { -CPUState *saved_env; +CPUUniCore32State *saved_env;target_ulong ret; saved_env = env;
@@ -61,9 +61,9 @@ static void asr_write(target_ulong val, target_ulong mask) env->uncached_asr = (env->uncached_asr & ~mask) | (val & mask); } -void cpu_asr_write (CPUState *env1,target_ulong val,target_ulong mask) +void cpu_asr_write (CPUUniCore32State *env1,target_ulong val,target_ulong mask) { -CPUState *saved_env; +CPUUniCore32State *saved_env; saved_env = env; env = env1;
target-unicore32/translate.c +30 -30
228 lines not on this page · raw message
Signature · 1 line
1.7.7
RFC PATCH v4 34/44 lm32 hw/: Don't use CPUState
In reply to Andreas FärberScripted conversion:
for file in hw/lm32_boards.c hw/milkymist.c; do
sed -i "s/CPUState/CPULM32State/g" $file
done
--- hw/lm32_boards.c | 10 +++++----- hw/milkymist.c | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-)
hw/lm32_boards.c +5 -5
@@ -31,7 +31,7 @@#include "exec-memory.h" typedef struct { - CPUState *env; + CPULM32State *env; target_phys_addr_t bootstrap_pc; target_phys_addr_t flash_base; target_phys_addr_t hwsetup_base;
@@ -42,7 +42,7 @@ typedef struct {static void cpu_irq_handler (void *opaque,int irq,int level) { -CPUState *env = opaque; +CPULM32State *env = opaque;if (level) {cpu_interrupt (env,CPU_INTERRUPT_HARD );
@@ -54,7 +54,7 @@ static void cpu_irq_handler(void *opaque, int irq, int level)static void main_cpu_reset (void *opaque) {ResetInfo *reset_info = opaque; -CPUState *env = reset_info->env; +CPULM32State *env = reset_info->env;cpu_state_reset (env);
@@ -75,7 +75,7 @@ static void lm32_evr_init(ram_addr_t ram_size_not_used,const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model) { - CPUState *env; + CPULM32State *env;DriveInfo *dinfo;MemoryRegion *address_space_mem =get_system_memory ();MemoryRegion *phys_ram =g_new (MemoryRegion,1 );
@@ -163,7 +163,7 @@ static void lm32_uclinux_init(ram_addr_t ram_size_not_used,const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model) { - CPUState *env; + CPULM32State *env;DriveInfo *dinfo;MemoryRegion *address_space_mem =get_system_memory ();MemoryRegion *phys_ram =g_new (MemoryRegion,1 );
hw/milkymist.c +4 -4
@@ -37,7 +37,7 @@#define KERNEL_LOAD_ADDR 0x40000000 typedef struct { - CPUState *env; + CPULM32State *env; target_phys_addr_t bootstrap_pc; target_phys_addr_t flash_base; target_phys_addr_t initrd_base;
@@ -47,7 +47,7 @@ typedef struct {static void cpu_irq_handler (void *opaque,int irq,int level) { -CPUState *env = opaque; +CPULM32State *env = opaque;if (level) {cpu_interrupt (env,CPU_INTERRUPT_HARD );
@@ -59,7 +59,7 @@ static void cpu_irq_handler(void *opaque, int irq, int level)static void main_cpu_reset (void *opaque) {ResetInfo *reset_info = opaque; -CPUState *env = reset_info->env; +CPULM32State *env = reset_info->env;cpu_state_reset (env);
@@ -79,7 +79,7 @@ milkymist_init(ram_addr_t ram_size_not_used,const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model) { - CPUState *env; + CPULM32State *env;int kernel_size;DriveInfo *dinfo;MemoryRegion *address_space_mem =get_system_memory ();
Signature · 1 line
1.7.7
RFC PATCH v4 35/44 m68k hw/: Don't use CPUState
In reply to Andreas FärberScripted conversion:
for file in hw/an5206.c hw/dummy_m68k.c hw/mcf.h hw/mcf5206.c hw/mcf5208.c hw/mcf_intc.c; do
sed -i "s/CPUState/CPUM68KState/g" $file
done
--- hw/an5206.c | 2 +- hw/dummy_m68k.c | 2 +- hw/mcf.h | 4 ++-- hw/mcf5206.c | 4 ++-- hw/mcf5208.c | 2 +- hw/mcf_intc.c | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-)
hw/an5206.c +1 -1
@@ -24,7 +24,7 @@ static void an5206_init(ram_addr_t ram_size, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model) { - CPUState *env; + CPUM68KState *env;int kernel_size;uint64_t elf_entry;target_phys_addr_t entry;
hw/dummy_m68k.c +1 -1
@@ -21,7 +21,7 @@ static void dummy_m68k_init(ram_addr_t ram_size, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model) { - CPUState *env; + CPUM68KState *env;MemoryRegion *address_space_mem =get_system_memory ();MemoryRegion *ram =g_new (MemoryRegion,1 );int kernel_size;
hw/mcf.h +2 -2
@@ -17,7 +17,7 @@ void mcf_uart_mm_init(struct MemoryRegion *sysmem,/* mcf_intc.c */ qemu_irq *mcf_intc_init (struct MemoryRegion *sysmem,target_phys_addr_t base, -CPUState *env); +CPUM68KState *env);/* mcf_fec.c */ void mcf_fec_init(struct MemoryRegion *sysmem, NICInfo *nd,
@@ -25,6 +25,6 @@ void mcf_fec_init(struct MemoryRegion *sysmem, NICInfo *nd,/* mcf5206.c */ qemu_irq *mcf5206_init (struct MemoryRegion *sysmem, -uint32_t base,CPUState *env); +uint32_t base,CPUM68KState *env);#endif
hw/mcf5206.c +2 -2
@@ -145,7 +145,7 @@ static m5206_timer_state *m5206_timer_init(qemu_irq irq)/* System Integration Module. */ typedef struct { - CPUState *env; + CPUM68KState *env; MemoryRegion iomem; m5206_timer_state *timer[2]; void *uart[2];
@@ -525,7 +525,7 @@ static const MemoryRegionOps m5206_mbar_ops = { .endianness = DEVICE_NATIVE_ENDIAN, }; -qemu_irq *mcf5206_init (MemoryRegion *sysmem,uint32_t base,CPUState *env) +qemu_irq *mcf5206_init (MemoryRegion *sysmem,uint32_t base,CPUM68KState *env) {m5206_mbar_state *s;qemu_irq *pic;
hw/mcf5208.c +1 -1
@@ -192,7 +192,7 @@ static void mcf5208evb_init(ram_addr_t ram_size, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model) { - CPUState *env; + CPUM68KState *env;int kernel_size;uint64_t elf_entry;target_phys_addr_t entry;
hw/mcf_intc.c +2 -2
@@ -16,7 +16,7 @@ typedef struct {uint64_t ifr;uint64_t enabled;uint8_t icr[64 ]; -CPUState *env; +CPUM68KState *env;int active_vector; } mcf_intc_state;
@@ -139,7 +139,7 @@ static const MemoryRegionOps mcf_intc_ops = {qemu_irq *mcf_intc_init (MemoryRegion *sysmem,target_phys_addr_t base, -CPUState *env) +CPUM68KState *env) {mcf_intc_state *s;
Signature · 1 line
1.7.7
RFC PATCH v4 36/44 microblaze hw/: Don't use CPUState
In reply to Andreas FärberScripted conversion:
for file in hw/microblaze_*.[hc] hw/petalogix_ml605_mmu.c hw/petalogix_s3adsp1800_mmu.c; do
sed -i "s/CPUState/CPUMBState/g" $file
done
--- hw/microblaze_boot.c | 8 ++++---- hw/microblaze_boot.h | 4 ++-- hw/microblaze_pic_cpu.c | 4 ++-- hw/microblaze_pic_cpu.h | 2 +- hw/petalogix_ml605_mmu.c | 4 ++-- hw/petalogix_s3adsp1800_mmu.c | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-)
hw/microblaze_boot.c +4 -4
@@ -35,7 +35,7 @@ static struct { - void (*machine_cpu_reset)(CPUState *); + void (*machine_cpu_reset)(CPUMBState *); uint32_t bootstrap_pc; uint32_t cmdline; uint32_t fdt;
@@ -43,7 +43,7 @@ static structstatic void main_cpu_reset (void *opaque) { -CPUState *env = opaque; +CPUMBState *env = opaque;cpu_state_reset (env); env->regs[5 ] = boot_info.cmdline;
@@ -99,9 +99,9 @@ static uint64_t translate_kernel_address(void *opaque, uint64_t addr)return addr -0x30000000LL ; } -void microblaze_load_kernel (CPUState *env,target_phys_addr_t ddr_base, +void microblaze_load_kernel (CPUMBState *env,target_phys_addr_t ddr_base,uint32_t ramsize,const char *dtb_filename, -void (*machine_cpu_reset)(CPUState *)) +void (*machine_cpu_reset)(CPUMBState *)) {QemuOpts *machine_opts;
hw/microblaze_boot.h +2 -2
@@ -3,8 +3,8 @@#include "hw.h" -void microblaze_load_kernel (CPUState *env,target_phys_addr_t ddr_base, +void microblaze_load_kernel (CPUMBState *env,target_phys_addr_t ddr_base,uint32_t ramsize,const char *dtb_filename, -void (*machine_cpu_reset)(CPUState *)); +void (*machine_cpu_reset)(CPUMBState *));#endif /* __MICROBLAZE_BOOT __ */
hw/microblaze_pic_cpu.c +2 -2
@@ -29,7 +29,7 @@static void microblaze_pic_cpu_handler (void *opaque,int irq,int level) { -CPUState *env = (CPUState *)opaque; +CPUMBState *env = (CPUMBState *)opaque;int type = irq ?CPU_INTERRUPT_NMI :CPU_INTERRUPT_HARD ;if (level)
@@ -38,7 +38,7 @@ static void microblaze_pic_cpu_handler(void *opaque, int irq, int level)cpu_reset_interrupt (env, type); } -qemu_irq *microblaze_pic_init_cpu (CPUState *env) +qemu_irq *microblaze_pic_init_cpu (CPUMBState *env) {return qemu_allocate_irqs (microblaze_pic_cpu_handler, env,2 ); }
hw/microblaze_pic_cpu.h +1 -1
@@ -3,6 +3,6 @@#include "qemu-common.h" -qemu_irq *microblaze_pic_init_cpu (CPUState *env); +qemu_irq *microblaze_pic_init_cpu (CPUMBState *env);#endif /* MICROBLAZE_PIC_CPU_H */
hw/petalogix_ml605_mmu.c +2 -2
@@ -54,7 +54,7 @@#define AXIENET_BASEADDR 0x82780000#define AXIDMA_BASEADDR 0x84600000 -static void machine_cpu_reset (CPUState *env) +static void machine_cpu_reset (CPUMBState *env) { env->pvr.regs[10 ] =0x0e000000 ;/* virtex 6 */ /* setup pvr to match kernel setting */
@@ -75,7 +75,7 @@ petalogix_ml605_init(ram_addr_t ram_size, {MemoryRegion *address_space_mem =get_system_memory ();DeviceState *dev; -CPUState *env; +CPUMBState *env;DriveInfo *dinfo;int i;target_phys_addr_t ddr_base =MEMORY_BASEADDR ;
hw/petalogix_s3adsp1800_mmu.c +2 -2
@@ -49,7 +49,7 @@#define UARTLITE_BASEADDR 0x84000000#define ETHLITE_BASEADDR 0x81000000 -static void machine_cpu_reset (CPUState *env) +static void machine_cpu_reset (CPUMBState *env) {/* FIXME: move to machine specfic cpu reset */ env->pvr.regs[10 ] =0x0c000000 ;/* spartan 3a dsp family. */
@@ -63,7 +63,7 @@ petalogix_s3adsp1800_init(ram_addr_t ram_size, const char *initrd_filename, const char *cpu_model) { DeviceState *dev; -CPUState *env; +CPUMBState *env;DriveInfo *dinfo;int i;target_phys_addr_t ddr_base =MEMORY_BASEADDR ;
Signature · 1 line
1.7.7
RFC PATCH v4 40/44 sh4 hw/: Don't use CPUState
In reply to Andreas FärberScripted conversion:
for file in hw/sh.h hw/shix.c hw/r2d.c; do
sed -i "s/CPUState/CPUSH4State/g" $file
done
--- hw/r2d.c | 6 +++--- hw/sh.h | 2 +- hw/shix.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)
hw/r2d.c +3 -3
@@ -192,14 +192,14 @@ static qemu_irq *r2d_fpga_init(MemoryRegion *sysmem, }typedef struct ResetData { -CPUState *env; +CPUSH4State *env;uint32_t vector; }ResetData ;static void main_cpu_reset (void *opaque) {ResetData *s = (ResetData *)opaque; -CPUState *env = s->env; +CPUSH4State *env = s->env;cpu_state_reset (env); env->pc = s->vector;
@@ -224,7 +224,7 @@ static void r2d_init(ram_addr_t ram_size, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model) { - CPUState *env; + CPUSH4State *env;ResetData *reset_info;struct SH7750State *s;MemoryRegion *sdram =g_new (MemoryRegion,1 );
hw/sh.h +1 -1
@@ -11,7 +11,7 @@struct SH7750State ;struct MemoryRegion ; -struct SH7750State *sh7750_init (CPUState * cpu,struct MemoryRegion *sysmem); +struct SH7750State *sh7750_init (CPUSH4State * cpu,struct MemoryRegion *sysmem); typedef struct { /* The callback will be triggered if any of the designated lines change */
hw/shix.c +1 -1
@@ -43,7 +43,7 @@ static void shix_init(ram_addr_t ram_size, const char *initrd_filename, const char *cpu_model) { int ret; -CPUState *env; +CPUSH4State *env;struct SH7750State *s;MemoryRegion *sysmem =get_system_memory ();MemoryRegion *rom =g_new (MemoryRegion,1 );
Signature · 1 line
1.7.7
RFC PATCH v4 9/44 hw/mc146818: Drop unneeded #includes
In reply to Andreas Färberpc.h and apic.h are not needed; apic.h would drag in x86 CPUState and is now included directly for TARGET_I386.
isa.h is already #included from mc146818rtc.h.
--- hw/mc146818rtc.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
hw/mc146818rtc.c +0 -2
@@ -24,8 +24,6 @@#include "hw.h" #include "qemu-timer.h" #include "sysemu.h" -#include "pc.h" -#include "isa.h" #include "mc146818rtc.h" #ifdef TARGET_I386
Signature · 1 line
1.7.7
RFC PATCH v4 17/44 target-lm32: Don't overuse CPUState
In reply to Andreas FärberScripted conversion:
sed -i "s/CPUState/CPULM32State/g" target-lm32/*.[hc] sed -i "s/#define CPULM32State/#define CPUState/" target-lm32/cpu.h
--- target-lm32/cpu.h | 28 ++++++++++++++-------------- target-lm32/helper.c | 16 ++++++++-------- target-lm32/machine.c | 22 +++++++++++----------- target-lm32/op_helper.c | 4 ++-- target-lm32/translate.c | 38 +++++++++++++++++++------------------- 5 files changed, 54 insertions(+), 54 deletions(-)
target-lm32/cpu.h +14 -14
@@ -36,7 +36,7 @@ typedef struct CPULM32State CPULM32State;#define NB_MMU_MODES 1#define TARGET_PAGE_BITS 12 -static inline int cpu_mmu_index (CPUState *env) +static inline int cpu_mmu_index (CPULM32State *env) {return 0 ; }
@@ -185,18 +185,18 @@ typedef struct CPULM32State { } CPULM32State; -CPUState *cpu_lm32_init (const char *cpu_model); +CPULM32State *cpu_lm32_init (const char *cpu_model);void cpu_lm32_list (FILE *f,fprintf_function cpu_fprintf); -int cpu_lm32_exec (CPUState *s); -void cpu_lm32_close (CPUState *s); -void do_interrupt (CPUState *env); +int cpu_lm32_exec (CPULM32State *s); +void cpu_lm32_close (CPULM32State *s); +void do_interrupt (CPULM32State *env);/* you can call this signal handler from your SIGBUS and SIGSEGV signal handlers to inform the virtual CPU of exceptions. non zero is returned if the signal was handled by the virtual CPU. */ int cpu_lm32_signal_handler (int host_signum,void *pinfo,void *puc);void lm32_translate_init (void ); -void cpu_lm32_set_phys_msb_ignore (CPUState *env,int value); +void cpu_lm32_set_phys_msb_ignore (CPULM32State *env,int value);#define cpu_list cpu_lm32_list#define cpu_init cpu_lm32_init
@@ -206,12 +206,12 @@ void cpu_lm32_set_phys_msb_ignore(CPUState *env, int value);#define CPU_SAVE_VERSION 1 -int cpu_lm32_handle_mmu_fault (CPUState *env,target_ulong address,int rw, +int cpu_lm32_handle_mmu_fault (CPULM32State *env,target_ulong address,int rw,int mmu_idx);#define cpu_handle_mmu_fault cpu_lm32_handle_mmu_fault#if defined(CONFIG_USER_ONLY ) -static inline void cpu_clone_regs (CPUState *env,target_ulong newsp) +static inline void cpu_clone_regs (CPULM32State *env,target_ulong newsp) {if (newsp) { env->regs[R_SP ] = newsp;
@@ -220,23 +220,23 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp) }#endif -static inline void cpu_set_tls (CPUState *env,target_ulong newtls) +static inline void cpu_set_tls (CPULM32State *env,target_ulong newtls) { } -static inline int cpu_interrupts_enabled (CPUState *env) +static inline int cpu_interrupts_enabled (CPULM32State *env) {return env->ie &IE_IE ; }#include "cpu-all.h" -static inline target_ulong cpu_get_pc (CPUState *env) +static inline target_ulong cpu_get_pc (CPULM32State *env) {return env->pc; } -static inline void cpu_get_tb_cpu_state (CPUState *env,target_ulong *pc, +static inline void cpu_get_tb_cpu_state (CPULM32State *env,target_ulong *pc,target_ulong *cs_base,int *flags) { *pc = env->pc;
@@ -244,14 +244,14 @@ static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc, *flags =0 ; } -static inline bool cpu_has_work (CPUState *env) +static inline bool cpu_has_work (CPULM32State *env) {return env->interrupt_request &CPU_INTERRUPT_HARD ; }#include "exec-all.h" -static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) +static inline void cpu_pc_from_tb (CPULM32State *env,TranslationBlock *tb) { env->pc = tb->pc; }
target-lm32/helper.c +8 -8
@@ -20,7 +20,7 @@#include "cpu.h" #include "host-utils.h" -int cpu_lm32_handle_mmu_fault (CPUState *env,target_ulong address,int rw, +int cpu_lm32_handle_mmu_fault (CPULM32State *env,target_ulong address,int rw,int mmu_idx) {int prot;
@@ -37,12 +37,12 @@ int cpu_lm32_handle_mmu_fault(CPUState *env, target_ulong address, int rw,return 0 ; } -target_phys_addr_t cpu_get_phys_page_debug (CPUState *env,target_ulong addr) +target_phys_addr_t cpu_get_phys_page_debug (CPULM32State *env,target_ulong addr) {return addr &TARGET_PAGE_MASK ; } -void do_interrupt (CPUState *env) +void do_interrupt (CPULM32State *env) {qemu_log_mask (CPU_LOG_INT ,"exception at pc=%x type=%x\n" , env->pc, env->exception_index);
@@ -192,9 +192,9 @@ static uint32_t cfg_by_def(const LM32Def *def)return cfg; } -CPUState *cpu_lm32_init (const char *cpu_model) +CPULM32State *cpu_lm32_init (const char *cpu_model) { -CPUState *env; +CPULM32State *env;const LM32Def *def;static int tcg_initialized;
@@ -203,7 +203,7 @@ CPUState *cpu_lm32_init(const char *cpu_model)return NULL ; } - env =g_malloc0 (sizeof (CPUState)); + env =g_malloc0 (sizeof (CPULM32State)); env->features = def->features; env->num_bps = def->num_breakpoints;
@@ -226,7 +226,7 @@ CPUState *cpu_lm32_init(const char *cpu_model)/* Some soc ignores the MSB on the address bus. Thus creating a shadow memory * area. As a general rule, 0x00000000-0x7fffffff is cached, whereas * 0x80000000-0xffffffff is not cached and used to access IO devices. */ -void cpu_lm32_set_phys_msb_ignore (CPUState *env,int value) +void cpu_lm32_set_phys_msb_ignore (CPULM32State *env,int value) {if (value) { env->flags |=LM32_FLAG_IGNORE_MSB ;
@@ -235,7 +235,7 @@ void cpu_lm32_set_phys_msb_ignore(CPUState *env, int value) } } -void cpu_state_reset (CPUState *env) +void cpu_state_reset (CPULM32State *env) {if (qemu_loglevel_mask (CPU_LOG_RESET )) {qemu_log ("CPU Reset (CPU %d)\n" , env->cpu_index);
target-lm32/machine.c +11 -11
@@ -7,17 +7,17 @@ static const VMStateDescription vmstate_cpu = { .minimum_version_id = 1, .minimum_version_id_old = 1, .fields = (VMStateField []) { -VMSTATE_UINT32_ARRAY (regs, CPUState,32 ), -VMSTATE_UINT32 (pc, CPUState), -VMSTATE_UINT32 (ie, CPUState), -VMSTATE_UINT32 (icc, CPUState), -VMSTATE_UINT32 (dcc, CPUState), -VMSTATE_UINT32 (cc, CPUState), -VMSTATE_UINT32 (eba, CPUState), -VMSTATE_UINT32 (dc, CPUState), -VMSTATE_UINT32 (deba, CPUState), -VMSTATE_UINT32_ARRAY (bp, CPUState,4 ), -VMSTATE_UINT32_ARRAY (wp, CPUState,4 ), +VMSTATE_UINT32_ARRAY (regs, CPULM32State,32 ), +VMSTATE_UINT32 (pc, CPULM32State), +VMSTATE_UINT32 (ie, CPULM32State), +VMSTATE_UINT32 (icc, CPULM32State), +VMSTATE_UINT32 (dcc, CPULM32State), +VMSTATE_UINT32 (cc, CPULM32State), +VMSTATE_UINT32 (eba, CPULM32State), +VMSTATE_UINT32 (dc, CPULM32State), +VMSTATE_UINT32 (deba, CPULM32State), +VMSTATE_UINT32_ARRAY (bp, CPULM32State,4 ), +VMSTATE_UINT32_ARRAY (wp, CPULM32State,4 ),VMSTATE_END_OF_LIST () } };
target-lm32/op_helper.c +2 -2
@@ -75,11 +75,11 @@ uint32_t helper_rcsr_jrx(void)NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */ /* XXX: fix it to restore all registers */ -void tlb_fill (CPUState *env1,target_ulong addr,int is_write,int mmu_idx, +void tlb_fill (CPULM32State *env1,target_ulong addr,int is_write,int mmu_idx,void *retaddr) {TranslationBlock *tb; -CPUState *saved_env; +CPULM32State *saved_env;unsigned long pc;int ret;
target-lm32/translate.c +19 -19
@@ -64,7 +64,7 @@ enum {/* This is the state at translation time. */ typedef struct DisasContext { - CPUState *env; + CPULM32State *env; target_ulong pc; /* Decoder. */
@@ -987,7 +987,7 @@ static inline void decode(DisasContext *dc) decinfo[dc->opcode](dc); } -static void check_breakpoint (CPUState *env,DisasContext *dc) +static void check_breakpoint (CPULM32State *env,DisasContext *dc) {CPUBreakpoint *bp;
@@ -1003,7 +1003,7 @@ static void check_breakpoint(CPUState *env, DisasContext *dc) }/* generate intermediate code for basic block 'tb'. */ -static void gen_intermediate_code_internal (CPUState *env, +static void gen_intermediate_code_internal (CPULM32State *env,TranslationBlock *tb,int search_pc) {struct DisasContext ctx, *dc = &ctx;
@@ -1129,17 +1129,17 @@ static void gen_intermediate_code_internal(CPUState *env,#endif } -void gen_intermediate_code (CPUState *env,struct TranslationBlock *tb) +void gen_intermediate_code (CPULM32State *env,struct TranslationBlock *tb) {gen_intermediate_code_internal (env, tb,0 ); } -void gen_intermediate_code_pc (CPUState *env,struct TranslationBlock *tb) +void gen_intermediate_code_pc (CPULM32State *env,struct TranslationBlock *tb) {gen_intermediate_code_internal (env, tb,1 ); } -void cpu_dump_state (CPUState *env,FILE *f,fprintf_function cpu_fprintf, +void cpu_dump_state (CPULM32State *env,FILE *f,fprintf_function cpu_fprintf,int flags) {int i;
@@ -1171,7 +1171,7 @@ void cpu_dump_state(CPUState *env, FILE *f, fprintf_function cpu_fprintf,cpu_fprintf (f,"\n\n" ); } -void restore_state_to_opc (CPUState *env,TranslationBlock *tb,int pc_pos) +void restore_state_to_opc (CPULM32State *env,TranslationBlock *tb,int pc_pos) { env->pc = gen_opc_pc[pc_pos]; }
@@ -1184,48 +1184,48 @@ void lm32_translate_init(void)for (i =0 ; i <ARRAY_SIZE (cpu_R); i++) { cpu_R[i] =tcg_global_mem_new (TCG_AREG0 , - offsetof(CPUState, regs[i]), + offsetof(CPULM32State, regs[i]), regnames[i]); }for (i =0 ; i <ARRAY_SIZE (cpu_bp); i++) { cpu_bp[i] =tcg_global_mem_new (TCG_AREG0 , - offsetof(CPUState, bp[i]), + offsetof(CPULM32State, bp[i]), regnames[32+i]); }for (i =0 ; i <ARRAY_SIZE (cpu_wp); i++) { cpu_wp[i] =tcg_global_mem_new (TCG_AREG0 , - offsetof(CPUState, wp[i]), + offsetof(CPULM32State, wp[i]), regnames[36+i]); } cpu_pc =tcg_global_mem_new (TCG_AREG0 , - offsetof(CPUState , pc), + offsetof(CPULM32State , pc),"pc" ); cpu_ie =tcg_global_mem_new (TCG_AREG0 , - offsetof(CPUState , ie), + offsetof(CPULM32State , ie),"ie" ); cpu_icc =tcg_global_mem_new (TCG_AREG0 , - offsetof(CPUState , icc), + offsetof(CPULM32State , icc),"icc" ); cpu_dcc =tcg_global_mem_new (TCG_AREG0 , - offsetof(CPUState , dcc), + offsetof(CPULM32State , dcc),"dcc" ); cpu_cc =tcg_global_mem_new (TCG_AREG0 , - offsetof(CPUState , cc), + offsetof(CPULM32State , cc),"cc" ); cpu_cfg =tcg_global_mem_new (TCG_AREG0 , - offsetof(CPUState , cfg), + offsetof(CPULM32State , cfg),"cfg" ); cpu_eba =tcg_global_mem_new (TCG_AREG0 , - offsetof(CPUState , eba), + offsetof(CPULM32State , eba),"eba" ); cpu_dc =tcg_global_mem_new (TCG_AREG0 , - offsetof(CPUState , dc), + offsetof(CPULM32State , dc),"dc" ); cpu_deba =tcg_global_mem_new (TCG_AREG0 , - offsetof(CPUState , deba), + offsetof(CPULM32State , deba),"deba" ); }
Signature · 1 line
1.7.7
RFC PATCH v4 20/44 target-mips: Don't overuse CPUState
In reply to Andreas FärberScripted conversion:
sed -i "s/CPUState/CPUMIPSState/g" target-mips/*.[hc] sed -i "s/#define CPUMIPSState/#define CPUState/" target-mips/cpu.h
--- target-mips/cpu.h | 40 +++--- target-mips/helper.c | 24 ++-- target-mips/machine.c | 4 +- target-mips/op_helper.c | 124 ++++++++-------- target-mips/translate.c | 356 +++++++++++++++++++++++----------------------- 5 files changed, 274 insertions(+), 274 deletions(-)
target-mips/cpu.h +20 -20
@@ -495,7 +495,7 @@ void r4k_helper_tlbwr (void);void r4k_helper_tlbp (void );void r4k_helper_tlbr (void ); -void cpu_unassigned_access (CPUState *env,target_phys_addr_t addr, +void cpu_unassigned_access (CPUMIPSState *env,target_phys_addr_t addr,int is_write,int is_exec,int unused,int size);#endif
@@ -515,12 +515,12 @@ void mips_cpu_list (FILE *f, fprintf_function cpu_fprintf);#define MMU_MODE1_SUFFIX _super#define MMU_MODE2_SUFFIX _user#define MMU_USER_IDX 2 -static inline int cpu_mmu_index (CPUState *env) +static inline int cpu_mmu_index (CPUMIPSState *env) {return env->hflags &MIPS_HFLAG_KSU ; } -static inline void cpu_clone_regs (CPUState *env,target_ulong newsp) +static inline void cpu_clone_regs (CPUMIPSState *env,target_ulong newsp) {if (newsp) env->active_tc.gpr[29 ] = newsp;
@@ -528,7 +528,7 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp) env->active_tc.gpr[2 ] =0 ; } -static inline int cpu_mips_hw_interrupts_pending (CPUState *env) +static inline int cpu_mips_hw_interrupts_pending (CPUMIPSState *env) {int32_t pending;int32_t status;
@@ -636,28 +636,28 @@ CPUMIPSState *cpu_mips_init(const char *cpu_model);int cpu_mips_signal_handler (int host_signum,void *pinfo,void *puc);/* mips_timer.c */ -uint32_t cpu_mips_get_random (CPUState *env); -uint32_t cpu_mips_get_count (CPUState *env); -void cpu_mips_store_count (CPUState *env,uint32_t value); -void cpu_mips_store_compare (CPUState *env,uint32_t value); -void cpu_mips_start_count (CPUState *env); -void cpu_mips_stop_count (CPUState *env); +uint32_t cpu_mips_get_random (CPUMIPSState *env); +uint32_t cpu_mips_get_count (CPUMIPSState *env); +void cpu_mips_store_count (CPUMIPSState *env,uint32_t value); +void cpu_mips_store_compare (CPUMIPSState *env,uint32_t value); +void cpu_mips_start_count (CPUMIPSState *env); +void cpu_mips_stop_count (CPUMIPSState *env);/* mips_int.c */ -void cpu_mips_soft_irq (CPUState *env,int irq,int level); +void cpu_mips_soft_irq (CPUMIPSState *env,int irq,int level);/* helper.c */ -int cpu_mips_handle_mmu_fault (CPUState *env,target_ulong address,int rw, +int cpu_mips_handle_mmu_fault (CPUMIPSState *env,target_ulong address,int rw,int mmu_idx);#define cpu_handle_mmu_fault cpu_mips_handle_mmu_fault -void do_interrupt (CPUState *env); +void do_interrupt (CPUMIPSState *env);#if !defined(CONFIG_USER_ONLY ) -void r4k_invalidate_tlb (CPUState *env,int idx,int use_extra); -target_phys_addr_t cpu_mips_translate_address (CPUState *env,target_ulong address, +void r4k_invalidate_tlb (CPUMIPSState *env,int idx,int use_extra); +target_phys_addr_t cpu_mips_translate_address (CPUMIPSState *env,target_ulong address,int rw);#endif -static inline void cpu_get_tb_cpu_state (CPUState *env,target_ulong *pc, +static inline void cpu_get_tb_cpu_state (CPUMIPSState *env,target_ulong *pc,target_ulong *cs_base,int *flags) { *pc = env->active_tc.PC;
@@ -665,12 +665,12 @@ static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc, *flags = env->hflags & (MIPS_HFLAG_TMASK |MIPS_HFLAG_BMASK ); } -static inline void cpu_set_tls (CPUState *env,target_ulong newtls) +static inline void cpu_set_tls (CPUMIPSState *env,target_ulong newtls) { env->tls_value = newtls; } -static inline int mips_vpe_active (CPUState *env) +static inline int mips_vpe_active (CPUMIPSState *env) {int active =1 ;
@@ -701,7 +701,7 @@ static inline int mips_vpe_active(CPUState *env)return active; } -static inline int cpu_has_work (CPUState *env) +static inline int cpu_has_work (CPUMIPSState *env) {int has_work =0 ;
@@ -730,7 +730,7 @@ static inline int cpu_has_work(CPUState *env)#include "exec-all.h" -static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) +static inline void cpu_pc_from_tb (CPUMIPSState *env,TranslationBlock *tb) { env->active_tc.PC = tb->pc; env->hflags &= ~MIPS_HFLAG_BMASK ;
target-mips/helper.c +12 -12
@@ -36,7 +36,7 @@ enum {#if !defined(CONFIG_USER_ONLY )/* no MMU emulation */ -int no_mmu_map_address (CPUState *env,target_phys_addr_t *physical,int *prot, +int no_mmu_map_address (CPUMIPSState *env,target_phys_addr_t *physical,int *prot,target_ulong address,int rw,int access_type) { *physical = address;
@@ -45,7 +45,7 @@ int no_mmu_map_address (CPUState *env, target_phys_addr_t *physical, int *prot, }/* fixed mapping MMU emulation */ -int fixed_mmu_map_address (CPUState *env,target_phys_addr_t *physical,int *prot, +int fixed_mmu_map_address (CPUMIPSState *env,target_phys_addr_t *physical,int *prot,target_ulong address,int rw,int access_type) {if (address <= (int32_t )0x7FFFFFFFUL ) {
@@ -63,7 +63,7 @@ int fixed_mmu_map_address (CPUState *env, target_phys_addr_t *physical, int *pro }/* MIPS32/MIPS64 R4000-style MMU emulation */ -int r4k_map_address (CPUState *env,target_phys_addr_t *physical,int *prot, +int r4k_map_address (CPUMIPSState *env,target_phys_addr_t *physical,int *prot,target_ulong address,int rw,int access_type) {uint8_t ASID = env->CP0_EntryHi &0xFF ;
@@ -99,7 +99,7 @@ int r4k_map_address (CPUState *env, target_phys_addr_t *physical, int *prot,return TLBRET_NOMATCH ; } -static int get_physical_address (CPUState *env,target_phys_addr_t *physical, +static int get_physical_address (CPUMIPSState *env,target_phys_addr_t *physical,int *prot,target_ulong address,int rw,int access_type) {
@@ -201,7 +201,7 @@ static int get_physical_address (CPUState *env, target_phys_addr_t *physical, }#endif -static void raise_mmu_exception (CPUState *env,target_ulong address, +static void raise_mmu_exception (CPUMIPSState *env,target_ulong address,int rw,int tlb_error) {int exception =0 , error_code =0 ;
@@ -254,7 +254,7 @@ static void raise_mmu_exception(CPUState *env, target_ulong address, }#if !defined(CONFIG_USER_ONLY ) -target_phys_addr_t cpu_get_phys_page_debug (CPUState *env,target_ulong addr) +target_phys_addr_t cpu_get_phys_page_debug (CPUMIPSState *env,target_ulong addr) {target_phys_addr_t phys_addr;int prot;
@@ -265,7 +265,7 @@ target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr) }#endif -int cpu_mips_handle_mmu_fault (CPUState *env,target_ulong address,int rw, +int cpu_mips_handle_mmu_fault (CPUMIPSState *env,target_ulong address,int rw,int mmu_idx) {#if !defined(CONFIG_USER_ONLY )
@@ -308,7 +308,7 @@ int cpu_mips_handle_mmu_fault (CPUState *env, target_ulong address, int rw, }#if !defined(CONFIG_USER_ONLY ) -target_phys_addr_t cpu_mips_translate_address (CPUState *env,target_ulong address,int rw) +target_phys_addr_t cpu_mips_translate_address (CPUMIPSState *env,target_ulong address,int rw) {target_phys_addr_t physical;int prot;
@@ -367,7 +367,7 @@ static const char * const excp_names[EXCP_LAST + 1] = { };#if !defined(CONFIG_USER_ONLY ) -static target_ulong exception_resume_pc (CPUState *env) +static target_ulong exception_resume_pc (CPUMIPSState *env) {target_ulong bad_pc;target_ulong isa_mode;
@@ -383,7 +383,7 @@ static target_ulong exception_resume_pc (CPUState *env)return bad_pc; } -static void set_hflags_for_handler (CPUState *env) +static void set_hflags_for_handler (CPUMIPSState *env) {/* Exception handlers are entered in 32-bit mode. */ env->hflags &= ~(MIPS_HFLAG_M16 );
@@ -396,7 +396,7 @@ static void set_hflags_for_handler (CPUState *env) }#endif -void do_interrupt (CPUState *env) +void do_interrupt (CPUMIPSState *env) {#if !defined(CONFIG_USER_ONLY )target_ulong offset;
@@ -637,7 +637,7 @@ void do_interrupt (CPUState *env) }#if !defined(CONFIG_USER_ONLY ) -void r4k_invalidate_tlb (CPUState *env,int idx,int use_extra) +void r4k_invalidate_tlb (CPUMIPSState *env,int idx,int use_extra) {r4k_tlb_t *tlb;target_ulong addr;
target-mips/machine.c +2 -2
@@ -42,7 +42,7 @@ static void save_fpu(QEMUFile *f, CPUMIPSFPUContext *fpu)void cpu_save (QEMUFile *f,void *opaque) { -CPUState *env = opaque; +CPUMIPSState *env = opaque;int i;/* Save active TC */
@@ -190,7 +190,7 @@ static void load_fpu(QEMUFile *f, CPUMIPSFPUContext *fpu)int cpu_load (QEMUFile *f,void *opaque,int version_id) { -CPUState *env = opaque; +CPUMIPSState *env = opaque;int i;if (version_id !=3 )
target-mips/op_helper.c +62 -62
475 lines not on this page · raw message
target-mips/translate.c +178 -178
1,257 lines not on this page · raw message
Signature · 1 line
1.7.7
RFC PATCH v4 21/44 target-ppc: Don't overuse CPUState
In reply to Andreas FärberScripted conversion:
sed -i "s/CPUState/CPUPPCState/g" target-ppc/*.[hc] sed -i "s/#define CPUPPCState/#define CPUState/" target-ppc/cpu.h
--- target-ppc/cpu.h | 38 ++++++++++---------- target-ppc/helper.c | 80 +++++++++++++++++++++--------------------- target-ppc/kvm.c | 38 ++++++++++---------- target-ppc/kvm_ppc.h | 12 +++--- target-ppc/machine.c | 4 +- target-ppc/op_helper.c | 12 +++--- target-ppc/translate.c | 78 +++++++++++++++++++++--------------------- target-ppc/translate_init.c | 42 +++++++++++----------- 8 files changed, 152 insertions(+), 152 deletions(-)
target-ppc/cpu.h +19 -19
@@ -1173,12 +1173,12 @@ void store_40x_dbcr0 (CPUPPCState *env, uint32_t val);void store_40x_sler (CPUPPCState *env,uint32_t val);void store_booke_tcr (CPUPPCState *env,target_ulong val);void store_booke_tsr (CPUPPCState *env,target_ulong val); -void booke206_flush_tlb (CPUState *env,int flags,const int check_iprot); -target_phys_addr_t booke206_tlb_to_page_size (CPUState *env,ppcmas_tlb_t *tlb); -int ppcemb_tlb_check (CPUState *env,ppcemb_tlb_t *tlb, +void booke206_flush_tlb (CPUPPCState *env,int flags,const int check_iprot); +target_phys_addr_t booke206_tlb_to_page_size (CPUPPCState *env,ppcmas_tlb_t *tlb); +int ppcemb_tlb_check (CPUPPCState *env,ppcemb_tlb_t *tlb,target_phys_addr_t *raddrp,target_ulong address,uint32_t pid,int ext,int i); -int ppcmas_tlb_check (CPUState *env,ppcmas_tlb_t *tlb, +int ppcmas_tlb_check (CPUPPCState *env,ppcmas_tlb_t *tlb,target_phys_addr_t *raddrp,target_ulong address,uint32_t pid);void ppc_tlb_invalidate_all (CPUPPCState *env);
@@ -1226,13 +1226,13 @@ int ppc_dcr_write (ppc_dcr_t *dcr_env, int dcrn, uint32_t val);#define MMU_MODE1_SUFFIX _kernel#define MMU_MODE2_SUFFIX _hypv#define MMU_USER_IDX 0 -static inline int cpu_mmu_index (CPUState *env) +static inline int cpu_mmu_index (CPUPPCState *env) {return env->mmu_idx; }#if defined(CONFIG_USER_ONLY ) -static inline void cpu_clone_regs (CPUState *env,target_ulong newsp) +static inline void cpu_clone_regs (CPUPPCState *env,target_ulong newsp) {if (newsp) env->gpr[1 ] = newsp;
@@ -2056,7 +2056,7 @@ enum {/*****************************************************************************/ -static inline void cpu_get_tb_cpu_state (CPUState *env,target_ulong *pc, +static inline void cpu_get_tb_cpu_state (CPUPPCState *env,target_ulong *pc,target_ulong *cs_base,int *flags) { *pc = env->nip;
@@ -2064,7 +2064,7 @@ static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc, *flags = env->hflags; } -static inline void cpu_set_tls (CPUState *env,target_ulong newtls) +static inline void cpu_set_tls (CPUPPCState *env,target_ulong newtls) {#if defined(TARGET_PPC64 )/* The kernel checks TIF_32BIT here; we don't support loading 32-bit
@@ -2076,7 +2076,7 @@ static inline void cpu_set_tls(CPUState *env, target_ulong newtls) }#if !defined(CONFIG_USER_ONLY ) -static inline int booke206_tlbm_id (CPUState *env,ppcmas_tlb_t *tlbm) +static inline int booke206_tlbm_id (CPUPPCState *env,ppcmas_tlb_t *tlbm) {uintptr_t tlbml = (uintptr_t )tlbm;uintptr_t tlbl = (uintptr_t )env->tlb.tlbm;
@@ -2084,21 +2084,21 @@ static inline int booke206_tlbm_id(CPUState *env, ppcmas_tlb_t *tlbm)return (tlbml - tlbl) /sizeof (env->tlb.tlbm[0 ]); } -static inline int booke206_tlb_size (CPUState *env,int tlbn) +static inline int booke206_tlb_size (CPUPPCState *env,int tlbn) {uint32_t tlbncfg = env->spr[SPR_BOOKE_TLB0CFG + tlbn];int r = tlbncfg & TLBnCFG_N_ENTRY;return r; } -static inline int booke206_tlb_ways (CPUState *env,int tlbn) +static inline int booke206_tlb_ways (CPUPPCState *env,int tlbn) {uint32_t tlbncfg = env->spr[SPR_BOOKE_TLB0CFG + tlbn];int r = tlbncfg >> TLBnCFG_ASSOC_SHIFT;return r; } -static inline int booke206_tlbm_to_tlbn (CPUState *env,ppcmas_tlb_t *tlbm) +static inline int booke206_tlbm_to_tlbn (CPUPPCState *env,ppcmas_tlb_t *tlbm) {int id =booke206_tlbm_id (env, tlbm);int end =0 ;
@@ -2115,14 +2115,14 @@ static inline int booke206_tlbm_to_tlbn(CPUState *env, ppcmas_tlb_t *tlbm)return 0 ; } -static inline int booke206_tlbm_to_way (CPUState *env,ppcmas_tlb_t *tlb) +static inline int booke206_tlbm_to_way (CPUPPCState *env,ppcmas_tlb_t *tlb) {int tlbn =booke206_tlbm_to_tlbn (env, tlb);int tlbid =booke206_tlbm_id (env, tlb);return tlbid & (booke206_tlb_ways (env, tlbn) -1 ); } -static inline ppcmas_tlb_t *booke206_get_tlbm (CPUState *env,const int tlbn, +static inline ppcmas_tlb_t *booke206_get_tlbm (CPUPPCState *env,const int tlbn,target_ulong ea,int way) {int r;
@@ -2149,7 +2149,7 @@ static inline ppcmas_tlb_t *booke206_get_tlbm(CPUState *env, const int tlbn, }/* returns bitmap of supported page sizes for a given TLB */ -static inline uint32_t booke206_tlbnps (CPUState *env,const int tlbn) +static inline uint32_t booke206_tlbnps (CPUPPCState *env,const int tlbn) {bool mav2 = false;uint32_t ret =0 ;
@@ -2171,20 +2171,20 @@ static inline uint32_t booke206_tlbnps(CPUState *env, const int tlbn)#endif -extern void (*cpu_ppc_hypercall)(CPUState *); +extern void (*cpu_ppc_hypercall)(CPUPPCState *); -static inline bool cpu_has_work (CPUState *env) +static inline bool cpu_has_work (CPUPPCState *env) {return msr_ee && (env->interrupt_request &CPU_INTERRUPT_HARD ); }#include "exec-all.h" -static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) +static inline void cpu_pc_from_tb (CPUPPCState *env,TranslationBlock *tb) { env->nip = tb->pc; } -void dump_mmu (FILE *f,fprintf_function cpu_fprintf,CPUState *env); +void dump_mmu (FILE *f,fprintf_function cpu_fprintf,CPUPPCState *env);#endif /* !defined (__CPU_PPC_H__) */
target-ppc/helper.c +40 -40
316 lines not on this page · raw message
target-ppc/kvm.c +19 -19
@@ -93,7 +93,7 @@ int kvm_arch_init(KVMState *s)return 0 ; } -static int kvm_arch_sync_sregs (CPUState *cenv) +static int kvm_arch_sync_sregs (CPUPPCState *cenv) {struct kvm_sregs sregs;int ret;
@@ -121,7 +121,7 @@ static int kvm_arch_sync_sregs(CPUState *cenv) }/* Set up a shared TLB array with KVM */ -static int kvm_booke206_tlb_init (CPUState *env) +static int kvm_booke206_tlb_init (CPUPPCState *env) {struct kvm_book3e_206_tlb_params params = {};struct kvm_config_tlb cfg = {};
@@ -166,7 +166,7 @@ static int kvm_booke206_tlb_init(CPUState *env)return 0 ; } -int kvm_arch_init_vcpu (CPUState *cenv) +int kvm_arch_init_vcpu (CPUPPCState *cenv) {int ret;
@@ -189,11 +189,11 @@ int kvm_arch_init_vcpu(CPUState *cenv)return ret; } -void kvm_arch_reset_vcpu (CPUState *env) +void kvm_arch_reset_vcpu (CPUPPCState *env) { } -static void kvm_sw_tlb_put (CPUState *env) +static void kvm_sw_tlb_put (CPUPPCState *env) {struct kvm_dirty_tlb dirty_tlb;unsigned char *bitmap;
@@ -218,7 +218,7 @@ static void kvm_sw_tlb_put(CPUState *env)g_free (bitmap); } -int kvm_arch_put_registers (CPUState *env,int level) +int kvm_arch_put_registers (CPUPPCState *env,int level) {struct kvm_regs regs;int ret;
@@ -263,7 +263,7 @@ int kvm_arch_put_registers(CPUState *env, int level)return ret; } -int kvm_arch_get_registers (CPUState *env) +int kvm_arch_get_registers (CPUPPCState *env) {struct kvm_regs regs;struct kvm_sregs sregs;
@@ -440,7 +440,7 @@ int kvm_arch_get_registers(CPUState *env)return 0 ; } -int kvmppc_set_interrupt (CPUState *env,int irq,int level) +int kvmppc_set_interrupt (CPUPPCState *env,int irq,int level) {unsigned virq = level ?KVM_INTERRUPT_SET_LEVEL :KVM_INTERRUPT_UNSET ;
@@ -465,7 +465,7 @@ int kvmppc_set_interrupt(CPUState *env, int irq, int level)#define PPC_INPUT_INT PPC6xx_INPUT_INT#endif -void kvm_arch_pre_run (CPUState *env,struct kvm_run *run) +void kvm_arch_pre_run (CPUPPCState *env,struct kvm_run *run) {int r;unsigned irq;
@@ -498,16 +498,16 @@ void kvm_arch_pre_run(CPUState *env, struct kvm_run *run)* anyways, so we will get a chance to deliver the rest. */ } -void kvm_arch_post_run (CPUState *env,struct kvm_run *run) +void kvm_arch_post_run (CPUPPCState *env,struct kvm_run *run) { } -int kvm_arch_process_async_events (CPUState *env) +int kvm_arch_process_async_events (CPUPPCState *env) {return env->halted; } -static int kvmppc_handle_halt (CPUState *env) +static int kvmppc_handle_halt (CPUPPCState *env) {if (!(env->interrupt_request &CPU_INTERRUPT_HARD ) && (msr_ee)) { env->halted =1 ;
@@ -518,7 +518,7 @@ static int kvmppc_handle_halt(CPUState *env) }/* map dcr access to existing qemu dcr emulation */ -static int kvmppc_handle_dcr_read (CPUState *env,uint32_t dcrn,uint32_t *data) +static int kvmppc_handle_dcr_read (CPUPPCState *env,uint32_t dcrn,uint32_t *data) {if (ppc_dcr_read (env->dcr_env, dcrn, data) <0 )fprintf (stderr,"Read to unhandled DCR (0x%x)\n" , dcrn);
@@ -526,7 +526,7 @@ static int kvmppc_handle_dcr_read(CPUState *env, uint32_t dcrn, uint32_t *data)return 0 ; } -static int kvmppc_handle_dcr_write (CPUState *env,uint32_t dcrn,uint32_t data) +static int kvmppc_handle_dcr_write (CPUPPCState *env,uint32_t dcrn,uint32_t data) {if (ppc_dcr_write (env->dcr_env, dcrn, data) <0 )fprintf (stderr,"Write to unhandled DCR (0x%x)\n" , dcrn);
@@ -534,7 +534,7 @@ static int kvmppc_handle_dcr_write(CPUState *env, uint32_t dcrn, uint32_t data)return 0 ; } -int kvm_arch_handle_exit (CPUState *env,struct kvm_run *run) +int kvm_arch_handle_exit (CPUPPCState *env,struct kvm_run *run) {int ret;
@@ -704,7 +704,7 @@ uint32_t kvmppc_get_dfp(void)return kvmppc_read_int_cpu_dt ("ibm,dfp" ); } -int kvmppc_get_hypercall (CPUState *env,uint8_t *buf,int buf_len) +int kvmppc_get_hypercall (CPUPPCState *env,uint8_t *buf,int buf_len) {uint32_t *hc = (uint32_t *)buf;
@@ -734,7 +734,7 @@ int kvmppc_get_hypercall(CPUState *env, uint8_t *buf, int buf_len)return 0 ; } -void kvmppc_set_papr (CPUState *env) +void kvmppc_set_papr (CPUPPCState *env) {struct kvm_enable_cap cap = {};struct kvm_one_reg reg = {};
@@ -930,12 +930,12 @@ const ppc_def_t *kvmppc_host_cpu_def(void)return spec; } -bool kvm_arch_stop_on_emulation_error (CPUState *env) +bool kvm_arch_stop_on_emulation_error (CPUPPCState *env) {return true; } -int kvm_arch_on_sigbus_vcpu (CPUState *env,int code,void *addr) +int kvm_arch_on_sigbus_vcpu (CPUPPCState *env,int code,void *addr) {return 1 ; }
target-ppc/kvm_ppc.h +6 -6
@@ -19,9 +19,9 @@ uint32_t kvmppc_get_tbfreq(void);uint64_t kvmppc_get_clockfreq (void );uint32_t kvmppc_get_vmx (void );uint32_t kvmppc_get_dfp (void ); -int kvmppc_get_hypercall (CPUState *env,uint8_t *buf,int buf_len); -int kvmppc_set_interrupt (CPUState *env,int irq,int level); -void kvmppc_set_papr (CPUState *env); +int kvmppc_get_hypercall (CPUPPCState *env,uint8_t *buf,int buf_len); +int kvmppc_set_interrupt (CPUPPCState *env,int irq,int level); +void kvmppc_set_papr (CPUPPCState *env);int kvmppc_smt_threads (void );#ifndef CONFIG_USER_ONLY off_t kvmppc_alloc_rma (const char *name,MemoryRegion *sysmem);
@@ -52,17 +52,17 @@ static inline uint32_t kvmppc_get_dfp(void)return 0 ; } -static inline int kvmppc_get_hypercall (CPUState *env,uint8_t *buf,int buf_len) +static inline int kvmppc_get_hypercall (CPUPPCState *env,uint8_t *buf,int buf_len) {return -1 ; } -static inline int kvmppc_set_interrupt (CPUState *env,int irq,int level) +static inline int kvmppc_set_interrupt (CPUPPCState *env,int irq,int level) {return -1 ; } -static inline void kvmppc_set_papr (CPUState *env) +static inline void kvmppc_set_papr (CPUPPCState *env) { }
target-ppc/machine.c +2 -2
@@ -4,7 +4,7 @@void cpu_save (QEMUFile *f,void *opaque) { -CPUState *env = (CPUState *)opaque; +CPUPPCState *env = (CPUPPCState *)opaque;unsigned int i, j;for (i =0 ; i <32 ; i++)
@@ -91,7 +91,7 @@ void cpu_save(QEMUFile *f, void *opaque)int cpu_load (QEMUFile *f,void *opaque,int version_id) { -CPUState *env = (CPUState *)opaque; +CPUPPCState *env = (CPUPPCState *)opaque;unsigned int i, j;target_ulong sdr1;
target-ppc/op_helper.c +6 -6
@@ -3714,11 +3714,11 @@ uint32_t helper_efdcmpeq (uint64_t op1, uint64_t op2)NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */ /* XXX: fix it to restore all registers */ -void tlb_fill (CPUState *env1,target_ulong addr,int is_write,int mmu_idx, +void tlb_fill (CPUPPCState *env1,target_ulong addr,int is_write,int mmu_idx,void *retaddr) {TranslationBlock *tb; -CPUState *saved_env; +CPUPPCState *saved_env;unsigned long pc;int ret;
@@ -4200,7 +4200,7 @@ target_ulong helper_440_tlbsx (target_ulong address)/* PowerPC BookE 2.06 TLB management */ -static ppcmas_tlb_t *booke206_cur_tlb (CPUState *env) +static ppcmas_tlb_t *booke206_cur_tlb (CPUPPCState *env) {uint32_t tlbncfg =0 ;int esel = (env->spr[SPR_BOOKE_MAS0 ] &MAS0_ESEL_MASK ) >>MAS0_ESEL_SHIFT ;
@@ -4306,7 +4306,7 @@ void helper_booke206_tlbwe(void) } } -static inline void booke206_tlb_to_mas (CPUState *env,ppcmas_tlb_t *tlb) +static inline void booke206_tlb_to_mas (CPUPPCState *env,ppcmas_tlb_t *tlb) {int tlbn =booke206_tlbm_to_tlbn (env, tlb);int way =booke206_tlbm_to_way (env, tlb);
@@ -4387,7 +4387,7 @@ void helper_booke206_tlbsx(target_ulong address) env->spr[SPR_BOOKE_MAS0 ] |= env->last_way <<MAS0_NV_SHIFT ; } -static inline void booke206_invalidate_ea_tlb (CPUState *env,int tlbn, +static inline void booke206_invalidate_ea_tlb (CPUPPCState *env,int tlbn,uint32_t ea) {int i;
@@ -4553,7 +4553,7 @@ void helper_msgsnd(target_ulong rb) {int irq =dbell2irq (rb);int pir = rb &DBELL_PIRTAG_MASK ; -CPUState *cenv; +CPUPPCState *cenv;if (irq <0 ) {return ;
target-ppc/translate.c +39 -39
261 lines not on this page · raw message
target-ppc/translate_init.c +21 -21
153 lines not on this page · raw message
Signature · 1 line
1.7.7
RFC PATCH v4 29/44 xtensa-semi: Don't use CPUState
In reply to Andreas FärberScripted conversion:
sed -i "s/CPUState/CPUXtensaState/g" xtensa-semi.c
--- xtensa-semi.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
xtensa-semi.c +1 -1
@@ -55,7 +55,7 @@ enum { SELECT_ONE_EXCEPT = 3, }; -void HELPER (simcall )(CPUState *env) +void HELPER (simcall )(CPUXtensaState *env) {uint32_t *regs = env->regs;
Signature · 1 line
1.7.7
RFC PATCH v4 33/44 i386 hw/: Don't use CPUState
In reply to Andreas FärberScripted conversion:
for file in hw/apic.h hw/kvm/apic.c hw/kvmvapic.c hw/pc.c hw/vmport.c hw/xen_machine_pv.c; do
sed -i "s/CPUState/CPUX86State/g" $file
done
--- hw/apic.h | 2 +- hw/kvm/apic.c | 2 +- hw/kvmvapic.c | 22 +++++++++++----------- hw/pc.c | 20 ++++++++++---------- hw/vmport.c | 12 ++++++------ hw/xen_machine_pv.c | 2 +- 6 files changed, 30 insertions(+), 30 deletions(-)
hw/apic.h +1 -1
@@ -22,7 +22,7 @@ void apic_handle_tpr_access_report(DeviceState *d, target_ulong ip, TPRAccess access);/* pc.c */ -int cpu_is_bsp (CPUState *env); +int cpu_is_bsp (CPUX86State *env);DeviceState *cpu_get_current_apic (void );#endif
hw/kvm/apic.c +1 -1
@@ -124,7 +124,7 @@ static void kvm_apic_vapic_base_update(APICCommonState *s)static void do_inject_external_nmi (void *data) {APICCommonState *s = data; -CPUState *env = s->cpu_env; +CPUX86State *env = s->cpu_env;uint32_t lvt;int ret;
hw/kvmvapic.c +11 -11
@@ -142,7 +142,7 @@ static void update_guest_rom_state(VAPICROMState *s)write_guest_rom_state (s); } -static int find_real_tpr_addr (VAPICROMState *s,CPUState *env) +static int find_real_tpr_addr (VAPICROMState *s,CPUX86State *env) {target_phys_addr_t paddr;target_ulong addr;
@@ -185,7 +185,7 @@ static bool opcode_matches(uint8_t *opcode, const TPRInstruction *instr) modrm_reg(opcode[1]) == instr->modrm_reg); } -static int evaluate_tpr_instruction (VAPICROMState *s,CPUState *env, +static int evaluate_tpr_instruction (VAPICROMState *s,CPUX86State *env,target_ulong *pip,TPRAccess access) {const TPRInstruction *instr;
@@ -267,7 +267,7 @@ instruction_ok:return 0 ; } -static int update_rom_mapping (VAPICROMState *s,CPUState *env,target_ulong ip) +static int update_rom_mapping (VAPICROMState *s,CPUX86State *env,target_ulong ip) {target_phys_addr_t paddr;uint32_t rom_state_vaddr;
@@ -330,7 +330,7 @@ static int update_rom_mapping(VAPICROMState *s, CPUState *env, target_ulong ip)* cannot be accessed or is considered invalid. This also ensures that we are * not patching the wrong guest. */ -static int get_kpcr_number (CPUState *env) +static int get_kpcr_number (CPUX86State *env) {struct kpcr {uint8_t fill1[0x1c ];
@@ -347,7 +347,7 @@ static int get_kpcr_number(CPUState *env)return kpcr.number; } -static int vapic_enable (VAPICROMState *s,CPUState *env) +static int vapic_enable (VAPICROMState *s,CPUX86State *env) {int cpu_number =get_kpcr_number (env);target_phys_addr_t vapic_paddr;
@@ -367,12 +367,12 @@ static int vapic_enable(VAPICROMState *s, CPUState *env)return 0 ; } -static void patch_byte (CPUState *env,target_ulong addr,uint8_t byte) +static void patch_byte (CPUX86State *env,target_ulong addr,uint8_t byte) {cpu_memory_rw_debug (env, addr, &byte,1 ,1 ); } -static void patch_call (VAPICROMState *s,CPUState *env,target_ulong ip, +static void patch_call (VAPICROMState *s,CPUX86State *env,target_ulong ip,uint32_t target) {uint32_t offset;
@@ -382,7 +382,7 @@ static void patch_call(VAPICROMState *s, CPUState *env, target_ulong ip,cpu_memory_rw_debug (env, ip +1 , (void *)&offset,sizeof (offset),1 ); } -static void patch_instruction (VAPICROMState *s,CPUState *env,target_ulong ip) +static void patch_instruction (VAPICROMState *s,CPUX86State *env,target_ulong ip) {target_phys_addr_t paddr;VAPICHandlers *handlers;
@@ -439,7 +439,7 @@ void vapic_report_tpr_access(DeviceState *dev, void *cpu, target_ulong ip, TPRAccess access) {VAPICROMState *s =DO_UPCAST (VAPICROMState, busdev.qdev, dev); -CPUState *env = cpu; +CPUX86State *env = cpu;cpu_synchronize_state (env);
@@ -475,7 +475,7 @@ static void vapic_enable_tpr_reporting(bool enable)VAPICEnableTPRReporting info = { .enable = enable, }; -CPUState *env; +CPUX86State *env;for (env = first_cpu; env !=NULL ; env = env->next_cpu) { info.apic = env->apic_state;
@@ -604,7 +604,7 @@ static int vapic_prepare(VAPICROMState *s)static void vapic_write (void *opaque,target_phys_addr_t addr,uint64_t data,unsigned int size) { -CPUState *env = cpu_single_env; +CPUX86State *env = cpu_single_env;target_phys_addr_t rom_paddr;VAPICROMState *s = opaque;
hw/pc.c +10 -10
@@ -140,7 +140,7 @@ void cpu_smm_register(cpu_set_smm_t callback, void *arg) smm_arg = arg; } -void cpu_smm_update (CPUState *env) +void cpu_smm_update (CPUX86State *env) {if (smm_set && smm_arg && env == first_cpu)smm_set (!!(env->hflags &HF_SMM_MASK ), smm_arg);
@@ -148,7 +148,7 @@ void cpu_smm_update(CPUState *env)/* IRQ handling */ -int cpu_get_pic_interrupt (CPUState *env) +int cpu_get_pic_interrupt (CPUX86State *env) {int intno;
@@ -167,7 +167,7 @@ int cpu_get_pic_interrupt(CPUState *env)static void pic_irq_request (void *opaque,int irq,int level) { -CPUState *env = first_cpu; +CPUX86State *env = first_cpu;DPRINTF ("pic_irqs: %s irq %d\n" , level?"raise" :"lower" , irq);if (env->apic_state) {
@@ -522,7 +522,7 @@ type_init(port92_register_types)static void handle_a20_line_change (void *opaque,int irq,int level) { -CPUState *cpu = opaque; +CPUX86State *cpu = opaque;/* XXX: send to all CPUs ? */ /* XXX: add logic to handle multiple A20 line sources */
@@ -869,7 +869,7 @@ void pc_init_ne2k_isa(ISABus *bus, NICInfo *nd) nb_ne2k++; } -int cpu_is_bsp (CPUState *env) +int cpu_is_bsp (CPUX86State *env) {/* We hard-wire the BSP to the first CPU. */ return env->cpu_index ==0 ;
@@ -917,7 +917,7 @@ static DeviceState *apic_init(void *env, uint8_t apic_id)void pc_acpi_smi_interrupt (void *opaque,int irq,int level) { -CPUState *s = opaque; +CPUX86State *s = opaque;if (level) {cpu_interrupt (s,CPU_INTERRUPT_SMI );
@@ -926,15 +926,15 @@ void pc_acpi_smi_interrupt(void *opaque, int irq, int level)static void pc_cpu_reset (void *opaque) { -CPUState *env = opaque; +CPUX86State *env = opaque;cpu_state_reset (env); env->halted = !cpu_is_bsp (env); } -static CPUState *pc_new_cpu (const char *cpu_model) +static CPUX86State *pc_new_cpu (const char *cpu_model) { -CPUState *env; +CPUX86State *env; env =cpu_init (cpu_model);if (!env) {
@@ -1070,7 +1070,7 @@ DeviceState *pc_vga_init(ISABus *isa_bus, PCIBus *pci_bus)static void cpu_request_exit (void *opaque,int irq,int level) { -CPUState *env = cpu_single_env; +CPUX86State *env = cpu_single_env;if (env && level) {cpu_exit (env);
hw/vmport.c +6 -6
@@ -57,7 +57,7 @@ void vmport_register(unsigned char command, IOPortReadFunc *func, void *opaque)static uint32_t vmport_ioport_read (void *opaque,uint32_t addr) {VMPortState *s = opaque; -CPUState *env = cpu_single_env; +CPUX86State *env = cpu_single_env;unsigned char command;uint32_t eax;
@@ -83,21 +83,21 @@ static uint32_t vmport_ioport_read(void *opaque, uint32_t addr)static void vmport_ioport_write (void *opaque,uint32_t addr,uint32_t val) { -CPUState *env = cpu_single_env; +CPUX86State *env = cpu_single_env; env->regs[R_EAX ] =vmport_ioport_read (opaque, addr); }static uint32_t vmport_cmd_get_version (void *opaque,uint32_t addr) { -CPUState *env = cpu_single_env; +CPUX86State *env = cpu_single_env; env->regs[R_EBX ] =VMPORT_MAGIC ;return 6 ; }static uint32_t vmport_cmd_ram_size (void *opaque,uint32_t addr) { -CPUState *env = cpu_single_env; +CPUX86State *env = cpu_single_env; env->regs[R_EBX ] =0x1177 ;return ram_size; }
@@ -105,7 +105,7 @@ static uint32_t vmport_cmd_ram_size(void *opaque, uint32_t addr)/* vmmouse helpers */ void vmmouse_get_data (uint32_t *data) { -CPUState *env = cpu_single_env; +CPUX86State *env = cpu_single_env; data[0 ] = env->regs[R_EAX ]; data[1 ] = env->regs[R_EBX ]; data[2 ] = env->regs[R_ECX ]; data[3 ] = env->regs[R_EDX ];
@@ -114,7 +114,7 @@ void vmmouse_get_data(uint32_t *data)void vmmouse_set_data (const uint32_t *data) { -CPUState *env = cpu_single_env; +CPUX86State *env = cpu_single_env; env->regs[R_EAX ] = data[0 ]; env->regs[R_EBX ] = data[1 ]; env->regs[R_ECX ] = data[2 ]; env->regs[R_EDX ] = data[3 ];
hw/xen_machine_pv.c +1 -1
@@ -36,7 +36,7 @@ static void xen_init_pv(ram_addr_t ram_size,const char *initrd_filename, const char *cpu_model) { - CPUState *env; + CPUX86State *env;DriveInfo *dinfo;int i;
Signature · 1 line
1.7.7
RFC PATCH v4 39/44 s390x hw/: Don't use CPUState
In reply to Andreas FärberScripted conversion:
for file in hw/s390-*.[hc]; do
sed -i "s/CPUState/CPUS390XState/g" $file
done
--- hw/s390-virtio-bus.c | 6 +++--- hw/s390-virtio.c | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-)
hw/s390-virtio-bus.c +3 -3
@@ -85,7 +85,7 @@ VirtIOS390Bus *s390_virtio_bus_init(ram_addr_t *ram_size)return bus; } -static void s390_virtio_irq (CPUState *env,int config_change,uint64_t token) +static void s390_virtio_irq (CPUS390XState *env,int config_change,uint64_t token) {if (kvm_enabled ()) {kvm_s390_virtio_irq (env, config_change, token);
@@ -116,7 +116,7 @@ static int s390_virtio_device_init(VirtIOS390Device *dev, VirtIODevice *vdev)s390_virtio_device_sync (dev);if (dev->qdev.hotplugged) { -CPUState *env =s390_cpu_addr2state (0 ); +CPUS390XState *env =s390_cpu_addr2state (0 );s390_virtio_irq (env,VIRTIO_PARAM_DEV_ADD , dev->dev_offs); }
@@ -331,7 +331,7 @@ static void virtio_s390_notify(void *opaque, uint16_t vector) {VirtIOS390Device *dev = (VirtIOS390Device *)opaque;uint64_t token =s390_virtio_device_vq_token (dev, vector); -CPUState *env =s390_cpu_addr2state (0 ); +CPUS390XState *env =s390_cpu_addr2state (0 );s390_virtio_irq (env,0 , token); }
hw/s390-virtio.c +8 -8
@@ -61,9 +61,9 @@#define MAX_BLK_DEVS 10static VirtIOS390Bus *s390_bus; -static CPUState **ipi_states; +static CPUS390XState **ipi_states; -CPUState *s390_cpu_addr2state (uint16_t cpu_addr) +CPUS390XState *s390_cpu_addr2state (uint16_t cpu_addr) {if (cpu_addr >= smp_cpus) {return NULL ;
@@ -72,7 +72,7 @@ CPUState *s390_cpu_addr2state(uint16_t cpu_addr)return ipi_states[cpu_addr]; } -int s390_virtio_hypercall (CPUState *env,uint64_t mem,uint64_t hypercall) +int s390_virtio_hypercall (CPUS390XState *env,uint64_t mem,uint64_t hypercall) {int r =0 , i;
@@ -129,7 +129,7 @@ int s390_virtio_hypercall(CPUState *env, uint64_t mem, uint64_t hypercall)*/ static unsigned s390_running_cpus; -void s390_add_running_cpu (CPUState *env) +void s390_add_running_cpu (CPUS390XState *env) {if (env->halted) { s390_running_cpus++;
@@ -138,7 +138,7 @@ void s390_add_running_cpu(CPUState *env) } } -unsigned s390_del_running_cpu (CPUState *env) +unsigned s390_del_running_cpu (CPUS390XState *env) {if (env->halted ==0 ) {assert (s390_running_cpus >=1 );
@@ -157,7 +157,7 @@ static void s390_init(ram_addr_t my_ram_size,const char *initrd_filename, const char *cpu_model) { - CPUState *env = NULL; + CPUS390XState *env = NULL;MemoryRegion *sysmem =get_system_memory ();MemoryRegion *ram =g_new (MemoryRegion,1 );ram_addr_t kernel_size =0 ;
@@ -205,10 +205,10 @@ static void s390_init(ram_addr_t my_ram_size, cpu_model ="host" ; } - ipi_states =g_malloc (sizeof (CPUState *) * smp_cpus); + ipi_states =g_malloc (sizeof (CPUS390XState *) * smp_cpus);for (i =0 ; i < smp_cpus; i++) { -CPUState *tmp_env; +CPUS390XState *tmp_env; tmp_env =cpu_init (cpu_model);if (!env) {
Signature · 1 line
1.7.7
RFC PATCH v4 22/44 target-s390x: Don't overuse CPUState
In reply to Andreas FärberScripted conversion:
sed -i "s/CPUState/CPUS390XState/g" target-s390x/*.[hc] sed -i "s/#define CPUS390XState/#define CPUState/" target-s390x/cpu.h
--- target-s390x/cpu.h | 46 +++++++++++++++--------------- target-s390x/helper.c | 38 ++++++++++++------------ target-s390x/kvm.c | 56 ++++++++++++++++++------------------ target-s390x/op_helper.c | 70 +++++++++++++++++++++++----------------------- target-s390x/translate.c | 56 ++++++++++++++++++------------------ 5 files changed, 133 insertions(+), 133 deletions(-)
target-s390x/cpu.h +23 -23
@@ -106,7 +106,7 @@ typedef struct CPUS390XState { } CPUS390XState;#if defined(CONFIG_USER_ONLY ) -static inline void cpu_clone_regs (CPUState *env,target_ulong newsp) +static inline void cpu_clone_regs (CPUS390XState *env,target_ulong newsp) {if (newsp) { env->regs[15 ] = newsp;
@@ -233,7 +233,7 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp)#define FLAG_MASK_64 (PSW_MASK_64 >> 32)#define FLAG_MASK_32 0x00001000 -static inline int cpu_mmu_index (CPUState *env) +static inline int cpu_mmu_index (CPUS390XState *env) {if (env->psw.mask &PSW_MASK_PSTATE ) {return 1 ;
@@ -242,7 +242,7 @@ static inline int cpu_mmu_index (CPUState *env)return 0 ; } -static inline void cpu_get_tb_cpu_state (CPUState * env,target_ulong *pc, +static inline void cpu_get_tb_cpu_state (CPUS390XState * env,target_ulong *pc,target_ulong *cs_base,int *flags) { *pc = env->psw.addr;
@@ -275,7 +275,7 @@ CPUS390XState *cpu_s390x_init(const char *cpu_model);void s390x_translate_init (void );int cpu_s390x_exec (CPUS390XState *s);void cpu_s390x_close (CPUS390XState *s); -void do_interrupt (CPUState *env); +void do_interrupt (CPUS390XState *env);/* you can call this signal handler from your SIGBUS and SIGSEGV signal handlers to inform the virtual CPU of exceptions. non zero
@@ -288,42 +288,42 @@ int cpu_s390x_handle_mmu_fault (CPUS390XState *env, target_ulong address, int rw#ifndef CONFIG_USER_ONLY -int s390_virtio_hypercall (CPUState *env,uint64_t mem,uint64_t hypercall); +int s390_virtio_hypercall (CPUS390XState *env,uint64_t mem,uint64_t hypercall);#ifdef CONFIG_KVM -void kvm_s390_interrupt (CPUState *env,int type,uint32_t code); -void kvm_s390_virtio_irq (CPUState *env,int config_change,uint64_t token); -void kvm_s390_interrupt_internal (CPUState *env,int type,uint32_t parm, +void kvm_s390_interrupt (CPUS390XState *env,int type,uint32_t code); +void kvm_s390_virtio_irq (CPUS390XState *env,int config_change,uint64_t token); +void kvm_s390_interrupt_internal (CPUS390XState *env,int type,uint32_t parm,uint64_t parm64,int vm);#else -static inline void kvm_s390_interrupt (CPUState *env,int type,uint32_t code) +static inline void kvm_s390_interrupt (CPUS390XState *env,int type,uint32_t code) { } -static inline void kvm_s390_virtio_irq (CPUState *env,int config_change, +static inline void kvm_s390_virtio_irq (CPUS390XState *env,int config_change,uint64_t token) { } -static inline void kvm_s390_interrupt_internal (CPUState *env,int type, +static inline void kvm_s390_interrupt_internal (CPUS390XState *env,int type,uint32_t parm,uint64_t parm64,int vm) { }#endif -CPUState *s390_cpu_addr2state (uint16_t cpu_addr); -void s390_add_running_cpu (CPUState *env); -unsigned s390_del_running_cpu (CPUState *env); +CPUS390XState *s390_cpu_addr2state (uint16_t cpu_addr); +void s390_add_running_cpu (CPUS390XState *env); +unsigned s390_del_running_cpu (CPUS390XState *env);/* from s390-virtio-bus */ extern const target_phys_addr_t virtio_size;#else -static inline void s390_add_running_cpu (CPUState *env) +static inline void s390_add_running_cpu (CPUS390XState *env) { } -static inline unsigned s390_del_running_cpu (CPUState *env) +static inline unsigned s390_del_running_cpu (CPUS390XState *env) {return 0 ; }
@@ -944,11 +944,11 @@ static inline void ebcdic_put(uint8_t *p, const char *ascii, int len)#define SIGP_STAT_INVALID_ORDER 0x00000002UL#define SIGP_STAT_RECEIVER_CHECK 0x00000001UL -void load_psw (CPUState *env,uint64_t mask,uint64_t addr); -int mmu_translate (CPUState *env,target_ulong vaddr,int rw,uint64_t asc, +void load_psw (CPUS390XState *env,uint64_t mask,uint64_t addr); +int mmu_translate (CPUS390XState *env,target_ulong vaddr,int rw,uint64_t asc,target_ulong *raddr,int *flags); -int sclp_service_call (CPUState *env,uint32_t sccb,uint64_t code); -uint32_t calc_cc (CPUState *env,uint32_t cc_op,uint64_t src,uint64_t dst, +int sclp_service_call (CPUS390XState *env,uint32_t sccb,uint64_t code); +uint32_t calc_cc (CPUS390XState *env,uint32_t cc_op,uint64_t src,uint64_t dst,uint64_t vr);#define TARGET_HAS_ICE 1
@@ -961,7 +961,7 @@ static inline uint64_t time2tod(uint64_t ns) {return (ns <<9 ) /125 ; } -static inline void cpu_inject_ext (CPUState *env,uint32_t code,uint32_t param, +static inline void cpu_inject_ext (CPUS390XState *env,uint32_t code,uint32_t param,uint64_t param64) {if (env->ext_index ==MAX_EXT_QUEUE -1 ) {
@@ -980,13 +980,13 @@ static inline void cpu_inject_ext(CPUState *env, uint32_t code, uint32_t param,cpu_interrupt (env,CPU_INTERRUPT_HARD ); } -static inline bool cpu_has_work (CPUState *env) +static inline bool cpu_has_work (CPUS390XState *env) {return (env->interrupt_request &CPU_INTERRUPT_HARD ) && (env->psw.mask &PSW_MASK_EXT ); } -static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock * tb) +static inline void cpu_pc_from_tb (CPUS390XState *env,TranslationBlock * tb) { env->psw.addr = tb->pc; }
target-s390x/helper.c +19 -19
@@ -53,7 +53,7 @@#ifndef CONFIG_USER_ONLY static void s390x_tod_timer (void *opaque) { -CPUState *env = opaque; +CPUS390XState *env = opaque; env->pending_int |=INTERRUPT_TOD ;cpu_interrupt (env,CPU_INTERRUPT_HARD );
@@ -61,7 +61,7 @@ static void s390x_tod_timer(void *opaque)static void s390x_cpu_timer (void *opaque) { -CPUState *env = opaque; +CPUS390XState *env = opaque; env->pending_int |=INTERRUPT_CPUTIMER ;cpu_interrupt (env,CPU_INTERRUPT_HARD );
@@ -102,12 +102,12 @@ CPUS390XState *cpu_s390x_init(const char *cpu_model)#if defined(CONFIG_USER_ONLY ) -void do_interrupt (CPUState *env) +void do_interrupt (CPUS390XState *env) { env->exception_index =-1 ; } -int cpu_s390x_handle_mmu_fault (CPUState *env,target_ulong address,int rw, +int cpu_s390x_handle_mmu_fault (CPUS390XState *env,target_ulong address,int rw,int mmu_idx) {/* fprintf(stderr,"%s: address 0x%lx rw %d mmu_idx %d\n",
@@ -135,14 +135,14 @@ void cpu_state_reset(CPUS390XState *env)#ifndef CONFIG_USER_ONLY /* Ensure to exit the TB after this call! */ -static void trigger_pgm_exception (CPUState *env,uint32_t code,uint32_t ilc) +static void trigger_pgm_exception (CPUS390XState *env,uint32_t code,uint32_t ilc) { env->exception_index =EXCP_PGM ; env->int_pgm_code = code; env->int_pgm_ilc = ilc; } -static int trans_bits (CPUState *env,uint64_t mode) +static int trans_bits (CPUS390XState *env,uint64_t mode) {int bits =0 ;
@@ -164,7 +164,7 @@ static int trans_bits(CPUState *env, uint64_t mode)return bits; } -static void trigger_prot_fault (CPUState *env,target_ulong vaddr,uint64_t mode) +static void trigger_prot_fault (CPUS390XState *env,target_ulong vaddr,uint64_t mode) {int ilc =ILC_LATER_INC_2 ;int bits =trans_bits (env, mode) |4 ;
@@ -175,7 +175,7 @@ static void trigger_prot_fault(CPUState *env, target_ulong vaddr, uint64_t mode)trigger_pgm_exception (env,PGM_PROTECTION , ilc); } -static void trigger_page_fault (CPUState *env,target_ulong vaddr,uint32_t type, +static void trigger_page_fault (CPUS390XState *env,target_ulong vaddr,uint32_t type,uint64_t asc,int rw) {int ilc =ILC_LATER ;
@@ -192,7 +192,7 @@ static void trigger_page_fault(CPUState *env, target_ulong vaddr, uint32_t type,trigger_pgm_exception (env, type, ilc); } -static int mmu_translate_asce (CPUState *env,target_ulong vaddr,uint64_t asc, +static int mmu_translate_asce (CPUS390XState *env,target_ulong vaddr,uint64_t asc,uint64_t asce,int level,target_ulong *raddr,int *flags,int rw) {
@@ -274,7 +274,7 @@ static int mmu_translate_asce(CPUState *env, target_ulong vaddr, uint64_t asc,return 0 ; } -static int mmu_translate_asc (CPUState *env,target_ulong vaddr,uint64_t asc, +static int mmu_translate_asc (CPUS390XState *env,target_ulong vaddr,uint64_t asc,target_ulong *raddr,int *flags,int rw) {uint64_t asce =0 ;
@@ -343,7 +343,7 @@ static int mmu_translate_asc(CPUState *env, target_ulong vaddr, uint64_t asc,return r; } -int mmu_translate (CPUState *env,target_ulong vaddr,int rw,uint64_t asc, +int mmu_translate (CPUS390XState *env,target_ulong vaddr,int rw,uint64_t asc,target_ulong *raddr,int *flags) {int r =-1 ;
@@ -404,7 +404,7 @@ out:return r; } -int cpu_s390x_handle_mmu_fault (CPUState *env,target_ulong _vaddr,int rw, +int cpu_s390x_handle_mmu_fault (CPUS390XState *env,target_ulong _vaddr,int rw,int mmu_idx) {uint64_t asc = env->psw.mask &PSW_MASK_ASC ;
@@ -444,7 +444,7 @@ int cpu_s390x_handle_mmu_fault (CPUState *env, target_ulong _vaddr, int rw,return 0 ; } -target_phys_addr_t cpu_get_phys_page_debug (CPUState *env,target_ulong vaddr) +target_phys_addr_t cpu_get_phys_page_debug (CPUS390XState *env,target_ulong vaddr) {target_ulong raddr;int prot =PAGE_READ |PAGE_WRITE |PAGE_EXEC ;
@@ -462,7 +462,7 @@ target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong vaddr)return raddr; } -void load_psw (CPUState *env,uint64_t mask,uint64_t addr) +void load_psw (CPUS390XState *env,uint64_t mask,uint64_t addr) {if (mask &PSW_MASK_WAIT ) {if (!(mask & (PSW_MASK_IO |PSW_MASK_EXT |PSW_MASK_MCHECK ))) {
@@ -481,7 +481,7 @@ void load_psw(CPUState *env, uint64_t mask, uint64_t addr) env->cc_op = (mask >>13 ) &3 ; } -static uint64_t get_psw_mask (CPUState *env) +static uint64_t get_psw_mask (CPUS390XState *env) {uint64_t r = env->psw.mask;
@@ -494,7 +494,7 @@ static uint64_t get_psw_mask(CPUState *env)return r; } -static void do_svc_interrupt (CPUState *env) +static void do_svc_interrupt (CPUS390XState *env) {uint64_t mask, addr;LowCore *lowcore;
@@ -514,7 +514,7 @@ static void do_svc_interrupt(CPUState *env)load_psw (env, mask, addr); } -static void do_program_interrupt (CPUState *env) +static void do_program_interrupt (CPUS390XState *env) {uint64_t mask, addr;LowCore *lowcore;
@@ -557,7 +557,7 @@ static void do_program_interrupt(CPUState *env)#define VIRTIO_SUBCODE_64 0x0D00 -static void do_ext_interrupt (CPUState *env) +static void do_ext_interrupt (CPUS390XState *env) {uint64_t mask, addr;LowCore *lowcore;
@@ -597,7 +597,7 @@ static void do_ext_interrupt(CPUState *env)load_psw (env, mask, addr); } -void do_interrupt (CPUState *env) +void do_interrupt (CPUS390XState *env) {qemu_log ("%s: %d at pc=%" PRIx64"\n" , __FUNCTION__, env->exception_index, env->psw.addr);
target-s390x/kvm.c +28 -28
207 lines not on this page · raw message
target-s390x/op_helper.c +35 -35
266 lines not on this page · raw message
target-s390x/translate.c +28 -28
183 lines not on this page · raw message
Signature · 1 line
1.7.7
RFC PATCH v4 28/44 m68k-semi: Don't use CPUState
In reply to Andreas FärberScripted conversion:
sed -i "s/CPUState/CPUM68KState/g" m68k-semi.c
--- m68k-semi.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
m68k-semi.c +2 -2
@@ -104,7 +104,7 @@ static int translate_openflags(int flags)return hf; } -static void translate_stat (CPUState *env,target_ulong addr,struct stat *s) +static void translate_stat (CPUM68KState *env,target_ulong addr,struct stat *s) {struct m68k_gdb_stat *p;
@@ -135,7 +135,7 @@ static void translate_stat(CPUState *env, target_ulong addr, struct stat *s)static int m68k_semi_is_fseek; -static void m68k_semi_cb (CPUState *env,target_ulong ret,target_ulong err) +static void m68k_semi_cb (CPUM68KState *env,target_ulong ret,target_ulong err) {target_ulong args;
Signature · 1 line
1.7.7
RFC PATCH v4 30/44 alpha hw/: Don't use CPUState
In reply to Andreas FärberScripted conversion:
for file in hw/alpha_*.[hc]; do
sed -i "s/CPUState/CPUAlphaState/g" $file
done
--- hw/alpha_dp264.c | 2 +- hw/alpha_sys.h | 2 +- hw/alpha_typhoon.c | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-)
hw/alpha_dp264.c +1 -1
@@ -49,7 +49,7 @@ static void clipper_init(ram_addr_t ram_size,const char *initrd_filename, const char *cpu_model) { - CPUState *cpus[4]; + CPUAlphaState *cpus[4];PCIBus *pci_bus;ISABus *isa_bus;qemu_irq rtc_irq;
hw/alpha_sys.h +1 -1
@@ -12,7 +12,7 @@#include "irq.h" -PCIBus *typhoon_init (ram_addr_t ,ISABus **,qemu_irq *,CPUState *[4 ], +PCIBus *typhoon_init (ram_addr_t ,ISABus **,qemu_irq *,CPUAlphaState *[4 ],pci_map_irq_fn );/* alpha_pci.c. */
hw/alpha_typhoon.c +7 -7
@@ -21,7 +21,7 @@ typedef struct TyphoonCchip {uint64_t drir;uint64_t dim[4 ];uint32_t iic[4 ]; -CPUState *cpu[4 ]; +CPUAlphaState *cpu[4 ]; } TyphoonCchip; typedef struct TyphoonWindow {
@@ -52,7 +52,7 @@ typedef struct TyphoonState { } TyphoonState;/* Called when one of DRIR or DIM changes. */ -static void cpu_irq_change (CPUState *env,uint64_t req) +static void cpu_irq_change (CPUAlphaState *env,uint64_t req) {/* If there are any non-masked interrupts, tell the cpu. */ if (env) {
@@ -66,7 +66,7 @@ static void cpu_irq_change(CPUState *env, uint64_t req)static uint64_t cchip_read (void *opaque,target_phys_addr_t addr,unsigned size) { -CPUState *env = cpu_single_env; +CPUAlphaState *env = cpu_single_env;TyphoonState *s = opaque;uint64_t ret =0 ;
@@ -347,7 +347,7 @@ static void cchip_write(void *opaque, target_phys_addr_t addr,if ((newval ^ oldval) &0xff0 ) {int i;for (i =0 ; i <4 ; ++i) { -CPUState *env = s->cchip.cpu[i]; +CPUAlphaState *env = s->cchip.cpu[i];if (env) {/* IPI can be either cleared or set by the write. */ if (newval & (1 << (i +8 ))) {
@@ -655,7 +655,7 @@ static void typhoon_set_timer_irq(void *opaque, int irq, int level)/* Deliver the interrupt to each CPU, considering each CPU's IIC. */ for (i =0 ; i <4 ; ++i) { -CPUState *env = s->cchip.cpu[i]; +CPUAlphaState *env = s->cchip.cpu[i];if (env) {uint32_t iic = s->cchip.iic[i];
@@ -693,7 +693,7 @@ static void typhoon_alarm_timer(void *opaque)PCIBus *typhoon_init (ram_addr_t ram_size,ISABus **isa_bus,qemu_irq *p_rtc_irq, -CPUState *cpus[4 ],pci_map_irq_fn sys_map_irq) +CPUAlphaState *cpus[4 ],pci_map_irq_fn sys_map_irq) {const uint64_t MB =1024 *1024 ;const uint64_t GB =1024 *MB ;
@@ -713,7 +713,7 @@ PCIBus *typhoon_init(ram_addr_t ram_size, ISABus **isa_bus,/* Remember the CPUs so that we can deliver interrupts to them. */ for (i =0 ; i <4 ; i++) { -CPUState *env = cpus[i]; +CPUAlphaState *env = cpus[i]; s->cchip.cpu[i] = env;if (env) { env->alarm_timer = qemu_new_timer_ns(rtc_clock,
Signature · 1 line
1.7.7
RFC PATCH v4 32/44 cris hw/: Don't use CPUState
In reply to Andreas FärberScripted conversion:
for file in hw/cris-boot.[hc] hw/cris_pic_cpu.c hw/axis_dev88.c hw/etraxfs.h hw/etraxfs_ser.c; do
sed -i "s/CPUState/CPUCRISState/g" $file
done
--- hw/axis_dev88.c | 2 +- hw/cris-boot.c | 4 ++-- hw/cris-boot.h | 2 +- hw/cris_pic_cpu.c | 4 ++-- hw/etraxfs.h | 2 +- hw/etraxfs_ser.c | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-)
hw/axis_dev88.c +1 -1
@@ -247,7 +247,7 @@ void axisdev88_init (ram_addr_t ram_size, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model) { - CPUState *env; + CPUCRISState *env;DeviceState *dev;SysBusDevice *s;DriveInfo *nand;
hw/cris-boot.c +2 -2
@@ -29,7 +29,7 @@static void main_cpu_reset (void *opaque) { -CPUState *env = opaque; +CPUCRISState *env = opaque;struct cris_load_info *li; li = env->load_info;
@@ -60,7 +60,7 @@ static uint64_t translate_kernel_address(void *opaque, uint64_t addr)return addr -0x80000000LL ; } -void cris_load_image (CPUState *env,struct cris_load_info *li) +void cris_load_image (CPUCRISState *env,struct cris_load_info *li) {uint64_t entry, high;int kcmdline_len;
hw/cris-boot.h +1 -1
@@ -8,4 +8,4 @@ struct cris_load_infotarget_phys_addr_t entry; }; -void cris_load_image (CPUState *env,struct cris_load_info *li); +void cris_load_image (CPUCRISState *env,struct cris_load_info *li);
hw/cris_pic_cpu.c +2 -2
@@ -30,7 +30,7 @@static void cris_pic_cpu_handler (void *opaque,int irq,int level) { -CPUState *env = (CPUState *)opaque; +CPUCRISState *env = (CPUCRISState *)opaque;int type = irq ?CPU_INTERRUPT_NMI :CPU_INTERRUPT_HARD ;if (level)
@@ -39,7 +39,7 @@ static void cris_pic_cpu_handler(void *opaque, int irq, int level)cpu_reset_interrupt (env, type); } -qemu_irq *cris_pic_init_cpu (CPUState *env) +qemu_irq *cris_pic_init_cpu (CPUCRISState *env) {return qemu_allocate_irqs (cris_pic_cpu_handler, env,2 ); }
hw/etraxfs.h +1 -1
@@ -25,7 +25,7 @@#include "net.h" #include "etraxfs_dma.h" -qemu_irq *cris_pic_init_cpu (CPUState *env); +qemu_irq *cris_pic_init_cpu (CPUCRISState *env);/* Instantiate an ETRAXFS Ethernet MAC. */ static inline DeviceState *
hw/etraxfs_ser.c +2 -2
@@ -78,7 +78,7 @@ static uint64_t ser_read(void *opaque, target_phys_addr_t addr, unsigned int size) {struct etrax_serial *s = opaque; -D (CPUState *env = s->env); +D (CPUCRISState *env = s->env);uint32_t r =0 ; addr >>=2 ;
@@ -116,7 +116,7 @@ ser_write(void *opaque, target_phys_addr_t addr,struct etrax_serial *s = opaque;uint32_t value = val64;unsigned char ch = val64; -D (CPUState *env = s->env); +D (CPUCRISState *env = s->env);D (qemu_log ("%s " TARGET_FMT_plx"=%x\n" , __func__, addr, value)); addr >>=2 ;
Signature · 1 line
1.7.7
RFC PATCH v4 37/44 mips hw/: Don't use CPUState
In reply to Andreas FärberScripted conversion:
for file in hw/mips_*.[hc]; do
sed -i "s/CPUState/CPUMIPSState/g" $file
done
--- hw/mips_cpudevs.h | 4 ++-- hw/mips_fulong2e.c | 10 +++++----- hw/mips_int.c | 6 +++--- hw/mips_jazz.c | 6 +++--- hw/mips_malta.c | 10 +++++----- hw/mips_mipssim.c | 6 +++--- hw/mips_r4k.c | 6 +++--- hw/mips_timer.c | 20 ++++++++++---------- 8 files changed, 34 insertions(+), 34 deletions(-)
hw/mips_cpudevs.h +2 -2
@@ -7,9 +7,9 @@ uint64_t cpu_mips_kseg0_to_phys(void *opaque, uint64_t addr);uint64_t cpu_mips_phys_to_kseg0 (void *opaque,uint64_t addr);/* mips_int.c */ -void cpu_mips_irq_init_cpu (CPUState *env); +void cpu_mips_irq_init_cpu (CPUMIPSState *env);/* mips_timer.c */ -void cpu_mips_clock_init (CPUState *); +void cpu_mips_clock_init (CPUMIPSState *);#endif
hw/mips_fulong2e.c +5 -5
@@ -103,7 +103,7 @@ static void GCC_FMT_ATTR(3, 4) prom_set(uint32_t* prom_buf, int index,va_end (ap); } -static int64_t load_kernel (CPUState *env) +static int64_t load_kernel (CPUMIPSState *env) {int64_t kernel_entry, kernel_low, kernel_high;int index =0 ;
@@ -169,7 +169,7 @@ static int64_t load_kernel (CPUState *env)return kernel_entry; } -static void write_bootloader (CPUState *env,uint8_t *base,int64_t kernel_addr) +static void write_bootloader (CPUMIPSState *env,uint8_t *base,int64_t kernel_addr) {uint32_t *p;
@@ -199,7 +199,7 @@ static void write_bootloader (CPUState *env, uint8_t *base, int64_t kernel_addr)static void main_cpu_reset (void *opaque) { -CPUState *env = opaque; +CPUMIPSState *env = opaque;cpu_state_reset (env);/* TODO: 2E reset stuff */
@@ -249,7 +249,7 @@ static void network_init (void)static void cpu_request_exit (void *opaque,int irq,int level) { -CPUState *env = cpu_single_env; +CPUMIPSState *env = cpu_single_env;if (env && level) {cpu_exit (env);
@@ -273,7 +273,7 @@ static void mips_fulong2e_init(ram_addr_t ram_size, const char *boot_device,i2c_bus *smbus;int i;DriveInfo *hd[MAX_IDE_BUS *MAX_IDE_DEVS ]; -CPUState *env; +CPUMIPSState *env;/* init CPUs */ if (cpu_model ==NULL ) {
hw/mips_int.c +3 -3
@@ -26,7 +26,7 @@static void cpu_mips_irq_request (void *opaque,int irq,int level) { -CPUState *env = (CPUState *)opaque; +CPUMIPSState *env = (CPUMIPSState *)opaque;if (irq <0 || irq >7 )return ;
@@ -44,7 +44,7 @@ static void cpu_mips_irq_request(void *opaque, int irq, int level) } } -void cpu_mips_irq_init_cpu (CPUState *env) +void cpu_mips_irq_init_cpu (CPUMIPSState *env) {qemu_irq *qi;int i;
@@ -55,7 +55,7 @@ void cpu_mips_irq_init_cpu(CPUState *env) } } -void cpu_mips_soft_irq (CPUState *env,int irq,int level) +void cpu_mips_soft_irq (CPUMIPSState *env,int irq,int level) {if (irq <0 || irq >2 ) {return ;
hw/mips_jazz.c +3 -3
@@ -50,7 +50,7 @@ enum jazz_model_estatic void main_cpu_reset (void *opaque) { -CPUState *env = opaque; +CPUMIPSState *env = opaque;cpu_state_reset (env); }
@@ -97,7 +97,7 @@ static const MemoryRegionOps dma_dummy_ops = {static void cpu_request_exit (void *opaque,int irq,int level) { -CPUState *env = cpu_single_env; +CPUMIPSState *env = cpu_single_env;if (env && level) {cpu_exit (env);
@@ -112,7 +112,7 @@ static void mips_jazz_init(MemoryRegion *address_space, {char *filename;int bios_size, n; -CPUState *env; +CPUMIPSState *env;qemu_irq *rc4030, *i8259;rc4030_dma *dmas;void * rc4030_opaque;
hw/mips_malta.c +5 -5
@@ -501,7 +501,7 @@ static void network_init(void)a3 - RAM size in bytes */ -static void write_bootloader (CPUState *env,uint8_t *base, +static void write_bootloader (CPUMIPSState *env,uint8_t *base,int64_t kernel_entry) {uint32_t *p;
@@ -737,7 +737,7 @@ static int64_t load_kernel (void)return kernel_entry; } -static void malta_mips_config (CPUState *env) +static void malta_mips_config (CPUMIPSState *env) { env->mvp->CP0_MVPConf0 |= ((smp_cpus -1 ) <<CP0MVPC0_PVPE ) | ((smp_cpus * env->nr_threads -1 ) <<CP0MVPC0_PTC );
@@ -745,7 +745,7 @@ static void malta_mips_config(CPUState *env)static void main_cpu_reset (void *opaque) { -CPUState *env = opaque; +CPUMIPSState *env = opaque;cpu_state_reset (env);/* The bootloader does not need to be rewritten as it is located in a
@@ -760,7 +760,7 @@ static void main_cpu_reset(void *opaque)static void cpu_request_exit (void *opaque,int irq,int level) { -CPUState *env = cpu_single_env; +CPUMIPSState *env = cpu_single_env;if (env && level) {cpu_exit (env);
@@ -782,7 +782,7 @@ void mips_malta_init (ram_addr_t ram_size,int64_t kernel_entry;PCIBus *pci_bus;ISABus *isa_bus; -CPUState *env; +CPUMIPSState *env;qemu_irq *isa_irq;qemu_irq *cpu_exit_irq;int piix4_devfn;
hw/mips_mipssim.c +3 -3
@@ -46,7 +46,7 @@ static struct _loaderparams { } loaderparams;typedef struct ResetData { -CPUState *env; +CPUMIPSState *env;uint64_t vector; }ResetData ;
@@ -105,7 +105,7 @@ static int64_t load_kernel(void)static void main_cpu_reset (void *opaque) {ResetData *s = (ResetData *)opaque; -CPUState *env = s->env; +CPUMIPSState *env = s->env;cpu_state_reset (env); env->active_tc.PC = s->vector & ~(target_ulong )1 ;
@@ -140,7 +140,7 @@ mips_mipssim_init (ram_addr_t ram_size,MemoryRegion *address_space_mem =get_system_memory ();MemoryRegion *ram =g_new (MemoryRegion,1 );MemoryRegion *bios =g_new (MemoryRegion,1 ); -CPUState *env; +CPUMIPSState *env;ResetData *reset_info;int bios_size;
hw/mips_r4k.c +3 -3
@@ -65,7 +65,7 @@ static const MemoryRegionOps mips_qemu_ops = { };typedef struct ResetData { -CPUState *env; +CPUMIPSState *env;uint64_t vector; }ResetData ;
@@ -143,7 +143,7 @@ static int64_t load_kernel(void)static void main_cpu_reset (void *opaque) {ResetData *s = (ResetData *)opaque; -CPUState *env = s->env; +CPUMIPSState *env = s->env;cpu_state_reset (env); env->active_tc.PC = s->vector;
@@ -162,7 +162,7 @@ void mips_r4k_init (ram_addr_t ram_size,MemoryRegion *bios;MemoryRegion *iomem =g_new (MemoryRegion,1 );int bios_size; -CPUState *env; +CPUMIPSState *env;ResetData *reset_info;int i;qemu_irq *i8259;
hw/mips_timer.c +10 -10
@@ -27,7 +27,7 @@#define TIMER_FREQ 100 * 1000 * 1000/* XXX: do not use a global */ -uint32_t cpu_mips_get_random (CPUState *env) +uint32_t cpu_mips_get_random (CPUMIPSState *env) {static uint32_t lfsr =1 ;static uint32_t prev_idx =0 ;
@@ -42,7 +42,7 @@ uint32_t cpu_mips_get_random (CPUState *env) }/* MIPS R4K timer */ -static void cpu_mips_timer_update (CPUState *env) +static void cpu_mips_timer_update (CPUMIPSState *env) {uint64_t now, next;uint32_t wait;
@@ -55,7 +55,7 @@ static void cpu_mips_timer_update(CPUState *env) }/* Expire the timer. */ -static void cpu_mips_timer_expire (CPUState *env) +static void cpu_mips_timer_expire (CPUMIPSState *env) {cpu_mips_timer_update (env);if (env->insn_flags &ISA_MIPS32R2 ) {
@@ -64,7 +64,7 @@ static void cpu_mips_timer_expire(CPUState *env)qemu_irq_raise (env->irq[(env->CP0_IntCtl >> CP0IntCtl_IPTI) &0x7 ]); } -uint32_t cpu_mips_get_count (CPUState *env) +uint32_t cpu_mips_get_count (CPUMIPSState *env) {if (env->CP0_Cause & (1 << CP0Ca_DC)) {return env->CP0_Count;
@@ -83,7 +83,7 @@ uint32_t cpu_mips_get_count (CPUState *env) } } -void cpu_mips_store_count (CPUState *env,uint32_t count) +void cpu_mips_store_count (CPUMIPSState *env,uint32_t count) {if (env->CP0_Cause & (1 << CP0Ca_DC)) env->CP0_Count = count;
@@ -97,7 +97,7 @@ void cpu_mips_store_count (CPUState *env, uint32_t count) } } -void cpu_mips_store_compare (CPUState *env,uint32_t value) +void cpu_mips_store_compare (CPUMIPSState *env,uint32_t value) { env->CP0_Compare = value;if (!(env->CP0_Cause & (1 << CP0Ca_DC)))
@@ -107,12 +107,12 @@ void cpu_mips_store_compare (CPUState *env, uint32_t value)qemu_irq_lower (env->irq[(env->CP0_IntCtl >> CP0IntCtl_IPTI) &0x7 ]); } -void cpu_mips_start_count (CPUState *env) +void cpu_mips_start_count (CPUMIPSState *env) {cpu_mips_store_count (env, env->CP0_Count); } -void cpu_mips_stop_count (CPUState *env) +void cpu_mips_stop_count (CPUMIPSState *env) {/* Store the current value */ env->CP0_Count += (uint32_t)muldiv64(qemu_get_clock_ns(vm_clock),
@@ -121,7 +121,7 @@ void cpu_mips_stop_count(CPUState *env)static void mips_timer_cb (void *opaque) { -CPUState *env; +CPUMIPSState *env; env = opaque;#if 0
@@ -139,7 +139,7 @@ static void mips_timer_cb (void *opaque) env->CP0_Count--; } -void cpu_mips_clock_init (CPUState *env) +void cpu_mips_clock_init (CPUMIPSState *env) { env->timer =qemu_new_timer_ns (vm_clock, &mips_timer_cb, env); env->CP0_Compare =0 ;
Signature · 1 line
1.7.7
RFC PATCH v4 10/44 linux-user: Don't overuse CPUState
In reply to Andreas FärberIn target-specific code use CPU*State.
While at it, fix indentation on those lines.
--- linux-user/elfload.c | 24 +++--- linux-user/m68k/syscall.h | 2 +- linux-user/main.c | 28 +++--- linux-user/signal.c | 201 +++++++++++++++++++++++---------------------- 4 files changed, 131 insertions(+), 124 deletions(-)
linux-user/elfload.c +12 -12
@@ -157,7 +157,7 @@ typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG];* * See linux kernel: arch/x86/include/asm/elf.h */ -static void elf_core_copy_regs (target_elf_gregset_t *regs,const CPUState *env) +static void elf_core_copy_regs (target_elf_gregset_t *regs,const CPUX86State *env) { (*regs)[0 ] = env->regs[15 ]; (*regs)[1 ] = env->regs[14 ];
@@ -229,7 +229,7 @@ typedef target_elf_greg_t target_elf_gregset_t[ELF_NREG];* * See linux kernel: arch/x86/include/asm/elf.h */ -static void elf_core_copy_regs (target_elf_gregset_t *regs,const CPUState *env) +static void elf_core_copy_regs (target_elf_gregset_t *regs,const CPUX86State *env) { (*regs)[0 ] = env->regs[R_EBX ]; (*regs)[1 ] = env->regs[R_ECX ];
@@ -288,7 +288,7 @@ static inline void init_thread(struct target_pt_regs *regs,#define ELF_NREG 18typedef target_elf_greg_t target_elf_gregset_t [ELF_NREG ]; -static void elf_core_copy_regs (target_elf_gregset_t *regs,const CPUState *env) +static void elf_core_copy_regs (target_elf_gregset_t *regs,const CPUARMState *env) { (*regs)[0 ] =tswapl (env->regs[0 ]); (*regs)[1 ] =tswapl (env->regs[1 ]);
@@ -307,7 +307,7 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env) (*regs)[14 ] =tswapl (env->regs[14 ]); (*regs)[15 ] =tswapl (env->regs[15 ]); - (*regs)[16 ] =tswapl (cpsr_read ((CPUState *)env)); + (*regs)[16 ] =tswapl (cpsr_read ((CPUARMState *)env)); (*regs)[17 ] =tswapl (env->regs[0 ]);/* XXX */ }
@@ -410,7 +410,7 @@ static inline void init_thread(struct target_pt_regs *regs,#define ELF_NREG 34typedef target_elf_greg_t target_elf_gregset_t [ELF_NREG ]; -static void elf_core_copy_regs (target_elf_gregset_t *regs,const CPUState *env) +static void elf_core_copy_regs (target_elf_gregset_t *regs,const CPUUniCore32State *env) { (*regs)[0 ] = env->regs[0 ]; (*regs)[1 ] = env->regs[1 ];
@@ -445,7 +445,7 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUState *env) (*regs)[30 ] = env->regs[30 ]; (*regs)[31 ] = env->regs[31 ]; - (*regs)[32 ] =cpu_asr_read ((CPUState *)env); + (*regs)[32 ] =cpu_asr_read ((CPUUniCore32State *)env); (*regs)[33 ] = env->regs[0 ];/* XXX */ }
@@ -572,7 +572,7 @@ enum {static uint32_t get_elf_hwcap (void ) { -CPUState *e = thread_env; +CPUPPCState *e = thread_env;uint32_t features =0 ;/* We don't have to be terribly complete here; the high points are
@@ -628,7 +628,7 @@ static inline void init_thread(struct target_pt_regs *_regs, struct image_info *#define ELF_NREG 48typedef target_elf_greg_t target_elf_gregset_t [ELF_NREG ]; -static void elf_core_copy_regs (target_elf_gregset_t *regs,const CPUState *env) +static void elf_core_copy_regs (target_elf_gregset_t *regs,const CPUPPCState *env) {int i;target_ulong ccr =0 ;
@@ -697,7 +697,7 @@ enum { };/* See linux kernel: arch/mips/kernel/process.c:elf_dump_regs. */ -static void elf_core_copy_regs (target_elf_gregset_t *regs,const CPUState *env) +static void elf_core_copy_regs (target_elf_gregset_t *regs,const CPUMIPSState *env) {int i;
@@ -749,7 +749,7 @@ static inline void init_thread(struct target_pt_regs *regs,typedef target_elf_greg_t target_elf_gregset_t [ELF_NREG ];/* See linux kernel: arch/mips/kernel/process.c:elf_dump_regs. */ -static void elf_core_copy_regs (target_elf_gregset_t *regs,const CPUState *env) +static void elf_core_copy_regs (target_elf_gregset_t *regs,const CPUMBState *env) {int i, pos =0 ;
@@ -797,7 +797,7 @@ enum { };static inline void elf_core_copy_regs (target_elf_gregset_t *regs, -const CPUState *env) +const CPUSH4State *env) {int i;
@@ -862,7 +862,7 @@ static inline void init_thread(struct target_pt_regs *regs,#define ELF_NREG 20typedef target_elf_greg_t target_elf_gregset_t [ELF_NREG ]; -static void elf_core_copy_regs (target_elf_gregset_t *regs,const CPUState *env) +static void elf_core_copy_regs (target_elf_gregset_t *regs,const CPUM68KState *env) { (*regs)[0 ] =tswapl (env->dregs[1 ]); (*regs)[1 ] =tswapl (env->dregs[2 ]);
linux-user/m68k/syscall.h +1 -1
@@ -18,4 +18,4 @@ struct target_pt_regs {#define UNAME_MACHINE "m68k" -void do_m68k_simcall (CPUState *,int ); +void do_m68k_simcall (CPUM68KState *,int );
linux-user/main.c +14 -14
@@ -71,7 +71,7 @@ void gemu_log(const char *fmt, ...) }#if defined(TARGET_I386 ) -int cpu_get_pic_interrupt (CPUState *env) +int cpu_get_pic_interrupt (CPUX86State *env) {return -1 ; }
@@ -247,7 +247,7 @@ void cpu_list_unlock(void)/***********************************************************/ /* CPUX86 core interface */ -void cpu_smm_update (CPUState *env) +void cpu_smm_update (CPUX86State *env) { }
@@ -889,7 +889,7 @@ void cpu_loop(CPUARMState *env)#ifdef TARGET_UNICORE32 -void cpu_loop (CPUState *env) +void cpu_loop (CPUUniCore32State *env) {int trapnr;unsigned int n, insn;
@@ -1226,36 +1226,36 @@ void cpu_loop (CPUSPARCState *env)#endif #ifdef TARGET_PPC -static inline uint64_t cpu_ppc_get_tb (CPUState *env) +static inline uint64_t cpu_ppc_get_tb (CPUPPCState *env) {/* TO FIX */ return 0 ; } -uint64_t cpu_ppc_load_tbl (CPUState *env) +uint64_t cpu_ppc_load_tbl (CPUPPCState *env) {return cpu_ppc_get_tb (env); } -uint32_t cpu_ppc_load_tbu (CPUState *env) +uint32_t cpu_ppc_load_tbu (CPUPPCState *env) {return cpu_ppc_get_tb (env) >>32 ; } -uint64_t cpu_ppc_load_atbl (CPUState *env) +uint64_t cpu_ppc_load_atbl (CPUPPCState *env) {return cpu_ppc_get_tb (env); } -uint32_t cpu_ppc_load_atbu (CPUState *env) +uint32_t cpu_ppc_load_atbu (CPUPPCState *env) {return cpu_ppc_get_tb (env) >>32 ; } -uint32_t cpu_ppc601_load_rtcu (CPUState *env) +uint32_t cpu_ppc601_load_rtcu (CPUPPCState *env) __attribute__ ((alias ("cpu_ppc_load_tbu" ) )); -uint32_t cpu_ppc601_load_rtcl (CPUState *env) +uint32_t cpu_ppc601_load_rtcl (CPUPPCState *env) {return cpu_ppc_load_tbl (env) &0x3FFFFF80 ; }
@@ -2276,7 +2276,7 @@ done_syscall:#endif #ifdef TARGET_SH4 -void cpu_loop (CPUState *env) +void cpu_loop (CPUSH4State *env) {int trapnr, ret;target_siginfo_t info;
@@ -2335,7 +2335,7 @@ void cpu_loop (CPUState *env)#endif #ifdef TARGET_CRIS -void cpu_loop (CPUState *env) +void cpu_loop (CPUCRISState *env) {int trapnr, ret;target_siginfo_t info;
@@ -2393,7 +2393,7 @@ void cpu_loop (CPUState *env)#endif #ifdef TARGET_MICROBLAZE -void cpu_loop (CPUState *env) +void cpu_loop (CPUMBState *env) {int trapnr, ret;target_siginfo_t info;
@@ -2630,7 +2630,7 @@ static void do_store_exclusive(CPUAlphaState *env, int reg, int quad)queue_signal (env,TARGET_SIGSEGV , &info); } -void cpu_loop (CPUState *env) +void cpu_loop (CPUAlphaState *env) {int trapnr;target_siginfo_t info;
linux-user/signal.c +104 -97
771 lines not on this page · raw message
Signature · 1 line
1.7.7
RFC PATCH v4 31/44 arm hw/: Don't use CPUState
In reply to Andreas FärberScripted conversion:
for file in hw/arm-misc.h hw/arm_boot.c hw/arm_pic.c hw/armv7m.c hw/exynos4210.h hw/highbank.c hw/integratorcp.c hw/musicpal.c hw/omap.h hw/pxa.h hw/pxa2xx_gpio.c hw/pxa2xx_pic.c hw/realview.c hw/strongarm.h hw/versatilepb.c hw/vexpress.c hw/xilinx_zynq.c ; do
sed -i "s/CPUState/CPUARMState/g" $file
done
--- hw/arm-misc.h | 8 ++++---- hw/arm_boot.c | 8 ++++---- hw/arm_pic.c | 4 ++-- hw/armv7m.c | 4 ++-- hw/exynos4210.h | 2 +- hw/highbank.c | 8 ++++---- hw/integratorcp.c | 2 +- hw/musicpal.c | 2 +- hw/omap.h | 2 +- hw/pxa.h | 6 +++--- hw/pxa2xx_gpio.c | 4 ++-- hw/pxa2xx_pic.c | 4 ++-- hw/realview.c | 2 +- hw/strongarm.h | 2 +- hw/versatilepb.c | 2 +- hw/vexpress.c | 4 ++-- hw/xilinx_zynq.c | 2 +- 17 files changed, 33 insertions(+), 33 deletions(-)
hw/arm-misc.h +4 -4
@@ -16,7 +16,7 @@/* The CPU is also modeled as an interrupt controller. */ #define ARM_PIC_CPU_IRQ 0#define ARM_PIC_CPU_FIQ 1 -qemu_irq *arm_pic_init_cpu (CPUState *env); +qemu_irq *arm_pic_init_cpu (CPUARMState *env);/* armv7m.c */ qemu_irq *armv7m_init(MemoryRegion *address_space_mem,
@@ -50,16 +50,16 @@ struct arm_boot_info {* perform any necessary CPU reset handling and set the PC for thei * secondary CPUs to point at this boot blob. */ -void (*write_secondary_boot)(CPUState *env, +void (*write_secondary_boot)(CPUARMState *env,const struct arm_boot_info *info); -void (*secondary_cpu_reset_hook)(CPUState *env, +void (*secondary_cpu_reset_hook)(CPUARMState *env,const struct arm_boot_info *info);/* Used internally by arm_boot.c */ int is_linux;target_phys_addr_t initrd_size;target_phys_addr_t entry; }; -void arm_load_kernel (CPUState *env,struct arm_boot_info *info); +void arm_load_kernel (CPUARMState *env,struct arm_boot_info *info);/* Multiplication factor to convert from system clock ticks to qemu timer ticks. */
hw/arm_boot.c +4 -4
@@ -59,7 +59,7 @@ static uint32_t smpboot[] = { 0 /* bootreg: Boot register address is held here */ }; -static void default_write_secondary (CPUState *env, +static void default_write_secondary (CPUARMState *env,const struct arm_boot_info *info) {int n;
@@ -72,7 +72,7 @@ static void default_write_secondary(CPUState *env, info->smp_loader_start); } -static void default_reset_secondary (CPUState *env, +static void default_reset_secondary (CPUARMState *env,const struct arm_boot_info *info) {stl_phys_notdirty (info->smp_bootreg_addr,0 );
@@ -274,7 +274,7 @@ static int load_dtb(target_phys_addr_t addr, const struct arm_boot_info *binfo)static void do_cpu_reset (void *opaque) { -CPUState *env = opaque; +CPUARMState *env = opaque;const struct arm_boot_info *info = env->boot_info;cpu_state_reset (env);
@@ -300,7 +300,7 @@ static void do_cpu_reset(void *opaque) } } -void arm_load_kernel (CPUState *env,struct arm_boot_info *info) +void arm_load_kernel (CPUARMState *env,struct arm_boot_info *info) {int kernel_size;int initrd_size;
hw/arm_pic.c +2 -2
@@ -13,7 +13,7 @@/* Input 0 is IRQ and input 1 is FIQ. */ static void arm_pic_cpu_handler (void *opaque,int irq,int level) { -CPUState *env = (CPUState *)opaque; +CPUARMState *env = (CPUARMState *)opaque;switch (irq) {case ARM_PIC_CPU_IRQ :if (level)
@@ -32,7 +32,7 @@ static void arm_pic_cpu_handler(void *opaque, int irq, int level) } } -qemu_irq *arm_pic_init_cpu (CPUState *env) +qemu_irq *arm_pic_init_cpu (CPUARMState *env) {return qemu_allocate_irqs (arm_pic_cpu_handler, env,2 ); }
hw/armv7m.c +2 -2
@@ -149,7 +149,7 @@ static void armv7m_bitband_init(void)static void armv7m_reset (void *opaque) { -cpu_state_reset ((CPUState *)opaque); +cpu_state_reset ((CPUARMState *)opaque); }/* Init CPU and memory for a v7-M based board.
@@ -160,7 +160,7 @@ qemu_irq *armv7m_init(MemoryRegion *address_space_mem, int flash_size, int sram_size, const char *kernel_filename, const char *cpu_model) { - CPUState *env; + CPUARMState *env;DeviceState *nvic;/* FIXME: make this local state. */ static qemu_irq pic[64 ];
hw/exynos4210.h +1 -1
@@ -83,7 +83,7 @@ typedef struct Exynos4210Irq { } Exynos4210Irq; typedef struct Exynos4210State { - CPUState * env[EXYNOS4210_NCPUS]; + CPUARMState * env[EXYNOS4210_NCPUS]; Exynos4210Irq irqs; qemu_irq *irq_table;
hw/highbank.c +4 -4
@@ -37,12 +37,12 @@/* Board init. */ static void highbank_cpu_reset (void *opaque) { -CPUState *env = opaque; +CPUARMState *env = opaque; env->cp15.c15_config_base_address =GIC_BASE_ADDR ; } -static void hb_write_secondary (CPUState *env,const struct arm_boot_info *info) +static void hb_write_secondary (CPUARMState *env,const struct arm_boot_info *info) {int n;uint32_t smpboot[] = {
@@ -66,7 +66,7 @@ static void hb_write_secondary(CPUState *env, const struct arm_boot_info *info)rom_add_blob_fixed ("smpboot" , smpboot,sizeof (smpboot),SMP_BOOT_ADDR ); } -static void hb_reset_secondary (CPUState *env,const struct arm_boot_info *info) +static void hb_reset_secondary (CPUARMState *env,const struct arm_boot_info *info) {switch (info->nb_cpus) {case 4 :
@@ -196,7 +196,7 @@ static void highbank_init(ram_addr_t ram_size, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model) { - CPUState *env = NULL; + CPUARMState *env = NULL;DeviceState *dev;SysBusDevice *busdev;qemu_irq *irqp;
hw/integratorcp.c +1 -1
@@ -443,7 +443,7 @@ static void integratorcp_init(ram_addr_t ram_size, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model) { - CPUState *env; + CPUARMState *env;MemoryRegion *address_space_mem =get_system_memory ();MemoryRegion *ram =g_new (MemoryRegion,1 );MemoryRegion *ram_alias =g_new (MemoryRegion,1 );
hw/musicpal.c +1 -1
@@ -1513,7 +1513,7 @@ static void musicpal_init(ram_addr_t ram_size, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model) { - CPUState *env; + CPUARMState *env;qemu_irq *cpu_pic;qemu_irq pic[32 ];DeviceState *dev;
hw/omap.h +1 -1
@@ -813,7 +813,7 @@ struct omap_mpu_state_s { omap3630, } mpu_model; -CPUState *env; +CPUARMState *env;qemu_irq *drq;
hw/pxa.h +3 -3
@@ -65,11 +65,11 @@# define PXA2XX_INTERNAL_SIZE 0x40000/* pxa2xx_pic.c */ -DeviceState *pxa2xx_pic_init (target_phys_addr_t base,CPUState *env); +DeviceState *pxa2xx_pic_init (target_phys_addr_t base,CPUARMState *env);/* pxa2xx_gpio.c */ DeviceState *pxa2xx_gpio_init (target_phys_addr_t base, -CPUState *env,DeviceState *pic,int lines); +CPUARMState *env,DeviceState *pic,int lines);void pxa2xx_gpio_read_notifier (DeviceState *dev,qemu_irq handler);/* pxa2xx_dma.c */
@@ -122,7 +122,7 @@ typedef struct PXA2xxI2SState PXA2xxI2SState;typedef struct PXA2xxFIrState PXA2xxFIrState ; typedef struct { - CPUState *env; + CPUARMState *env; DeviceState *pic; qemu_irq reset; MemoryRegion sdram;
hw/pxa2xx_gpio.c +2 -2
@@ -20,7 +20,7 @@ struct PXA2xxGPIOInfo {qemu_irq irq0, irq1, irqX;int lines;int ncpu; -CPUState *cpu_env; +CPUARMState *cpu_env;/* XXX: GNU C vectors are more suitable */ uint32_t ilevel[PXA2XX_GPIO_BANKS ];
@@ -249,7 +249,7 @@ static const MemoryRegionOps pxa_gpio_ops = { };DeviceState *pxa2xx_gpio_init (target_phys_addr_t base, -CPUState *env,DeviceState *pic,int lines) +CPUARMState *env,DeviceState *pic,int lines) {DeviceState *dev;
hw/pxa2xx_pic.c +2 -2
@@ -34,7 +34,7 @@ typedef struct { SysBusDevice busdev; MemoryRegion iomem; - CPUState *cpu_env; + CPUARMState *cpu_env; uint32_t int_enabled[2]; uint32_t int_pending[2]; uint32_t is_fiq[2];
@@ -245,7 +245,7 @@ static int pxa2xx_pic_post_load(void *opaque, int version_id)return 0 ; } -DeviceState *pxa2xx_pic_init (target_phys_addr_t base,CPUState *env) +DeviceState *pxa2xx_pic_init (target_phys_addr_t base,CPUARMState *env) {DeviceState *dev =qdev_create (NULL ,"pxa2xx_pic" );PXA2xxPICState *s =FROM_SYSBUS (PXA2xxPICState,sysbus_from_qdev (dev));
hw/realview.c +1 -1
@@ -129,7 +129,7 @@ static void realview_init(ram_addr_t ram_size, const char *initrd_filename, const char *cpu_model, enum realview_board_type board_type) { - CPUState *env = NULL; + CPUARMState *env = NULL;MemoryRegion *sysmem =get_system_memory ();MemoryRegion *ram_lo =g_new (MemoryRegion,1 );MemoryRegion *ram_hi =g_new (MemoryRegion,1 );
hw/strongarm.h +1 -1
@@ -53,7 +53,7 @@ enum { }; typedef struct { - CPUState *env; + CPUARMState *env; MemoryRegion sdram; DeviceState *pic; DeviceState *gpio;
hw/versatilepb.c +1 -1
@@ -168,7 +168,7 @@ static void versatile_init(ram_addr_t ram_size, const char *initrd_filename, const char *cpu_model, int board_id) { - CPUState *env; + CPUARMState *env;MemoryRegion *sysmem =get_system_memory ();MemoryRegion *ram =g_new (MemoryRegion,1 );qemu_irq *cpu_pic;
hw/vexpress.c +2 -2
@@ -159,7 +159,7 @@ static void a9_daughterboard_init(const VEDBoardInfo *daughterboard,const char *cpu_model, qemu_irq *pic, uint32_t *proc_id) { - CPUState *env = NULL; + CPUARMState *env = NULL;MemoryRegion *sysmem =get_system_memory ();MemoryRegion *ram =g_new (MemoryRegion,1 );MemoryRegion *lowram =g_new (MemoryRegion,1 );
@@ -259,7 +259,7 @@ static void a15_daughterboard_init(const VEDBoardInfo *daughterboard, qemu_irq *pic, uint32_t *proc_id) {int n; -CPUState *env =NULL ; +CPUARMState *env =NULL ;MemoryRegion *sysmem =get_system_memory ();MemoryRegion *ram =g_new (MemoryRegion,1 );MemoryRegion *sram =g_new (MemoryRegion,1 );
hw/xilinx_zynq.c +1 -1
@@ -50,7 +50,7 @@ static void zynq_init(ram_addr_t ram_size, const char *boot_device, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model) { - CPUState *env = NULL; + CPUARMState *env = NULL;MemoryRegion *address_space_mem =get_system_memory ();MemoryRegion *ext_ram =g_new (MemoryRegion,1 );MemoryRegion *ocm_ram =g_new (MemoryRegion,1 );
Signature · 1 line
1.7.7
RFC PATCH v4 41/44 sparc hw/: Don't use CPUState
In reply to Andreas FärberScripted conversion:
for file in hw/sun4m.c hw/sun4u.c hw/grlib.h hw/leon3.c; do
sed -i "s/CPUState/CPUSPARCState/g" $file
done
--- hw/grlib.h | 2 +- hw/leon3.c | 8 ++++---- hw/sun4m.c | 12 ++++++------ hw/sun4u.c | 24 ++++++++++++------------ 4 files changed, 23 insertions(+), 23 deletions(-)
hw/grlib.h +1 -1
@@ -42,7 +42,7 @@ void grlib_irqmp_ack(DeviceState *dev, int intno);static inline DeviceState *grlib_irqmp_create (target_phys_addr_t base, -CPUState *env, +CPUSPARCState *env,qemu_irq **cpu_irqs,uint32_t nr_irqs,set_pil_in_fn set_pil_in)
hw/leon3.c +4 -4
@@ -42,14 +42,14 @@#define MAX_PILS 16typedef struct ResetData { -CPUState *env; +CPUSPARCState *env;uint32_t entry;/* save kernel entry in case of reset */ }ResetData ;static void main_cpu_reset (void *opaque) {ResetData *s = (ResetData *)opaque; -CPUState *env = s->env; +CPUSPARCState *env = s->env;cpu_state_reset (env);
@@ -65,7 +65,7 @@ void leon3_irq_ack(void *irq_manager, int intno)static void leon3_set_pil_in (void *opaque,uint32_t pil_in) { -CPUState *env = (CPUState *)opaque; +CPUSPARCState *env = (CPUSPARCState *)opaque;assert (env !=NULL );
@@ -101,7 +101,7 @@ static void leon3_generic_hw_init(ram_addr_t ram_size,const char *initrd_filename, const char *cpu_model) { - CPUState *env; + CPUSPARCState *env;MemoryRegion *address_space_mem =get_system_memory ();MemoryRegion *ram =g_new (MemoryRegion,1 );MemoryRegion *prom =g_new (MemoryRegion,1 );
hw/sun4m.c +6 -6
@@ -228,7 +228,7 @@ void sun4m_irq_info(Monitor *mon)slavio_irq_info (mon, slavio_intctl); } -void cpu_check_irqs (CPUState *env) +void cpu_check_irqs (CPUSPARCState *env) {if (env->pil_in && (env->interrupt_index ==0 || (env->interrupt_index & ~15 ) ==TT_EXTINT )) {
@@ -253,7 +253,7 @@ void cpu_check_irqs(CPUState *env) } } -static void cpu_kick_irq (CPUState *env) +static void cpu_kick_irq (CPUSPARCState *env) { env->halted =0 ;cpu_check_irqs (env);
@@ -262,7 +262,7 @@ static void cpu_kick_irq(CPUState *env)static void cpu_set_irq (void *opaque,int irq,int level) { -CPUState *env = opaque; +CPUSPARCState *env = opaque;if (level) {trace_sun4m_cpu_set_irq_raise (irq);
@@ -281,7 +281,7 @@ static void dummy_cpu_set_irq(void *opaque, int irq, int level)static void main_cpu_reset (void *opaque) { -CPUState *env = opaque; +CPUSPARCState *env = opaque;cpu_state_reset (env); env->halted =0 ;
@@ -289,7 +289,7 @@ static void main_cpu_reset(void *opaque)static void secondary_cpu_reset (void *opaque) { -CPUState *env = opaque; +CPUSPARCState *env = opaque;cpu_state_reset (env); env->halted =1 ;
@@ -809,7 +809,7 @@ static TypeInfo ram_info = {static void cpu_devinit (const char *cpu_model,unsigned int id,uint64_t prom_addr,qemu_irq **cpu_irqs) { -CPUState *env; +CPUSPARCState *env; env =cpu_init (cpu_model);if (!env) {
hw/sun4u.c +12 -12
@@ -243,7 +243,7 @@ static unsigned long sun4u_load_kernel(const char *kernel_filename,return kernel_size; } -void cpu_check_irqs (CPUState *env) +void cpu_check_irqs (CPUSPARCState *env) {uint32_t pil = env->pil_in | (env->softint & ~(SOFTINT_TIMER |SOFTINT_STIMER ));
@@ -297,7 +297,7 @@ void cpu_check_irqs(CPUState *env) } } -static void cpu_kick_irq (CPUState *env) +static void cpu_kick_irq (CPUSPARCState *env) { env->halted =0 ;cpu_check_irqs (env);
@@ -306,7 +306,7 @@ static void cpu_kick_irq(CPUState *env)static void cpu_set_irq (void *opaque,int irq,int level) { -CPUState *env = opaque; +CPUSPARCState *env = opaque;if (level) {CPUIRQ_DPRINTF ("Raise CPU IRQ %d\n" , irq);
@@ -320,7 +320,7 @@ static void cpu_set_irq(void *opaque, int irq, int level) }typedef struct ResetData { -CPUState *env; +CPUSPARCState *env;uint64_t prom_addr; }ResetData ;
@@ -344,7 +344,7 @@ void cpu_get_timer(QEMUFile *f, CPUTimer *s)qemu_get_timer (f, s->qtimer); } -static CPUTimer *cpu_timer_create (const char * name,CPUState *env, +static CPUTimer *cpu_timer_create (const char * name,CPUSPARCState *env,QEMUBHFunc *cb,uint32_t frequency,uint64_t disabled_mask) {
@@ -373,7 +373,7 @@ static void cpu_timer_reset(CPUTimer *timer)static void main_cpu_reset (void *opaque) {ResetData *s = (ResetData *)opaque; -CPUState *env = s->env; +CPUSPARCState *env = s->env;static unsigned int nr_resets;cpu_state_reset (env);
@@ -396,7 +396,7 @@ static void main_cpu_reset(void *opaque)static void tick_irq (void *opaque) { -CPUState *env = opaque; +CPUSPARCState *env = opaque;CPUTimer * timer = env->tick;
@@ -413,7 +413,7 @@ static void tick_irq(void *opaque)static void stick_irq (void *opaque) { -CPUState *env = opaque; +CPUSPARCState *env = opaque;CPUTimer * timer = env->stick;
@@ -430,7 +430,7 @@ static void stick_irq(void *opaque)static void hstick_irq (void *opaque) { -CPUState *env = opaque; +CPUSPARCState *env = opaque;CPUTimer * timer = env->hstick;
@@ -714,9 +714,9 @@ static TypeInfo ram_info = { .class_init = ram_class_init, }; -static CPUState *cpu_devinit (const char *cpu_model,const struct hwdef *hwdef) +static CPUSPARCState *cpu_devinit (const char *cpu_model,const struct hwdef *hwdef) { -CPUState *env; +CPUSPARCState *env;ResetData *reset_info;uint32_t tick_frequency =100 *1000000 ;
@@ -755,7 +755,7 @@ static void sun4uv_init(MemoryRegion *address_space_mem, const char *initrd_filename, const char *cpu_model, const struct hwdef *hwdef) { - CPUState *env; + CPUSPARCState *env;M48t59State *nvram;unsigned int i;long initrd_size, kernel_size;
Signature · 1 line
1.7.7
RFC PATCH v4 42/44 xtensa hw/: Don't use CPUState
In reply to Andreas FärberScripted conversion:
for file in hw/xtensa_*.[hc]; do
sed -i "s/CPUState/CPUXtensaState/g" $file
done
--- hw/xtensa_lx60.c | 4 ++-- hw/xtensa_pic.c | 16 ++++++++-------- hw/xtensa_sim.c | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-)
hw/xtensa_lx60.c +2 -2
@@ -148,7 +148,7 @@ static uint64_t translate_phys_addr(void *env, uint64_t addr)static void lx60_reset (void *opaque) { -CPUState *env = opaque; +CPUXtensaState *env = opaque;cpu_state_reset (env); }
@@ -164,7 +164,7 @@ static void lx_init(const LxBoardDesc *board,int be =0 ;#endif MemoryRegion *system_memory =get_system_memory (); -CPUState *env =NULL ; +CPUXtensaState *env =NULL ;MemoryRegion *ram, *rom, *system_io;DriveInfo *dinfo;pflash_t *flash =NULL ;
hw/xtensa_pic.c +8 -8
@@ -29,7 +29,7 @@#include "qemu-log.h" #include "qemu-timer.h" -void xtensa_advance_ccount (CPUState *env,uint32_t d) +void xtensa_advance_ccount (CPUXtensaState *env,uint32_t d) {uint32_t old_ccount = env->sregs[CCOUNT ];
@@ -45,7 +45,7 @@ void xtensa_advance_ccount(CPUState *env, uint32_t d) } } -void check_interrupts (CPUState *env) +void check_interrupts (CPUXtensaState *env) {int minlevel =xtensa_get_cintlevel (env);uint32_t int_set_enabled = env->sregs[INTSET ] & env->sregs[INTENABLE ];
@@ -84,7 +84,7 @@ void check_interrupts(CPUState *env)static void xtensa_set_irq (void *opaque,int irq,int active) { -CPUState *env = opaque; +CPUXtensaState *env = opaque;if (irq >= env->config->ninterrupt) {qemu_log ("%s: bad IRQ %d\n" , __func__, irq);
@@ -101,12 +101,12 @@ static void xtensa_set_irq(void *opaque, int irq, int active) } } -void xtensa_timer_irq (CPUState *env,uint32_t id,uint32_t active) +void xtensa_timer_irq (CPUXtensaState *env,uint32_t id,uint32_t active) {qemu_set_irq (env->irq_inputs[env->config->timerint[id]], active); } -void xtensa_rearm_ccompare_timer (CPUState *env) +void xtensa_rearm_ccompare_timer (CPUXtensaState *env) {int i;uint32_t wake_ccount = env->sregs[CCOUNT ] -1 ;
@@ -125,7 +125,7 @@ void xtensa_rearm_ccompare_timer(CPUState *env)static void xtensa_ccompare_cb (void *opaque) { -CPUState *env = opaque; +CPUXtensaState *env = opaque;if (env->halted) { env->halt_clock =qemu_get_clock_ns (vm_clock);
@@ -137,7 +137,7 @@ static void xtensa_ccompare_cb(void *opaque) } } -void xtensa_irq_init (CPUState *env) +void xtensa_irq_init (CPUXtensaState *env) { env->irq_inputs = (void **)qemu_allocate_irqs ( xtensa_set_irq, env, env->config->ninterrupt);
@@ -148,7 +148,7 @@ void xtensa_irq_init(CPUState *env) } } -void *xtensa_get_extint (CPUState *env,unsigned extint) +void *xtensa_get_extint (CPUXtensaState *env,unsigned extint) {if (extint < env->config->nextint) {unsigned irq = env->config->extint[extint];
hw/xtensa_sim.c +1 -1
@@ -47,7 +47,7 @@ static void sim_init(ram_addr_t ram_size, const char *kernel_filename, const char *kernel_cmdline, const char *initrd_filename, const char *cpu_model) { - CPUState *env = NULL; + CPUXtensaState *env = NULL;MemoryRegion *ram, *rom;int n;
Signature · 1 line
1.7.7
RFC PATCH v4 44/44 qom: Introduce CPU class
In reply to Andreas FärberReintroduce CPUState as QOM object: It's abstract and derived directly from TYPE_OBJECT for compatibility with the user emulators. The identifier CPUState avoids conflicts between CPU() and the struct.
Introduce $(qom-twice-y) to build it separately for system and for user emulators.
Prepare a virtual reset method, (re)introduce cpu_reset() as wrapper.
--- Makefile.objs | 3 ++ configure | 1 + include/qemu/cpu.h | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++ qom/Makefile | 1 + qom/cpu.c | 58 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 138 insertions(+), 0 deletions(-) create mode 100644 include/qemu/cpu.h create mode 100644 qom/cpu.c
Makefile.objs +3 -0
@@ -14,6 +14,7 @@ universal-obj-y += $(qobject-obj-y) # QOM include $(SRC_PATH)/qom/Makefile qom-obj-y = $(addprefix qom/, $(qom-y)) +qom-obj-twice-y = $(addprefix qom/, $(qom-twice-y)) universal-obj-y += $(qom-obj-y)
@@ -89,6 +90,7 @@ fsdev-obj-$(CONFIG_VIRTFS) += $(addprefix fsdev/, $(fsdev-nested-y)) common-obj-y = $(block-obj-y) blockdev.o common-obj-y += $(net-obj-y) +common-obj-y += $(qom-obj-twice-y) common-obj-$(CONFIG_LINUX) += $(fsdev-obj-$(CONFIG_LINUX)) common-obj-y += readline.o console.o cursor.o common-obj-y += $(oslib-obj-y)
@@ -194,6 +196,7 @@ user-obj-y += cutils.o cache-utils.o user-obj-y += module.o user-obj-y += qemu-user.o user-obj-y += $(trace-obj-y) +user-obj-y += $(qom-obj-twice-y) ###################################################################### # libhw
configure +1 -0
@@ -3888,6 +3888,7 @@ fi d=libuser mkdir -p $d mkdir -p $d/trace +mkdir -p $d/qom symlink $source_path/Makefile.user $d/Makefile if test "$docs" = "yes" ; then
include/qemu/cpu.h new file +75 -0
75 lines not on this page · raw message
qom/Makefile +1 -0
@@ -1 +1,2 @@ qom-y = object.o container.o qom-qobject.o +qom-twice-y = cpu.o
qom/cpu.c new file +58 -0
58 lines not on this page · raw message
Signature · 1 line
1.7.7
RFC PATCH v4 16/44 target-i386: Don't overuse CPUState
In reply to Andreas FärberScripted conversion:
sed -i "s/CPUState/CPUX86State/g" target-i386/*.[hc] sed -i "s/#define CPUX86State/#define CPUState/" target-i386/cpu.h
--- target-i386/cpu.h | 34 +++++----- target-i386/helper.c | 38 +++++----- target-i386/kvm.c | 76 ++++++++++---------- target-i386/machine.c | 172 +++++++++++++++++++++++----------------------- target-i386/op_helper.c | 34 +++++----- target-i386/translate.c | 82 +++++++++++----------- 6 files changed, 218 insertions(+), 218 deletions(-)
target-i386/cpu.h +17 -17
@@ -787,7 +787,7 @@ int cpu_x86_exec(CPUX86State *s);void cpu_x86_close (CPUX86State *s);void x86_cpu_list (FILE *f,fprintf_function cpu_fprintf,const char *optarg);void x86_cpudef_setup (void ); -int cpu_x86_support_mca_broadcast (CPUState *env); +int cpu_x86_support_mca_broadcast (CPUX86State *env);int cpu_get_pic_interrupt (CPUX86State *s);/* MSDOS compatibility mode FPU exception support */
@@ -969,7 +969,7 @@ uint64_t cpu_get_tsc(CPUX86State *env);#define MMU_MODE0_SUFFIX _kernel#define MMU_MODE1_SUFFIX _user#define MMU_USER_IDX 1 -static inline int cpu_mmu_index (CPUState *env) +static inline int cpu_mmu_index (CPUX86State *env) {return (env->hflags &HF_CPL_MASK ) ==3 ?1 :0 ; }
@@ -1008,7 +1008,7 @@ static inline int cpu_mmu_index (CPUState *env)void optimize_flags_init (void );#if defined(CONFIG_USER_ONLY ) -static inline void cpu_clone_regs (CPUState *env,target_ulong newsp) +static inline void cpu_clone_regs (CPUX86State *env,target_ulong newsp) {if (newsp) env->regs[R_ESP ] = newsp;
@@ -1023,7 +1023,7 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp)#include "hw/apic.h" #endif -static inline bool cpu_has_work (CPUState *env) +static inline bool cpu_has_work (CPUX86State *env) {return ((env->interrupt_request &CPU_INTERRUPT_HARD ) && (env->eflags & IF_MASK)) ||
@@ -1035,12 +1035,12 @@ static inline bool cpu_has_work(CPUState *env)#include "exec-all.h" -static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) +static inline void cpu_pc_from_tb (CPUX86State *env,TranslationBlock *tb) { env->eip = tb->pc - tb->cs_base; } -static inline void cpu_get_tb_cpu_state (CPUState *env,target_ulong *pc, +static inline void cpu_get_tb_cpu_state (CPUX86State *env,target_ulong *pc,target_ulong *cs_base,int *flags) { *cs_base = env->segs[R_CS ].base;
@@ -1049,29 +1049,29 @@ static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc, (env->eflags & (IOPL_MASK |TF_MASK |RF_MASK |VM_MASK )); } -void do_cpu_init (CPUState *env); -void do_cpu_sipi (CPUState *env); +void do_cpu_init (CPUX86State *env); +void do_cpu_sipi (CPUX86State *env);#define MCE_INJECT_BROADCAST 1#define MCE_INJECT_UNCOND_AO 2 -void cpu_x86_inject_mce (Monitor *mon,CPUState *cenv,int bank, +void cpu_x86_inject_mce (Monitor *mon,CPUX86State *cenv,int bank,uint64_t status,uint64_t mcg_status,uint64_t addr,uint64_t misc,int flags);/* op_helper.c */ -void do_interrupt (CPUState *env); -void do_interrupt_x86_hardirq (CPUState *env,int intno,int is_hw); -void QEMU_NORETURN raise_exception_env(int exception_index, CPUState *nenv); -void QEMU_NORETURN raise_exception_err_env(CPUState *nenv, int exception_index, +void do_interrupt (CPUX86State *env); +void do_interrupt_x86_hardirq (CPUX86State *env,int intno,int is_hw); +void QEMU_NORETURN raise_exception_env(int exception_index, CPUX86State *nenv); +void QEMU_NORETURN raise_exception_err_env(CPUX86State *nenv, int exception_index,int error_code); -void do_smm_enter (CPUState *env1); +void do_smm_enter (CPUX86State *env1); -void svm_check_intercept (CPUState *env1,uint32_t type); +void svm_check_intercept (CPUX86State *env1,uint32_t type); -uint32_t cpu_cc_compute_all (CPUState *env1,int op); +uint32_t cpu_cc_compute_all (CPUX86State *env1,int op); -void cpu_report_tpr_access (CPUState *env,TPRAccess access); +void cpu_report_tpr_access (CPUX86State *env,TPRAccess access);#endif /* CPU_I386_H */
target-i386/helper.c +19 -19
@@ -27,7 +27,7 @@//#define DEBUG_MMU /* NOTE: must be called outside the CPU execute loop */ -void cpu_state_reset (CPUState *env) +void cpu_state_reset (CPUX86State *env) {int i;
@@ -106,7 +106,7 @@ void cpu_x86_close(CPUX86State *env)g_free (env); } -static void cpu_x86_version (CPUState *env,int *family,int *model) +static void cpu_x86_version (CPUX86State *env,int *family,int *model) {int cpuver = env->cpuid_version;
@@ -119,7 +119,7 @@ static void cpu_x86_version(CPUState *env, int *family, int *model) }/* Broadcast MCA signal for processor version 06H_EH and above */ -int cpu_x86_support_mca_broadcast (CPUState *env) +int cpu_x86_support_mca_broadcast (CPUX86State *env) {int family =0 ;int model =0 ;
@@ -191,7 +191,7 @@ static const char *cc_op_str[] = { };static void -cpu_x86_dump_seg_cache (CPUState *env,FILE *f,fprintf_function cpu_fprintf, +cpu_x86_dump_seg_cache (CPUX86State *env,FILE *f,fprintf_function cpu_fprintf,const char *name,struct SegmentCache *sc) {#ifdef TARGET_X86_64
@@ -248,7 +248,7 @@ done:#define DUMP_CODE_BYTES_TOTAL 50#define DUMP_CODE_BYTES_BACKWARD 20 -void cpu_dump_state (CPUState *env,FILE *f,fprintf_function cpu_fprintf, +void cpu_dump_state (CPUX86State *env,FILE *f,fprintf_function cpu_fprintf,int flags) {int eflags, i, nb;
@@ -857,7 +857,7 @@ int cpu_x86_handle_mmu_fault(CPUX86State *env, target_ulong addr,return 1 ; } -target_phys_addr_t cpu_get_phys_page_debug (CPUState *env,target_ulong addr) +target_phys_addr_t cpu_get_phys_page_debug (CPUX86State *env,target_ulong addr) {target_ulong pde_addr, pte_addr;uint64_t pte;
@@ -951,7 +951,7 @@ target_phys_addr_t cpu_get_phys_page_debug(CPUState *env, target_ulong addr)return paddr; } -void hw_breakpoint_insert (CPUState *env,int index) +void hw_breakpoint_insert (CPUX86State *env,int index) {int type, err =0 ;
@@ -979,7 +979,7 @@ void hw_breakpoint_insert(CPUState *env, int index) env->cpu_breakpoint[index] =NULL ; } -void hw_breakpoint_remove (CPUState *env,int index) +void hw_breakpoint_remove (CPUX86State *env,int index) {if (!env->cpu_breakpoint[index])return ;
@@ -998,7 +998,7 @@ void hw_breakpoint_remove(CPUState *env, int index) } } -int check_hw_breakpoints (CPUState *env,int force_dr6_update) +int check_hw_breakpoints (CPUX86State *env,int force_dr6_update) {target_ulong dr6;int reg, type;
@@ -1022,7 +1022,7 @@ int check_hw_breakpoints(CPUState *env, int force_dr6_update)static CPUDebugExcpHandler *prev_debug_excp_handler; -static void breakpoint_handler (CPUState *env) +static void breakpoint_handler (CPUX86State *env) {CPUBreakpoint *bp;
@@ -1050,7 +1050,7 @@ static void breakpoint_handler(CPUState *env) typedef struct MCEInjectionParams { Monitor *mon; - CPUState *env; + CPUX86State *env; int bank; uint64_t status; uint64_t mcg_status;
@@ -1062,7 +1062,7 @@ typedef struct MCEInjectionParams {static void do_inject_x86_mce (void *data) {MCEInjectionParams *params = data; -CPUState *cenv = params->env; +CPUX86State *cenv = params->env;uint64_t *banks = cenv->mce_banks +4 * params->bank;cpu_synchronize_state (cenv);
@@ -1132,7 +1132,7 @@ static void do_inject_x86_mce(void *data) } } -void cpu_x86_inject_mce (Monitor *mon,CPUState *cenv,int bank, +void cpu_x86_inject_mce (Monitor *mon,CPUX86State *cenv,int bank,uint64_t status,uint64_t mcg_status,uint64_t addr,uint64_t misc,int flags) {
@@ -1147,7 +1147,7 @@ void cpu_x86_inject_mce(Monitor *mon, CPUState *cenv, int bank, .flags = flags, };unsigned bank_num = cenv->mcg_cap &0xff ; -CPUState *env; +CPUX86State *env;if (!cenv->mcg_cap) {monitor_printf (mon,"MCE injection not supported\n" );
@@ -1184,7 +1184,7 @@ void cpu_x86_inject_mce(Monitor *mon, CPUState *cenv, int bank, } } -void cpu_report_tpr_access (CPUState *env,TPRAccess access) +void cpu_report_tpr_access (CPUX86State *env,TPRAccess access) {TranslationBlock *tb;
@@ -1276,7 +1276,7 @@ CPUX86State *cpu_x86_init(const char *cpu_model) }#if !defined(CONFIG_USER_ONLY ) -void do_cpu_init (CPUState *env) +void do_cpu_init (CPUX86State *env) {int sipi = env->interrupt_request &CPU_INTERRUPT_SIPI ;uint64_t pat = env->pat;
@@ -1288,15 +1288,15 @@ void do_cpu_init(CPUState *env) env->halted = !cpu_is_bsp(env); } -void do_cpu_sipi (CPUState *env) +void do_cpu_sipi (CPUX86State *env) {apic_sipi (env->apic_state); }#else -void do_cpu_init (CPUState *env) +void do_cpu_init (CPUX86State *env) { } -void do_cpu_sipi (CPUState *env) +void do_cpu_sipi (CPUX86State *env) { }#endif
target-i386/kvm.c +38 -38
304 lines not on this page · raw message
target-i386/machine.c +86 -86
277 lines not on this page · raw message
target-i386/op_helper.c +17 -17
@@ -125,7 +125,7 @@ static inline void load_eflags(int eflags, int update_mask)/* load efer and update the corresponding hflags. XXX: do consistency checks with cpuid bits ? */ -static inline void cpu_load_efer (CPUState *env,uint64_t val) +static inline void cpu_load_efer (CPUX86State *env,uint64_t val) { env->efer = val; env->hflags &= ~(HF_LMA_MASK |HF_SVME_MASK );
@@ -1376,9 +1376,9 @@ static void do_interrupt_all(int intno, int is_int, int error_code,#endif } -void do_interrupt (CPUState *env1) +void do_interrupt (CPUX86State *env1) { -CPUState *saved_env; +CPUX86State *saved_env; saved_env = env; env = env1;
@@ -1406,9 +1406,9 @@ void do_interrupt(CPUState *env1) env = saved_env; } -void do_interrupt_x86_hardirq (CPUState *env1,int intno,int is_hw) +void do_interrupt_x86_hardirq (CPUX86State *env1,int intno,int is_hw) { -CPUState *saved_env; +CPUX86State *saved_env; saved_env = env; env = env1;
@@ -1492,7 +1492,7 @@ static void QEMU_NORETURN raise_exception_err(int exception_index,raise_interrupt (exception_index,0 , error_code,0 ); } -void raise_exception_err_env (CPUState *nenv,int exception_index, +void raise_exception_err_env (CPUX86State *nenv,int exception_index,int error_code) { env = nenv;
@@ -1504,7 +1504,7 @@ static void QEMU_NORETURN raise_exception(int exception_index)raise_interrupt (exception_index,0 ,0 ,0 ); } -void raise_exception_env (int exception_index,CPUState *nenv) +void raise_exception_env (int exception_index,CPUX86State *nenv) { env = nenv;raise_exception (exception_index);
@@ -1513,7 +1513,7 @@ void raise_exception_env(int exception_index, CPUState *nenv)#if defined(CONFIG_USER_ONLY ) -void do_smm_enter (CPUState *env1) +void do_smm_enter (CPUX86State *env1) { }
@@ -1529,12 +1529,12 @@ void helper_rsm(void)#define SMM_REVISION_ID 0x00020000#endif -void do_smm_enter (CPUState *env1) +void do_smm_enter (CPUX86State *env1) {target_ulong sm_state;SegmentCache *dt;int i, offset; -CPUState *saved_env; +CPUX86State *saved_env; saved_env = env; env = env1;
@@ -5002,7 +5002,7 @@ void helper_boundl(target_ulong a0, int v)NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */ /* XXX: fix it to restore all registers */ -void tlb_fill (CPUState *env1,target_ulong addr,int is_write,int mmu_idx, +void tlb_fill (CPUX86State *env1,target_ulong addr,int is_write,int mmu_idx,void *retaddr) {TranslationBlock *tb;
@@ -5066,7 +5066,7 @@ void helper_svm_check_intercept_param(uint32_t type, uint64_t param) { } -void svm_check_intercept (CPUState *env1,uint32_t type) +void svm_check_intercept (CPUX86State *env1,uint32_t type) { }
@@ -5101,7 +5101,7 @@ static inline void svm_load_seg(target_phys_addr_t addr, SegmentCache *sc) }static inline void svm_load_seg_cache (target_phys_addr_t addr, -CPUState *env,int seg_reg) +CPUX86State *env,int seg_reg) {SegmentCache sc1, *sc = &sc1;svm_load_seg (addr, sc);
@@ -5460,9 +5460,9 @@ void helper_svm_check_intercept_param(uint32_t type, uint64_t param) } } -void svm_check_intercept (CPUState *env1,uint32_t type) +void svm_check_intercept (CPUX86State *env1,uint32_t type) { -CPUState *saved_env; +CPUX86State *saved_env; saved_env = env; env = env1;
@@ -5840,9 +5840,9 @@ uint32_t helper_cc_compute_all(int op) } } -uint32_t cpu_cc_compute_all (CPUState *env1,int op) +uint32_t cpu_cc_compute_all (CPUX86State *env1,int op) { -CPUState *saved_env; +CPUX86State *saved_env;uint32_t ret; saved_env = env;
target-i386/translate.c +41 -41
185 lines not on this page · raw message
Signature · 1 line
1.7.7
RFC PATCH v4 24/44 target-sparc: Don't overuse CPUState
In reply to Andreas FärberScripted conversion:
sed -i "s/CPUState/CPUSPARCState/g" target-sparc/*.[hc] sed -i "s/#define CPUSPARCState/#define CPUState/" target-sparc/cpu.h
--- target-sparc/cc_helper.c | 66 ++++++++++++++++++------------------ target-sparc/cpu.h | 56 +++++++++++++++--------------- target-sparc/cpu_init.c | 2 +- target-sparc/fop_helper.c | 68 ++++++++++++++++++------------------ target-sparc/helper.c | 16 ++++---- target-sparc/int32_helper.c | 6 ++-- target-sparc/int64_helper.c | 12 +++--- target-sparc/ldst_helper.c | 16 ++++---- target-sparc/machine.c | 4 +- target-sparc/mmu_helper.c | 28 +++++++------- target-sparc/op_helper.c | 4 +- target-sparc/translate.c | 80 +++++++++++++++++++++--------------------- target-sparc/win_helper.c | 58 +++++++++++++++--------------- 13 files changed, 208 insertions(+), 208 deletions(-)
target-sparc/cc_helper.c +33 -33
@@ -20,12 +20,12 @@#include "cpu.h" #include "helper.h" -static uint32_t compute_all_flags (CPUState *env) +static uint32_t compute_all_flags (CPUSPARCState *env) {return env->psr &PSR_ICC ; } -static uint32_t compute_C_flags (CPUState *env) +static uint32_t compute_C_flags (CPUSPARCState *env) {return env->psr &PSR_CARRY ; }
@@ -43,12 +43,12 @@ static inline uint32_t get_NZ_icc(int32_t dst) }#ifdef TARGET_SPARC64 -static uint32_t compute_all_flags_xcc (CPUState *env) +static uint32_t compute_all_flags_xcc (CPUSPARCState *env) {return env->xcc &PSR_ICC ; } -static uint32_t compute_C_flags_xcc (CPUState *env) +static uint32_t compute_C_flags_xcc (CPUSPARCState *env) {return env->xcc &PSR_CARRY ; }
@@ -76,7 +76,7 @@ static inline uint32_t get_V_div_icc(target_ulong src2)return ret; } -static uint32_t compute_all_div (CPUState *env) +static uint32_t compute_all_div (CPUSPARCState *env) {uint32_t ret;
@@ -85,7 +85,7 @@ static uint32_t compute_all_div(CPUState *env)return ret; } -static uint32_t compute_C_div (CPUState *env) +static uint32_t compute_C_div (CPUSPARCState *env) {return 0 ; }
@@ -155,7 +155,7 @@ static inline uint32_t get_V_add_xcc(target_ulong dst, target_ulong src1,return ret; } -static uint32_t compute_all_add_xcc (CPUState *env) +static uint32_t compute_all_add_xcc (CPUSPARCState *env) {uint32_t ret;
@@ -165,13 +165,13 @@ static uint32_t compute_all_add_xcc(CPUState *env) return ret; } -static uint32_t compute_C_add_xcc (CPUState *env) +static uint32_t compute_C_add_xcc (CPUSPARCState *env) {return get_C_add_xcc (CC_DST ,CC_SRC ); }#endif -static uint32_t compute_all_add (CPUState *env) +static uint32_t compute_all_add (CPUSPARCState *env) {uint32_t ret;
@@ -181,13 +181,13 @@ static uint32_t compute_all_add(CPUState *env)return ret; } -static uint32_t compute_C_add (CPUState *env) +static uint32_t compute_C_add (CPUSPARCState *env) {return get_C_add_icc (CC_DST ,CC_SRC ); }#ifdef TARGET_SPARC64 -static uint32_t compute_all_addx_xcc (CPUState *env) +static uint32_t compute_all_addx_xcc (CPUSPARCState *env) {uint32_t ret;
@@ -197,7 +197,7 @@ static uint32_t compute_all_addx_xcc(CPUState *env)return ret; } -static uint32_t compute_C_addx_xcc (CPUState *env) +static uint32_t compute_C_addx_xcc (CPUSPARCState *env) {uint32_t ret;
@@ -206,7 +206,7 @@ static uint32_t compute_C_addx_xcc(CPUState *env) }#endif -static uint32_t compute_all_addx (CPUState *env) +static uint32_t compute_all_addx (CPUSPARCState *env) {uint32_t ret;
@@ -216,7 +216,7 @@ static uint32_t compute_all_addx(CPUState *env)return ret; } -static uint32_t compute_C_addx (CPUState *env) +static uint32_t compute_C_addx (CPUSPARCState *env) {uint32_t ret;
@@ -234,7 +234,7 @@ static inline uint32_t get_V_tag_icc(target_ulong src1, target_ulong src2)return ret; } -static uint32_t compute_all_tadd (CPUState *env) +static uint32_t compute_all_tadd (CPUSPARCState *env) {uint32_t ret;
@@ -245,7 +245,7 @@ static uint32_t compute_all_tadd(CPUState *env)return ret; } -static uint32_t compute_all_taddtv (CPUState *env) +static uint32_t compute_all_taddtv (CPUSPARCState *env) {uint32_t ret;
@@ -320,7 +320,7 @@ static inline uint32_t get_V_sub_xcc(target_ulong dst, target_ulong src1,return ret; } -static uint32_t compute_all_sub_xcc (CPUState *env) +static uint32_t compute_all_sub_xcc (CPUSPARCState *env) {uint32_t ret;
@@ -330,13 +330,13 @@ static uint32_t compute_all_sub_xcc(CPUState *env) return ret; } -static uint32_t compute_C_sub_xcc (CPUState *env) +static uint32_t compute_C_sub_xcc (CPUSPARCState *env) {return get_C_sub_xcc (CC_SRC ,CC_SRC2 ); }#endif -static uint32_t compute_all_sub (CPUState *env) +static uint32_t compute_all_sub (CPUSPARCState *env) {uint32_t ret;
@@ -346,13 +346,13 @@ static uint32_t compute_all_sub(CPUState *env)return ret; } -static uint32_t compute_C_sub (CPUState *env) +static uint32_t compute_C_sub (CPUSPARCState *env) {return get_C_sub_icc (CC_SRC ,CC_SRC2 ); }#ifdef TARGET_SPARC64 -static uint32_t compute_all_subx_xcc (CPUState *env) +static uint32_t compute_all_subx_xcc (CPUSPARCState *env) {uint32_t ret;
@@ -362,7 +362,7 @@ static uint32_t compute_all_subx_xcc(CPUState *env)return ret; } -static uint32_t compute_C_subx_xcc (CPUState *env) +static uint32_t compute_C_subx_xcc (CPUSPARCState *env) {uint32_t ret;
@@ -371,7 +371,7 @@ static uint32_t compute_C_subx_xcc(CPUState *env) }#endif -static uint32_t compute_all_subx (CPUState *env) +static uint32_t compute_all_subx (CPUSPARCState *env) {uint32_t ret;
@@ -381,7 +381,7 @@ static uint32_t compute_all_subx(CPUState *env)return ret; } -static uint32_t compute_C_subx (CPUState *env) +static uint32_t compute_C_subx (CPUSPARCState *env) {uint32_t ret;
@@ -389,7 +389,7 @@ static uint32_t compute_C_subx(CPUState *env)return ret; } -static uint32_t compute_all_tsub (CPUState *env) +static uint32_t compute_all_tsub (CPUSPARCState *env) {uint32_t ret;
@@ -400,7 +400,7 @@ static uint32_t compute_all_tsub(CPUState *env)return ret; } -static uint32_t compute_all_tsubtv (CPUState *env) +static uint32_t compute_all_tsubtv (CPUSPARCState *env) {uint32_t ret;
@@ -409,26 +409,26 @@ static uint32_t compute_all_tsubtv(CPUState *env)return ret; } -static uint32_t compute_all_logic (CPUState *env) +static uint32_t compute_all_logic (CPUSPARCState *env) {return get_NZ_icc (CC_DST ); } -static uint32_t compute_C_logic (CPUState *env) +static uint32_t compute_C_logic (CPUSPARCState *env) {return 0 ; }#ifdef TARGET_SPARC64 -static uint32_t compute_all_logic_xcc (CPUState *env) +static uint32_t compute_all_logic_xcc (CPUSPARCState *env) {return get_NZ_xcc (CC_DST ); }#endif typedef struct CCTable { -uint32_t (*compute_all)(CPUState *env);/* return all the flags */ -uint32_t (*compute_c)(CPUState *env);/* return the C flag */ +uint32_t (*compute_all)(CPUSPARCState *env);/* return all the flags */ +uint32_t (*compute_c)(CPUSPARCState *env);/* return the C flag */ }CCTable ;static const CCTable icc_table[CC_OP_NB ] = {
@@ -463,7 +463,7 @@ static const CCTable xcc_table[CC_OP_NB] = { };#endif -void helper_compute_psr (CPUState *env) +void helper_compute_psr (CPUSPARCState *env) {uint32_t new_psr;
@@ -476,7 +476,7 @@ void helper_compute_psr(CPUState *env)CC_OP =CC_OP_FLAGS ; } -uint32_t helper_compute_C_icc (CPUState *env) +uint32_t helper_compute_C_icc (CPUSPARCState *env) {uint32_t ret;
target-sparc/cpu.h +28 -28
148 lines not on this page · raw message
target-sparc/cpu_init.c +1 -1
@@ -780,7 +780,7 @@ static void cpu_print_cc(FILE *f, fprintf_function cpu_fprintf,#define REGS_PER_LINE 8#endif -void cpu_dump_state (CPUState *env,FILE *f,fprintf_function cpu_fprintf, +void cpu_dump_state (CPUSPARCState *env,FILE *f,fprintf_function cpu_fprintf,int flags) {int i, x;
target-sparc/fop_helper.c +34 -34
264 lines not on this page · raw message
target-sparc/helper.c +8 -8
@@ -22,13 +22,13 @@#include "helper.h" #include "sysemu.h" -void helper_raise_exception (CPUState *env,int tt) +void helper_raise_exception (CPUSPARCState *env,int tt) { env->exception_index = tt;cpu_loop_exit (env); } -void helper_debug (CPUState *env) +void helper_debug (CPUSPARCState *env) { env->exception_index =EXCP_DEBUG ;cpu_loop_exit (env);
@@ -64,7 +64,7 @@ void helper_tick_set_limit(void *opaque, uint64_t limit) }#endif -static target_ulong helper_udiv_common (CPUState *env,target_ulong a, +static target_ulong helper_udiv_common (CPUSPARCState *env,target_ulong a,target_ulong b,int cc) {int overflow =0 ;
@@ -92,17 +92,17 @@ static target_ulong helper_udiv_common(CPUState *env, target_ulong a,return x0; } -target_ulong helper_udiv (CPUState *env,target_ulong a,target_ulong b) +target_ulong helper_udiv (CPUSPARCState *env,target_ulong a,target_ulong b) {return helper_udiv_common (env, a, b,0 ); } -target_ulong helper_udiv_cc (CPUState *env,target_ulong a,target_ulong b) +target_ulong helper_udiv_cc (CPUSPARCState *env,target_ulong a,target_ulong b) {return helper_udiv_common (env, a, b,1 ); } -static target_ulong helper_sdiv_common (CPUState *env,target_ulong a, +static target_ulong helper_sdiv_common (CPUSPARCState *env,target_ulong a,target_ulong b,int cc) {int overflow =0 ;
@@ -130,12 +130,12 @@ static target_ulong helper_sdiv_common(CPUState *env, target_ulong a,return x0; } -target_ulong helper_sdiv (CPUState *env,target_ulong a,target_ulong b) +target_ulong helper_sdiv (CPUSPARCState *env,target_ulong a,target_ulong b) {return helper_sdiv_common (env, a, b,0 ); } -target_ulong helper_sdiv_cc (CPUState *env,target_ulong a,target_ulong b) +target_ulong helper_sdiv_cc (CPUSPARCState *env,target_ulong a,target_ulong b) {return helper_sdiv_common (env, a, b,1 ); }
target-sparc/int32_helper.c +3 -3
@@ -58,7 +58,7 @@ static const char * const excp_names[0x80] = { };#endif -void do_interrupt (CPUState *env) +void do_interrupt (CPUSPARCState *env) {int cwp, intno = env->exception_index;
@@ -132,7 +132,7 @@ void do_interrupt(CPUState *env) }#if !defined(CONFIG_USER_ONLY ) -static void leon3_cache_control_int (CPUState *env) +static void leon3_cache_control_int (CPUSPARCState *env) {uint32_t state =0 ;
@@ -161,7 +161,7 @@ static void leon3_cache_control_int(CPUState *env) } } -void leon3_irq_manager (CPUState *env,void *irq_manager,int intno) +void leon3_irq_manager (CPUSPARCState *env,void *irq_manager,int intno) {leon3_irq_ack (irq_manager, intno);leon3_cache_control_int (env);
target-sparc/int64_helper.c +6 -6
@@ -59,7 +59,7 @@ static const char * const excp_names[0x80] = { };#endif -void do_interrupt (CPUState *env) +void do_interrupt (CPUSPARCState *env) {int intno = env->exception_index;trap_state *tsptr;
@@ -160,12 +160,12 @@ void do_interrupt(CPUState *env) env->exception_index =-1 ; } -trap_state *cpu_tsptr (CPUState * env) +trap_state *cpu_tsptr (CPUSPARCState * env) {return &env->ts[env->tl &MAXTL_MASK ]; } -static bool do_modify_softint (CPUState *env,uint32_t value) +static bool do_modify_softint (CPUSPARCState *env,uint32_t value) {if (env->softint != value) { env->softint = value;
@@ -179,21 +179,21 @@ static bool do_modify_softint(CPUState *env, uint32_t value)return false; } -void helper_set_softint (CPUState *env,uint64_t value) +void helper_set_softint (CPUSPARCState *env,uint64_t value) {if (do_modify_softint (env, env->softint | (uint32_t )value)) {trace_int_helper_set_softint (env->softint); } } -void helper_clear_softint (CPUState *env,uint64_t value) +void helper_clear_softint (CPUSPARCState *env,uint64_t value) {if (do_modify_softint (env, env->softint & (uint32_t )~value)) {trace_int_helper_clear_softint (env->softint); } } -void helper_write_softint (CPUState *env,uint64_t value) +void helper_write_softint (CPUSPARCState *env,uint64_t value) {if (do_modify_softint (env, (uint32_t )value)) {trace_int_helper_write_softint (env->softint);
target-sparc/ldst_helper.c +8 -8
@@ -129,7 +129,7 @@ static uint64_t ultrasparc_tag_target(uint64_t tag_access_register)static void replace_tlb_entry (SparcTLBEntry *tlb,uint64_t tlb_tag,uint64_t tlb_tte, -CPUState *env1) +CPUSPARCState *env1) {target_ulong mask, size, va, offset;
@@ -152,7 +152,7 @@ static void replace_tlb_entry(SparcTLBEntry *tlb, }static void demap_tlb (SparcTLBEntry *tlb,target_ulong demap_addr, -const char *strmmu,CPUState *env1) +const char *strmmu,CPUSPARCState *env1) {unsigned int i;target_ulong mask;
@@ -213,7 +213,7 @@ static void demap_tlb(SparcTLBEntry *tlb, target_ulong demap_addr,static void replace_tlb_1bit_lru (SparcTLBEntry *tlb,uint64_t tlb_tag,uint64_t tlb_tte, -const char *strmmu,CPUState *env1) +const char *strmmu,CPUSPARCState *env1) {unsigned int i, replace_used;
@@ -263,7 +263,7 @@ static void replace_tlb_1bit_lru(SparcTLBEntry *tlb,#endif -static inline target_ulong address_mask (CPUState *env1,target_ulong addr) +static inline target_ulong address_mask (CPUSPARCState *env1,target_ulong addr) {#ifdef TARGET_SPARC64 if (AM_CHECK (env1)) {
@@ -300,7 +300,7 @@ static inline int is_translating_asi(int asi)#endif } -static inline target_ulong asi_address_mask (CPUState *env1, +static inline target_ulong asi_address_mask (CPUSPARCState *env1,int asi,target_ulong addr) {if (is_translating_asi (asi)) {
@@ -323,7 +323,7 @@ void helper_check_align(target_ulong addr, uint32_t align)#if !defined(TARGET_SPARC64 ) && !defined(CONFIG_USER_ONLY ) && \ defined(DEBUG_MXCC ) -static void dump_mxcc (CPUState *env) +static void dump_mxcc (CPUSPARCState *env) { printf("mxccdata: %016" PRIx64 " %016" PRIx64 " %016" PRIx64 " %016" PRIx64 "\n",
@@ -2358,10 +2358,10 @@ static void do_unassigned_access(target_phys_addr_t addr, int is_write,#endif #if !defined(CONFIG_USER_ONLY ) -void cpu_unassigned_access (CPUState *env1,target_phys_addr_t addr, +void cpu_unassigned_access (CPUSPARCState *env1,target_phys_addr_t addr,int is_write,int is_exec,int is_asi,int size) { -CPUState *saved_env; +CPUSPARCState *saved_env; saved_env = env; env = env1;
target-sparc/machine.c +2 -2
@@ -6,7 +6,7 @@void cpu_save (QEMUFile *f,void *opaque) { -CPUState *env = opaque; +CPUSPARCState *env = opaque;int i;uint32_t tmp;
@@ -111,7 +111,7 @@ void cpu_save(QEMUFile *f, void *opaque)int cpu_load (QEMUFile *f,void *opaque,int version_id) { -CPUState *env = opaque; +CPUSPARCState *env = opaque;int i;uint32_t tmp;
target-sparc/mmu_helper.c +14 -14
@@ -25,7 +25,7 @@#if defined(CONFIG_USER_ONLY ) -int cpu_sparc_handle_mmu_fault (CPUState *env1,target_ulong address,int rw, +int cpu_sparc_handle_mmu_fault (CPUSPARCState *env1,target_ulong address,int rw,int mmu_idx) {if (rw &2 ) {
@@ -76,7 +76,7 @@ static const int perm_table[2][8] = { } }; -static int get_physical_address (CPUState *env,target_phys_addr_t *physical, +static int get_physical_address (CPUSPARCState *env,target_phys_addr_t *physical,int *prot,int *access_index,target_ulong address,int rw,int mmu_idx,target_ulong *page_size)
@@ -198,7 +198,7 @@ static int get_physical_address(CPUState *env, target_phys_addr_t *physical, }/* Perform address translation */ -int cpu_sparc_handle_mmu_fault (CPUState *env,target_ulong address,int rw, +int cpu_sparc_handle_mmu_fault (CPUSPARCState *env,target_ulong address,int rw,int mmu_idx) {target_phys_addr_t paddr;
@@ -244,7 +244,7 @@ int cpu_sparc_handle_mmu_fault(CPUState *env, target_ulong address, int rw, } } -target_ulong mmu_probe (CPUState *env,target_ulong address,int mmulev) +target_ulong mmu_probe (CPUSPARCState *env,target_ulong address,int mmulev) {target_phys_addr_t pde_ptr;uint32_t pde;
@@ -310,7 +310,7 @@ target_ulong mmu_probe(CPUState *env, target_ulong address, int mmulev)return 0 ; } -void dump_mmu (FILE *f,fprintf_function cpu_fprintf,CPUState *env) +void dump_mmu (FILE *f,fprintf_function cpu_fprintf,CPUSPARCState *env) {target_ulong va, va1, va2;unsigned int n, m, o;
@@ -354,7 +354,7 @@ void dump_mmu(FILE *f, fprintf_function cpu_fprintf, CPUState *env)* reads (and only reads) in stack frames as if windows were flushed. We assume * that the sparc ABI is followed. */ -int target_memory_rw_debug (CPUState *env,target_ulong addr, +int target_memory_rw_debug (CPUSPARCState *env,target_ulong addr,uint8_t *buf,int len,int is_write) {int i;
@@ -479,7 +479,7 @@ static inline int ultrasparc_tag_match(SparcTLBEntry *tlb,return 0 ; } -static int get_physical_address_data (CPUState *env, +static int get_physical_address_data (CPUSPARCState *env,target_phys_addr_t *physical,int *prot,target_ulong address,int rw,int mmu_idx) {
@@ -598,7 +598,7 @@ static int get_physical_address_data(CPUState *env,return 1 ; } -static int get_physical_address_code (CPUState *env, +static int get_physical_address_code (CPUSPARCState *env,target_phys_addr_t *physical,int *prot,target_ulong address,int mmu_idx) {
@@ -667,7 +667,7 @@ static int get_physical_address_code(CPUState *env,return 1 ; } -static int get_physical_address (CPUState *env,target_phys_addr_t *physical, +static int get_physical_address (CPUSPARCState *env,target_phys_addr_t *physical,int *prot,int *access_index,target_ulong address,int rw,int mmu_idx,target_ulong *page_size)
@@ -701,7 +701,7 @@ static int get_physical_address(CPUState *env, target_phys_addr_t *physical, }/* Perform address translation */ -int cpu_sparc_handle_mmu_fault (CPUState *env,target_ulong address,int rw, +int cpu_sparc_handle_mmu_fault (CPUSPARCState *env,target_ulong address,int rw,int mmu_idx) {target_ulong virt_addr, vaddr;
@@ -727,7 +727,7 @@ int cpu_sparc_handle_mmu_fault(CPUState *env, target_ulong address, int rw,return 1 ; } -void dump_mmu (FILE *f,fprintf_function cpu_fprintf,CPUState *env) +void dump_mmu (FILE *f,fprintf_function cpu_fprintf,CPUSPARCState *env) {unsigned int i;const char *mask;
@@ -813,7 +813,7 @@ void dump_mmu(FILE *f, fprintf_function cpu_fprintf, CPUState *env)#endif /* TARGET_SPARC64 */ -static int cpu_sparc_get_phys_page (CPUState *env,target_phys_addr_t *phys, +static int cpu_sparc_get_phys_page (CPUSPARCState *env,target_phys_addr_t *phys,target_ulong addr,int rw,int mmu_idx) {target_ulong page_size;
@@ -824,7 +824,7 @@ static int cpu_sparc_get_phys_page(CPUState *env, target_phys_addr_t *phys, }#if defined(TARGET_SPARC64 ) -target_phys_addr_t cpu_get_phys_page_nofault (CPUState *env,target_ulong addr, +target_phys_addr_t cpu_get_phys_page_nofault (CPUSPARCState *env,target_ulong addr,int mmu_idx) {target_phys_addr_t phys_addr;
@@ -836,7 +836,7 @@ target_phys_addr_t cpu_get_phys_page_nofault(CPUState *env, target_ulong addr, }#endif -target_phys_addr_t cpu_get_phys_page_debug (CPUState *env,target_ulong addr) +target_phys_addr_t cpu_get_phys_page_debug (CPUSPARCState *env,target_ulong addr) {target_phys_addr_t phys_addr;int mmu_idx =cpu_mmu_index (env);
target-sparc/op_helper.c +2 -2
@@ -54,11 +54,11 @@ static void do_unaligned_access(target_ulong addr, int is_write, int is_user,NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */ /* XXX: fix it to restore all registers */ -void tlb_fill (CPUState *env1,target_ulong addr,int is_write,int mmu_idx, +void tlb_fill (CPUSPARCState *env1,target_ulong addr,int is_write,int mmu_idx,void *retaddr) {int ret; -CPUState *saved_env; +CPUSPARCState *saved_env; saved_env = env; env = env1;
target-sparc/translate.c +40 -40
198 lines not on this page · raw message
target-sparc/win_helper.c +29 -29
224 lines not on this page · raw message
Signature · 1 line
1.7.7
RFC PATCH v4 38/44 ppc hw/: Don't use CPUState
In reply to Andreas FärberScripted conversion:
for file in hw/ppc*.[hc] hw/mpc8544_guts.c hw/spapr*.[hc] hw/virtex_ml507.c hw/xics.c; do
sed -i "s/CPUState/CPUPPCState/g" $file
done
--- hw/mpc8544_guts.c | 2 +- hw/ppc.c | 110 ++++++++++++++++++++++++------------------------ hw/ppc.h | 28 ++++++------ hw/ppc405.h | 8 ++-- hw/ppc405_uc.c | 34 +++++++------- hw/ppc440_bamboo.c | 6 +- hw/ppc4xx.h | 8 ++-- hw/ppc4xx_devs.c | 10 ++-- hw/ppc_booke.c | 20 ++++---- hw/ppc_newworld.c | 4 +- hw/ppc_oldworld.c | 4 +- hw/ppc_prep.c | 6 +- hw/ppce500_mpc8544ds.c | 12 +++--- hw/ppce500_spin.c | 8 ++-- hw/spapr.c | 10 ++-- hw/spapr.h | 4 +- hw/spapr_hcall.c | 42 +++++++++--------- hw/spapr_llan.c | 10 ++-- hw/spapr_rtas.c | 4 +- hw/spapr_vio.c | 12 +++--- hw/spapr_vty.c | 4 +- hw/virtex_ml507.c | 10 ++-- hw/xics.c | 10 ++-- 23 files changed, 183 insertions(+), 183 deletions(-)
hw/mpc8544_guts.c +1 -1
@@ -62,7 +62,7 @@ static uint64_t mpc8544_guts_read(void *opaque, target_phys_addr_t addr, unsigned size) {uint32_t value =0 ; -CPUState *env = cpu_single_env; +CPUPPCState *env = cpu_single_env; addr &=MPC8544_GUTS_MMIO_SIZE -1 ;switch (addr) {
hw/ppc.c +55 -55
415 lines not on this page · raw message
hw/ppc.h +14 -14
@@ -1,4 +1,4 @@ -void ppc_set_irq (CPUState *env,int n_IRQ,int level); +void ppc_set_irq (CPUPPCState *env,int n_IRQ,int level);/* PowerPC hardware exceptions management helpers */ typedef void (*clk_setup_cb )(void *opaque,uint32_t freq);
@@ -43,32 +43,32 @@ struct ppc_tb_t {*/ uint64_t cpu_ppc_get_tb (ppc_tb_t *tb_env,uint64_t vmclk,int64_t tb_offset); -clk_setup_cb cpu_ppc_tb_init (CPUState *env,uint32_t freq); +clk_setup_cb cpu_ppc_tb_init (CPUPPCState *env,uint32_t freq);/* Embedded PowerPC DCR management */ typedef uint32_t (*dcr_read_cb )(void *opaque,int dcrn);typedef void (*dcr_write_cb )(void *opaque,int dcrn,uint32_t val); -int ppc_dcr_init (CPUState *env,int (*dcr_read_error)(int dcrn), +int ppc_dcr_init (CPUPPCState *env,int (*dcr_read_error)(int dcrn),int (*dcr_write_error)(int dcrn)); -int ppc_dcr_register (CPUState *env,int dcrn,void *opaque, +int ppc_dcr_register (CPUPPCState *env,int dcrn,void *opaque,dcr_read_cb drc_read,dcr_write_cb dcr_write); -clk_setup_cb ppc_40x_timers_init (CPUState *env,uint32_t freq, +clk_setup_cb ppc_40x_timers_init (CPUPPCState *env,uint32_t freq,unsigned int decr_excp);/* Embedded PowerPC reset */ -void ppc40x_core_reset (CPUState *env); -void ppc40x_chip_reset (CPUState *env); -void ppc40x_system_reset (CPUState *env); +void ppc40x_core_reset (CPUPPCState *env); +void ppc40x_chip_reset (CPUPPCState *env); +void ppc40x_system_reset (CPUPPCState *env);void PREP_debug_write (void *opaque,uint32_t addr,uint32_t val);extern CPUWriteMemoryFunc *const PPC_io_write[];extern CPUReadMemoryFunc *const PPC_io_read[];void PPC_debug_write (void *opaque,uint32_t addr,uint32_t val); -void ppc40x_irq_init (CPUState *env); -void ppce500_irq_init (CPUState *env); -void ppc6xx_irq_init (CPUState *env); -void ppc970_irq_init (CPUState *env); -void ppcPOWER7_irq_init (CPUState *env); +void ppc40x_irq_init (CPUPPCState *env); +void ppce500_irq_init (CPUPPCState *env); +void ppc6xx_irq_init (CPUPPCState *env); +void ppc970_irq_init (CPUPPCState *env); +void ppcPOWER7_irq_init (CPUPPCState *env);/* PPC machines for OpenBIOS */ enum {
@@ -89,4 +89,4 @@ enum {#define PPC_SERIAL_MM_BAUDBASE 399193/* ppc_booke.c */ -void ppc_booke_timers_init (CPUState *env,uint32_t freq,uint32_t flags); +void ppc_booke_timers_init (CPUPPCState *env,uint32_t freq,uint32_t flags);
hw/ppc405.h +4 -4
@@ -56,23 +56,23 @@ struct ppc4xx_bd_info_t { };/* PowerPC 405 core */ -ram_addr_t ppc405_set_bootinfo (CPUState *env,ppc4xx_bd_info_t *bd, +ram_addr_t ppc405_set_bootinfo (CPUPPCState *env,ppc4xx_bd_info_t *bd,uint32_t flags); -CPUState *ppc405cr_init (MemoryRegion *address_space_mem, +CPUPPCState *ppc405cr_init (MemoryRegion *address_space_mem,MemoryRegion ram_memories[4 ],target_phys_addr_t ram_bases[4 ],target_phys_addr_t ram_sizes[4 ],uint32_t sysclk,qemu_irq **picp,int do_init); -CPUState *ppc405ep_init (MemoryRegion *address_space_mem, +CPUPPCState *ppc405ep_init (MemoryRegion *address_space_mem,MemoryRegion ram_memories[2 ],target_phys_addr_t ram_bases[2 ],target_phys_addr_t ram_sizes[2 ],uint32_t sysclk,qemu_irq **picp,int do_init);/* IBM STBxxx microcontrollers */ -CPUState *ppc_stb025_init (MemoryRegion ram_memories[2], +CPUPPCState *ppc_stb025_init (MemoryRegion ram_memories[2], target_phys_addr_t ram_bases[2], target_phys_addr_t ram_sizes[2], uint32_t sysclk, qemu_irq **picp,
hw/ppc405_uc.c +17 -17
@@ -41,7 +41,7 @@#define DEBUG_CLOCKS //#define DEBUG_CLOCKS_LL -ram_addr_t ppc405_set_bootinfo (CPUState *env,ppc4xx_bd_info_t *bd, +ram_addr_t ppc405_set_bootinfo (CPUPPCState *env,ppc4xx_bd_info_t *bd,uint32_t flags) {ram_addr_t bdloc;
@@ -169,7 +169,7 @@ static void ppc4xx_plb_reset (void *opaque) plb->besr =0x00000000 ; } -static void ppc4xx_plb_init (CPUState *env) +static void ppc4xx_plb_init (CPUPPCState *env) {ppc4xx_plb_t *plb;
@@ -245,7 +245,7 @@ static void ppc4xx_pob_reset (void *opaque) pob->besr[1 ] =0x0000000 ; } -static void ppc4xx_pob_init (CPUState *env) +static void ppc4xx_pob_init (CPUPPCState *env) {ppc4xx_pob_t *pob;
@@ -574,7 +574,7 @@ static void ebc_reset (void *opaque) ebc->cfg =0x80400000 ; } -static void ppc405_ebc_init (CPUState *env) +static void ppc405_ebc_init (CPUPPCState *env) {ppc4xx_ebc_t *ebc;
@@ -657,7 +657,7 @@ static void ppc405_dma_reset (void *opaque) dma->pol =0x00000000 ; } -static void ppc405_dma_init (CPUState *env,qemu_irq irqs[4 ]) +static void ppc405_dma_init (CPUPPCState *env,qemu_irq irqs[4 ]) {ppc405_dma_t *dma;
@@ -960,7 +960,7 @@ static void ocm_reset (void *opaque) ocm->dsacntl = dsacntl; } -static void ppc405_ocm_init (CPUState *env) +static void ppc405_ocm_init (CPUPPCState *env) {ppc405_ocm_t *ocm;
@@ -1713,7 +1713,7 @@ static void ppc40x_mal_reset (void *opaque) mal->txeobisr =0x00000000 ; } -static void ppc405_mal_init (CPUState *env,qemu_irq irqs[4 ]) +static void ppc405_mal_init (CPUPPCState *env,qemu_irq irqs[4 ]) {ppc40x_mal_t *mal;int i;
@@ -1764,7 +1764,7 @@ static void ppc405_mal_init(CPUState *env, qemu_irq irqs[4])/*****************************************************************************/ /* SPR */ -void ppc40x_core_reset (CPUState *env) +void ppc40x_core_reset (CPUPPCState *env) {target_ulong dbsr;
@@ -1776,7 +1776,7 @@ void ppc40x_core_reset (CPUState *env) env->spr[SPR_40x_DBSR] = dbsr; } -void ppc40x_chip_reset (CPUState *env) +void ppc40x_chip_reset (CPUPPCState *env) {target_ulong dbsr;
@@ -1789,13 +1789,13 @@ void ppc40x_chip_reset (CPUState *env) env->spr[SPR_40x_DBSR] = dbsr; } -void ppc40x_system_reset (CPUState *env) +void ppc40x_system_reset (CPUPPCState *env) {printf ("Reset PowerPC system\n" );qemu_system_reset_request (); } -void store_40x_dbcr0 (CPUState *env,uint32_t val) +void store_40x_dbcr0 (CPUPPCState *env,uint32_t val) {switch ((val >>28 ) &0x3 ) {case 0x0 :
@@ -2066,7 +2066,7 @@ static void ppc405cr_clk_init (ppc405cr_cpc_t *cpc) cpc->psr |=D <<17 ; } -static void ppc405cr_cpc_init (CPUState *env,clk_setup_t clk_setup[7 ], +static void ppc405cr_cpc_init (CPUPPCState *env,clk_setup_t clk_setup[7 ],uint32_t sysclk) {ppc405cr_cpc_t *cpc;
@@ -2096,7 +2096,7 @@ static void ppc405cr_cpc_init (CPUState *env, clk_setup_t clk_setup[7],qemu_register_reset (ppc405cr_cpc_reset, cpc); } -CPUState *ppc405cr_init(MemoryRegion *address_space_mem, +CPUPPCState *ppc405cr_init(MemoryRegion *address_space_mem, MemoryRegion ram_memories[4], target_phys_addr_t ram_bases[4], target_phys_addr_t ram_sizes[4],
@@ -2105,7 +2105,7 @@ CPUState *ppc405cr_init(MemoryRegion *address_space_mem, {clk_setup_t clk_setup[PPC405CR_CLK_NB ];qemu_irq dma_irqs[4 ]; -CPUState *env; +CPUPPCState *env;qemu_irq *pic, *irqs;memset (clk_setup,0 ,sizeof (clk_setup));
@@ -2408,7 +2408,7 @@ static void ppc405ep_cpc_reset (void *opaque) }/* XXX: sysclk should be between 25 and 100 MHz */ -static void ppc405ep_cpc_init (CPUState *env,clk_setup_t clk_setup[8 ], +static void ppc405ep_cpc_init (CPUPPCState *env,clk_setup_t clk_setup[8 ],uint32_t sysclk) {ppc405ep_cpc_t *cpc;
@@ -2445,7 +2445,7 @@ static void ppc405ep_cpc_init (CPUState *env, clk_setup_t clk_setup[8],#endif } -CPUState *ppc405ep_init(MemoryRegion *address_space_mem, +CPUPPCState *ppc405ep_init(MemoryRegion *address_space_mem, MemoryRegion ram_memories[2], target_phys_addr_t ram_bases[2], target_phys_addr_t ram_sizes[2],
@@ -2454,7 +2454,7 @@ CPUState *ppc405ep_init(MemoryRegion *address_space_mem, {clk_setup_t clk_setup[PPC405EP_CLK_NB ], tlb_clk_setup;qemu_irq dma_irqs[4 ], gpt_irqs[5 ], mal_irqs[4 ]; -CPUState *env; +CPUPPCState *env;qemu_irq *pic, *irqs;memset (clk_setup,0 ,sizeof (clk_setup));
hw/ppc440_bamboo.c +3 -3
@@ -121,7 +121,7 @@ out: }/* Create reset TLB entries for BookE, spanning the 32bit addr space. */ -static void mmubooke_create_initial_mapping (CPUState *env, +static void mmubooke_create_initial_mapping (CPUPPCState *env,target_ulong va,target_phys_addr_t pa) {
@@ -145,7 +145,7 @@ static void mmubooke_create_initial_mapping(CPUState *env,static void main_cpu_reset (void *opaque) { -CPUState *env = opaque; +CPUPPCState *env = opaque;cpu_state_reset (env); env->gpr[1 ] = (16 <<20 ) -8 ;
@@ -172,7 +172,7 @@ static void bamboo_init(ram_addr_t ram_size,qemu_irq *pic;qemu_irq *irqs;PCIBus *pcibus; -CPUState *env; +CPUPPCState *env;uint64_t elf_entry;uint64_t elf_lowaddr;target_phys_addr_t loadaddr =0 ;
hw/ppc4xx.h +4 -4
@@ -28,7 +28,7 @@#include "pci.h" /* PowerPC 4xx core initialization */ -CPUState *ppc4xx_init (const char *cpu_model, +CPUPPCState *ppc4xx_init (const char *cpu_model,clk_setup_t *cpu_clk,clk_setup_t *tb_clk,uint32_t sysclk);
@@ -38,7 +38,7 @@ enum {PPCUIC_OUTPUT_CINT =1 , PPCUIC_OUTPUT_NB, }; -qemu_irq *ppcuic_init (CPUState *env,qemu_irq *irqs, +qemu_irq *ppcuic_init (CPUPPCState *env,qemu_irq *irqs,uint32_t dcr_base,int has_ssr,int has_vr); ram_addr_t ppc4xx_sdram_adjust(ram_addr_t ram_size, int nr_banks,
@@ -47,13 +47,13 @@ ram_addr_t ppc4xx_sdram_adjust(ram_addr_t ram_size, int nr_banks,target_phys_addr_t ram_sizes[], const unsigned int sdram_bank_sizes[]); -void ppc4xx_sdram_init (CPUState *env,qemu_irq irq,int nbanks, +void ppc4xx_sdram_init (CPUPPCState *env,qemu_irq irq,int nbanks,MemoryRegion ram_memories[],target_phys_addr_t *ram_bases,target_phys_addr_t *ram_sizes,int do_init); -PCIBus *ppc4xx_pci_init(CPUState *env, qemu_irq pci_irqs[4], +PCIBus *ppc4xx_pci_init(CPUPPCState *env, qemu_irq pci_irqs[4], target_phys_addr_t config_space, target_phys_addr_t int_ack, target_phys_addr_t special_cycle,
hw/ppc4xx_devs.c +5 -5
@@ -40,18 +40,18 @@static void ppc4xx_reset (void *opaque) { -CPUState *env = opaque; +CPUPPCState *env = opaque;cpu_state_reset (env); }/*****************************************************************************/ /* Generic PowerPC 4xx processor instantiation */ -CPUState *ppc4xx_init (const char *cpu_model, +CPUPPCState *ppc4xx_init (const char *cpu_model,clk_setup_t *cpu_clk,clk_setup_t *tb_clk,uint32_t sysclk) { -CPUState *env; +CPUPPCState *env;/* init CPUs */ env =cpu_init (cpu_model);
@@ -295,7 +295,7 @@ static void ppcuic_reset (void *opaque) } } -qemu_irq *ppcuic_init (CPUState *env,qemu_irq *irqs, +qemu_irq *ppcuic_init (CPUPPCState *env,qemu_irq *irqs,uint32_t dcr_base,int has_ssr,int has_vr) {ppcuic_t *uic;
@@ -641,7 +641,7 @@ static void sdram_reset (void *opaque) sdram->cfg =0x00800000 ; } -void ppc4xx_sdram_init (CPUState *env, qemu_irq irq, int nbanks, +void ppc4xx_sdram_init (CPUPPCState *env, qemu_irq irq, int nbanks, MemoryRegion *ram_memories, target_phys_addr_t *ram_bases, target_phys_addr_t *ram_sizes,
hw/ppc_booke.c +10 -10
@@ -71,7 +71,7 @@ struct booke_timer_t {uint32_t flags; }; -static void booke_update_irq (CPUState *env) +static void booke_update_irq (CPUPPCState *env) { ppc_set_irq(env, PPC_INTERRUPT_DECR, (env->spr[SPR_BOOKE_TSR] & TSR_DIS
@@ -88,7 +88,7 @@ static void booke_update_irq(CPUState *env)/* Return the location of the bit of time base at which the FIT will raise an interrupt */ -static uint8_t booke_get_fit_target (CPUState *env,ppc_tb_t *tb_env) +static uint8_t booke_get_fit_target (CPUPPCState *env,ppc_tb_t *tb_env) {uint8_t fp = (env->spr[SPR_BOOKE_TCR ] &TCR_FP_MASK ) >>TCR_FP_SHIFT ;
@@ -106,7 +106,7 @@ static uint8_t booke_get_fit_target(CPUState *env, ppc_tb_t *tb_env)/* Return the location of the bit of time base at which the WDT will raise an interrupt */ -static uint8_t booke_get_wdt_target (CPUState *env,ppc_tb_t *tb_env) +static uint8_t booke_get_wdt_target (CPUPPCState *env,ppc_tb_t *tb_env) {uint8_t wp = (env->spr[SPR_BOOKE_TCR ] &TCR_WP_MASK ) >>TCR_WP_SHIFT ;
@@ -122,7 +122,7 @@ static uint8_t booke_get_wdt_target(CPUState *env, ppc_tb_t *tb_env)return wp; } -static void booke_update_fixed_timer (CPUState *env, +static void booke_update_fixed_timer (CPUPPCState *env,uint8_t target_bit,uint64_t *next,struct QEMUTimer *timer)
@@ -153,7 +153,7 @@ static void booke_update_fixed_timer(CPUState *env,static void booke_decr_cb (void *opaque) { -CPUState *env = opaque; +CPUPPCState *env = opaque; env->spr[SPR_BOOKE_TSR ] |=TSR_DIS ;booke_update_irq (env);
@@ -166,7 +166,7 @@ static void booke_decr_cb(void *opaque)static void booke_fit_cb (void *opaque) { -CPUState *env; +CPUPPCState *env;ppc_tb_t *tb_env;booke_timer_t *booke_timer;
@@ -185,7 +185,7 @@ static void booke_fit_cb(void *opaque)static void booke_wdt_cb (void *opaque) { -CPUState *env; +CPUPPCState *env;ppc_tb_t *tb_env;booke_timer_t *booke_timer;
@@ -203,13 +203,13 @@ static void booke_wdt_cb(void *opaque) booke_timer->wdt_timer); } -void store_booke_tsr (CPUState *env,target_ulong val) +void store_booke_tsr (CPUPPCState *env,target_ulong val) { env->spr[SPR_BOOKE_TSR ] &= ~val;booke_update_irq (env); } -void store_booke_tcr (CPUState *env,target_ulong val) +void store_booke_tcr (CPUPPCState *env,target_ulong val) {ppc_tb_t *tb_env = env->tb_env;booke_timer_t *booke_timer = tb_env->opaque;
@@ -231,7 +231,7 @@ void store_booke_tcr(CPUState *env, target_ulong val) } -void ppc_booke_timers_init (CPUState *env,uint32_t freq,uint32_t flags) +void ppc_booke_timers_init (CPUPPCState *env,uint32_t freq,uint32_t flags) {ppc_tb_t *tb_env;booke_timer_t *booke_timer;
hw/ppc_newworld.c +2 -2
@@ -124,7 +124,7 @@ static target_phys_addr_t round_page(target_phys_addr_t addr)static void ppc_core99_reset (void *opaque) { -CPUState *env = opaque; +CPUPPCState *env = opaque;cpu_state_reset (env); }
@@ -137,7 +137,7 @@ static void ppc_core99_init (ram_addr_t ram_size,const char *initrd_filename, const char *cpu_model) { - CPUState *env = NULL; + CPUPPCState *env = NULL;char *filename;qemu_irq *pic, **openpic_irqs;MemoryRegion *unin_memory =g_new (MemoryRegion,1 );
hw/ppc_oldworld.c +2 -2
@@ -68,7 +68,7 @@ static target_phys_addr_t round_page(target_phys_addr_t addr)static void ppc_heathrow_reset (void *opaque) { -CPUState *env = opaque; +CPUPPCState *env = opaque;cpu_state_reset (env); }
@@ -81,7 +81,7 @@ static void ppc_heathrow_init (ram_addr_t ram_size, const char *cpu_model) {MemoryRegion *sysmem =get_system_memory (); -CPUState *env =NULL ; +CPUPPCState *env =NULL ;char *filename;qemu_irq *pic, **heathrow_irqs;int linux_boot, i;
hw/ppc_prep.c +3 -3
@@ -464,7 +464,7 @@ static const MemoryRegionOps PPC_prep_io_ops = {static void cpu_request_exit (void *opaque,int irq,int level) { -CPUState *env = cpu_single_env; +CPUPPCState *env = cpu_single_env;if (env && level) {cpu_exit (env);
@@ -473,7 +473,7 @@ static void cpu_request_exit(void *opaque, int irq, int level)static void ppc_prep_reset (void *opaque) { -CPUState *env = opaque; +CPUPPCState *env = opaque;cpu_state_reset (env); }
@@ -487,7 +487,7 @@ static void ppc_prep_init (ram_addr_t ram_size, const char *cpu_model) {MemoryRegion *sysmem =get_system_memory (); -CPUState *env =NULL ; +CPUPPCState *env =NULL ;char *filename;nvram_t nvram;M48t59State *m48t59;
hw/ppce500_mpc8544ds.c +6 -6
@@ -58,7 +58,7 @@ struct boot_infouint32_t entry; }; -static int mpc8544_load_device_tree(CPUState *env, +static int mpc8544_load_device_tree(CPUPPCState *env, target_phys_addr_t addr, uint32_t ramsize, target_phys_addr_t initrd_base,
@@ -178,7 +178,7 @@ static inline target_phys_addr_t booke206_page_size_to_tlb(uint64_t size)return ffs (size >>10 ) -1 ; } -static void mmubooke_create_initial_mapping (CPUState *env, +static void mmubooke_create_initial_mapping (CPUPPCState *env,target_ulong va,target_phys_addr_t pa) {
@@ -196,7 +196,7 @@ static void mmubooke_create_initial_mapping(CPUState *env,static void mpc8544ds_cpu_reset_sec (void *opaque) { -CPUState *env = opaque; +CPUPPCState *env = opaque;cpu_state_reset (env);
@@ -208,7 +208,7 @@ static void mpc8544ds_cpu_reset_sec(void *opaque)static void mpc8544ds_cpu_reset (void *opaque) { -CPUState *env = opaque; +CPUPPCState *env = opaque;struct boot_info *bi = env->load_info;cpu_state_reset (env);
@@ -231,7 +231,7 @@ static void mpc8544ds_init(ram_addr_t ram_size,MemoryRegion *address_space_mem =get_system_memory ();MemoryRegion *ram =g_new (MemoryRegion,1 );PCIBus *pci_bus; -CPUState *env =NULL ; +CPUPPCState *env =NULL ;uint64_t elf_entry;uint64_t elf_lowaddr;target_phys_addr_t entry=0 ;
@@ -244,7 +244,7 @@ static void mpc8544ds_init(ram_addr_t ram_size,unsigned int pci_irq_nrs[4 ] = {1 ,2 ,3 ,4 };qemu_irq **irqs, *mpic;DeviceState *dev; -CPUState *firstenv =NULL ; +CPUPPCState *firstenv =NULL ;/* Setup CPUs */ if (cpu_model ==NULL ) {
hw/ppce500_spin.c +4 -4
@@ -49,7 +49,7 @@ typedef struct spin_state { } SpinState;typedef struct spin_kick { -CPUState *env; +CPUPPCState *env;SpinInfo *spin; }SpinKick ;
@@ -73,7 +73,7 @@ static inline target_phys_addr_t booke206_page_size_to_tlb(uint64_t size)return (ffs (size >>10 ) -1 ) >>1 ; } -static void mmubooke_create_initial_mapping (CPUState *env, +static void mmubooke_create_initial_mapping (CPUPPCState *env,target_ulong va,target_phys_addr_t pa,target_phys_addr_t len)
@@ -91,7 +91,7 @@ static void mmubooke_create_initial_mapping(CPUState *env,static void spin_kick (void *data) {SpinKick *kick = data; -CPUState *env = kick->env; +CPUPPCState *env = kick->env;SpinInfo *curspin = kick->spin;target_phys_addr_t map_size =64 *1024 *1024 ;target_phys_addr_t map_start;
@@ -121,7 +121,7 @@ static void spin_write(void *opaque, target_phys_addr_t addr, uint64_t value, {SpinState *s = opaque;int env_idx = addr /sizeof (SpinInfo); -CPUState *env; +CPUPPCState *env;SpinInfo *curspin = &s->spin[env_idx];uint8_t *curspin_p = (uint8_t *)curspin;
hw/spapr.c +5 -5
@@ -110,7 +110,7 @@ qemu_irq spapr_allocate_irq(uint32_t hint, uint32_t *irq_num)static int spapr_set_associativity (void *fdt,sPAPREnvironment *spapr) {int ret =0 , offset; -CPUState *env; +CPUPPCState *env;char cpu_model[32 ];int smt =kvmppc_smt_threads ();
@@ -155,7 +155,7 @@ static void *spapr_create_fdt_skel(const char *cpu_model, long hash_shift) {void *fdt; -CPUState *env; +CPUPPCState *env;uint64_t mem_reg_property[2 ];uint32_t start_prop =cpu_to_be32 (initrd_base);uint32_t end_prop =cpu_to_be32 (initrd_base + initrd_size);
@@ -476,7 +476,7 @@ static uint64_t translate_kernel_address(void *opaque, uint64_t addr)return (addr &0x0fffffff ) +KERNEL_LOAD_ADDR ; } -static void emulate_spapr_hypercall (CPUState *env) +static void emulate_spapr_hypercall (CPUPPCState *env) { env->gpr[3 ] =spapr_hypercall (env, env->gpr[3 ], &env->gpr[4 ]); }
@@ -504,7 +504,7 @@ static void spapr_reset(void *opaque)static void spapr_cpu_reset (void *opaque) { -CPUState *env = opaque; +CPUPPCState *env = opaque;cpu_state_reset (env); }
@@ -517,7 +517,7 @@ static void ppc_spapr_init(ram_addr_t ram_size,const char *initrd_filename, const char *cpu_model) { - CPUState *env; + CPUPPCState *env;int i;MemoryRegion *sysmem =get_system_memory ();MemoryRegion *ram =g_new (MemoryRegion,1 );
hw/spapr.h +2 -2
@@ -278,12 +278,12 @@ extern sPAPREnvironment *spapr; do { } while (0)#endif -typedef target_ulong (*spapr_hcall_fn )(CPUState *env,sPAPREnvironment *spapr, +typedef target_ulong (*spapr_hcall_fn )(CPUPPCState *env,sPAPREnvironment *spapr,target_ulong opcode,target_ulong *args);void spapr_register_hypercall (target_ulong opcode,spapr_hcall_fn fn); -target_ulong spapr_hypercall (CPUState *env,target_ulong opcode, +target_ulong spapr_hypercall (CPUPPCState *env,target_ulong opcode,target_ulong *args);qemu_irq spapr_allocate_irq (uint32_t hint,uint32_t *irq_num);
hw/spapr_hcall.c +21 -21
167 lines not on this page · raw message
hw/spapr_llan.c +5 -5
@@ -254,7 +254,7 @@ static int check_bd(VIOsPAPRVLANDevice *dev, vlan_bd_t bd,return 0 ; } -static target_ulong h_register_logical_lan (CPUState *env, +static target_ulong h_register_logical_lan (CPUPPCState *env,sPAPREnvironment *spapr,target_ulong opcode,target_ulong *args)
@@ -320,7 +320,7 @@ static target_ulong h_register_logical_lan(CPUState *env, } -static target_ulong h_free_logical_lan (CPUState *env,sPAPREnvironment *spapr, +static target_ulong h_free_logical_lan (CPUPPCState *env,sPAPREnvironment *spapr,target_ulong opcode,target_ulong *args) {target_ulong reg = args[0 ];
@@ -343,7 +343,7 @@ static target_ulong h_free_logical_lan(CPUState *env, sPAPREnvironment *spapr,return H_SUCCESS ; } -static target_ulong h_add_logical_lan_buffer (CPUState *env, +static target_ulong h_add_logical_lan_buffer (CPUPPCState *env,sPAPREnvironment *spapr,target_ulong opcode,target_ulong *args)
@@ -392,7 +392,7 @@ static target_ulong h_add_logical_lan_buffer(CPUState *env,return H_SUCCESS ; } -static target_ulong h_send_logical_lan (CPUState *env,sPAPREnvironment *spapr, +static target_ulong h_send_logical_lan (CPUPPCState *env,sPAPREnvironment *spapr,target_ulong opcode,target_ulong *args) {target_ulong reg = args[0 ];
@@ -461,7 +461,7 @@ static target_ulong h_send_logical_lan(CPUState *env, sPAPREnvironment *spapr,return H_SUCCESS ; } -static target_ulong h_multicast_ctrl (CPUState *env,sPAPREnvironment *spapr, +static target_ulong h_multicast_ctrl (CPUPPCState *env,sPAPREnvironment *spapr,target_ulong opcode,target_ulong *args) {target_ulong reg = args[0 ];
hw/spapr_rtas.c +2 -2
@@ -118,7 +118,7 @@ static void rtas_query_cpu_stopped_state(sPAPREnvironment *spapr, uint32_t nret, target_ulong rets) {target_ulong id; -CPUState *env; +CPUPPCState *env;if (nargs !=1 || nret !=2 ) {rtas_st (rets,0 ,-3 );
@@ -151,7 +151,7 @@ static void rtas_start_cpu(sPAPREnvironment *spapr, uint32_t nret, target_ulong rets) {target_ulong id, start, r3; -CPUState *env; +CPUPPCState *env;if (nargs !=3 || nret !=1 ) {rtas_st (rets,0 ,-3 );
hw/spapr_vio.c +6 -6
@@ -194,7 +194,7 @@ static void rtce_init(VIOsPAPRDevice *dev) } } -static target_ulong h_put_tce (CPUState *env,sPAPREnvironment *spapr, +static target_ulong h_put_tce (CPUPPCState *env,sPAPREnvironment *spapr,target_ulong opcode,target_ulong *args) {target_ulong liobn = args[0 ];
@@ -405,7 +405,7 @@ uint64_t ldq_tce(VIOsPAPRDevice *dev, uint64_t taddr)/* * CRQ handling */ -static target_ulong h_reg_crq (CPUState *env,sPAPREnvironment *spapr, +static target_ulong h_reg_crq (CPUPPCState *env,sPAPREnvironment *spapr,target_ulong opcode,target_ulong *args) {target_ulong reg = args[0 ];
@@ -453,7 +453,7 @@ static target_ulong h_reg_crq(CPUState *env, sPAPREnvironment *spapr,return H_SUCCESS ; } -static target_ulong h_free_crq (CPUState *env,sPAPREnvironment *spapr, +static target_ulong h_free_crq (CPUPPCState *env,sPAPREnvironment *spapr,target_ulong opcode,target_ulong *args) {target_ulong reg = args[0 ];
@@ -474,7 +474,7 @@ static target_ulong h_free_crq(CPUState *env, sPAPREnvironment *spapr,return H_SUCCESS ; } -static target_ulong h_send_crq (CPUState *env,sPAPREnvironment *spapr, +static target_ulong h_send_crq (CPUPPCState *env,sPAPREnvironment *spapr,target_ulong opcode,target_ulong *args) {target_ulong reg = args[0 ];
@@ -498,7 +498,7 @@ static target_ulong h_send_crq(CPUState *env, sPAPREnvironment *spapr,return H_HARDWARE ; } -static target_ulong h_enable_crq (CPUState *env,sPAPREnvironment *spapr, +static target_ulong h_enable_crq (CPUPPCState *env,sPAPREnvironment *spapr,target_ulong opcode,target_ulong *args) {target_ulong reg = args[0 ];
@@ -680,7 +680,7 @@ static int spapr_vio_busdev_init(DeviceState *qdev)return pc->init (dev); } -static target_ulong h_vio_signal (CPUState *env,sPAPREnvironment *spapr, +static target_ulong h_vio_signal (CPUPPCState *env,sPAPREnvironment *spapr,target_ulong opcode,target_ulong *args) {
hw/spapr_vty.c +2 -2
@@ -72,7 +72,7 @@ static int spapr_vty_init(VIOsPAPRDevice *sdev)/* Forward declaration */ static VIOsPAPRDevice *vty_lookup (sPAPREnvironment *spapr,target_ulong reg); -static target_ulong h_put_term_char (CPUState *env,sPAPREnvironment *spapr, +static target_ulong h_put_term_char (CPUPPCState *env,sPAPREnvironment *spapr,target_ulong opcode,target_ulong *args) {target_ulong reg = args[0 ];
@@ -99,7 +99,7 @@ static target_ulong h_put_term_char(CPUState *env, sPAPREnvironment *spapr,return H_SUCCESS ; } -static target_ulong h_get_term_char (CPUState *env,sPAPREnvironment *spapr, +static target_ulong h_get_term_char (CPUPPCState *env,sPAPREnvironment *spapr,target_ulong opcode,target_ulong *args) {target_ulong reg = args[0 ];
hw/virtex_ml507.c +5 -5
@@ -56,7 +56,7 @@ static struct boot_info } boot_info;/* Create reset TLB entries for BookE, spanning the 32bit addr space. */ -static void mmubooke_create_initial_mapping (CPUState *env, +static void mmubooke_create_initial_mapping (CPUPPCState *env,target_ulong va,target_phys_addr_t pa) {
@@ -78,12 +78,12 @@ static void mmubooke_create_initial_mapping(CPUState *env, tlb->PID =0 ; } -static CPUState *ppc440_init_xilinx (ram_addr_t *ram_size, +static CPUPPCState *ppc440_init_xilinx (ram_addr_t *ram_size,int do_init,const char *cpu_model,uint32_t sysclk) { -CPUState *env; +CPUPPCState *env;qemu_irq *irqs; env =cpu_init (cpu_model);
@@ -106,7 +106,7 @@ static CPUState *ppc440_init_xilinx(ram_addr_t *ram_size,static void main_cpu_reset (void *opaque) { -CPUState *env = opaque; +CPUPPCState *env = opaque;struct boot_info *bi = env->load_info;cpu_state_reset (env);
@@ -188,7 +188,7 @@ static void virtex_init(ram_addr_t ram_size, {MemoryRegion *address_space_mem =get_system_memory ();DeviceState *dev; -CPUState *env; +CPUPPCState *env;target_phys_addr_t ram_base =0 ;DriveInfo *dinfo;MemoryRegion *phys_ram =g_new (MemoryRegion,1 );
hw/xics.c +5 -5
@@ -268,7 +268,7 @@ qemu_irq xics_find_qirq(struct icp_state *icp, int irq)return icp->ics->qirqs[irq - icp->ics->offset]; } -static target_ulong h_cppr (CPUState *env,sPAPREnvironment *spapr, +static target_ulong h_cppr (CPUPPCState *env,sPAPREnvironment *spapr,target_ulong opcode,target_ulong *args) {target_ulong cppr = args[0 ];
@@ -277,7 +277,7 @@ static target_ulong h_cppr(CPUState *env, sPAPREnvironment *spapr,return H_SUCCESS ; } -static target_ulong h_ipi (CPUState *env,sPAPREnvironment *spapr, +static target_ulong h_ipi (CPUPPCState *env,sPAPREnvironment *spapr,target_ulong opcode,target_ulong *args) {target_ulong server = args[0 ];
@@ -292,7 +292,7 @@ static target_ulong h_ipi(CPUState *env, sPAPREnvironment *spapr, } -static target_ulong h_xirr (CPUState *env,sPAPREnvironment *spapr, +static target_ulong h_xirr (CPUPPCState *env,sPAPREnvironment *spapr,target_ulong opcode,target_ulong *args) {uint32_t xirr =icp_accept (spapr->icp->ss + env->cpu_index);
@@ -301,7 +301,7 @@ static target_ulong h_xirr(CPUState *env, sPAPREnvironment *spapr,return H_SUCCESS ; } -static target_ulong h_eoi (CPUState *env,sPAPREnvironment *spapr, +static target_ulong h_eoi (CPUPPCState *env,sPAPREnvironment *spapr,target_ulong opcode,target_ulong *args) {target_ulong xirr = args[0 ];
@@ -424,7 +424,7 @@ static void rtas_int_on(sPAPREnvironment *spapr, uint32_t token,struct icp_state *xics_system_init (int nr_irqs) { -CPUState *env; +CPUPPCState *env;int max_server_num;int i;struct icp_state *icp;
Signature · 1 line
1.7.7
RFC PATCH v4 43/44 Rename CPUState -> CPUArchState
In reply to Andreas Färber--- 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(-)
bsd-user/main.c +4 -4
@@ -70,11 +70,11 @@ int cpu_get_pic_interrupt(CPUX86State *env)#endif /* 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) { } -static inline void cpu_exec_end (CPUState *env) +static inline void cpu_exec_end (CPUArchState *env) { }
@@ -713,7 +713,7 @@ static void usage(void)exit (1 ); } -THREAD CPUState *thread_env; +THREAD CPUArchState *thread_env;/* 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 = ®s1;struct image_info info1, *info = &info1;TaskState ts1, *ts = &ts1; -CPUState *env; +CPUArchState *env;int optind;const char *r;int gdbstub_port =0 ;
bsd-user/qemu.h +6 -6
@@ -139,8 +139,8 @@ abi_long do_openbsd_syscall(void *cpu_env, int num, abi_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 ret);extern int do_strace;/* 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 *tinfo); -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_ulong sp);/* mmap.c */
bsd-user/signal.c +1 -1
@@ -33,6 +33,6 @@ void signal_init(void) { } -void process_pending_signals (CPUState *cpu_env) +void process_pending_signals (CPUArchState *cpu_env) { }
cpu-all.h +28 -28
116 lines not on this page · raw message
cpu-defs.h +1 -1
@@ -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 */ \
cpu-exec.c +8 -8
@@ -26,12 +26,12 @@ int tb_invalidated_flag;//#define CONFIG_DEBUG_EXEC -bool qemu_cpu_has_work (CPUState *env) +bool qemu_cpu_has_work (CPUArchState *env) {return cpu_has_work (env); } -void cpu_loop_exit (CPUState *env) +void cpu_loop_exit (CPUArchState *env) { env->current_tb =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 */
@@ -52,7 +52,7 @@ void cpu_resume_from_signal(CPUState *env, void *puc)/* 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_cycles,tb_free (tb); } -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; } -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(CPUDebugExcpHandler *handler)return old_handler; } -static void cpu_handle_debug_exception (CPUState *env) +static void cpu_handle_debug_exception (CPUArchState *env) {CPUWatchpoint *wp;
@@ -181,7 +181,7 @@ static void cpu_handle_debug_exception(CPUState *env)volatile sig_atomic_t exit_request; -int cpu_exec (CPUState *env) +int cpu_exec (CPUArchState *env) {int ret, interrupt_request;TranslationBlock *tb;
cpus.c +38 -38
304 lines not on this page · raw message
darwin-user/main.c +3 -3
@@ -71,7 +71,7 @@ void gemu_log(const char *fmt, ...)va_end (ap); } -int cpu_get_pic_interrupt (CPUState *env) +int cpu_get_pic_interrupt (CPUArchState *env) {return -1 ; }
@@ -729,7 +729,7 @@ static void usage(void) }/* XXX: currently only used for async signals (see signal.c) */ -CPUState *global_env; +CPUArchState *global_env;/* used to free thread contexts */ TaskState *first_task_state;
@@ -741,7 +741,7 @@ int main(int argc, char **argv)const char *log_mask =NULL ;struct target_pt_regs regs1, *regs = ®s1;TaskState ts1, *ts = &ts1; -CPUState *env; +CPUArchState *env;int optind;short use_gdbstub =0 ;const char *r;
darwin-user/qemu.h +3 -3
@@ -104,8 +104,8 @@ void qerror(const char *fmt, ...) GCC_FMT_ATTR(1, 2);void write_dt (void *ptr,unsigned long addr,unsigned long limit,int flags); -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);
@@ -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 *info);void target_to_host_siginfo (siginfo_t *info,const target_siginfo_t *tinfo); -long do_sigreturn (CPUState *env,int num); +long do_sigreturn (CPUArchState *env,int num);/* machload.c */ int mach_exec(const char * filename, char ** argv, char ** envp,
darwin-user/signal.c +2 -2
@@ -377,12 +377,12 @@ long do_sigreturn(CPUX86State *env, int num)#else 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" ); } -long do_sigreturn (CPUState *env,int num) +long do_sigreturn (CPUArchState *env,int num) {int i =0 ;struct target_sigcontext *scp =get_int_arg (&i, env);
def-helper.h +1 -1
@@ -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/* We can't use glue() here because it falls foul of C preprocessor
disas.c +2 -2
@@ -339,7 +339,7 @@ const char *lookup_symbol(target_ulong orig_addr)#include "monitor.h" static int monitor_disas_is_physical; -static CPUState *monitor_disas_env; +static CPUArchState *monitor_disas_env; 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 ; } -void monitor_disas (Monitor *mon,CPUState *env, +void monitor_disas (Monitor *mon,CPUArchState *env,target_ulong pc,int nb_insn,int is_physical,int flags) {int count, i;
disas.h +1 -1
@@ -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 flags); -void monitor_disas (Monitor *mon,CPUState *env, +void monitor_disas (Monitor *mon,CPUArchState *env,target_ulong pc,int nb_insn,int is_physical,int flags);/* Look up symbol for debugging purpose. Returns "" if unknown. */
dyngen-exec.h +2 -2
@@ -61,10 +61,10 @@#endif #if defined(AREG0 ) -register CPUState *env asm(AREG0); +register CPUArchState *env asm(AREG0);#else /* TODO: Try env = cpu_single_env. */ -extern CPUState *env; +extern CPUArchState *env;#endif #endif /* !defined(__DYNGEN_EXEC_H__) */
exec-all.h +19 -19
@@ -76,30 +76,30 @@ extern uint16_t gen_opc_icount[OPC_BUF_SIZE];#include "qemu-log.h" -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 *tb); +void gen_intermediate_code_pc (CPUArchState *env,struct TranslationBlock *tb); +void restore_state_to_opc (CPUArchState *env,struct TranslationBlock *tb,int pc_pos);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, +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,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) }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 ]; -void tlb_fill (CPUState *env1,target_ulong addr,int is_write,int mmu_idx, +void tlb_fill (CPUArchState *env1,target_ulong addr,int is_write,int mmu_idx,void *retaddr);#include "softmmu_defs.h"
@@ -332,15 +332,15 @@ void tlb_fill(CPUState *env1, target_ulong addr, int is_write, int mmu_idx,#endif #if defined(CONFIG_USER_ONLY ) -static inline tb_page_addr_t get_page_addr_code (CPUState *env1,target_ulong addr) +static inline tb_page_addr_t get_page_addr_code (CPUArchState *env1,target_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 -typedef void (CPUDebugExcpHandler )(CPUState *env); +typedef void (CPUDebugExcpHandler )(CPUArchState *env);CPUDebugExcpHandler *cpu_set_debug_excp_handler (CPUDebugExcpHandler *handler);
@@ -352,7 +352,7 @@ extern volatile sig_atomic_t exit_request;/* Deterministic execution requires that IO only be performed on the last 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 ;
exec.c +57 -57
410 lines not on this page · raw message
gdbstub.c +22 -22
157 lines not on this page · raw message
gdbstub.h +8 -8
@@ -11,22 +11,22 @@#define GDB_WATCHPOINT_ACCESS 4#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 err);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);
gen-icount.h +4 -4
@@ -14,13 +14,13 @@ static inline void gen_icount_start(void) icount_label =gen_new_label (); count =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.u32));/* This is a horrid hack to allow fixing up the value later. */ icount_arg = gen_opparam_ptr +1 ;tcg_gen_subi_i32 (count, count,0xdeadbeef );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); }
@@ -36,13 +36,13 @@ static void gen_icount_end(TranslationBlock *tb, int num_insns)static inline void gen_io_start (void ) {TCGv_i32 tmp =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); }static inline void gen_io_end (void ) {TCGv_i32 tmp =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); }
kvm-all.c +27 -27
197 lines not on this page · raw message
kvm-stub.c +11 -11
@@ -22,7 +22,7 @@ int kvm_pit_in_kernel(void) } -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) { } -void kvm_cpu_synchronize_state (CPUState *env) +void kvm_cpu_synchronize_state (CPUArchState *env) { } -void kvm_cpu_synchronize_post_reset (CPUState *env) +void kvm_cpu_synchronize_post_reset (CPUArchState *env) { } -void kvm_cpu_synchronize_post_init (CPUState *env) +void kvm_cpu_synchronize_post_init (CPUArchState *env) { } -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) { } -int kvm_update_guest_debug (CPUState *env,unsigned long reinject_trap) +int kvm_update_guest_debug (CPUArchState *env,unsigned long reinject_trap) {return -ENOSYS ; } -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 ; } -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 ; } -void kvm_remove_all_breakpoints (CPUState *current_env) +void kvm_remove_all_breakpoints (CPUArchState *current_env) { }#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 ; } -int kvm_on_sigbus_vcpu (CPUState *env,int code,void *addr) +int kvm_on_sigbus_vcpu (CPUArchState *env,int code,void *addr) {return 1 ; }
kvm.h +30 -30
142 lines not on this page · raw message
linux-user/elfload.c +8 -8
@@ -1044,7 +1044,7 @@ static inline void bswap_sym(struct elf_sym *sym) { }#endif #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);
@@ -1930,7 +1930,7 @@ int load_elf_binary(struct linux_binprm * bprm, struct 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 caller)
@@ -2054,8 +2054,8 @@ static void fill_auxv_note(struct memelfnote *, const 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 CPUArchState *); +static void fill_thread_info (struct elf_note_info *,const CPUArchState *);static int core_dump_filename (const TaskState *,char *,size_t );static int dump_write (int ,const void *,size_t );
@@ -2448,7 +2448,7 @@ static int write_note(struct memelfnote *men, int fd)return (0 ); } -static void fill_thread_info (struct elf_note_info *info,const CPUState *env) +static void fill_thread_info (struct elf_note_info *info,const CPUArchState *env) {TaskState *ts = (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) }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 =NULL ; +CPUArchState *cpu =NULL ;TaskState *ts = (TaskState *)env->opaque;int i;
@@ -2595,7 +2595,7 @@ static int write_note_info(struct elf_note_info *info, 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 = (const TaskState *)env->opaque;struct vm_area_struct *vma =NULL ;
linux-user/main.c +7 -7
@@ -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 ();
@@ -172,7 +172,7 @@ static inline void end_exclusive(void) }/* 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) }/* 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 =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) { } -static inline void cpu_exec_end (CPUState *env) +static inline void cpu_exec_end (CPUArchState *env) { }
@@ -2888,7 +2888,7 @@ void cpu_loop(CPUS390XState *env)#endif /* TARGET_S390X */ -THREAD CPUState *thread_env; +THREAD CPUArchState *thread_env;void task_settid (TaskState *ts) {
@@ -3277,7 +3277,7 @@ int main(int argc, char **argv, char **envp)struct image_info info1, *info = &info1;struct linux_binprm bprm;TaskState *ts; -CPUState *env; +CPUArchState *env;int optind;char **target_environ, **wrk;char **target_argv;
linux-user/qemu.h +7 -7
@@ -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 */ };void do_init_thread (struct target_pt_regs *regs,struct image_info *infop);
@@ -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;/* 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 *tinfo);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_ulong sp);#ifdef TARGET_I386
linux-user/signal.c +8 -8
@@ -347,7 +347,7 @@ void signal_init(void)/* signal queue handling */ -static inline struct sigqueue *alloc_sigqueue (CPUState *env) +static inline struct sigqueue *alloc_sigqueue (CPUArchState *env) {TaskState *ts = env->opaque;struct sigqueue *q = ts->first_free;
@@ -357,7 +357,7 @@ static inline struct sigqueue *alloc_sigqueue(CPUState *env)return q; } -static inline void free_sigqueue (CPUState *env,struct sigqueue *q) +static inline void free_sigqueue (CPUArchState *env,struct sigqueue *q) {TaskState *ts = env->opaque; q->next = ts->first_free;
@@ -415,7 +415,7 @@ static void QEMU_NORETURN force_sig(int target_sig)/* 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 = env->opaque;struct emulated_sigtable *k;
@@ -5214,25 +5214,25 @@ long do_rt_sigreturn(CPUAlphaState *env)#else 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" ); }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" ); } -long do_sigreturn (CPUState *env) +long do_sigreturn (CPUArchState *env) {fprintf (stderr,"do_sigreturn: not implemented\n" );return -TARGET_ENOSYS ; } -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)#endif -void process_pending_signals (CPUState *cpu_env) +void process_pending_signals (CPUArchState *cpu_env) {int sig;abi_ulong handler;
linux-user/syscall.c +14 -14
@@ -3955,7 +3955,7 @@ static abi_long do_arch_prctl(CPUX86State *env, int code, abi_ulong addr)static pthread_mutex_t clone_lock =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 = arg; -CPUState *env; +CPUArchState *env;TaskState *ts; env = info->env;
@@ -3998,7 +3998,7 @@ static void *clone_func(void *arg)static int clone_func (void *arg) { -CPUState *env = arg; +CPUArchState *env = arg;cpu_loop (env);/* never exits */ return 0 ;
@@ -4007,13 +4007,13 @@ static int clone_func(void *arg)/* 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 newsp,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)static int open_self_maps (void *cpu_env,int fd) { -TaskState *ts = ((CPUState *)cpu_env)->opaque; +TaskState *ts = ((CPUArchState *)cpu_env)->opaque; 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)static int open_self_stat (void *cpu_env,int fd) { -TaskState *ts = ((CPUState *)cpu_env)->opaque; +TaskState *ts = ((CPUArchState *)cpu_env)->opaque;abi_ulong start_stack = ts->info->start_stack;int i;
@@ -4678,7 +4678,7 @@ static int open_self_stat(void *cpu_env, int fd)static int open_self_auxv (void *cpu_env,int fd) { -TaskState *ts = ((CPUState *)cpu_env)->opaque; +TaskState *ts = ((CPUArchState *)cpu_env)->opaque;abi_ulong auxv = ts->info->saved_auxv;abi_ulong len = ts->info->auxv_len;char *ptr;
@@ -4784,13 +4784,13 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,be disabling signals. */ if (first_cpu->next_cpu) {TaskState *ts; -CPUState **lastp; -CPUState *p; +CPUArchState **lastp; +CPUArchState *p;cpu_list_lock (); lastp = &first_cpu; p = first_cpu; -while (p && p != (CPUState *)cpu_env) { +while (p && p != (CPUArchState *)cpu_env) { lastp = &p->next_cpu; p = p->next_cpu; }
@@ -4801,7 +4801,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1,/* Remove the CPU from the list. */ *lastp = p->next_cpu;cpu_list_unlock (); - ts = ((CPUState *)cpu_env)->opaque; + ts = ((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_long arg1,break ;case TARGET_NR_mprotect: { -TaskState *ts = ((CPUState *)cpu_env)->opaque; +TaskState *ts = ((CPUArchState *)cpu_env)->opaque;/* Special hack to detect libc making the stack executable. */ if ((arg3 &PROT_GROWSDOWN ) && arg1 >= ts->info->stack_limit
@@ -7076,7 +7076,7 @@ abi_long do_syscall(void *cpu_env, int num, abi_long 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 =do_sigaltstack (arg1, arg2,get_sp_from_cpustate ((CPUState *)cpu_env)); + ret =do_sigaltstack (arg1, arg2,get_sp_from_cpustate ((CPUArchState *)cpu_env));break ;#else goto unimplemented;
monitor.c +28 -28
220 lines not on this page · raw message
poison.h +1 -1
@@ -34,7 +34,7 @@#pragma GCC poison TARGET_PAGE_BITS#pragma GCC poison TARGET_PAGE_ALIGN -#pragma GCC poison CPUState +#pragma GCC poison CPUArchState#pragma GCC poison env#pragma GCC poison lduw_phys
softmmu-semi.h +6 -6
@@ -7,14 +7,14 @@* This code is licensed under the GPL */ -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;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;
@@ -26,7 +26,7 @@ static inline uint32_t softmmu_tget8(CPUState *env, uint32_t addr)#define get_user_u8 (arg, p) ({ arg = softmmu_tget8(env, p) ; 0; })#define get_user_ual (arg, p) get_user_u32(arg, p) -static inline void softmmu_tput32 (CPUState *env,uint32_t addr,uint32_t val) +static inline void softmmu_tput32 (CPUArchState *env,uint32_t addr,uint32_t val) { val =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) -static void *softmmu_lock_user (CPUState *env,uint32_t addr,uint32_t len, +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, copy) -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, uint32_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 addr, +static void softmmu_unlock_user (CPUArchState *env,void *p,target_ulong addr,target_ulong len) {if (len)
target-alpha/cpu.h +1 -1
@@ -25,7 +25,7 @@#define TARGET_LONG_BITS 64 -#define CPUState struct CPUAlphaState +#define CPUArchState struct CPUAlphaState#include "cpu-defs.h"
target-arm/cpu.h +1 -1
@@ -23,7 +23,7 @@#define ELF_MACHINE EM_ARM -#define CPUState struct CPUARMState +#define CPUArchState struct CPUARMState#include "config.h" #include "qemu-common.h"
target-cris/cpu.h +1 -1
@@ -25,7 +25,7 @@#define TARGET_LONG_BITS 32 -#define CPUState struct CPUCRISState +#define CPUArchState struct CPUCRISState#include "cpu-defs.h"
target-i386/cpu.h +1 -1
@@ -42,7 +42,7 @@#define ELF_MACHINE EM_386#endif -#define CPUState struct CPUX86State +#define CPUArchState struct CPUX86State#include "cpu-defs.h"
target-lm32/cpu.h +1 -1
@@ -22,7 +22,7 @@#define TARGET_LONG_BITS 32 -#define CPUState struct CPULM32State +#define CPUArchState struct CPULM32State#include "config.h" #include "qemu-common.h"
target-m68k/cpu.h +1 -1
@@ -22,7 +22,7 @@#define TARGET_LONG_BITS 32 -#define CPUState struct CPUM68KState +#define CPUArchState struct CPUM68KState#include "config.h" #include "qemu-common.h"
target-microblaze/cpu.h +1 -1
@@ -24,7 +24,7 @@#define TARGET_LONG_BITS 32 -#define CPUState struct CPUMBState +#define CPUArchState struct CPUMBState#include "cpu-defs.h" #include "softfloat.h"
target-mips/cpu.h +1 -1
@@ -7,7 +7,7 @@#define ELF_MACHINE EM_MIPS -#define CPUState struct CPUMIPSState +#define CPUArchState struct CPUMIPSState#include "config.h" #include "qemu-common.h"
target-ppc/cpu.h +1 -1
@@ -71,7 +71,7 @@#endif /* defined (TARGET_PPC64) */ -#define CPUState struct CPUPPCState +#define CPUArchState struct CPUPPCState#include "cpu-defs.h"
target-s390x/cpu.h +1 -1
@@ -26,7 +26,7 @@#define ELF_MACHINE EM_S390 -#define CPUState struct CPUS390XState +#define CPUArchState struct CPUS390XState#include "cpu-defs.h" #define TARGET_PAGE_BITS 12
target-sh4/cpu.h +1 -1
@@ -37,7 +37,7 @@#define SH_CPU_SH7750_ALL (SH_CPU_SH7750 | SH_CPU_SH7750S | SH_CPU_SH7750R)#define SH_CPU_SH7751_ALL (SH_CPU_SH7751 | SH_CPU_SH7751R) -#define CPUState struct CPUSH4State +#define CPUArchState struct CPUSH4State#include "cpu-defs.h"
target-sparc/cpu.h +1 -1
@@ -23,7 +23,7 @@# endif #endif -#define CPUState struct CPUSPARCState +#define CPUArchState struct CPUSPARCState#include "cpu-defs.h"
target-unicore32/cpu.h +1 -1
@@ -18,7 +18,7 @@#define ELF_MACHINE EM_UNICORE32 -#define CPUState struct CPUUniCore32State +#define CPUArchState struct CPUUniCore32State#include "config.h" #include "qemu-common.h"
target-xtensa/cpu.h +1 -1
@@ -31,7 +31,7 @@#define TARGET_LONG_BITS 32#define ELF_MACHINE EM_XTENSA -#define CPUState struct CPUXtensaState +#define CPUArchState struct CPUXtensaState#include "config.h" #include "qemu-common.h"
tcg/arm/tcg-target.c +11 -11
@@ -990,10 +990,10 @@ static inline void tcg_out_qemu_ld(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_BITS ));/* In the -* ldr r1 [r0, #(offsetof(CPUState, tlb_table[mem_index][0].addr_read))] +* ldr r1 [r0, #(offsetof(CPUArchState, tlb_table[mem_index][0].addr_read))] * below, the offset is likely to exceed 12 bits if mem_index != 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, const 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));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_BITS ));/* In the -* ldr r1 [r0, #(offsetof(CPUState, tlb_table[mem_index][0].addr_write))] +* ldr r1 [r0, #(offsetof(CPUArchState, tlb_table[mem_index][0].addr_write))] * below, the offset is likely to exceed 12 bits if mem_index != 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, const 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));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 );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 )); }
tcg/hppa/tcg-target.c +4 -4
@@ -1040,13 +1040,13 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, int opc) lab1 =gen_new_label (); lab2 =gen_new_label (); - offset = offsetof(CPUState, tlb_table[mem_index][0].addr_read); + offset = offsetof(CPUArchState, tlb_table[mem_index][0].addr_read); offset =tcg_out_tlb_read (s,TCG_REG_R26 ,TCG_REG_R25 , addrlo_reg, addrhi_reg, opc &3 , lab1, offset);/* 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) - offset); + offsetof(CPUArchState, tlb_table[mem_index][0].addend) - offset);tcg_out_qemu_ld_direct (s, datalo_reg, datahi_reg, addrlo_reg,TCG_REG_R20 , opc);tcg_out_branch (s, lab2,1 );
@@ -1155,13 +1155,13 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args, int opc) lab1 =gen_new_label (); lab2 =gen_new_label (); - offset = offsetof(CPUState, tlb_table[mem_index][0].addr_write); + offset = offsetof(CPUArchState, tlb_table[mem_index][0].addr_write); offset =tcg_out_tlb_read (s,TCG_REG_R26 ,TCG_REG_R25 , addrlo_reg, addrhi_reg, opc, lab1, offset);/* 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) - offset); + offsetof(CPUArchState, tlb_table[mem_index][0].addend) - offset);/* There are no indexed stores, so we must do this addition explitly. Careful to avoid R20, which is used for the bswaps to follow. */
tcg/i386/tcg-target.c +1 -1
@@ -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);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);/* cmp 0(r1), r0 */
tcg/ia64/tcg-target.c +5 -5
@@ -1479,8 +1479,8 @@ static inline void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args, int opc)/* Read the TLB entry */ tcg_out_qemu_tlb (s, addr_reg, s_bits, - offsetof(CPUState, tlb_table[mem_index][0].addr_read), - offsetof(CPUState, tlb_table[mem_index][0].addend)); + offsetof(CPUArchState, tlb_table[mem_index][0].addr_read), + offsetof(CPUArchState, tlb_table[mem_index][0].addend));/* 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, const TCGArg *args, int opc)#endif tcg_out_qemu_tlb (s, addr_reg, opc, - offsetof(CPUState, tlb_table[mem_index][0].addr_write), - offsetof(CPUState, tlb_table[mem_index][0].addend)); + offsetof(CPUArchState, tlb_table[mem_index][0].addr_write), + offsetof(CPUArchState, tlb_table[mem_index][0].addend));/* 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 );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 )); }
tcg/mips/tcg-target.c +7 -7
@@ -827,7 +827,7 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *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);
@@ -837,7 +837,7 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args,tcg_out_nop (s);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); label1_ptr = 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 TCGArg *args,reloc_pc16 (label1_ptr, (tcg_target_long ) s->code_ptr);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].addend));tcg_out_opc_reg (s,OPC_ADDU ,TCG_REG_V0 ,TCG_REG_A0 , addr_regl);#else if (GUEST_BASE == (int16_t )GUEST_BASE ) {
@@ -1013,7 +1013,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *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_write) + 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);
@@ -1023,7 +1023,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args,tcg_out_nop (s);tcg_out_opc_imm (s,OPC_LW ,TCG_REG_AT ,TCG_REG_A0 , - offsetof(CPUState, tlb_table[mem_index][0].addr_write) + addr_memh); + offsetof(CPUArchState, tlb_table[mem_index][0].addr_write) + addr_memh); label1_ptr = 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 TCGArg *args,reloc_pc16 (label1_ptr, (tcg_target_long ) s->code_ptr);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].addend));tcg_out_opc_reg (s,OPC_ADDU ,TCG_REG_A0 ,TCG_REG_A0 , addr_regl);#else if (GUEST_BASE == (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 */ 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 )); }
tcg/ppc/tcg-target.c +2 -2
@@ -564,7 +564,7 @@ static void tcg_out_qemu_ld (TCGContext *s, const TCGArg *args, int opc)tcg_out32 (s, (LWZU |RT (r1) |RA (r0) - | offsetof (CPUState, tlb_table[mem_index][0].addr_read) + | offsetof (CPUArchState, tlb_table[mem_index][0].addr_read) ) ); tcg_out32 (s, (RLWINM
@@ -760,7 +760,7 @@ static void tcg_out_qemu_st (TCGContext *s, const TCGArg *args, int opc)tcg_out32 (s, (LWZU |RT (r1) |RA (r0) - | offsetof (CPUState, tlb_table[mem_index][0].addr_write) + | offsetof (CPUArchState, tlb_table[mem_index][0].addr_write) ) ); tcg_out32 (s, (RLWINM
tcg/ppc64/tcg-target.c +2 -2
@@ -635,7 +635,7 @@ static void tcg_out_qemu_ld (TCGContext *s, const TCGArg *args, int opc) rbase =0 ;tcg_out_tlb_read (s, r0, r1, r2, addr_reg, s_bits, - offsetof (CPUState, tlb_table[mem_index][0].addr_read)); + offsetof (CPUArchState, tlb_table[mem_index][0].addr_read));tcg_out32 (s,CMP |BF (7 ) |RA (r2) |RB (r1) |CMP_L );
@@ -782,7 +782,7 @@ static void tcg_out_qemu_st (TCGContext *s, const TCGArg *args, int opc) rbase =0 ;tcg_out_tlb_read (s, r0, r1, r2, addr_reg, opc, - offsetof (CPUState, tlb_table[mem_index][0].addr_write)); + offsetof (CPUArchState, tlb_table[mem_index][0].addr_write));tcg_out32 (s,CMP |BF (7 ) |RA (r2) |RB (r1) |CMP_L );
tcg/s390/tcg-target.c +4 -4
@@ -1439,9 +1439,9 @@ static void tcg_prepare_qemu_ldst(TCGContext* s, TCGReg data_reg,tgen64_andi_tmp (s, arg1, (CPU_TLB_SIZE -1 ) <<CPU_TLB_ENTRY_BITS );if (is_store) { - ofs = offsetof(CPUState, tlb_table[mem_index][0].addr_write); + ofs = offsetof(CPUArchState, tlb_table[mem_index][0].addr_write); }else { - ofs = offsetof(CPUState, tlb_table[mem_index][0].addr_read); + ofs = offsetof(CPUArchState, tlb_table[mem_index][0].addr_read); }assert (ofs <0x80000 );
@@ -1515,7 +1515,7 @@ static void tcg_prepare_qemu_ldst(TCGContext* s, TCGReg data_reg, *(label1_ptr +1 ) = ((unsigned long )s->code_ptr - (unsigned long )label1_ptr) >>1 ; - ofs = offsetof(CPUState, tlb_table[mem_index][0].addend); + ofs = offsetof(CPUArchState, tlb_table[mem_index][0].addend);assert (ofs <0x80000 );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 );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 )); }
tcg/sparc/tcg-target.c +2 -2
@@ -776,7 +776,7 @@ static void tcg_out_qemu_ld(TCGContext *s, const TCGArg *args,tcg_out_andi (s, arg1, (CPU_TLB_SIZE -1 ) <<CPU_TLB_ENTRY_BITS );/* 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));/* add env, arg1, arg1 */
@@ -988,7 +988,7 @@ static void tcg_out_qemu_st(TCGContext *s, const TCGArg *args,tcg_out_andi (s, arg1, (CPU_TLB_SIZE -1 ) <<CPU_TLB_ENTRY_BITS );/* 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));/* add env, arg1, arg1 */
tcg/tci/tcg-target.c +1 -1
@@ -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 )); }
tcg/tci/tcg-target.h +1 -1
@@ -154,7 +154,7 @@ typedef enum {void tci_disas (uint8_t opc); -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 static inline void flush_icache_range(tcg_target_ulong start,
tci.c +2 -2
@@ -52,7 +52,7 @@ typedef uint64_t (*helper_function)(tcg_target_ulong, tcg_target_ulong,/* TCI can optionally use a global register variable for env. */ #if !defined(AREG0 ) -CPUState *env; +CPUArchState *env;#endif /* 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, TCGCond condition) }/* 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 =0 ;
translate-all.c +2 -2
@@ -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 = &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 = &tcg_ctx;int j;
user-exec.c +2 -2
@@ -38,7 +38,7 @@//#define DEBUG_SIGNAL -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_code);
@@ -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 = puc;
xen-all.c +2 -2
@@ -530,14 +530,14 @@ static MemoryListener xen_memory_listener = {static void xen_reset_vcpu (void *opaque) { -CPUState *env = opaque; +CPUArchState *env = opaque; env->halted =1 ; }void xen_vcpu_init (void ) { -CPUState *first_cpu; +CPUArchState *first_cpu;if ((first_cpu =qemu_get_cpu (0 ))) {qemu_register_reset (xen_reset_vcpu, first_cpu);
Signature · 1 line
1.7.7
PATCH RESEND v2 1/20 qom: Introduce object_class_get_list()
In reply to Andreas FärberThis function allows to obtain a singly-linked list of classes, which can be sorted by the caller.
--- include/qemu/object.h | 11 +++++++++++ qom/object.c | 17 +++++++++++++++++ 2 files changed, 28 insertions(+), 0 deletions(-)
include/qemu/object.h +11 -0
@@ -560,6 +560,17 @@ ObjectClass *object_class_by_name(const char *typename);void object_class_foreach (void (*fn)(ObjectClass *klass,void *opaque),const char *implements_type,bool include_abstract,void *opaque); + +/** +* object_class_get_list: +* @implements_type: The type to filter for, including its derivatives. +* @include_abstract: Whether to include abstract classes. +* +* Returns: A singly-linked list of the classes in reverse hashtable order. +*/ +GSList *object_class_get_list (const char *implements_type, +bool include_abstract); +/** * object_ref: * @obj: the object
qom/object.c +17 -0
@@ -572,6 +572,23 @@ void object_class_foreach(void (*fn)(ObjectClass *klass, void *opaque),g_hash_table_foreach (type_table_get (), object_class_foreach_tramp, &data); } +static void object_class_get_list_tramp (ObjectClass *klass,void *opaque) +{ +GSList **list = opaque; + + *list =g_slist_prepend (*list, klass); +} + +GSList *object_class_get_list (const char *implements_type, +bool include_abstract) +{ +GSList *list =NULL ; + +object_class_foreach (object_class_get_list_tramp, + implements_type, include_abstract, &list); +return list; +} +void object_ref (Object *obj) { obj->ref++;
Signature · 1 line
1.7.7
v4 cover QOM'ify ARM CPU
In reply to Andreas FärberHello,
Since the ARM target lately has been the target with the highest rate of changes, let's convert it first, as a proof of concept. Especially its reset handler can be greatly simplified through QOM.
Patch 1 is a RESEND of object_class_get_list() v2. Needed for virtually every target.
Patch 2 moves the CPUID lookup to ARMCPUClass. Patch 3 integrates legacy CPUARMState into ARMCPU.
Patches 5-17 step by step move CPUID-dependent initializations to CPU-specific code. Patch 6 is a proof of concept for CPUState -> CPU lookup.
(NEW:)
Patch 18 adds CPU properties to manipulate parts of the CPUID (MIDR). Patch 19 uses them to drop CPU classes that differ only by variant and revision. Patch 20 adds a "/cpu" property for -M integratorcp (a single-CPU board for which we have a test image on qemu.org) to allow inspection of CPU properties over QMP.
Available at:
http://repo.or.cz/w/qemu/afaerber.git/shortlog/refs/heads/qom-cpu-arm.v4
Regards,
Andreas
v3 -> v4:
* Rebased on top of type_init() v2, object_class_get_list() v2, qom-cpu v4.
* Rename cpu-core.h to cpu-qom.h. While the term "ARM core" is quite common, it is less so for other architectures like s390x so use a neutral term.
* Use container_of() for CPUState -> CPU macros (suggested by Anthony).
* Rework arm_env_get_object() -> arm_env_get_cpu(), avoids some casts (suggested by Anthony). Also rename ENV_GET_OBJECT() -> ENV_GET_CPU().
* Sort -cpu ? list.
* Use object_class_get_list() and sort ourselves rather than using object_class_foreach_ordered() with callbacks (suggested by Anthony).
* Drop ARMCPUClass jtag_id since it turned out unneeded in QEMU (Peter+Andrzej).
* Drop experimental "halted" property since that should be in common code.
* Introduce "cpuid-variant" and "cpuid-revision" properties.
* Use CPU properties to drop unneeded pxa270-* classes.
* Move "/cpu" child property to integratorcp machine.
v2 -> v3:
* Rebased against qom-upstream.14 branch (and that against master).
* Rename target-arm/cpu-core.c to cpu.c now that we no longer need VPATH.
* Leave cpu-core.h as is to separate from legacy cpu.h.
* Fix -cpu alias "pxa270": handled in cpu_arm_init().
* Use proper GPL headers.
* Start removing CPUID uses in cpu_reset_model_id() and cpu.h.
* Fully convert cpu_reset_model_id() to ARMCPUInfo or per-model code.
* Experiment with adding properties ("halted").
* For testing, add a "/cpu" child property (HACK).
v1 -> v2:
* Cherry-pick Anthony's object_class_foreach() patch.
* Fix ARMCPUClass type name (arm-cpu-core -> arm-cpu).
* Add documentation.
* Rename ARMCPUDef to ARMCPUInfo.
* Use a C99-style table for initializing the classes through class_data instead of individual class_init functions (suggested by Anthony).
* Prepare reset callback.
* Make ENV_GET_OBJECT() use an inline function for readability.
* Invoke the CPU's reset method from cpu_reset().
* Do feature initialization via table where sensible.
* Add feature flags to ARMCPU as well (suggested by PMM for future tweaking, also simplifies load/save a bit) and initialize them from ARMCPUClass.
* Make feature inference work for ARMCPU as well by not passing the ARMCPUClass. Use function-local macros to avoid the ugliness of deferencing the features pointer.
Andreas Färber (20):
qom: Introduce object_class_get_list()
target-arm: Introduce QOM ARMCPUClass
target-arm: Embed CPUARMState in QOM ARMCPU
target-arm: Prepare model-specific class_init function
target-arm: Overwrite reset handler for ti925t
target-arm: Move CPU feature flags out of CPUState
target-arm: No longer abort on unhandled CPUIDs on reset
target-arm: Store cp15 c0_c1 and c0_c2 in ARMCPUClass
target-arm: Store CTR in ARMCPUClass
target-arm: Store SCTLR in ARMCPUClass
target-arm: Drop JTAG_ID documentation
target-arm: Move the PXA270's iwMMXt reset to pxa270_reset()
target-arm: Store VFP FPSID register in ARMCPUClass
target-arm: Store VFP MVFR0 and MVFR1 in ARMCPUClass
target-arm: Store CLIDR in ARMCPUClass
target-arm: Store CCSIDRs in ARMCPUClass
target-arm: Kill off cpu_reset_model_id()
target-arm: Add cpuid-{variant,revision} properties to CPU
target-arm: Simplify pxa270 CPU classes hw/integratorcp: Add child property for CPU
Makefile.target | 1 + hw/integratorcp.c | 3 + include/qemu/object.h | 11 + qom/object.c | 17 ++ target-arm/cpu-qom.h | 98 ++++++++ target-arm/cpu.c | 643 +++++++++++++++++++++++++++++++++++++++++++++++++ target-arm/cpu.h | 27 +-- target-arm/helper.c | 471 ++++++------------------------------ target-arm/machine.c | 6 +- 9 files changed, 851 insertions(+), 426 deletions(-) create mode 100644 target-arm/cpu-qom.h create mode 100644 target-arm/cpu.c
Signature · 1 line
1.7.7
RFC PATCH v4 3/20 target-arm: Embed CPUARMState in QOM ARMCPU
We g_malloc0()'ed CPUARMState ourself, and exec.c's cpu_copy() runs through cpu_init() as well, so we are at liberty to supply the CPUState any way we see fit. Having CPUARMState as field in the QOM CPU allows both to access env from an ARMCPU object and to access the QOM Object and its ObjectClass from an env pointer, in ARM code for now.
The goal is to convert all CPUs to QOM and to use CPU objects in central places, especially once we have property support for Object. This will then allow to have TCG AREG0 point to target-specific fields where small immediate offsets are desired (as pointed out by rth) while allowing for common fields at known offsets from the base class.
Having the CPUID in ARMCPUClass, we can set it from the instance_init function. Same for cpu_model_str, which is now the QOM class name.
Make cpu_state_reset() call cpu_reset() and move most of its code to arm_cpu_reset().
--- target-arm/cpu-qom.h | 12 +++++++ target-arm/cpu.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++ target-arm/helper.c | 75 ++++------------------------------------------ 3 files changed, 100 insertions(+), 69 deletions(-)
target-arm/cpu-qom.h +12 -0
@@ -21,6 +21,7 @@#define QEMU_ARM_CPU_QOM_H #include "qemu/cpu.h" +#include "cpu.h" #define TYPE_ARM_CPU "arm-cpu"
@@ -51,6 +52,7 @@ typedef struct ARMCPUClass {/** * ARMCPU: +* @env: Legacy CPU state. * * An ARM CPU core. */
@@ -58,7 +60,17 @@ typedef struct ARMCPU {/*< private >*/ CPUState parent_obj;/*< public >*/ + +/* TODO Inline this and split off common state */ + CPUARMState env; }ARMCPU ; +static inline ARMCPU *arm_env_get_cpu (CPUARMState *env) +{ +return ARM_CPU (container_of (env,ARMCPU , env)); +} + +#define ENV_GET_CPU (e) CPU(arm_env_get_cpu(e)) +#endif
target-arm/cpu.c +82 -0
106 lines not on this page · raw message
target-arm/helper.c +6 -69
121 lines not on this page · raw message
Signature · 1 line
1.7.7
RFC PATCH v4 9/20 target-arm: Store CTR in ARMCPUClass
In reply to Andreas Färber--- target-arm/cpu-qom.h | 1 + target-arm/cpu.c | 18 ++++++++++++++++++ target-arm/helper.c | 12 ------------ 3 files changed, 19 insertions(+), 12 deletions(-)
target-arm/cpu-qom.h +1 -0
@@ -48,6 +48,7 @@ typedef struct ARMCPUClass {struct {uint32_t c0_cpuid; +uint32_t c0_cachetype;uint32_t c0_c1[8 ];uint32_t c0_c2[8 ]; } cp15;
target-arm/cpu.c +18 -0
@@ -46,6 +46,7 @@ static void arm_cpu_reset(CPUState *c) env->cp15.c15_config_base_address = tmp;/* TODO Move these into arm_cpu_initfn() once no longer zeroed above. */ + env->cp15.c0_cachetype = klass->cp15.c0_cachetype;memcpy (env->cp15.c0_c1, klass->cp15.c0_c1,8 *sizeof (uint32_t ));memcpy (env->cp15.c0_c2, klass->cp15.c0_c2,8 *sizeof (uint32_t ));
@@ -169,6 +170,7 @@ static inline void unset_class_feature(ARMCPUClass *klass, int feature) typedef struct ARMCPUInfo { const char *name; uint32_t id; + uint32_t cp15_c0_cachetype; uint32_t cp15_c0_c1[8]; uint32_t cp15_c0_c2[8]; uint32_t features;
@@ -188,6 +190,7 @@ static void arm1136_r0_class_init(ARMCPUClass *k, const ARMCPUInfo *info)* for 1136_r2 (in particular r0p2 does not actually implement most * of the ID registers). */ + k->cp15.c0_cachetype = r1_class->cp15.c0_cachetype;memcpy (k->cp15.c0_c1, r1_class->cp15.c0_c1,8 *sizeof (uint32_t ));memcpy (k->cp15.c0_c2, r1_class->cp15.c0_c2,8 *sizeof (uint32_t )); }
@@ -216,12 +219,16 @@ static void sa11xx_class_init(ARMCPUClass *k, const ARMCPUInfo *info)static void pxa25x_class_init (ARMCPUClass *k,const ARMCPUInfo *info) { + k->cp15.c0_cachetype =0xd172172 ; +set_class_feature (k,ARM_FEATURE_V5 );set_class_feature (k,ARM_FEATURE_XSCALE ); }static void pxa270_class_init (ARMCPUClass *k,const ARMCPUInfo *info) { + k->cp15.c0_cachetype =0xd172172 ; +set_class_feature (k,ARM_FEATURE_V5 );set_class_feature (k,ARM_FEATURE_XSCALE );set_class_feature (k,ARM_FEATURE_IWMMXT );
@@ -231,18 +238,21 @@ static const ARMCPUInfo arm_cpus[] = { { .name = "arm926", .id = 0x41069265, + .cp15_c0_cachetype = 0x1dd20d2, .features = ARM_FEATURE(V5) | ARM_FEATURE(VFP), }, { .name = "arm946", .id = 0x41059461, + .cp15_c0_cachetype = 0x0f004006, .features = ARM_FEATURE(V5) | ARM_FEATURE(MPU), }, { .name = "arm1026", .id = 0x4106a262, + .cp15_c0_cachetype = 0x1dd20d2, .features = ARM_FEATURE(V5) | ARM_FEATURE(VFP) | ARM_FEATURE(AUXCR),
@@ -259,6 +269,7 @@ static const ARMCPUInfo arm_cpus[] = { { .name = "arm1136", .id = 0x4117b363, + .cp15_c0_cachetype = 0x1dd20d2, .cp15_c0_c1 = {0x111 ,0x1 ,0x2 ,0x3 ,0x01130003 ,0x10030302 ,0x01222110 ,0
@@ -273,6 +284,7 @@ static const ARMCPUInfo arm_cpus[] = { { .name = "arm1176", .id = 0x410fb767, + .cp15_c0_cachetype = 0x1dd20d2, .cp15_c0_c1 = {0x111 ,0x11 ,0x33 ,0 ,0x01130003 ,0x10030302 ,0x01222100 ,0
@@ -288,6 +300,7 @@ static const ARMCPUInfo arm_cpus[] = { { .name = "arm11mpcore", .id = 0x410fb022, + .cp15_c0_cachetype = 0x1dd20d2, .cp15_c0_c1 = {0x111 ,0x1 ,0 ,0x2 ,0x01100103 ,0x10020302 ,0x01222000 ,0
@@ -309,6 +322,7 @@ static const ARMCPUInfo arm_cpus[] = { { .name = "cortex-a8", .id = 0x410fc080, + .cp15_c0_cachetype = 0x82048004, .cp15_c0_c1 = {0x1031 ,0x11 ,0x400 ,0 ,0x31100003 ,0x20000000 ,0x01202000 ,0x11
@@ -325,6 +339,7 @@ static const ARMCPUInfo arm_cpus[] = { { .name = "cortex-a9", .id = 0x410fc090, + .cp15_c0_cachetype = 0x80038003, .cp15_c0_c1 = {0x1031 ,0x11 ,0x000 ,0 ,0x00100103 ,0x20000000 ,0x01230000 ,0x00002111
@@ -347,6 +362,7 @@ static const ARMCPUInfo arm_cpus[] = { { .name = "cortex-a15", .id = 0x412fc0f1, + .cp15_c0_cachetype = 0x8444c004, .cp15_c0_c1 = {0x00001131 ,0x00011011 ,0x02010555 ,0x00000000 ,0x10201105 ,0x20000000 ,0x01240000 ,0x02102211
@@ -367,6 +383,7 @@ static const ARMCPUInfo arm_cpus[] = { { .name = "ti925t", .id = 0x54029252, + .cp15_c0_cachetype = 0x5109149, .features =ARM_FEATURE (V4T ) | ARM_FEATURE(OMAPCP), .class_init = ti925t_class_init,
@@ -473,6 +490,7 @@ static void arm_cpu_class_init(ObjectClass *klass, void *data) cpu_class->reset = arm_cpu_reset; k->cp15.c0_cpuid = info->id; + k->cp15.c0_cachetype = info->cp15_c0_cachetype;memcpy (k->cp15.c0_c1, info->cp15_c0_c1,8 *sizeof (uint32_t ));memcpy (k->cp15.c0_c2, info->cp15_c0_c2,8 *sizeof (uint32_t )); k->features = info->features;
target-arm/helper.c +0 -12
@@ -10,16 +10,13 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id)switch (id) {case ARM_CPUID_ARM926 : env->vfp.xregs[ARM_VFP_FPSID ] =0x41011090 ; - env->cp15.c0_cachetype =0x1dd20d2 ; env->cp15.c1_sys =0x00090078 ;break ;case ARM_CPUID_ARM946 : - env->cp15.c0_cachetype =0x0f004006 ; env->cp15.c1_sys =0x00000078 ;break ;case ARM_CPUID_ARM1026 : env->vfp.xregs[ARM_VFP_FPSID ] =0x410110a0 ; - env->cp15.c0_cachetype =0x1dd20d2 ; env->cp15.c1_sys =0x00090078 ;break ;case ARM_CPUID_ARM1136 :
@@ -37,27 +34,23 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id) env->vfp.xregs[ARM_VFP_FPSID ] =0x410120b4 ; env->vfp.xregs[ARM_VFP_MVFR0 ] =0x11111111 ; env->vfp.xregs[ARM_VFP_MVFR1 ] =0x00000000 ; - env->cp15.c0_cachetype =0x1dd20d2 ; env->cp15.c1_sys =0x00050078 ;break ;case ARM_CPUID_ARM1176 : env->vfp.xregs[ARM_VFP_FPSID ] =0x410120b5 ; env->vfp.xregs[ARM_VFP_MVFR0 ] =0x11111111 ; env->vfp.xregs[ARM_VFP_MVFR1 ] =0x00000000 ; - env->cp15.c0_cachetype =0x1dd20d2 ; env->cp15.c1_sys =0x00050078 ;break ;case ARM_CPUID_ARM11MPCORE : env->vfp.xregs[ARM_VFP_FPSID ] =0x410120b4 ; env->vfp.xregs[ARM_VFP_MVFR0 ] =0x11111111 ; env->vfp.xregs[ARM_VFP_MVFR1 ] =0x00000000 ; - env->cp15.c0_cachetype =0x1dd20d2 ;break ;case ARM_CPUID_CORTEXA8 : env->vfp.xregs[ARM_VFP_FPSID ] =0x410330c0 ; env->vfp.xregs[ARM_VFP_MVFR0 ] =0x11110222 ; env->vfp.xregs[ARM_VFP_MVFR1 ] =0x00011100 ; - env->cp15.c0_cachetype =0x82048004 ; env->cp15.c0_clid = (1 <<27 ) | (2 <<24 ) |3 ; env->cp15.c0_ccsid[0 ] =0xe007e01a ;/* 16k L1 dcache. */ env->cp15.c0_ccsid[1 ] =0x2007e01a ;/* 16k L1 icache. */
@@ -68,7 +61,6 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id) env->vfp.xregs[ARM_VFP_FPSID ] =0x41033090 ; env->vfp.xregs[ARM_VFP_MVFR0 ] =0x11110222 ; env->vfp.xregs[ARM_VFP_MVFR1 ] =0x01111111 ; - env->cp15.c0_cachetype =0x80038003 ; env->cp15.c0_clid = (1 <<27 ) | (1 <<24 ) |3 ; env->cp15.c0_ccsid[0 ] =0xe00fe015 ;/* 16k L1 dcache. */ env->cp15.c0_ccsid[1 ] =0x200fe015 ;/* 16k L1 icache. */
@@ -78,7 +70,6 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id) env->vfp.xregs[ARM_VFP_FPSID ] =0x410430f0 ; env->vfp.xregs[ARM_VFP_MVFR0 ] =0x10110222 ; env->vfp.xregs[ARM_VFP_MVFR1 ] =0x11111111 ; - env->cp15.c0_cachetype =0x8444c004 ; env->cp15.c0_clid =0x0a200023 ; env->cp15.c0_ccsid[0 ] =0x701fe00a ;/* 32K L1 dcache */ env->cp15.c0_ccsid[1 ] =0x201fe00a ;/* 32K L1 icache */
@@ -87,7 +78,6 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id)break ;case ARM_CPUID_TI915T :case ARM_CPUID_TI925T : - env->cp15.c0_cachetype =0x5109149 ; env->cp15.c1_sys =0x00000070 ; env->cp15.c15_i_max =0x000 ; env->cp15.c15_i_min =0xff0 ;
@@ -98,7 +88,6 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id)case ARM_CPUID_PXA261 :case ARM_CPUID_PXA262 :/* JTAG_ID is ((id << 28) | 0x09265013) */ - env->cp15.c0_cachetype =0xd172172 ; env->cp15.c1_sys =0x00000078 ;break ;case ARM_CPUID_PXA270_A0 :
@@ -109,7 +98,6 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id)case ARM_CPUID_PXA270_C5 :/* JTAG_ID is ((id << 28) | 0x09265013) */ env->iwmmxt.cregs[ARM_IWMMXT_wCID] =0x69051000 |'Q' ; - env->cp15.c0_cachetype =0xd172172 ; env->cp15.c1_sys =0x00000078 ;break ;case ARM_CPUID_SA1100 :
Signature · 1 line
1.7.7
RFC PATCH v4 13/20 target-arm: Store VFP FPSID register in ARMCPUClass
In reply to Andreas Färber--- target-arm/cpu-qom.h | 3 +++ target-arm/cpu.c | 11 +++++++++++ target-arm/cpu.h | 1 - target-arm/helper.c | 12 ------------ 4 files changed, 14 insertions(+), 13 deletions(-)
target-arm/cpu-qom.h +3 -0
@@ -53,6 +53,9 @@ typedef struct ARMCPUClass {uint32_t c0_c2[8 ];uint32_t c1_sys; } cp15; +struct { +uint32_t fpsid; + } vfp;uint32_t features; } ARMCPUClass;
target-arm/cpu.c +11 -0
@@ -52,6 +52,7 @@ static void arm_cpu_reset(CPUState *c)/* Genuine reset */ env->cp15.c1_sys = klass->cp15.c1_sys; + env->vfp.xregs[ARM_VFP_FPSID ] = klass->vfp.fpsid;#if defined(CONFIG_USER_ONLY ) env->uncached_cpsr =ARM_CPU_MODE_USR ;
@@ -177,6 +178,7 @@ typedef struct ARMCPUInfo {uint32_t cp15_c0_c1[8 ];uint32_t cp15_c0_c2[8 ];uint32_t cp15_c1_sys; +uint32_t vfp_fpsid;uint32_t features;void (*class_init)(ARMCPUClass *klass,const struct ARMCPUInfo *info); } ARMCPUInfo;
@@ -263,6 +265,7 @@ static const ARMCPUInfo arm_cpus[] = { .id = 0x41069265, .cp15_c0_cachetype = 0x1dd20d2, .cp15_c1_sys = 0x00090078, + .vfp_fpsid = 0x41011090, .features =ARM_FEATURE (V5 ) | ARM_FEATURE(VFP), },
@@ -279,6 +282,7 @@ static const ARMCPUInfo arm_cpus[] = { .id = 0x4106a262, .cp15_c0_cachetype = 0x1dd20d2, .cp15_c1_sys = 0x00090078, + .vfp_fpsid = 0x410110a0, .features =ARM_FEATURE (V5 ) |ARM_FEATURE (VFP ) | ARM_FEATURE(AUXCR),
@@ -305,6 +309,7 @@ static const ARMCPUInfo arm_cpus[] = { 0x141, 0, 0, 0 }, .cp15_c1_sys = 0x00050078, + .vfp_fpsid = 0x410120b4, .features =ARM_FEATURE (V6 ) | ARM_FEATURE(VFP), },
@@ -321,6 +326,7 @@ static const ARMCPUInfo arm_cpus[] = {0x01141 ,0 ,0 ,0 }, .cp15_c1_sys = 0x00050078, + .vfp_fpsid = 0x410120b5, .features = ARM_FEATURE(V6K) |ARM_FEATURE (VFP ) | ARM_FEATURE(VAPA),
@@ -337,6 +343,7 @@ static const ARMCPUInfo arm_cpus[] = {0x00100011 ,0x12002111 ,0x11221011 ,0x01102131 ,0x141 ,0 ,0 ,0 }, + .vfp_fpsid = 0x410120b4, .features = ARM_FEATURE(V6K) |ARM_FEATURE (VFP ) | ARM_FEATURE(VAPA),
@@ -360,6 +367,7 @@ static const ARMCPUInfo arm_cpus[] = {0x00111142 ,0 ,0 ,0 }, .cp15_c1_sys = 0x00c50078, + .vfp_fpsid = 0x410330c0, .features = ARM_FEATURE(V7) |ARM_FEATURE (VFP3 ) | ARM_FEATURE(NEON) |
@@ -378,6 +386,7 @@ static const ARMCPUInfo arm_cpus[] = {0x00111142 ,0 ,0 ,0 }, .cp15_c1_sys = 0x00c50078, + .vfp_fpsid = 0x41033090, .features = ARM_FEATURE(V7) |ARM_FEATURE (VFP3 ) | ARM_FEATURE(VFP_FP16) |
@@ -402,6 +411,7 @@ static const ARMCPUInfo arm_cpus[] = {0x10011142 ,0 ,0 ,0 }, .cp15_c1_sys = 0x00c50078, + .vfp_fpsid = 0x410430f0, .features = ARM_FEATURE(V7) |ARM_FEATURE (VFP4 ) | ARM_FEATURE(VFP_FP16) |
@@ -526,6 +536,7 @@ static void arm_cpu_class_init(ObjectClass *klass, void *data)memcpy (k->cp15.c0_c1, info->cp15_c0_c1,8 *sizeof (uint32_t ));memcpy (k->cp15.c0_c2, info->cp15_c0_c2,8 *sizeof (uint32_t )); k->cp15.c1_sys = info->cp15_c1_sys; + k->vfp.fpsid = info->vfp_fpsid; k->features = info->features;if (info->class_init !=NULL ) {
target-arm/cpu.h +0 -1
@@ -403,7 +403,6 @@ void cpu_arm_set_cp_io(CPUARMState *env, int cpnum,#define ARM_CPUID (env) (env->cp15.c0_cpuid)#define ARM_CPUID_ARM1026 0x4106a262 -#define ARM_CPUID_ARM926 0x41069265#define ARM_CPUID_TI915T 0x54029152#define ARM_CPUID_TI925T 0x54029252#define ARM_CPUID_ARM1136 0x4117b363
target-arm/helper.c +0 -12
@@ -8,12 +8,6 @@static void cpu_reset_model_id (CPUARMState *env,uint32_t id) {switch (id) { -case ARM_CPUID_ARM926 : - env->vfp.xregs[ARM_VFP_FPSID ] =0x41011090 ; -break ; -case ARM_CPUID_ARM1026 : - env->vfp.xregs[ARM_VFP_FPSID ] =0x410110a0 ; -break ;case ARM_CPUID_ARM1136 :/* This is the 1136 r1, which is a v6K core */ /* Fall through */
@@ -26,22 +20,18 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id)* for 1136_r2 (in particular r0p2 does not actually implement most * of the ID registers). */ - env->vfp.xregs[ARM_VFP_FPSID ] =0x410120b4 ; env->vfp.xregs[ARM_VFP_MVFR0 ] =0x11111111 ; env->vfp.xregs[ARM_VFP_MVFR1 ] =0x00000000 ;break ;case ARM_CPUID_ARM1176 : - env->vfp.xregs[ARM_VFP_FPSID ] =0x410120b5 ; env->vfp.xregs[ARM_VFP_MVFR0 ] =0x11111111 ; env->vfp.xregs[ARM_VFP_MVFR1 ] =0x00000000 ;break ;case ARM_CPUID_ARM11MPCORE : - env->vfp.xregs[ARM_VFP_FPSID ] =0x410120b4 ; env->vfp.xregs[ARM_VFP_MVFR0 ] =0x11111111 ; env->vfp.xregs[ARM_VFP_MVFR1 ] =0x00000000 ;break ;case ARM_CPUID_CORTEXA8 : - env->vfp.xregs[ARM_VFP_FPSID ] =0x410330c0 ; env->vfp.xregs[ARM_VFP_MVFR0 ] =0x11110222 ; env->vfp.xregs[ARM_VFP_MVFR1 ] =0x00011100 ; env->cp15.c0_clid = (1 <<27 ) | (2 <<24 ) |3 ;
@@ -50,7 +40,6 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id) env->cp15.c0_ccsid[2 ] =0xf0000000 ;/* No L2 icache. */ break ;case ARM_CPUID_CORTEXA9 : - env->vfp.xregs[ARM_VFP_FPSID ] =0x41033090 ; env->vfp.xregs[ARM_VFP_MVFR0 ] =0x11110222 ; env->vfp.xregs[ARM_VFP_MVFR1 ] =0x01111111 ; env->cp15.c0_clid = (1 <<27 ) | (1 <<24 ) |3 ;
@@ -58,7 +47,6 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id) env->cp15.c0_ccsid[1 ] =0x200fe015 ;/* 16k L1 icache. */ break ;case ARM_CPUID_CORTEXA15 : - env->vfp.xregs[ARM_VFP_FPSID ] =0x410430f0 ; env->vfp.xregs[ARM_VFP_MVFR0 ] =0x10110222 ; env->vfp.xregs[ARM_VFP_MVFR1 ] =0x11111111 ; env->cp15.c0_clid =0x0a200023 ;
Signature · 1 line
1.7.7
RFC PATCH v4 7/20 target-arm: No longer abort on unhandled CPUIDs on reset
In reply to Andreas FärberHaving moved the reset code for some CPUs to class_init, we can drop some of the cases in the switch.
--- target-arm/cpu.h | 2 -- target-arm/helper.c | 5 ----- 2 files changed, 0 insertions(+), 7 deletions(-)
target-arm/cpu.h +0 -2
@@ -427,8 +427,6 @@ void cpu_arm_set_cp_io(CPUARMState *env, int cpnum,#define ARM_CPUID_CORTEXA8 0x410fc080#define ARM_CPUID_CORTEXA9 0x410fc090#define ARM_CPUID_CORTEXA15 0x412fc0f1 -#define ARM_CPUID_CORTEXM3 0x410fc231 -#define ARM_CPUID_ANY 0xffffffff#if defined(CONFIG_USER_ONLY )#define TARGET_PAGE_BITS 12
target-arm/helper.c +0 -5
@@ -136,10 +136,6 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id) env->cp15.c0_ccsid[2 ] =0x711fe07a ;/* 4096K L2 unified cache */ env->cp15.c1_sys =0x00c50078 ;break ; -case ARM_CPUID_CORTEXM3 : -break ; -case ARM_CPUID_ANY :/* For userspace emulation. */ -break ;case ARM_CPUID_TI915T :case ARM_CPUID_TI925T : env->cp15.c0_cachetype =0x5109149 ;
@@ -172,7 +168,6 @@ static void cpu_reset_model_id(CPUARMState *env, uint32_t id) env->cp15.c1_sys =0x00000070 ;break ;default : -cpu_abort (env,"Bad CPU ID: %x\n" , id);break ; } }
Signature · 1 line
1.7.7