From d031df638ed1b3cedfe516cfddb13e1211070a43 Mon Sep 17 00:00:00 2001
Message-Id: <d031df638ed1b3cedfe516cfddb13e1211070a43.1333999313.git.blauwirbel@gmail.com>
In-Reply-To: <524db9d8331b9f4a43459081909e8816f77b3952.1333999313.git.blauwirbel@gmail.com>
References: <524db9d8331b9f4a43459081909e8816f77b3952.1333999313.git.blauwirbel@gmail.com>
From: Blue Swirl <blauwirbel@gmail.com>
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 <blauwirbel@gmail.com>
---
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(-)
@@ -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) */
@@ -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)
@@ -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] = {
@@ -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] = {
@@ -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] = {
@@ -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] = {
@@ -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] = {
@@ -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] = {
@@ -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] = {
@@ -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] = {
@@ -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] = {
@@ -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
Signed-off-by: Blue Swirl <blauwirbel@gmail.com> --- 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(-) {