Skip to content

Commit

Permalink
softmmu: introduce cpu_ldst.h
Browse files Browse the repository at this point in the history
This will collect all load and store helpers soon.  For now
it is just a replacement for softmmu_exec.h, which this patch
stops including directly, but we also include it where this will
be necessary in order to simplify the next patch.

Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
bonzini committed Jun 5, 2014
1 parent 1d85476 commit f08b617
Show file tree
Hide file tree
Showing 50 changed files with 84 additions and 60 deletions.
1 change: 1 addition & 0 deletions bsd-user/qemu.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <string.h>

#include "cpu.h"
#include "exec/cpu_ldst.h"

#undef DEBUG_REMAP
#ifdef DEBUG_REMAP
Expand Down
1 change: 1 addition & 0 deletions cputlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "exec/exec-all.h"
#include "exec/memory.h"
#include "exec/address-spaces.h"
#include "exec/cpu_ldst.h"

#include "exec/cputlb.h"

Expand Down
35 changes: 35 additions & 0 deletions include/exec/cpu_ldst.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* Software MMU support
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*
*/

/*
* Generate inline load/store functions for all MMU modes (typically
* at least _user and _kernel) as well as _data versions, for all data
* sizes.
*
* Used by target op helpers.
*
* MMU mode suffixes are defined in target cpu.h.
*/
#ifndef CPU_LDST_H
#define CPU_LDST_H

#if !defined(CONFIG_USER_ONLY)
#include "exec/softmmu_exec.h"
#endif

#endif /* CPU_LDST_H */
1 change: 1 addition & 0 deletions linux-user/qemu.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <string.h>

#include "cpu.h"
#include "exec/cpu_ldst.h"

#undef DEBUG_REMAP
#ifdef DEBUG_REMAP
Expand Down
1 change: 1 addition & 0 deletions monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
#include "trace/simple.h"
#endif
#include "exec/memory.h"
#include "exec/cpu_ldst.h"
#include "qmp-commands.h"
#include "hmp.h"
#include "qemu/thread.h"
Expand Down
4 changes: 1 addition & 3 deletions target-alpha/mem_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

#include "cpu.h"
#include "exec/helper-proto.h"

#include "exec/cpu_ldst.h"

/* Softmmu support */
#ifndef CONFIG_USER_ONLY
Expand Down Expand Up @@ -131,8 +131,6 @@ void alpha_cpu_unassigned_access(CPUState *cs, hwaddr addr,
dynamic_excp(env, 0, EXCP_MCHK, 0);
}

#include "exec/softmmu_exec.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) */
Expand Down
1 change: 1 addition & 0 deletions target-alpha/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "disas/disas.h"
#include "qemu/host-utils.h"
#include "tcg-op.h"
#include "exec/cpu_ldst.h"

#include "exec/helper-proto.h"
#include "exec/helper-gen.h"
Expand Down
1 change: 1 addition & 0 deletions target-arm/arm_ldst.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#ifndef ARM_LDST_H
#define ARM_LDST_H

#include "exec/cpu_ldst.h"
#include "qemu/bswap.h"

/* Load an instruction and return it in the standard little-endian order */
Expand Down
3 changes: 1 addition & 2 deletions target-arm/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
#include "sysemu/sysemu.h"
#include "qemu/bitops.h"
#include "qemu/crc32c.h"
#include "exec/cpu_ldst.h"
#include "arm_ldst.h"
#include <zlib.h> /* For crc32 */

#ifndef CONFIG_USER_ONLY
#include "exec/softmmu_exec.h"

static inline int get_phys_addr(CPUARMState *env, target_ulong address,
int access_type, int is_user,
hwaddr *phys_ptr, int *prot,
Expand Down
3 changes: 1 addition & 2 deletions target-arm/op_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "cpu.h"
#include "exec/helper-proto.h"
#include "internals.h"
#include "exec/cpu_ldst.h"

#define SIGNBIT (uint32_t)0x80000000
#define SIGNBIT64 ((uint64_t)1 << 63)
Expand Down Expand Up @@ -56,8 +57,6 @@ uint32_t HELPER(neon_tbl)(CPUARMState *env, uint32_t ireg, uint32_t def,

#if !defined(CONFIG_USER_ONLY)

#include "exec/softmmu_exec.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)
Expand Down
1 change: 1 addition & 0 deletions target-cris/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "cpu.h"
#include "mmu.h"
#include "qemu/host-utils.h"
#include "exec/cpu_ldst.h"


//#define CRIS_HELPER_DEBUG
Expand Down
3 changes: 1 addition & 2 deletions target-cris/op_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "mmu.h"
#include "exec/helper-proto.h"
#include "qemu/host-utils.h"
#include "exec/cpu_ldst.h"

//#define CRIS_OP_HELPER_DEBUG

Expand All @@ -35,8 +36,6 @@
#endif

#if !defined(CONFIG_USER_ONLY)
#include "exec/softmmu_exec.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) */
Expand Down
1 change: 1 addition & 0 deletions target-cris/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "tcg-op.h"
#include "exec/helper-proto.h"
#include "mmu.h"
#include "exec/cpu_ldst.h"
#include "crisv32-decode.h"

#include "exec/helper-gen.h"
Expand Down
5 changes: 1 addition & 4 deletions target-i386/fpu_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
#include "exec/helper-proto.h"
#include "qemu/aes.h"
#include "qemu/host-utils.h"

#if !defined(CONFIG_USER_ONLY)
#include "exec/softmmu_exec.h"
#endif /* !defined(CONFIG_USER_ONLY) */
#include "exec/cpu_ldst.h"

#define FPU_RC_MASK 0xc00
#define FPU_RC_NEAR 0x000
Expand Down
5 changes: 1 addition & 4 deletions target-i386/mem_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@

#include "cpu.h"
#include "exec/helper-proto.h"

#if !defined(CONFIG_USER_ONLY)
#include "exec/softmmu_exec.h"
#endif /* !defined(CONFIG_USER_ONLY) */
#include "exec/cpu_ldst.h"

/* broken thread support */

Expand Down
5 changes: 1 addition & 4 deletions target-i386/misc_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@
#include "cpu.h"
#include "exec/ioport.h"
#include "exec/helper-proto.h"

#if !defined(CONFIG_USER_ONLY)
#include "exec/softmmu_exec.h"
#endif /* !defined(CONFIG_USER_ONLY) */
#include "exec/cpu_ldst.h"

/* check if Port I/O is allowed in TSS */
static inline void check_io(CPUX86State *env, int addr, int size)
Expand Down
5 changes: 1 addition & 4 deletions target-i386/seg_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@
#include "cpu.h"
#include "qemu/log.h"
#include "exec/helper-proto.h"
#include "exec/cpu_ldst.h"

//#define DEBUG_PCALL

#if !defined(CONFIG_USER_ONLY)
#include "exec/softmmu_exec.h"
#endif /* !defined(CONFIG_USER_ONLY) */

#ifdef DEBUG_PCALL
# define LOG_PCALL(...) qemu_log_mask(CPU_LOG_PCALL, ## __VA_ARGS__)
# define LOG_PCALL_STATE(cpu) \
Expand Down
5 changes: 1 addition & 4 deletions target-i386/svm_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@
#include "cpu.h"
#include "exec/cpu-all.h"
#include "exec/helper-proto.h"

#if !defined(CONFIG_USER_ONLY)
#include "exec/softmmu_exec.h"
#endif /* !defined(CONFIG_USER_ONLY) */
#include "exec/cpu_ldst.h"

/* Secure Virtual Machine helpers */

Expand Down
1 change: 1 addition & 0 deletions target-i386/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "cpu.h"
#include "disas/disas.h"
#include "tcg-op.h"
#include "exec/cpu_ldst.h"

#include "exec/helper-proto.h"
#include "exec/helper-gen.h"
Expand Down
2 changes: 1 addition & 1 deletion target-lm32/op_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "hw/lm32/lm32_pic.h"
#include "hw/char/lm32_juart.h"

#include "exec/softmmu_exec.h"
#include "exec/cpu_ldst.h"

#ifndef CONFIG_USER_ONLY
#include "sysemu/sysemu.h"
Expand Down
1 change: 1 addition & 0 deletions target-lm32/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "exec/helper-proto.h"
#include "tcg-op.h"

#include "exec/cpu_ldst.h"
#include "hw/lm32/lm32_pic.h"

#include "exec/helper-gen.h"
Expand Down
3 changes: 1 addition & 2 deletions target-m68k/op_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
#include "cpu.h"
#include "exec/helper-proto.h"
#include "exec/cpu_ldst.h"

#if defined(CONFIG_USER_ONLY)

Expand All @@ -34,8 +35,6 @@ void do_interrupt_m68k_hardirq(CPUM68KState *env)

extern int semihosting_enabled;

#include "exec/softmmu_exec.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) */
Expand Down
1 change: 1 addition & 0 deletions target-m68k/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "disas/disas.h"
#include "tcg-op.h"
#include "qemu/log.h"
#include "exec/cpu_ldst.h"

#include "exec/helper-proto.h"
#include "exec/helper-gen.h"
Expand Down
2 changes: 1 addition & 1 deletion target-microblaze/op_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
#include "cpu.h"
#include "exec/helper-proto.h"
#include "qemu/host-utils.h"
#include "exec/cpu_ldst.h"

#define D(x)

#if !defined(CONFIG_USER_ONLY)
#include "exec/softmmu_exec.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
Expand Down
1 change: 1 addition & 0 deletions target-microblaze/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "tcg-op.h"
#include "exec/helper-proto.h"
#include "microblaze-decode.h"
#include "exec/cpu_ldst.h"
#include "exec/helper-gen.h"

#define SIM_COMPAT 0
Expand Down
6 changes: 1 addition & 5 deletions target-mips/op_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,8 @@
#include <stdlib.h>
#include "cpu.h"
#include "qemu/host-utils.h"

#include "exec/helper-proto.h"

#if !defined(CONFIG_USER_ONLY)
#include "exec/softmmu_exec.h"
#endif /* !defined(CONFIG_USER_ONLY) */
#include "exec/cpu_ldst.h"

#ifndef CONFIG_USER_ONLY
static inline void cpu_mips_tlb_flush (CPUMIPSState *env, int flush_global);
Expand Down
1 change: 1 addition & 0 deletions target-mips/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include "cpu.h"
#include "disas/disas.h"
#include "tcg-op.h"
#include "exec/cpu_ldst.h"

#include "exec/helper-proto.h"
#include "exec/helper-gen.h"
Expand Down
2 changes: 1 addition & 1 deletion target-moxie/helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include "cpu.h"
#include "mmu.h"
#include "exec/exec-all.h"
#include "exec/softmmu_exec.h"
#include "exec/cpu_ldst.h"
#include "qemu/host-utils.h"
#include "exec/helper-proto.h"

Expand Down
1 change: 1 addition & 0 deletions target-moxie/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "exec/exec-all.h"
#include "disas/disas.h"
#include "tcg-op.h"
#include "exec/cpu_ldst.h"

#include "exec/helper-proto.h"
#include "exec/helper-gen.h"
Expand Down
2 changes: 1 addition & 1 deletion target-openrisc/mmu_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
*/

#include "cpu.h"
#include "exec/cpu_ldst.h"

#ifndef CONFIG_USER_ONLY
#include "exec/softmmu_exec.h"

void tlb_fill(CPUState *cs, target_ulong addr, int is_write,
int mmu_idx, uintptr_t retaddr)
Expand Down
1 change: 1 addition & 0 deletions target-openrisc/translate.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "qemu/log.h"
#include "config.h"
#include "qemu/bitops.h"
#include "exec/cpu_ldst.h"

#include "exec/helper-proto.h"
#include "exec/helper-gen.h"
Expand Down
1 change: 1 addition & 0 deletions target-ppc/excp_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
*/
#include "cpu.h"
#include "exec/helper-proto.h"
#include "exec/cpu_ldst.h"

#include "helper_regs.h"

Expand Down
5 changes: 1 addition & 4 deletions target-ppc/mem_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
#include "exec/helper-proto.h"

#include "helper_regs.h"

#if !defined(CONFIG_USER_ONLY)
#include "exec/softmmu_exec.h"
#endif /* !defined(CONFIG_USER_ONLY) */
#include "exec/cpu_ldst.h"

//#define DEBUG_OP

Expand Down
3 changes: 1 addition & 2 deletions target-ppc/mmu_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "kvm_ppc.h"
#include "mmu-hash64.h"
#include "mmu-hash32.h"
#include "exec/cpu_ldst.h"

//#define DEBUG_MMU
//#define DEBUG_BATS
Expand Down Expand Up @@ -2903,8 +2904,6 @@ void helper_booke206_tlbflush(CPUPPCState *env, uint32_t type)

/*****************************************************************************/

#include "exec/softmmu_exec.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) */
Expand Down
Loading

0 comments on commit f08b617

Please sign in to comment.