exec: Split softmmu_defs.h

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.

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
Richard Henderson 2013-08-27 13:13:44 -07:00
parent b1669e5e32
commit e58eb53413
14 changed files with 49 additions and 76 deletions

View File

@ -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, void tlb_fill(CPUArchState *env1, target_ulong addr, int is_write, int mmu_idx,
uintptr_t retaddr); 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 ACCESS_TYPE (NB_MMU_MODES + 1)
#define MEMSUFFIX _code #define MEMSUFFIX _code

View File

@ -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 */

View File

@ -19,7 +19,8 @@
#define ldul_executive ldl_executive #define ldul_executive ldl_executive
#define ldul_supervisor ldl_supervisor #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 ACCESS_TYPE 0
#define MEMSUFFIX MMU_MODE0_SUFFIX #define MEMSUFFIX MMU_MODE0_SUFFIX

View File

@ -778,8 +778,6 @@ static inline void tcg_out_nop(TCGContext *s)
} }
#ifdef CONFIG_SOFTMMU #ifdef CONFIG_SOFTMMU
#include "exec/softmmu_defs.h"
/* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr, /* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr,
int mmu_idx) */ int mmu_idx) */
static const void * const qemu_ld_helpers[4] = { static const void * const qemu_ld_helpers[4] = {

View File

@ -1058,8 +1058,6 @@ static inline void tcg_out_goto_label(TCGContext *s, int cond, int label_index)
#ifdef CONFIG_SOFTMMU #ifdef CONFIG_SOFTMMU
#include "exec/softmmu_defs.h"
/* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr, /* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr,
int mmu_idx) */ int mmu_idx) */
static const void * const qemu_ld_helpers[4] = { static const void * const qemu_ld_helpers[4] = {

View File

@ -910,8 +910,6 @@ static void tcg_out_movcond(TCGContext *s, int cond, TCGArg ret,
} }
#if defined(CONFIG_SOFTMMU) #if defined(CONFIG_SOFTMMU)
#include "exec/softmmu_defs.h"
/* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr, /* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr,
int mmu_idx) */ int mmu_idx) */
static const void * const qemu_ld_helpers[4] = { static const void * const qemu_ld_helpers[4] = {

View File

@ -1021,9 +1021,6 @@ static void tcg_out_jmp(TCGContext *s, uintptr_t dest)
} }
#if defined(CONFIG_SOFTMMU) #if defined(CONFIG_SOFTMMU)
#include "exec/softmmu_defs.h"
/* helper signature: helper_ret_ld_mmu(CPUState *env, target_ulong addr, /* helper signature: helper_ret_ld_mmu(CPUState *env, target_ulong addr,
* int mmu_idx, uintptr_t ra) * int mmu_idx, uintptr_t ra)
*/ */

View File

@ -1490,9 +1490,6 @@ static inline void tcg_out_movcond(TCGContext *s, TCGCond cond, TCGArg ret,
} }
#if defined(CONFIG_SOFTMMU) #if defined(CONFIG_SOFTMMU)
#include "exec/softmmu_defs.h"
/* Load and compare a TLB entry, and return the result in (p6, p7). /* Load and compare a TLB entry, and return the result in (p6, p7).
R2 is loaded with the address of the addend TLB entry. R2 is loaded with the address of the addend TLB entry.
R57 is loaded with the address, zero extented on 32-bit targets. */ R57 is loaded with the address, zero extented on 32-bit targets. */

View File

@ -919,9 +919,6 @@ static void tcg_out_setcond2(TCGContext *s, TCGCond cond, TCGReg ret,
} }
#if defined(CONFIG_SOFTMMU) #if defined(CONFIG_SOFTMMU)
#include "exec/softmmu_defs.h"
/* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr, /* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr,
int mmu_idx) */ int mmu_idx) */
static const void * const qemu_ld_helpers[4] = { static const void * const qemu_ld_helpers[4] = {

View File

@ -549,8 +549,6 @@ static void add_qemu_ldst_label (TCGContext *s,
label->label_ptr[0] = label_ptr; label->label_ptr[0] = label_ptr;
} }
#include "exec/softmmu_defs.h"
/* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr, /* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr,
int mmu_idx) */ int mmu_idx) */
static const void * const qemu_ld_helpers[4] = { static const void * const qemu_ld_helpers[4] = {

View File

@ -750,9 +750,6 @@ static void tcg_out_ldsta(TCGContext *s, TCGReg ret, TCGReg addr,
} }
#if defined (CONFIG_SOFTMMU) #if defined (CONFIG_SOFTMMU)
#include "exec/softmmu_defs.h"
/* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr, /* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr,
int mmu_idx) */ int mmu_idx) */
static const void * const qemu_ld_helpers[4] = { static const void * const qemu_ld_helpers[4] = {

View File

@ -315,9 +315,6 @@ static const uint8_t tcg_cond_to_ltr_cond[] = {
}; };
#ifdef CONFIG_SOFTMMU #ifdef CONFIG_SOFTMMU
#include "exec/softmmu_defs.h"
/* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr, /* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr,
int mmu_idx) */ int mmu_idx) */
static const void * const qemu_ld_helpers[4] = { static const void * const qemu_ld_helpers[4] = {

View File

@ -831,8 +831,6 @@ static void tcg_target_qemu_prologue(TCGContext *s)
#if defined(CONFIG_SOFTMMU) #if defined(CONFIG_SOFTMMU)
#include "exec/softmmu_defs.h"
/* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr, /* helper signature: helper_ld_mmu(CPUState *env, target_ulong addr,
int mmu_idx) */ int mmu_idx) */
static const void * const qemu_ld_helpers[4] = { static const void * const qemu_ld_helpers[4] = {

View File

@ -21,6 +21,10 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#ifndef TCG_H
#define TCG_H
#include "qemu-common.h" #include "qemu-common.h"
#include "tcg-target.h" #include "tcg-target.h"
@ -745,3 +749,42 @@ void tcg_register_jit(void *buf, size_t buf_size);
/* Generate TB finalization at the end of block */ /* Generate TB finalization at the end of block */
void tcg_out_tb_finalize(TCGContext *s); void tcg_out_tb_finalize(TCGContext *s);
#endif #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 */