From: Aurelien Jarno <aurelien@aurel32.net>
To: Richard Henderson <rth@twiddle.net>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH v2 5/7] exec: Split softmmu_defs.h
Date: Fri, 30 Aug 2013 18:55:20 +0200 [thread overview]
Message-ID: <20130830165520.GA15700@ohm.aurel32.net> (raw)
In-Reply-To: <1377813961-12208-6-git-send-email-rth@twiddle.net>
On Thu, Aug 29, 2013 at 03:05:59PM -0700, Richard Henderson wrote:
> The _cmmu helpers can be moved to exec-all.h. The helpers that are
> used from TCG will shortly need access to tcg_target_long so move
> their declarations into tcg.h.
>
> This requires minor include adjustments to all TCG backends.
>
> Signed-off-by: Richard Henderson <rth@twiddle.net>
> ---
> include/exec/exec-all.h | 5 ++++-
> include/exec/softmmu_defs.h | 49 ---------------------------------------------
> include/exec/softmmu_exec.h | 3 ++-
> tcg/aarch64/tcg-target.c | 2 --
> tcg/arm/tcg-target.c | 2 --
> tcg/hppa/tcg-target.c | 2 --
> tcg/i386/tcg-target.c | 3 ---
> tcg/ia64/tcg-target.c | 3 ---
> tcg/mips/tcg-target.c | 3 ---
> tcg/ppc/tcg-target.c | 2 --
> tcg/ppc64/tcg-target.c | 3 ---
> tcg/s390/tcg-target.c | 3 ---
> tcg/sparc/tcg-target.c | 2 --
> tcg/tcg.h | 43 +++++++++++++++++++++++++++++++++++++++
> 14 files changed, 49 insertions(+), 76 deletions(-)
> delete mode 100644 include/exec/softmmu_defs.h
>
> diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
> index 6f71a4f..beb4149 100644
> --- a/include/exec/exec-all.h
> +++ b/include/exec/exec-all.h
> @@ -377,7 +377,10 @@ bool io_mem_write(struct MemoryRegion *mr, hwaddr addr,
> void tlb_fill(CPUArchState *env1, target_ulong addr, int is_write, int mmu_idx,
> uintptr_t retaddr);
>
> -#include "exec/softmmu_defs.h"
> +uint8_t helper_ldb_cmmu(CPUArchState *env, target_ulong addr, int mmu_idx);
> +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 MEMSUFFIX _code
> diff --git a/include/exec/softmmu_defs.h b/include/exec/softmmu_defs.h
> deleted file mode 100644
> index e55e717..0000000
> --- a/include/exec/softmmu_defs.h
> +++ /dev/null
> @@ -1,49 +0,0 @@
> -/*
> - * Software MMU support
> - *
> - * Declare helpers used by TCG for qemu_ld/st ops.
> - *
> - * Used by softmmu_exec.h, TCG targets and exec-all.h.
> - *
> - */
> -#ifndef SOFTMMU_DEFS_H
> -#define SOFTMMU_DEFS_H
> -
> -uint8_t helper_ret_ldb_mmu(CPUArchState *env, target_ulong addr,
> - int mmu_idx, uintptr_t retaddr);
> -uint16_t helper_ret_ldw_mmu(CPUArchState *env, target_ulong addr,
> - int mmu_idx, uintptr_t retaddr);
> -uint32_t helper_ret_ldl_mmu(CPUArchState *env, target_ulong addr,
> - int mmu_idx, uintptr_t retaddr);
> -uint64_t helper_ret_ldq_mmu(CPUArchState *env, target_ulong addr,
> - int mmu_idx, uintptr_t retaddr);
> -
> -void helper_ret_stb_mmu(CPUArchState *env, target_ulong addr, uint8_t val,
> - int mmu_idx, uintptr_t retaddr);
> -void helper_ret_stw_mmu(CPUArchState *env, target_ulong addr, uint16_t val,
> - int mmu_idx, uintptr_t retaddr);
> -void helper_ret_stl_mmu(CPUArchState *env, target_ulong addr, uint32_t val,
> - int mmu_idx, uintptr_t retaddr);
> -void helper_ret_stq_mmu(CPUArchState *env, target_ulong addr, uint64_t val,
> - int mmu_idx, uintptr_t retaddr);
> -
> -uint8_t helper_ldb_mmu(CPUArchState *env, target_ulong addr, int mmu_idx);
> -uint16_t helper_ldw_mmu(CPUArchState *env, target_ulong addr, int mmu_idx);
> -uint32_t helper_ldl_mmu(CPUArchState *env, target_ulong addr, int mmu_idx);
> -uint64_t helper_ldq_mmu(CPUArchState *env, target_ulong addr, int mmu_idx);
> -
> -void helper_stb_mmu(CPUArchState *env, target_ulong addr,
> - uint8_t val, int mmu_idx);
> -void helper_stw_mmu(CPUArchState *env, target_ulong addr,
> - uint16_t val, int mmu_idx);
> -void helper_stl_mmu(CPUArchState *env, target_ulong addr,
> - uint32_t val, int mmu_idx);
> -void helper_stq_mmu(CPUArchState *env, target_ulong addr,
> - uint64_t val, int mmu_idx);
> -
> -uint8_t helper_ldb_cmmu(CPUArchState *env, target_ulong addr, int mmu_idx);
> -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);
> -
> -#endif /* SOFTMMU_DEFS_H */
> diff --git a/include/exec/softmmu_exec.h b/include/exec/softmmu_exec.h
> index 3e4e886..6fde154 100644
> --- a/include/exec/softmmu_exec.h
> +++ b/include/exec/softmmu_exec.h
> @@ -19,7 +19,8 @@
> #define ldul_executive ldl_executive
> #define ldul_supervisor ldl_supervisor
>
> -#include "exec/softmmu_defs.h"
> +/* The memory helpers for tcg-generated code need tcg_target_long etc. */
> +#include "tcg.h"
>
> #define ACCESS_TYPE 0
> #define MEMSUFFIX MMU_MODE0_SUFFIX
> diff --git a/tcg/aarch64/tcg-target.c b/tcg/aarch64/tcg-target.c
> index 41a17f8..55ff700 100644
> --- a/tcg/aarch64/tcg-target.c
> +++ b/tcg/aarch64/tcg-target.c
> @@ -778,8 +778,6 @@ static inline void tcg_out_nop(TCGContext *s)
> }
>
> #ifdef CONFIG_SOFTMMU
> -#include "exec/softmmu_defs.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/arm/tcg-target.c b/tcg/arm/tcg-target.c
> index 6c4854d..6d084b3 100644
> --- a/tcg/arm/tcg-target.c
> +++ b/tcg/arm/tcg-target.c
> @@ -1058,8 +1058,6 @@ static inline void tcg_out_goto_label(TCGContext *s, int cond, int label_index)
>
> #ifdef CONFIG_SOFTMMU
>
> -#include "exec/softmmu_defs.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 68f77ba..bac1f12 100644
> --- a/tcg/hppa/tcg-target.c
> +++ b/tcg/hppa/tcg-target.c
> @@ -906,8 +906,6 @@ static void tcg_out_movcond(TCGContext *s, int cond, TCGArg ret,
> }
>
> #if defined(CONFIG_SOFTMMU)
> -#include "exec/softmmu_defs.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 84f17fe..4c98cc4 100644
> --- a/tcg/i386/tcg-target.c
> +++ b/tcg/i386/tcg-target.c
> @@ -1022,9 +1022,6 @@ static void tcg_out_jmp(TCGContext *s, tcg_target_long dest)
> }
>
> #if defined(CONFIG_SOFTMMU)
> -
> -#include "exec/softmmu_defs.h"
> -
> /* helper signature: helper_ret_ld_mmu(CPUState *env, target_ulong addr,
> * int mmu_idx, uintptr_t ra)
> */
> diff --git a/tcg/ia64/tcg-target.c b/tcg/ia64/tcg-target.c
> index 2373d9e..56a1b3a 100644
> --- a/tcg/ia64/tcg-target.c
> +++ b/tcg/ia64/tcg-target.c
> @@ -1490,9 +1490,6 @@ static inline void tcg_out_movcond(TCGContext *s, TCGCond cond, TCGArg ret,
> }
>
> #if defined(CONFIG_SOFTMMU)
> -
> -#include "exec/softmmu_defs.h"
> -
> /* Load and compare a TLB entry, and return the result in (p6, p7).
> R2 is loaded with the address of the addend TLB entry.
> R57 is loaded with the address, zero extented on 32-bit targets. */
> diff --git a/tcg/mips/tcg-target.c b/tcg/mips/tcg-target.c
> index 793532e..a750d42 100644
> --- a/tcg/mips/tcg-target.c
> +++ b/tcg/mips/tcg-target.c
> @@ -919,9 +919,6 @@ static void tcg_out_setcond2(TCGContext *s, TCGCond cond, TCGReg ret,
> }
>
> #if defined(CONFIG_SOFTMMU)
> -
> -#include "exec/softmmu_defs.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 453ab6b..9a73d06 100644
> --- a/tcg/ppc/tcg-target.c
> +++ b/tcg/ppc/tcg-target.c
> @@ -549,8 +549,6 @@ static void add_qemu_ldst_label (TCGContext *s,
> label->label_ptr[0] = label_ptr;
> }
>
> -#include "exec/softmmu_defs.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 0678de2..ec067e6 100644
> --- a/tcg/ppc64/tcg-target.c
> +++ b/tcg/ppc64/tcg-target.c
> @@ -750,9 +750,6 @@ static void tcg_out_ldsta(TCGContext *s, TCGReg ret, TCGReg addr,
> }
>
> #if defined (CONFIG_SOFTMMU)
> -
> -#include "exec/softmmu_defs.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 f229f1c..5b556fe 100644
> --- a/tcg/s390/tcg-target.c
> +++ b/tcg/s390/tcg-target.c
> @@ -315,9 +315,6 @@ static const uint8_t tcg_cond_to_ltr_cond[] = {
> };
>
> #ifdef CONFIG_SOFTMMU
> -
> -#include "exec/softmmu_defs.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 5bfd29c..b1e3fc1 100644
> --- a/tcg/sparc/tcg-target.c
> +++ b/tcg/sparc/tcg-target.c
> @@ -831,8 +831,6 @@ static void tcg_target_qemu_prologue(TCGContext *s)
>
> #if defined(CONFIG_SOFTMMU)
>
> -#include "exec/softmmu_defs.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/tcg.h b/tcg/tcg.h
> index f3f9889..eeff6b7 100644
> --- a/tcg/tcg.h
> +++ b/tcg/tcg.h
> @@ -21,6 +21,10 @@
> * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
> * THE SOFTWARE.
> */
> +
> +#ifndef TCG_H
> +#define TCG_H
> +
> #include "qemu-common.h"
>
> /* Target word size (must be identical to pointer size). */
> @@ -741,3 +745,42 @@ void tcg_register_jit(void *buf, size_t buf_size);
> /* Generate TB finalization at the end of block */
> void tcg_out_tb_finalize(TCGContext *s);
> #endif
> +
> +/*
> + * Memory helpers that will be used by TCG generated code.
> + */
> +#ifdef CONFIG_SOFTMMU
> +uint8_t helper_ret_ldb_mmu(CPUArchState *env, target_ulong addr,
> + int mmu_idx, uintptr_t retaddr);
> +uint16_t helper_ret_ldw_mmu(CPUArchState *env, target_ulong addr,
> + int mmu_idx, uintptr_t retaddr);
> +uint32_t helper_ret_ldl_mmu(CPUArchState *env, target_ulong addr,
> + int mmu_idx, uintptr_t retaddr);
> +uint64_t helper_ret_ldq_mmu(CPUArchState *env, target_ulong addr,
> + int mmu_idx, uintptr_t retaddr);
> +
> +void helper_ret_stb_mmu(CPUArchState *env, target_ulong addr, uint8_t val,
> + int mmu_idx, uintptr_t retaddr);
> +void helper_ret_stw_mmu(CPUArchState *env, target_ulong addr, uint16_t val,
> + int mmu_idx, uintptr_t retaddr);
> +void helper_ret_stl_mmu(CPUArchState *env, target_ulong addr, uint32_t val,
> + int mmu_idx, uintptr_t retaddr);
> +void helper_ret_stq_mmu(CPUArchState *env, target_ulong addr, uint64_t val,
> + int mmu_idx, uintptr_t retaddr);
> +
> +uint8_t helper_ldb_mmu(CPUArchState *env, target_ulong addr, int mmu_idx);
> +uint16_t helper_ldw_mmu(CPUArchState *env, target_ulong addr, int mmu_idx);
> +uint32_t helper_ldl_mmu(CPUArchState *env, target_ulong addr, int mmu_idx);
> +uint64_t helper_ldq_mmu(CPUArchState *env, target_ulong addr, int mmu_idx);
> +
> +void helper_stb_mmu(CPUArchState *env, target_ulong addr,
> + uint8_t val, int mmu_idx);
> +void helper_stw_mmu(CPUArchState *env, target_ulong addr,
> + uint16_t val, int mmu_idx);
> +void helper_stl_mmu(CPUArchState *env, target_ulong addr,
> + uint32_t val, int mmu_idx);
> +void helper_stq_mmu(CPUArchState *env, target_ulong addr,
> + uint64_t val, int mmu_idx);
> +#endif /* CONFIG_SOFTMMU */
> +
> +#endif /* TCG_H */
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
--
Aurelien Jarno GPG: 1024D/F1BCDB73
aurelien@aurel32.net http://www.aurel32.net
next prev parent reply other threads:[~2013-08-30 16:55 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-29 22:05 [Qemu-devel] [PATCH v2 0/7] Further tcg ldst improvements Richard Henderson
2013-08-29 22:05 ` [Qemu-devel] [PATCH v2 1/7] exec: Reorganize the GETRA/GETPC macros Richard Henderson
2013-08-30 16:55 ` Aurelien Jarno
2013-08-29 22:05 ` [Qemu-devel] [PATCH v2 2/7] tcg-i386: Don't perform GETPC adjustment in TCG code Richard Henderson
2013-08-30 16:55 ` Aurelien Jarno
2013-08-29 22:05 ` [Qemu-devel] [PATCH v2 3/7] exec: Rename USUFFIX to LSUFFIX Richard Henderson
2013-08-30 16:55 ` Aurelien Jarno
2013-08-29 22:05 ` [Qemu-devel] [PATCH v2 4/7] target: Include softmmu_exec.h where forgotten Richard Henderson
2013-08-30 16:55 ` Aurelien Jarno
2013-08-29 22:05 ` [Qemu-devel] [PATCH v2 5/7] exec: Split softmmu_defs.h Richard Henderson
2013-08-30 16:55 ` Aurelien Jarno [this message]
2013-08-29 22:06 ` [Qemu-devel] [PATCH v2 6/7] tcg: Introduce zero and sign-extended versions of load helpers Richard Henderson
2013-08-30 16:55 ` Aurelien Jarno
2013-08-30 17:20 ` Richard Henderson
2013-08-30 19:12 ` Aurelien Jarno
2013-08-30 20:53 ` Richard Henderson
2013-08-30 21:23 ` Aurelien Jarno
2013-08-31 0:05 ` Richard Henderson
2013-08-29 22:06 ` [Qemu-devel] [PATCH v2 7/7] tcg-i386: Make use of zero-extended memory helper routines Richard Henderson
2013-08-30 21:23 ` Aurelien Jarno
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=20130830165520.GA15700@ohm.aurel32.net \
--to=aurelien@aurel32.net \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.