introduce NEED_GLOBAL_ENV
v2 cover introduce NEED_GLOBAL_ENV
Let's start the cleanups from the feature required by Blue Swirl. I also include here a baby step towards removing eminently TCG-related stuff from cpu.h.
After this series, only a bunch of files will include exec-all.h, instead of getting it indirectly from cpu.h.
Note that (as sworn in the previous submission) exec.h is only included by files that need the global register variable (i.e. cpu-exec.c and target-*/op_helper.c), and this is the same subset that gets NEED_GLOBAL_ENV in this patchset.
i386 and sparc have functions declared in cpu.h that are in op_helper.c. I checked that these do not need the global variable, but it would be nice to cleanup those too.
v1->v2: leave in #undefs, add static to cpu_mips_tlb_flush
Paolo Bonzini (4):
remove unused stuff from */exec.h
move cpu_pc_from_tb to target-*/exec.h
remove exec-all.h inclusion from cpu.h
require #define NEED_GLOBAL_ENV for files that need the global
register variable
cpu-exec.c | 2 ++ exec-all.h | 4 ++++ gdbstub.c | 1 + hw/xen_domainbuild.c | 1 + kvm-stub.c | 1 + monitor.c | 1 + target-alpha/cpu.h | 6 ------ target-alpha/exec.h | 9 +++++---- target-alpha/op_helper.c | 1 + target-arm/cpu.h | 6 ------ target-arm/exec.h | 8 ++++++-- target-arm/op_helper.c | 1 + target-cris/cpu.h | 6 ------ target-cris/exec.h | 11 ++++++----- target-cris/op_helper.c | 1 + target-i386/cpu.h | 7 ------- target-i386/exec.h | 8 ++++++-- target-i386/op_helper.c | 3 ++- target-m68k/cpu.h | 6 ------ target-m68k/exec.h | 8 ++++++-- target-m68k/op_helper.c | 2 ++ target-microblaze/cpu.h | 6 ------ target-microblaze/exec.h | 10 ++++++---- target-microblaze/op_helper.c | 1 + target-mips/cpu.h | 8 -------- target-mips/exec.h | 17 +++++++---------- target-mips/op_helper.c | 9 ++++++++- target-ppc/cpu.h | 6 ------ target-ppc/exec.h | 7 +++++-- target-ppc/op_helper.c | 2 ++ target-s390x/cpu.h | 6 ------ target-s390x/exec.h | 8 ++++++-- target-s390x/op_helper.c | 1 + target-sh4/cpu.h | 7 ------- target-sh4/exec.h | 8 ++++++-- target-sh4/op_helper.c | 2 ++ target-sparc/cpu.h | 7 ------- target-sparc/exec.h | 8 ++++++-- target-sparc/op_helper.c | 1 + 39 files changed, 97 insertions(+), 110 deletions(-)
PATCH v2 1/4 remove unused stuff from */exec.h
--- target-alpha/exec.h | 2 -- target-cris/exec.h | 3 --- target-i386/op_helper.c | 2 +- target-microblaze/exec.h | 2 -- target-mips/exec.h | 8 -------- target-mips/op_helper.c | 7 ++++++- 6 files changed, 7 insertions(+), 17 deletions(-)
target-alpha/exec.h +0 -2
@@ -28,8 +28,6 @@ register struct CPUAlphaState *env asm(AREG0); -#define PARAM (n) ((uint64_t)PARAM##n) -#define SPARAM (n) ((int32_t)PARAM##n)#define FP_STATUS (env->fp_status)#include "cpu.h"
target-cris/exec.h +0 -3
@@ -28,9 +28,6 @@ register struct CPUCRISState *env asm(AREG0);#include "softmmu_exec.h" #endif -void cpu_cris_flush_flags (CPUCRISState *env,int cc_op); -void helper_movec (CPUCRISState *env,int reg,uint32_t val); -static inline int cpu_has_work (CPUState *env) {return (env->interrupt_request & (CPU_INTERRUPT_HARD |CPU_INTERRUPT_NMI ));
target-i386/op_helper.c +1 -1
@@ -16,7 +16,7 @@* You should have received a copy of the GNU Lesser General Public * License along with this library; if not, see <http://www.gnu.org/licenses/>. */ -#define CPU_NO_GLOBAL_REGS +#include "exec.h" #include "exec-all.h" #include "host-utils.h"
target-microblaze/exec.h +0 -2
@@ -27,8 +27,6 @@ register struct CPUMBState *env asm(AREG0);#include "softmmu_exec.h" #endif -void cpu_mb_flush_flags (CPUMBState *env,int cc_op); -static inline int cpu_has_work (CPUState *env) {return (env->interrupt_request & (CPU_INTERRUPT_HARD |CPU_INTERRUPT_NMI ));
target-mips/exec.h +0 -8
@@ -17,14 +17,6 @@ register struct CPUMIPSState *env asm(AREG0);#include "softmmu_exec.h" #endif /* !defined(CONFIG_USER_ONLY) */ -void dump_fpu (CPUState *env); -void fpu_dump_state (CPUState *env,FILE *f, -int (*fpu_fprintf)(FILE *f,const char *fmt, ...), -int flags); - -void cpu_mips_clock_init (CPUState *env); -void cpu_mips_tlb_flush (CPUState *env,int flush_global); -static inline int cpu_has_work (CPUState *env) { return (env->interrupt_request &
target-mips/op_helper.c +6 -1
@@ -22,6 +22,11 @@#include "host-utils.h" #include "helper.h" + +#ifndef CONFIG_USER_ONLY +static inline void cpu_mips_tlb_flush (CPUState *env,int flush_global); +#endif +/*****************************************************************************/ /* Exceptions processing helpers */
@@ -1635,7 +1640,7 @@ target_ulong helper_yield(target_ulong arg1)#ifndef CONFIG_USER_ONLY /* TLB management */ -void cpu_mips_tlb_flush (CPUState *env,int flush_global) +static void cpu_mips_tlb_flush (CPUState *env,int flush_global) {/* Flush qemu's TLB and discard all shadowed entries. */ tlb_flush (env, flush_global);
Signature · 1 line
1.7.0.1
PATCH v2 2/4 move cpu_pc_from_tb to target-*/exec.h
In reply to Paolo Bonzini--- target-alpha/cpu.h | 5 ----- target-alpha/exec.h | 5 +++++ target-arm/cpu.h | 5 ----- target-arm/exec.h | 6 ++++++ target-cris/cpu.h | 5 ----- target-cris/exec.h | 6 ++++++ target-i386/cpu.h | 5 ----- target-i386/exec.h | 6 ++++++ target-m68k/cpu.h | 5 ----- target-m68k/exec.h | 6 ++++++ target-microblaze/cpu.h | 5 ----- target-microblaze/exec.h | 6 ++++++ target-mips/cpu.h | 7 ------- target-mips/exec.h | 7 +++++++ target-ppc/cpu.h | 5 ----- target-ppc/exec.h | 5 +++++ target-s390x/cpu.h | 5 ----- target-s390x/exec.h | 6 ++++++ target-sh4/cpu.h | 6 ------ target-sh4/exec.h | 6 ++++++ target-sparc/cpu.h | 6 ------ target-sparc/exec.h | 6 ++++++ 22 files changed, 65 insertions(+), 59 deletions(-)
target-alpha/cpu.h +0 -5
@@ -512,11 +512,6 @@ void pal_init (CPUState *env);void call_pal (CPUState *env);#endif -static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) -{ - env->pc = tb->pc; -} -static inline void cpu_get_tb_cpu_state (CPUState *env,target_ulong *pc,target_ulong *cs_base,int *flags) {
target-alpha/exec.h +5 -0
@@ -53,4 +53,9 @@ static inline int cpu_halted(CPUState *env) return EXCP_HALTED; } +static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) +{ + env->pc = tb->pc; +} +#endif /* !defined (__ALPHA_EXEC_H__) */
target-arm/cpu.h +0 -5
@@ -437,11 +437,6 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp)#include "cpu-all.h" #include "exec-all.h" -static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) -{ - env->regs[15 ] = tb->pc; -} -static inline void cpu_get_tb_cpu_state (CPUState *env,target_ulong *pc,target_ulong *cs_base,int *flags) {
target-arm/exec.h +6 -0
@@ -50,3 +50,9 @@ static inline int cpu_halted(CPUState *env) {#endif void raise_exception (int ); + +static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) +{ + env->regs[15 ] = tb->pc; +} +
target-cris/cpu.h +0 -5
@@ -252,11 +252,6 @@ static inline void cpu_set_tls(CPUCRISState *env, target_ulong newtls)#include "cpu-all.h" #include "exec-all.h" -static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) -{ - env->pc = tb->pc; -} -static inline void cpu_get_tb_cpu_state (CPUState *env,target_ulong *pc,target_ulong *cs_base,int *flags) {
target-cris/exec.h +6 -0
@@ -45,3 +45,9 @@ static inline int cpu_halted(CPUState *env) { }return EXCP_HALTED ; } + +static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) +{ + env->pc = tb->pc; +} +
target-i386/cpu.h +0 -5
@@ -936,11 +936,6 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp)#include "hw/apic.h" #endif -static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) -{ - env->eip = tb->pc - tb->cs_base; -} -static inline void cpu_get_tb_cpu_state (CPUState *env,target_ulong *pc,target_ulong *cs_base,int *flags) {
target-i386/exec.h +6 -0
@@ -327,3 +327,9 @@ static inline void cpu_load_efer(CPUState *env, uint64_t val)if (env->efer &MSR_EFER_SVME ) env->hflags |=HF_SVME_MASK ; } + +static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) +{ + env->eip = tb->pc - tb->cs_base; +} +
target-m68k/cpu.h +0 -5
@@ -244,11 +244,6 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp)#include "cpu-all.h" #include "exec-all.h" -static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) -{ - env->pc = tb->pc; -} -static inline void cpu_get_tb_cpu_state (CPUState *env,target_ulong *pc,target_ulong *cs_base,int *flags) {
target-m68k/exec.h +6 -0
@@ -42,3 +42,9 @@ static inline int cpu_halted(CPUState *env) { }return EXCP_HALTED ; } + +static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) +{ + env->pc = tb->pc; +} +
target-microblaze/cpu.h +0 -5
@@ -307,11 +307,6 @@ static inline int cpu_interrupts_enabled(CPUState *env)#include "cpu-all.h" #include "exec-all.h" -static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) -{ - env->sregs[SR_PC ] = tb->pc; -} -static inline target_ulong cpu_get_pc (CPUState *env) {return env->sregs[SR_PC ];
target-microblaze/exec.h +6 -0
@@ -44,3 +44,9 @@ static inline int cpu_halted(CPUState *env) { }return EXCP_HALTED ; } + +static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) +{ + env->sregs[SR_PC ] = tb->pc; +} +
target-mips/cpu.h +0 -7
@@ -612,13 +612,6 @@ target_phys_addr_t cpu_mips_translate_address (CPUState *env, target_ulong addre int rw);#endif -static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) -{ - env->active_tc.PC = tb->pc; - env->hflags &= ~MIPS_HFLAG_BMASK ; - env->hflags |= tb->flags &MIPS_HFLAG_BMASK ; -} -static inline void cpu_get_tb_cpu_state (CPUState *env,target_ulong *pc,target_ulong *cs_base,int *flags) {
target-mips/exec.h +7 -0
@@ -76,4 +76,11 @@ static inline void compute_hflags(CPUState *env) } } +static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) +{ + env->active_tc.PC = tb->pc; + env->hflags &= ~MIPS_HFLAG_BMASK ; + env->hflags |= tb->flags &MIPS_HFLAG_BMASK ; +} +#endif /* !defined(__QEMU_MIPS_EXEC_H__) */
target-ppc/cpu.h +0 -5
@@ -1601,11 +1601,6 @@ enum {/*****************************************************************************/ -static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) -{ - env->nip = tb->pc; -} -static inline void cpu_get_tb_cpu_state (CPUState *env,target_ulong *pc,target_ulong *cs_base,int *flags) {
target-ppc/exec.h +5 -0
@@ -52,4 +52,9 @@ static inline int cpu_halted(CPUState *env) return EXCP_HALTED; } +static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) +{ + env->nip = tb->pc; +} +#endif /* !defined (__PPC_H__) */
target-s390x/cpu.h +0 -5
@@ -123,11 +123,6 @@ extern CPUState *s390_cpu_addr2state(uint16_t cpu_addr);#define EXCP_ADDR 5/* addressing exception */ #define EXCP_EXECUTE_SVC 0xff00000/* supervisor call via execute insn */ -static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock * tb) -{ - env->psw.addr = tb->pc; -} -static inline void cpu_get_tb_cpu_state (CPUState * env,target_ulong *pc,target_ulong *cs_base,int *flags) {
target-s390x/exec.h +6 -0
@@ -45,3 +45,9 @@ static inline int cpu_halted(CPUState *env) }return EXCP_HALTED ; } + +static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock * tb) +{ + env->psw.addr = tb->pc; +} +
target-sh4/cpu.h +0 -6
@@ -303,12 +303,6 @@ static inline int cpu_ptel_pr (uint32_t ptel)#define PTEA_TC (1 << 3)#define cpu_ptea_tc (ptea) (((ptea) & PTEA_TC) >> 3) -static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) -{ - env->pc = tb->pc; - env->flags = tb->flags; -} -#define TB_FLAG_PENDING_MOVCA (1 << 4) static inline void cpu_get_tb_cpu_state(CPUState *env, target_ulong *pc,
target-sh4/exec.h +6 -0
@@ -47,4 +47,10 @@ static inline int cpu_halted(CPUState *env) {#include "softmmu_exec.h" #endif +static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) +{ + env->pc = tb->pc; + env->flags = tb->flags; +} +#endif /* _EXEC_SH4_H */
target-sparc/cpu.h +0 -6
@@ -625,12 +625,6 @@ void cpu_tick_set_limit(CPUTimer *timer, uint64_t limit);trap_state *cpu_tsptr (CPUState * env);#endif -static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) -{ - env->pc = tb->pc; - env->npc = tb->cs_base; -} -static inline void cpu_get_tb_cpu_state (CPUState *env,target_ulong *pc,target_ulong *cs_base,int *flags) {
target-sparc/exec.h +6 -0
@@ -32,4 +32,10 @@ static inline int cpu_halted(CPUState *env1) { return EXCP_HALTED; } +static inline void cpu_pc_from_tb (CPUState *env,TranslationBlock *tb) +{ + env->pc = tb->pc; + env->npc = tb->cs_base; +} +#endif
Signature · 1 line
1.7.0.1
PATCH v2 3/4 remove exec-all.h inclusion from cpu.h
In reply to Paolo Bonzini--- gdbstub.c | 1 + hw/xen_domainbuild.c | 1 + kvm-stub.c | 1 + monitor.c | 1 + target-alpha/cpu.h | 1 - target-arm/cpu.h | 1 - target-cris/cpu.h | 1 - target-i386/cpu.h | 2 -- target-m68k/cpu.h | 1 - target-microblaze/cpu.h | 1 - target-mips/cpu.h | 1 - target-ppc/cpu.h | 1 - target-s390x/cpu.h | 1 - target-sh4/cpu.h | 1 - target-sparc/cpu.h | 1 - 15 files changed, 4 insertions(+), 12 deletions(-)
gdbstub.c +1 -0
@@ -37,6 +37,7 @@#define MAX_PACKET_LENGTH 4096 +#include "exec-all.h" #include "qemu_socket.h" #include "kvm.h"
hw/xen_domainbuild.c +1 -0
@@ -3,6 +3,7 @@#include "xen_domainbuild.h" #include "sysemu.h" #include "qemu-timer.h" +#include "qemu-log.h" #include <xenguest.h>
kvm-stub.c +1 -0
@@ -13,6 +13,7 @@#include "qemu-common.h" #include "sysemu.h" #include "hw/hw.h" +#include "exec-all.h" #include "gdbstub.h" #include "kvm.h"
monitor.c +1 -0
@@ -55,6 +55,7 @@#include "json-streamer.h" #include "json-parser.h" #include "osdep.h" +#include "exec-all.h" //#define DEBUG //#define DEBUG_COMPLETION
target-alpha/cpu.h +0 -1
@@ -413,7 +413,6 @@ static inline int cpu_mmu_index (CPUState *env) }#include "cpu-all.h" -#include "exec-all.h" enum {FEATURE_ASN =0x00000001 ,
target-arm/cpu.h +0 -1
@@ -435,7 +435,6 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp)#endif #include "cpu-all.h" -#include "exec-all.h" static inline void cpu_get_tb_cpu_state (CPUState *env,target_ulong *pc,target_ulong *cs_base,int *flags)
target-cris/cpu.h +0 -1
@@ -250,7 +250,6 @@ static inline void cpu_set_tls(CPUCRISState *env, target_ulong newtls)#define SFR_RW_MM_TLB_HI env->pregs[PR_SRS]][6#include "cpu-all.h" -#include "exec-all.h" static inline void cpu_get_tb_cpu_state (CPUState *env,target_ulong *pc,target_ulong *cs_base,int *flags)
target-i386/cpu.h +0 -2
@@ -928,8 +928,6 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp)#endif #include "cpu-all.h" -#include "exec-all.h" -#include "svm.h" #if !defined(CONFIG_USER_ONLY )
target-m68k/cpu.h +0 -1
@@ -242,7 +242,6 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp)#endif #include "cpu-all.h" -#include "exec-all.h" static inline void cpu_get_tb_cpu_state (CPUState *env,target_ulong *pc,target_ulong *cs_base,int *flags)
target-microblaze/cpu.h +0 -1
@@ -305,7 +305,6 @@ static inline int cpu_interrupts_enabled(CPUState *env) }#include "cpu-all.h" -#include "exec-all.h" static inline target_ulong cpu_get_pc (CPUState *env) {
target-mips/cpu.h +0 -1
@@ -526,7 +526,6 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp) }#include "cpu-all.h" -#include "exec-all.h" /* Memory access type : * may be needed for precise access rights control and precise exceptions.
target-ppc/cpu.h +0 -1
@@ -849,7 +849,6 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp)#endif #include "cpu-all.h" -#include "exec-all.h" /*****************************************************************************/ /* CRF definitions */
target-s390x/cpu.h +0 -1
@@ -116,7 +116,6 @@ extern CPUState *s390_cpu_addr2state(uint16_t cpu_addr);#define cpu_gen_code cpu_s390x_gen_code#include "cpu-all.h" -#include "exec-all.h" #define EXCP_OPEX 1/* operation exception (sigill) */ #define EXCP_SVC 2/* supervisor call (syscall) */
target-sh4/cpu.h +0 -1
@@ -211,7 +211,6 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp)#endif #include "cpu-all.h" -#include "exec-all.h" /* Memory access type */ enum {
target-sparc/cpu.h +0 -1
@@ -615,7 +615,6 @@ static inline void cpu_clone_regs(CPUState *env, target_ulong newsp)#endif #include "cpu-all.h" -#include "exec-all.h" #ifdef TARGET_SPARC64 /* sun4u.c */
Signature · 1 line
1.7.0.1
PATCH v2 4/4 require #define NEED_GLOBAL_ENV for files that need the global register variable
In reply to Paolo Bonzini--- cpu-exec.c | 2 ++ exec-all.h | 4 ++++ target-alpha/exec.h | 2 -- target-alpha/op_helper.c | 1 + target-arm/exec.h | 2 -- target-arm/op_helper.c | 1 + target-cris/exec.h | 2 -- target-cris/op_helper.c | 1 + target-i386/exec.h | 2 -- target-i386/op_helper.c | 1 + target-m68k/exec.h | 2 -- target-m68k/op_helper.c | 2 ++ target-microblaze/exec.h | 2 -- target-microblaze/op_helper.c | 1 + target-mips/exec.h | 2 -- target-mips/op_helper.c | 2 ++ target-ppc/exec.h | 2 -- target-ppc/op_helper.c | 2 ++ target-s390x/exec.h | 2 -- target-s390x/op_helper.c | 1 + target-sh4/exec.h | 2 -- target-sh4/op_helper.c | 2 ++ target-sparc/exec.h | 2 -- target-sparc/op_helper.c | 1 + 24 files changed, 21 insertions(+), 22 deletions(-)
cpu-exec.c +2 -0
@@ -16,7 +16,9 @@* You should have received a copy of the GNU Lesser General Public * License along with this library; if not, see <http://www.gnu.org/licenses/>. */ +#include "config.h" +#define NEED_GLOBAL_ENV #include "exec.h" #include "disas.h" #include "tcg.h"
exec-all.h +4 -0
@@ -353,4 +353,8 @@ extern int singlestep;/* cpu-exec.c */ extern volatile sig_atomic_t exit_request; +#ifdef NEED_GLOBAL_ENV +register CPUState *env asm(AREG0); +#endif +#endif
target-alpha/exec.h +0 -2
@@ -26,8 +26,6 @@#define TARGET_LONG_BITS 64 -register struct CPUAlphaState *env asm(AREG0); -#define FP_STATUS (env->fp_status)#include "cpu.h"
target-alpha/op_helper.c +1 -0
@@ -17,6 +17,7 @@* License along with this library; if not, see <http://www.gnu.org/licenses/>. */ +#define NEED_GLOBAL_ENV #include "exec.h" #include "host-utils.h" #include "softfloat.h"
target-arm/exec.h +0 -2
@@ -19,8 +19,6 @@#include "config.h" #include "dyngen-exec.h" -register struct CPUARMState *env asm(AREG0); -#define M0 env->iwmmxt.val#include "cpu.h"
target-arm/op_helper.c +1 -0
@@ -16,6 +16,7 @@* You should have received a copy of the GNU Lesser General Public * License along with this library; if not, see <http://www.gnu.org/licenses/>. */ +#define NEED_GLOBAL_ENV #include "exec.h" #include "helpers.h"
target-cris/exec.h +0 -2
@@ -19,8 +19,6 @@*/ #include "dyngen-exec.h" -register struct CPUCRISState *env asm(AREG0); -#include "cpu.h" #include "exec-all.h"
target-cris/op_helper.c +1 -0
@@ -18,6 +18,7 @@* License along with this library; if not, see <http://www.gnu.org/licenses/>. */ +#define NEED_GLOBAL_ENV #include "exec.h" #include "mmu.h" #include "helper.h"
target-i386/exec.h +0 -2
@@ -28,8 +28,6 @@#include "cpu-defs.h" -register struct CPUX86State *env asm(AREG0); -#include "qemu-common.h" #include "qemu-log.h"
target-i386/op_helper.c +1 -0
@@ -17,6 +17,7 @@* License along with this library; if not, see <http://www.gnu.org/licenses/>. */ +#define NEED_GLOBAL_ENV #include "exec.h" #include "exec-all.h" #include "host-utils.h"
target-m68k/exec.h +0 -2
@@ -19,8 +19,6 @@*/ #include "dyngen-exec.h" -register struct CPUM68KState *env asm(AREG0); -#include "cpu.h" #include "exec-all.h"
target-m68k/op_helper.c +2 -0
@@ -16,6 +16,8 @@* You should have received a copy of the GNU Lesser General Public * License along with this library; if not, see <http://www.gnu.org/licenses/>. */ + +#define NEED_GLOBAL_ENV #include "exec.h" #include "helpers.h"
target-microblaze/exec.h +0 -2
@@ -18,8 +18,6 @@*/ #include "dyngen-exec.h" -register struct CPUMBState *env asm(AREG0); -#include "cpu.h" #include "exec-all.h"
target-microblaze/op_helper.c +1 -0
@@ -17,6 +17,7 @@* License along with this library; if not, see <http://www.gnu.org/licenses/>. */ +#define NEED_GLOBAL_ENV #include <assert.h> #include "exec.h" #include "helper.h"
target-mips/exec.h +0 -2
@@ -8,8 +8,6 @@#include "dyngen-exec.h" #include "cpu-defs.h" -register struct CPUMIPSState *env asm(AREG0); -#include "cpu.h" #include "exec-all.h"
target-mips/op_helper.c +2 -0
@@ -16,6 +16,8 @@* You should have received a copy of the GNU Lesser General Public * License along with this library; if not, see <http://www.gnu.org/licenses/>. */ + +#define NEED_GLOBAL_ENV #include <stdlib.h> #include "exec.h"
target-ppc/exec.h +0 -2
@@ -29,8 +29,6 @@/* Precise emulation is needed to correctly emulate exception flags */ #define USE_PRECISE_EMULATION 1 -register struct CPUPPCState *env asm(AREG0); -#if !defined(CONFIG_USER_ONLY )#include "softmmu_exec.h" #endif /* !defined(CONFIG_USER_ONLY) */
target-ppc/op_helper.c +2 -0
@@ -16,6 +16,8 @@* You should have received a copy of the GNU Lesser General Public * License along with this library; if not, see <http://www.gnu.org/licenses/>. */ + +#define NEED_GLOBAL_ENV #include <string.h> #include "exec.h" #include "host-utils.h"
target-s390x/exec.h +0 -2
@@ -19,8 +19,6 @@#include "dyngen-exec.h" -register struct CPUS390XState *env asm(AREG0); -#include "config.h" #include "cpu.h" #include "exec-all.h"
target-s390x/op_helper.c +1 -0
@@ -17,6 +17,7 @@* License along with this library; if not, see <http://www.gnu.org/licenses/>. */ +#define NEED_GLOBAL_ENV #include "exec.h" /*****************************************************************************/
target-sh4/exec.h +0 -2
@@ -22,8 +22,6 @@#include "config.h" #include "dyngen-exec.h" -register struct CPUSH4State *env asm(AREG0); -#include "cpu.h" #include "exec-all.h"
target-sh4/op_helper.c +2 -0
@@ -18,6 +18,8 @@*/ #include <assert.h> #include <stdlib.h> + +#define NEED_GLOBAL_ENV #include "exec.h" #include "helper.h"
target-sparc/exec.h +0 -2
@@ -3,8 +3,6 @@#include "config.h" #include "dyngen-exec.h" -register struct CPUSPARCState *env asm(AREG0); -#include "cpu.h" #include "exec-all.h"
target-sparc/op_helper.c +1 -0
@@ -1,3 +1,4 @@ +#define NEED_GLOBAL_ENV #include "exec.h" #include "host-utils.h" #include "helper.h"
Signature · 4 lines
1.7.0.1 #include <stdlib.h> #include "exec.h"
target-ppc/exec.h +0 -2
@@ -29,8 +29,6 @@/* Precise emulation is needed to correctly emulate exception flags */ #define USE_PRECISE_EMULATION 1 -register struct CPUPPCState *env asm(AREG0); -#if !defined(CONFIG_USER_ONLY )#include "softmmu_exec.h" #endif /* !defined(CONFIG_USER_ONLY) */
target-ppc/op_helper.c +2 -0
@@ -16,6 +16,8 @@* You should have received a copy of the GNU Lesser General Public * License along with this library; if not, see <http://www.gnu.org/licenses/>. */ + +#define NEED_GLOBAL_ENV #include <string.h> #include "exec.h" #include "host-utils.h"
target-s390x/exec.h +0 -2
@@ -19,8 +19,6 @@#include "dyngen-exec.h" -register struct CPUS390XState *env asm(AREG0); -#include "config.h" #include "cpu.h" #include "exec-all.h"
target-s390x/op_helper.c +1 -0
@@ -17,6 +17,7 @@* License along with this library; if not, see <http://www.gnu.org/licenses/>. */ +#define NEED_GLOBAL_ENV #include "exec.h" /*****************************************************************************/
target-sh4/exec.h +0 -2
@@ -22,8 +22,6 @@#include "config.h" #include "dyngen-exec.h" -register struct CPUSH4State *env asm(AREG0); -#include "cpu.h" #include "exec-all.h"
target-sh4/op_helper.c +2 -0
@@ -18,6 +18,8 @@*/ #include <assert.h> #include <stdlib.h> + +#define NEED_GLOBAL_ENV #include "exec.h" #include "helper.h"
target-sparc/exec.h +0 -2
@@ -3,8 +3,6 @@#include "config.h" #include "dyngen-exec.h" -register struct CPUSPARCState *env asm(AREG0); -#include "cpu.h" #include "exec-all.h"
target-sparc/op_helper.c +1 -0
@@ -1,3 +1,4 @@ +#define NEED_GLOBAL_ENV #include "exec.h" #include "host-utils.h" #include "helper.h"
Signature · 1 line
1.7.0.1
Blue Swirl
AppliedThanks, applied patches 1 to 3.
Quoted 67 lines · Paolo Bonzini
Let's start the cleanups from the feature required by Blue Swirl. I also include here a baby step towards removing eminently TCG-related stuff from
cpu.h.After this series, only a bunch of files will include
exec-all.h, instead of getting it indirectly fromcpu.h.Note that (as sworn in the previous submission)
exec.his only included by files that need the global register variable (i.e.cpu-exec.candtarget-*/op_helper.c), and this is the same subset that getsNEED_GLOBAL_ENVin this patchset.i386 and sparc have functions declared in
cpu.hthat are inop_helper.c. I checked that these do not need the global variable, but it would be nice to cleanup those too.
v1->v2: leave in #undefs, add static tocpu_mips_tlb_flushPaolo Bonzini (4):
remove unused stuff from*/exec.h
movecpu_pc_from_tbtotarget-*/exec.h
removeexec-all.hinclusion fromcpu.h
require #defineNEED_GLOBAL_ENVfor files that need the global register variablecpu-exec.c | 2 ++ exec-all.h | 4 ++++ gdbstub.c | 1 +hw/xen_domainbuild.c | 1 +
kvm-stub.c | 1 +
monitor.c | 1 +
target-alpha/cpu.h | 6 ------
target-alpha/exec.h | 9 +++++----
target-alpha/op_helper.c | 1 +
target-arm/cpu.h | 6 ------
target-arm/exec.h | 8 ++++++--
target-arm/op_helper.c | 1 +
target-cris/cpu.h | 6 ------
target-cris/exec.h | 11 ++++++-----
target-cris/op_helper.c | 1 +
target-i386/cpu.h | 7 -------
target-i386/exec.h | 8 ++++++--
target-i386/op_helper.c | 3 ++-
target-m68k/cpu.h | 6 ------
target-m68k/exec.h | 8 ++++++--target-m68k/op_helper.c | 2 ++ target-microblaze/cpu.h | 6 ------ target-microblaze/exec.h | 10 ++++++----target-microblaze/op_helper.c | 1 +
target-mips/cpu.h| 8 --------target-mips/exec.h| 17 +++++++----------target-mips/op_helper.c| 9 ++++++++-target-ppc/cpu.h| 6 ------target-ppc/exec.h| 7 +++++--target-ppc/op_helper.c| 2 ++target-s390x/cpu.h| 6 ------target-s390x/exec.h| 8 ++++++--target-s390x/op_helper.c| 1 +target-sh4/cpu.h| 7 -------target-sh4/exec.h| 8 ++++++--target-sh4/op_helper.c| 2 ++target-sparc/cpu.h| 7 -------target-sparc/exec.h| 8 ++++++--target-sparc/op_helper.c| 1 +39 files changed, 97 insertions(+), 110 deletions(-)