qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, rth@twiddle.net
Subject: [Qemu-devel] [RFC PATCH 04/11] softmmu: move definition of CPU_MMU_INDEX to inclusion site, drop ACCESS_TYPE
Date: Thu,  8 May 2014 18:09:44 +0200	[thread overview]
Message-ID: <1399565391-27833-5-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1399565391-27833-1-git-send-email-pbonzini@redhat.com>

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 include/exec/exec-all.h       |  4 ++--
 include/exec/softmmu_exec.h   | 28 ++++++++++++++--------------
 include/exec/softmmu_header.h | 11 -----------
 3 files changed, 16 insertions(+), 27 deletions(-)

diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
index 63713ba..3696e9d 100644
--- a/include/exec/exec-all.h
+++ b/include/exec/exec-all.h
@@ -340,7 +340,7 @@ uint16_t helper_ldw_cmmu(CPUArchState *env, target_ulong addr, int mmu_idx);
 uint32_t helper_ldl_cmmu(CPUArchState *env, target_ulong addr, int mmu_idx);
 uint64_t helper_ldq_cmmu(CPUArchState *env, target_ulong addr, int mmu_idx);
 
-#define ACCESS_TYPE (NB_MMU_MODES + 1)
+#define CPU_MMU_INDEX (cpu_mmu_index(env))
 #define MEMSUFFIX _code
 #define SOFTMMU_CODE_ACCESS
 
@@ -356,7 +356,7 @@ uint64_t helper_ldq_cmmu(CPUArchState *env, target_ulong addr, int mmu_idx);
 #define DATA_SIZE 8
 #include "exec/softmmu_header.h"
 
-#undef ACCESS_TYPE
+#undef CPU_MMU_INDEX
 #undef MEMSUFFIX
 #undef SOFTMMU_CODE_ACCESS
 
diff --git a/include/exec/softmmu_exec.h b/include/exec/softmmu_exec.h
index 470db20..8217733 100644
--- a/include/exec/softmmu_exec.h
+++ b/include/exec/softmmu_exec.h
@@ -22,7 +22,7 @@
 /* The memory helpers for tcg-generated code need tcg_target_long etc.  */
 #include "tcg.h"
 
-#define ACCESS_TYPE 0
+#define CPU_MMU_INDEX 0
 #define MEMSUFFIX MMU_MODE0_SUFFIX
 #define DATA_SIZE 1
 #include "exec/softmmu_header.h"
@@ -35,10 +35,10 @@
 
 #define DATA_SIZE 8
 #include "exec/softmmu_header.h"
-#undef ACCESS_TYPE
+#undef CPU_MMU_INDEX
 #undef MEMSUFFIX
 
-#define ACCESS_TYPE 1
+#define CPU_MMU_INDEX 1
 #define MEMSUFFIX MMU_MODE1_SUFFIX
 #define DATA_SIZE 1
 #include "exec/softmmu_header.h"
@@ -51,12 +51,12 @@
 
 #define DATA_SIZE 8
 #include "exec/softmmu_header.h"
-#undef ACCESS_TYPE
+#undef CPU_MMU_INDEX
 #undef MEMSUFFIX
 
 #if (NB_MMU_MODES >= 3)
 
-#define ACCESS_TYPE 2
+#define CPU_MMU_INDEX 2
 #define MEMSUFFIX MMU_MODE2_SUFFIX
 #define DATA_SIZE 1
 #include "exec/softmmu_header.h"
@@ -69,13 +69,13 @@
 
 #define DATA_SIZE 8
 #include "exec/softmmu_header.h"
-#undef ACCESS_TYPE
+#undef CPU_MMU_INDEX
 #undef MEMSUFFIX
 #endif /* (NB_MMU_MODES >= 3) */
 
 #if (NB_MMU_MODES >= 4)
 
-#define ACCESS_TYPE 3
+#define CPU_MMU_INDEX 3
 #define MEMSUFFIX MMU_MODE3_SUFFIX
 #define DATA_SIZE 1
 #include "exec/softmmu_header.h"
@@ -88,13 +88,13 @@
 
 #define DATA_SIZE 8
 #include "exec/softmmu_header.h"
-#undef ACCESS_TYPE
+#undef CPU_MMU_INDEX
 #undef MEMSUFFIX
 #endif /* (NB_MMU_MODES >= 4) */
 
 #if (NB_MMU_MODES >= 5)
 
-#define ACCESS_TYPE 4
+#define CPU_MMU_INDEX 4
 #define MEMSUFFIX MMU_MODE4_SUFFIX
 #define DATA_SIZE 1
 #include "exec/softmmu_header.h"
@@ -107,13 +107,13 @@
 
 #define DATA_SIZE 8
 #include "exec/softmmu_header.h"
-#undef ACCESS_TYPE
+#undef CPU_MMU_INDEX
 #undef MEMSUFFIX
 #endif /* (NB_MMU_MODES >= 5) */
 
 #if (NB_MMU_MODES >= 6)
 
-#define ACCESS_TYPE 5
+#define CPU_MMU_INDEX 5
 #define MEMSUFFIX MMU_MODE5_SUFFIX
 #define DATA_SIZE 1
 #include "exec/softmmu_header.h"
@@ -126,7 +126,7 @@
 
 #define DATA_SIZE 8
 #include "exec/softmmu_header.h"
-#undef ACCESS_TYPE
+#undef CPU_MMU_INDEX
 #undef MEMSUFFIX
 #endif /* (NB_MMU_MODES >= 6) */
 
@@ -135,7 +135,7 @@
 #endif /* (NB_MMU_MODES > 6) */
 
 /* these access are slower, they must be as rare as possible */
-#define ACCESS_TYPE (NB_MMU_MODES)
+#define CPU_MMU_INDEX (cpu_mmu_index(env))
 #define MEMSUFFIX _data
 #define DATA_SIZE 1
 #include "exec/softmmu_header.h"
@@ -148,7 +148,7 @@
 
 #define DATA_SIZE 8
 #include "exec/softmmu_header.h"
-#undef ACCESS_TYPE
+#undef CPU_MMU_INDEX
 #undef MEMSUFFIX
 
 #define ldub(p) ldub_data(p)
diff --git a/include/exec/softmmu_header.h b/include/exec/softmmu_header.h
index cc85a43..bb18f97 100644
--- a/include/exec/softmmu_header.h
+++ b/include/exec/softmmu_header.h
@@ -47,16 +47,6 @@
 #error unsupported data size
 #endif
 
-#if ACCESS_TYPE < (NB_MMU_MODES)
-#define CPU_MMU_INDEX ACCESS_TYPE
-#elif ACCESS_TYPE == (NB_MMU_MODES)
-#define CPU_MMU_INDEX (cpu_mmu_index(env))
-#elif ACCESS_TYPE == (NB_MMU_MODES + 1)
-#define CPU_MMU_INDEX (cpu_mmu_index(env))
-#else
-#error invalid ACCESS_TYPE
-#endif
-
 #if DATA_SIZE == 8
 #define RES_TYPE uint64_t
 #else
@@ -199,6 +189,5 @@ static inline void glue(cpu_stfl, MEMSUFFIX)(CPUArchState *env,
 #undef SUFFIX
 #undef USUFFIX
 #undef DATA_SIZE
-#undef CPU_MMU_INDEX
 #undef MMUSUFFIX
 #undef ADDR_READ
-- 
1.8.3.1

  parent reply	other threads:[~2014-05-08 16:44 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-08 16:09 [Qemu-devel] [RFC PATCH 00/11] Cleanup load/store functions in headers and C files Paolo Bonzini
2014-05-08 16:09 ` [Qemu-devel] [RFC PATCH 01/11] hw: use ld_p/st_p instead of ld_raw/st_raw Paolo Bonzini
2014-05-09 18:18   ` Peter Maydell
2014-05-09 19:03     ` Paolo Bonzini
2014-05-08 16:09 ` [Qemu-devel] [RFC PATCH 02/11] softmmu: start introducing SOFTMMU_CODE_ACCESS in softmmu_header.h Paolo Bonzini
2014-05-08 16:09 ` [Qemu-devel] [RFC PATCH 03/11] softmmu: move MMUSUFFIX under SOFTMMU_CODE_ACCESS Paolo Bonzini
2014-05-08 16:09 ` Paolo Bonzini [this message]
2014-05-08 16:09 ` [Qemu-devel] [RFC PATCH 05/11] softmmu: move ALIGNED_ONLY to cpu.h Paolo Bonzini
2014-05-08 16:09 ` [Qemu-devel] [RFC PATCH 06/11] softmmu: commonize helper definitions Paolo Bonzini
2014-05-08 16:09 ` [Qemu-devel] [RFC PATCH 07/11] softmmu: move softmmu_template.h out of include/ Paolo Bonzini
2014-05-08 16:09 ` [Qemu-devel] [RFC PATCH 08/11] softmmu: make do_unaligned_access extern Paolo Bonzini
2014-05-13  6:53   ` Andreas Färber
2014-05-13  7:08     ` Paolo Bonzini
2014-05-08 16:09 ` [Qemu-devel] [RFC PATCH 09/11] target-arm: move arm_*_code to a separate file Paolo Bonzini
2014-05-13  7:03   ` Andreas Färber
2014-05-13  9:05     ` Peter Maydell
2014-05-08 16:09 ` [Qemu-devel] [RFC PATCH 10/11] softmmu: introduce cpu_ldst.h Paolo Bonzini
2014-05-08 16:09 ` [Qemu-devel] [RFC PATCH 11/11] softmmu: move all load/store functions to cpu_ldst.h Paolo Bonzini
2014-05-12 17:36   ` Richard Henderson
2014-05-13  7:13   ` Andreas Färber
2014-05-13  7:32     ` Paolo Bonzini
2014-05-12 17:37 ` [Qemu-devel] [RFC PATCH 00/11] Cleanup load/store functions in headers and C files Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1399565391-27833-5-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).