mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
cputlb: Provide cpu_(ld,st}*_mmuidx_ra for user-only
This finishes the new interface began with the previous patch. Document the interface and deprecate MMU_MODE<N>_SUFFIX. Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
fc4120a378
commit
f4e1bae259
2 changed files with 230 additions and 61 deletions
|
@ -25,9 +25,13 @@
|
|||
*
|
||||
* The syntax for the accessors is:
|
||||
*
|
||||
* load: cpu_ld{sign}{size}_{mmusuffix}(env, ptr)
|
||||
* load: cpu_ld{sign}{size}_{mmusuffix}(env, ptr)
|
||||
* cpu_ld{sign}{size}_{mmusuffix}_ra(env, ptr, retaddr)
|
||||
* cpu_ld{sign}{size}_mmuidx_ra(env, ptr, mmu_idx, retaddr)
|
||||
*
|
||||
* store: cpu_st{sign}{size}_{mmusuffix}(env, ptr, val)
|
||||
* store: cpu_st{size}_{mmusuffix}(env, ptr, val)
|
||||
* cpu_st{size}_{mmusuffix}_ra(env, ptr, val, retaddr)
|
||||
* cpu_st{size}_mmuidx_ra(env, ptr, val, mmu_idx, retaddr)
|
||||
*
|
||||
* sign is:
|
||||
* (empty): for 32 and 64 bit sizes
|
||||
|
@ -40,9 +44,10 @@
|
|||
* l: 32 bits
|
||||
* q: 64 bits
|
||||
*
|
||||
* mmusuffix is one of the generic suffixes "data" or "code", or
|
||||
* (for softmmu configs) a target-specific MMU mode suffix as defined
|
||||
* in target cpu.h.
|
||||
* mmusuffix is one of the generic suffixes "data" or "code", or "mmuidx".
|
||||
* The "mmuidx" suffix carries an extra mmu_idx argument that specifies
|
||||
* the index to use; the "data" and "code" suffixes take the index from
|
||||
* cpu_mmu_index().
|
||||
*/
|
||||
#ifndef CPU_LDST_H
|
||||
#define CPU_LDST_H
|
||||
|
@ -145,6 +150,71 @@ static inline void clear_helper_retaddr(void)
|
|||
#undef MEMSUFFIX
|
||||
#undef CODE_ACCESS
|
||||
|
||||
/*
|
||||
* Provide the same *_mmuidx_ra interface as for softmmu.
|
||||
* The mmu_idx argument is ignored.
|
||||
*/
|
||||
|
||||
static inline uint32_t cpu_ldub_mmuidx_ra(CPUArchState *env, abi_ptr addr,
|
||||
int mmu_idx, uintptr_t ra)
|
||||
{
|
||||
return cpu_ldub_data_ra(env, addr, ra);
|
||||
}
|
||||
|
||||
static inline uint32_t cpu_lduw_mmuidx_ra(CPUArchState *env, abi_ptr addr,
|
||||
int mmu_idx, uintptr_t ra)
|
||||
{
|
||||
return cpu_lduw_data_ra(env, addr, ra);
|
||||
}
|
||||
|
||||
static inline uint32_t cpu_ldl_mmuidx_ra(CPUArchState *env, abi_ptr addr,
|
||||
int mmu_idx, uintptr_t ra)
|
||||
{
|
||||
return cpu_ldl_data_ra(env, addr, ra);
|
||||
}
|
||||
|
||||
static inline uint64_t cpu_ldq_mmuidx_ra(CPUArchState *env, abi_ptr addr,
|
||||
int mmu_idx, uintptr_t ra)
|
||||
{
|
||||
return cpu_ldq_data_ra(env, addr, ra);
|
||||
}
|
||||
|
||||
static inline int cpu_ldsb_mmuidx_ra(CPUArchState *env, abi_ptr addr,
|
||||
int mmu_idx, uintptr_t ra)
|
||||
{
|
||||
return cpu_ldsb_data_ra(env, addr, ra);
|
||||
}
|
||||
|
||||
static inline int cpu_ldsw_mmuidx_ra(CPUArchState *env, abi_ptr addr,
|
||||
int mmu_idx, uintptr_t ra)
|
||||
{
|
||||
return cpu_ldsw_data_ra(env, addr, ra);
|
||||
}
|
||||
|
||||
static inline void cpu_stb_mmuidx_ra(CPUArchState *env, abi_ptr addr,
|
||||
uint32_t val, int mmu_idx, uintptr_t ra)
|
||||
{
|
||||
cpu_stb_data_ra(env, addr, val, ra);
|
||||
}
|
||||
|
||||
static inline void cpu_stw_mmuidx_ra(CPUArchState *env, abi_ptr addr,
|
||||
uint32_t val, int mmu_idx, uintptr_t ra)
|
||||
{
|
||||
cpu_stw_data_ra(env, addr, val, ra);
|
||||
}
|
||||
|
||||
static inline void cpu_stl_mmuidx_ra(CPUArchState *env, abi_ptr addr,
|
||||
uint32_t val, int mmu_idx, uintptr_t ra)
|
||||
{
|
||||
cpu_stl_data_ra(env, addr, val, ra);
|
||||
}
|
||||
|
||||
static inline void cpu_stq_mmuidx_ra(CPUArchState *env, abi_ptr addr,
|
||||
uint64_t val, int mmu_idx, uintptr_t ra)
|
||||
{
|
||||
cpu_stq_data_ra(env, addr, val, ra);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
/* Needed for TCG_OVERSIZED_GUEST */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue