From patchwork Mon Apr 9 19:47:18 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 151464 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 99764B700D for ; Tue, 10 Apr 2012 05:47:54 +1000 (EST) Received: from localhost ([::1]:42372 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHKZ6-0001TD-IU for incoming@patchwork.ozlabs.org; Mon, 09 Apr 2012 15:47:52 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56061) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHKYw-0001Ss-Ku for qemu-devel@nongnu.org; Mon, 09 Apr 2012 15:47:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SHKYt-0002C5-Iy for qemu-devel@nongnu.org; Mon, 09 Apr 2012 15:47:42 -0400 Received: from mail-iy0-f173.google.com ([209.85.210.173]:47226) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SHKYt-00028P-AE for qemu-devel@nongnu.org; Mon, 09 Apr 2012 15:47:39 -0400 Received: by mail-iy0-f173.google.com with SMTP id j26so7538618iaf.4 for ; Mon, 09 Apr 2012 12:47:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=YpBh+/q1qrFGJhTIOrTfhbNBQycKynep+MlItYi7lm8=; b=cuBcrnpewtQvjDgeZji9HJ1dT6CZ7NZkeRmVIr6MR4P4jE3Die6v/RLxiQr/FNSnU/ nFWwXG3IixwIZ5oBEreO0CcsmUoHj/z8sUNxgPzeBXAV2RCHp5dRPtOVJiYLn5EN4OWo MLafy+9exf1AAnl0g0AsN/NP0mSf99zYR8oVsIgW298Oa5gGj/jk5MFJMXSISYXjsTdv Sq5O8elha6ktH5SZfTrzc0bzDS11gReZ5NcuKYH5kHwDucCvzgCihgStOFR4g7DhkpLJ uZkxdbf9tcUpJlr6Rp9zo/lRWzcYGSEfZv+7yb9zFX0qGUs4qdkuVyb3bUddCZ71tuZe XiZw== Received: by 10.50.153.198 with SMTP id vi6mr231181igb.0.1334000858501; Mon, 09 Apr 2012 12:47:38 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.197.194 with HTTP; Mon, 9 Apr 2012 12:47:18 -0700 (PDT) From: Blue Swirl Date: Mon, 9 Apr 2012 19:47:18 +0000 Message-ID: To: qemu-devel X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.210.173 Subject: [Qemu-devel] [PATCH 3/4] softmmu: move TCG memory access helpers to TCG targets X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Blue Swirl --- target-alpha/mem_helper.c | 14 -------------- target-sparc/ldst_helper.c | 13 ------------- tcg/arm/tcg-target.c | 14 ++++++++++++++ tcg/hppa/tcg-target.c | 14 ++++++++++++++ tcg/i386/tcg-target.c | 14 ++++++++++++++ tcg/ia64/tcg-target.c | 14 ++++++++++++++ tcg/mips/tcg-target.c | 14 ++++++++++++++ tcg/ppc/tcg-target.c | 14 ++++++++++++++ tcg/ppc64/tcg-target.c | 14 ++++++++++++++ tcg/s390/tcg-target.c | 14 ++++++++++++++ tcg/sparc/tcg-target.c | 14 ++++++++++++++ tci.c | 21 +++++++++++++++++++++ 12 files changed, 147 insertions(+), 27 deletions(-) { From d031df638ed1b3cedfe516cfddb13e1211070a43 Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: <524db9d8331b9f4a43459081909e8816f77b3952.1333999313.git.blauwirbel@gmail.com> References: <524db9d8331b9f4a43459081909e8816f77b3952.1333999313.git.blauwirbel@gmail.com> From: Blue Swirl Date: Sun, 8 Apr 2012 12:21:48 +0000 Subject: [PATCH 3/4] softmmu: move TCG memory access helpers to TCG targets Signed-off-by: Blue Swirl --- target-alpha/mem_helper.c | 14 -------------- target-sparc/ldst_helper.c | 13 ------------- tcg/arm/tcg-target.c | 14 ++++++++++++++ tcg/hppa/tcg-target.c | 14 ++++++++++++++ tcg/i386/tcg-target.c | 14 ++++++++++++++ tcg/ia64/tcg-target.c | 14 ++++++++++++++ tcg/mips/tcg-target.c | 14 ++++++++++++++ tcg/ppc/tcg-target.c | 14 ++++++++++++++ tcg/ppc64/tcg-target.c | 14 ++++++++++++++ tcg/s390/tcg-target.c | 14 ++++++++++++++ tcg/sparc/tcg-target.c | 14 ++++++++++++++ tci.c | 21 +++++++++++++++++++++ 12 files changed, 147 insertions(+), 27 deletions(-) diff --git a/target-alpha/mem_helper.c b/target-alpha/mem_helper.c index a32ee75..489fc19 100644 --- a/target-alpha/mem_helper.c +++ b/target-alpha/mem_helper.c @@ -117,20 +117,6 @@ void cpu_unassigned_access(CPUAlphaState *env, target_phys_addr_t addr, #include "softmmu_exec.h" -#define MMUSUFFIX _mmu - -#define SHIFT 0 -#include "softmmu_template.h" - -#define SHIFT 1 -#include "softmmu_template.h" - -#define SHIFT 2 -#include "softmmu_template.h" - -#define SHIFT 3 -#include "softmmu_template.h" - /* try to fill the TLB and return an exception if error. If retaddr is NULL, it means that the function was called in C code (i.e. not from generated code or from helper.c) */ diff --git a/target-sparc/ldst_helper.c b/target-sparc/ldst_helper.c index d288318..f6e1f45 100644 --- a/target-sparc/ldst_helper.c +++ b/target-sparc/ldst_helper.c @@ -66,19 +66,6 @@ #if !defined(CONFIG_USER_ONLY) #include "softmmu_exec.h" -#define MMUSUFFIX _mmu - -#define SHIFT 0 -#include "softmmu_template.h" - -#define SHIFT 1 -#include "softmmu_template.h" - -#define SHIFT 2 -#include "softmmu_template.h" - -#define SHIFT 3 -#include "softmmu_template.h" #endif #if defined(TARGET_SPARC64) && !defined(CONFIG_USER_ONLY) diff --git a/tcg/arm/tcg-target.c b/tcg/arm/tcg-target.c index 4d59a63..99853dd 100644 --- a/tcg/arm/tcg-target.c +++ b/tcg/arm/tcg-target.c @@ -930,6 +930,20 @@ static inline void tcg_out_goto_label(TCGContext *s, int cond, int label_index) #include "../../softmmu_defs.h" #ifdef CONFIG_TCG_PASS_AREG0 +#define MMUSUFFIX _mmu + +#define SHIFT 0 +#include "softmmu_template.h" + +#define SHIFT 1 +#include "softmmu_template.h" + +#define SHIFT 2 +#include "softmmu_template.h" + +#define SHIFT 3 +#include "softmmu_template.h" + /* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr, int mmu_idx) */ static const void * const qemu_ld_helpers[4] = { diff --git a/tcg/hppa/tcg-target.c b/tcg/hppa/tcg-target.c index 2885212..abb7312 100644 --- a/tcg/hppa/tcg-target.c +++ b/tcg/hppa/tcg-target.c @@ -883,6 +883,20 @@ static void tcg_out_setcond2(TCGContext *s, int cond, TCGArg ret, #include "../../softmmu_defs.h" #ifdef CONFIG_TCG_PASS_AREG0 +#define MMUSUFFIX _mmu + +#define SHIFT 0 +#include "softmmu_template.h" + +#define SHIFT 1 +#include "softmmu_template.h" + +#define SHIFT 2 +#include "softmmu_template.h" + +#define SHIFT 3 +#include "softmmu_template.h" + /* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr, int mmu_idx) */ static const void * const qemu_ld_helpers[4] = { diff --git a/tcg/i386/tcg-target.c b/tcg/i386/tcg-target.c index 871a7e7..ce6cfe6 100644 --- a/tcg/i386/tcg-target.c +++ b/tcg/i386/tcg-target.c @@ -961,6 +961,20 @@ static void tcg_out_jmp(TCGContext *s, tcg_target_long dest) #include "../../softmmu_defs.h" #ifdef CONFIG_TCG_PASS_AREG0 +#define MMUSUFFIX _mmu + +#define SHIFT 0 +#include "softmmu_template.h" + +#define SHIFT 1 +#include "softmmu_template.h" + +#define SHIFT 2 +#include "softmmu_template.h" + +#define SHIFT 3 +#include "softmmu_template.h" + /* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr, int mmu_idx) */ static const void *qemu_ld_helpers[4] = { diff --git a/tcg/ia64/tcg-target.c b/tcg/ia64/tcg-target.c index e02dacc..7484395 100644 --- a/tcg/ia64/tcg-target.c +++ b/tcg/ia64/tcg-target.c @@ -1453,6 +1453,20 @@ static inline void tcg_out_qemu_tlb(TCGContext *s, TCGArg addr_reg, } #ifdef CONFIG_TCG_PASS_AREG0 +#define MMUSUFFIX _mmu + +#define SHIFT 0 +#include "softmmu_template.h" + +#define SHIFT 1 +#include "softmmu_template.h" + +#define SHIFT 2 +#include "softmmu_template.h" + +#define SHIFT 3 +#include "softmmu_template.h" + /* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr, int mmu_idx) */ static const void * const qemu_ld_helpers[4] = { diff --git a/tcg/mips/tcg-target.c b/tcg/mips/tcg-target.c index 393ba07..af97e03 100644 --- a/tcg/mips/tcg-target.c +++ b/tcg/mips/tcg-target.c @@ -751,6 +751,20 @@ static void tcg_out_setcond2(TCGContext *s, TCGCond cond, int ret, #include "../../softmmu_defs.h" #ifdef CONFIG_TCG_PASS_AREG0 +#define MMUSUFFIX _mmu + +#define SHIFT 0 +#include "softmmu_template.h" + +#define SHIFT 1 +#include "softmmu_template.h" + +#define SHIFT 2 +#include "softmmu_template.h" + +#define SHIFT 3 +#include "softmmu_template.h" + /* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr, int mmu_idx) */ static const void * const qemu_ld_helpers[4] = { diff --git a/tcg/ppc/tcg-target.c b/tcg/ppc/tcg-target.c index b0aa914..32347f2 100644 --- a/tcg/ppc/tcg-target.c +++ b/tcg/ppc/tcg-target.c @@ -509,6 +509,20 @@ static void tcg_out_call (TCGContext *s, tcg_target_long arg, int const_arg) #include "../../softmmu_defs.h" #ifdef CONFIG_TCG_PASS_AREG0 +#define MMUSUFFIX _mmu + +#define SHIFT 0 +#include "softmmu_template.h" + +#define SHIFT 1 +#include "softmmu_template.h" + +#define SHIFT 2 +#include "softmmu_template.h" + +#define SHIFT 3 +#include "softmmu_template.h" + /* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr, int mmu_idx) */ static const void * const qemu_ld_helpers[4] = { diff --git a/tcg/ppc64/tcg-target.c b/tcg/ppc64/tcg-target.c index f2ad9e3..3610d88 100644 --- a/tcg/ppc64/tcg-target.c +++ b/tcg/ppc64/tcg-target.c @@ -553,6 +553,20 @@ static void tcg_out_ldsta (TCGContext *s, int ret, int addr, #include "../../softmmu_defs.h" #ifdef CONFIG_TCG_PASS_AREG0 +#define MMUSUFFIX _mmu + +#define SHIFT 0 +#include "softmmu_template.h" + +#define SHIFT 1 +#include "softmmu_template.h" + +#define SHIFT 2 +#include "softmmu_template.h" + +#define SHIFT 3 +#include "softmmu_template.h" + /* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr, int mmu_idx) */ static const void * const qemu_ld_helpers[4] = { diff --git a/tcg/s390/tcg-target.c b/tcg/s390/tcg-target.c index 04662c1..90dd6fa 100644 --- a/tcg/s390/tcg-target.c +++ b/tcg/s390/tcg-target.c @@ -302,6 +302,20 @@ static const uint8_t tcg_cond_to_ltr_cond[10] = { #include "../../softmmu_defs.h" #ifdef CONFIG_TCG_PASS_AREG0 +#define MMUSUFFIX _mmu + +#define SHIFT 0 +#include "softmmu_template.h" + +#define SHIFT 1 +#include "softmmu_template.h" + +#define SHIFT 2 +#include "softmmu_template.h" + +#define SHIFT 3 +#include "softmmu_template.h" + /* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr, int mmu_idx) */ static const void * const qemu_ld_helpers[4] = { diff --git a/tcg/sparc/tcg-target.c b/tcg/sparc/tcg-target.c index 247a278..1227a15 100644 --- a/tcg/sparc/tcg-target.c +++ b/tcg/sparc/tcg-target.c @@ -716,6 +716,20 @@ static void tcg_target_qemu_prologue(TCGContext *s) #include "../../softmmu_defs.h" #ifdef CONFIG_TCG_PASS_AREG0 +#define MMUSUFFIX _mmu + +#define SHIFT 0 +#include "softmmu_template.h" + +#define SHIFT 1 +#include "softmmu_template.h" + +#define SHIFT 2 +#include "softmmu_template.h" + +#define SHIFT 3 +#include "softmmu_template.h" + /* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr, int mmu_idx) */ static const void * const qemu_ld_helpers[4] = { diff --git a/tci.c b/tci.c index c43fe7d..565ae85 100644 --- a/tci.c +++ b/tci.c @@ -439,6 +439,27 @@ static bool tci_compare64(uint64_t u0, uint64_t u1, TCGCond condition) return result; } +#if defined(CONFIG_SOFTMMU) + +#include "softmmu_defs.h" + +#ifdef CONFIG_TCG_PASS_AREG0 +#define MMUSUFFIX _mmu + +#define SHIFT 0 +#include "softmmu_template.h" + +#define SHIFT 1 +#include "softmmu_template.h" + +#define SHIFT 2 +#include "softmmu_template.h" + +#define SHIFT 3 +#include "softmmu_template.h" +#endif +#endif + /* Interpret pseudo code in tb. */ tcg_target_ulong tcg_qemu_tb_exec(CPUArchState *cpustate, uint8_t *tb_ptr) { -- 1.7.2.5