From patchwork Tue Jun 29 07:58:50 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 57250 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 78CBEB6F0C for ; Tue, 29 Jun 2010 18:03:11 +1000 (EST) Received: from localhost ([127.0.0.1]:41755 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OTVme-00087m-Ld for incoming@patchwork.ozlabs.org; Tue, 29 Jun 2010 04:03:08 -0400 Received: from [140.186.70.92] (port=46233 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OTVij-0006lB-1V for qemu-devel@nongnu.org; Tue, 29 Jun 2010 03:59:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OTVih-00051P-6r for qemu-devel@nongnu.org; Tue, 29 Jun 2010 03:59:04 -0400 Received: from mail-vw0-f45.google.com ([209.85.212.45]:61791) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OTVih-00050W-1s for qemu-devel@nongnu.org; Tue, 29 Jun 2010 03:59:03 -0400 Received: by mail-vw0-f45.google.com with SMTP id 14so1857973vws.4 for ; Tue, 29 Jun 2010 00:59:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:from:to:cc:subject :date:message-id:x-mailer:in-reply-to:references; bh=AfpwwzNqkbsmrJNPcA+/vm1JXreGw5vr3UeEDn75e8M=; b=KWaZ1JHyzY9osyD0ctB63uTqXAj55wMJkSueMH/s4EhYP1SPRHNE2cjfMHVJqNvJCc QwgPsbozh0CkGquJ4hJHTIUm9yVpZEm7oLQAQjsWAUYukN2YqKfuDouRnLP4nYYRJ8yd LgZe4eUIvBmkXnpw4x2EaNp/+68wxISzB4Z40= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; b=eSHLe0xRgzUvA0jWLenMHhTjKOIslVomNIEFGRcLBpKbD64ZeMfKWkh1mwSDBOhd6O QkeS/0TL73kPoGXjzkJfQPBkmrEdl5tIvNlfz3syHIefUpXUjrWbLnr6QZswhRRrOEJt iZS6wHhRSG4y/KblZB+M/md8jKMmW+SVZjqDQ= Received: by 10.220.47.142 with SMTP id n14mr3682944vcf.87.1277798342650; Tue, 29 Jun 2010 00:59:02 -0700 (PDT) Received: from localhost.localdomain (nat-pool-brq-t.redhat.com [209.132.186.34]) by mx.google.com with ESMTPS id h17sm6136800vcr.3.2010.06.29.00.59.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 29 Jun 2010 00:59:02 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Tue, 29 Jun 2010 09:58:50 +0200 Message-Id: <1277798332-32389-3-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.7.0.1 In-Reply-To: <1277798332-32389-1-git-send-email-pbonzini@redhat.com> References: <1277798332-32389-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: blauwirbel@gmail.com Subject: [Qemu-devel] [PATCH v2 2/4] move cpu_pc_from_tb to target-*/exec.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: 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(-) diff --git a/target-alpha/cpu.h b/target-alpha/cpu.h index 314d6ac..c333396 100644 --- a/target-alpha/cpu.h +++ b/target-alpha/cpu.h @@ -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) { diff --git a/target-alpha/exec.h b/target-alpha/exec.h index 0fb459d..a8a38d2 100644 --- a/target-alpha/exec.h +++ b/target-alpha/exec.h @@ -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__) */ diff --git a/target-arm/cpu.h b/target-arm/cpu.h index f3d138d..ddf764e 100644 --- a/target-arm/cpu.h +++ b/target-arm/cpu.h @@ -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) { diff --git a/target-arm/exec.h b/target-arm/exec.h index 0225c3f..e4c35a3 100644 --- a/target-arm/exec.h +++ b/target-arm/exec.h @@ -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; +} + diff --git a/target-cris/cpu.h b/target-cris/cpu.h index a62d57c..f86c52a 100644 --- a/target-cris/cpu.h +++ b/target-cris/cpu.h @@ -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) { diff --git a/target-cris/exec.h b/target-cris/exec.h index 55776ba..93ce768 100644 --- a/target-cris/exec.h +++ b/target-cris/exec.h @@ -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; +} + diff --git a/target-i386/cpu.h b/target-i386/cpu.h index 8dafa0d..e320c80 100644 --- a/target-i386/cpu.h +++ b/target-i386/cpu.h @@ -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) { diff --git a/target-i386/exec.h b/target-i386/exec.h index 4ff3c57..fc8945b 100644 --- a/target-i386/exec.h +++ b/target-i386/exec.h @@ -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; +} + diff --git a/target-m68k/cpu.h b/target-m68k/cpu.h index b2f37ec..0f84514 100644 --- a/target-m68k/cpu.h +++ b/target-m68k/cpu.h @@ -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) { diff --git a/target-m68k/exec.h b/target-m68k/exec.h index ece9aa0..f31e06e 100644 --- a/target-m68k/exec.h +++ b/target-m68k/exec.h @@ -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; +} + diff --git a/target-microblaze/cpu.h b/target-microblaze/cpu.h index ff8c8c8..a2677cf 100644 --- a/target-microblaze/cpu.h +++ b/target-microblaze/cpu.h @@ -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]; diff --git a/target-microblaze/exec.h b/target-microblaze/exec.h index db1c99e..87b2494 100644 --- a/target-microblaze/exec.h +++ b/target-microblaze/exec.h @@ -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; +} + diff --git a/target-mips/cpu.h b/target-mips/cpu.h index c21b8e4..1aaca77 100644 --- a/target-mips/cpu.h +++ b/target-mips/cpu.h @@ -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) { diff --git a/target-mips/exec.h b/target-mips/exec.h index a07761d..af61b54 100644 --- a/target-mips/exec.h +++ b/target-mips/exec.h @@ -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__) */ diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h index 2ad4486..ca0eb1e 100644 --- a/target-ppc/cpu.h +++ b/target-ppc/cpu.h @@ -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) { diff --git a/target-ppc/exec.h b/target-ppc/exec.h index 09f592c..44cc5e9 100644 --- a/target-ppc/exec.h +++ b/target-ppc/exec.h @@ -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__) */ diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h index dd407b2..49d3128 100644 --- a/target-s390x/cpu.h +++ b/target-s390x/cpu.h @@ -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) { diff --git a/target-s390x/exec.h b/target-s390x/exec.h index 837f853..bf3f264 100644 --- a/target-s390x/exec.h +++ b/target-s390x/exec.h @@ -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; +} + diff --git a/target-sh4/cpu.h b/target-sh4/cpu.h index f8b1680..f2dee37 100644 --- a/target-sh4/cpu.h +++ b/target-sh4/cpu.h @@ -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, diff --git a/target-sh4/exec.h b/target-sh4/exec.h index edd667d..2999c02 100644 --- a/target-sh4/exec.h +++ b/target-sh4/exec.h @@ -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 */ diff --git a/target-sparc/cpu.h b/target-sparc/cpu.h index 8f0484b..95fe3dc 100644 --- a/target-sparc/cpu.h +++ b/target-sparc/cpu.h @@ -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) { diff --git a/target-sparc/exec.h b/target-sparc/exec.h index c84e055..f811571 100644 --- a/target-sparc/exec.h +++ b/target-sparc/exec.h @@ -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