mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-20 08:34:03 -06:00
include/exec: Inline *_code memory operations
These need to be per-target for 'abi_ptr' and endianness. These expand inline to the *_mmu api with a lookup of the target's cpu_mmu_index() and ra == 0. Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
0a29f11676
commit
4ba597c138
3 changed files with 27 additions and 72 deletions
|
@ -473,10 +473,33 @@ cpu_stq_le_data(CPUArchState *env, abi_ptr addr, uint64_t val)
|
|||
# define cpu_stq_mmuidx_ra cpu_stq_le_mmuidx_ra
|
||||
#endif
|
||||
|
||||
uint32_t cpu_ldub_code(CPUArchState *env, abi_ptr addr);
|
||||
uint32_t cpu_lduw_code(CPUArchState *env, abi_ptr addr);
|
||||
uint32_t cpu_ldl_code(CPUArchState *env, abi_ptr addr);
|
||||
uint64_t cpu_ldq_code(CPUArchState *env, abi_ptr addr);
|
||||
static inline uint32_t cpu_ldub_code(CPUArchState *env, abi_ptr addr)
|
||||
{
|
||||
CPUState *cs = env_cpu(env);
|
||||
MemOpIdx oi = make_memop_idx(MO_UB, cpu_mmu_index(cs, true));
|
||||
return cpu_ldb_code_mmu(env, addr, oi, 0);
|
||||
}
|
||||
|
||||
static inline uint32_t cpu_lduw_code(CPUArchState *env, abi_ptr addr)
|
||||
{
|
||||
CPUState *cs = env_cpu(env);
|
||||
MemOpIdx oi = make_memop_idx(MO_TEUW, cpu_mmu_index(cs, true));
|
||||
return cpu_ldw_code_mmu(env, addr, oi, 0);
|
||||
}
|
||||
|
||||
static inline uint32_t cpu_ldl_code(CPUArchState *env, abi_ptr addr)
|
||||
{
|
||||
CPUState *cs = env_cpu(env);
|
||||
MemOpIdx oi = make_memop_idx(MO_TEUL, cpu_mmu_index(cs, true));
|
||||
return cpu_ldl_code_mmu(env, addr, oi, 0);
|
||||
}
|
||||
|
||||
static inline uint64_t cpu_ldq_code(CPUArchState *env, abi_ptr addr)
|
||||
{
|
||||
CPUState *cs = env_cpu(env);
|
||||
MemOpIdx oi = make_memop_idx(MO_TEUQ, cpu_mmu_index(cs, true));
|
||||
return cpu_ldq_code_mmu(env, addr, oi, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* tlb_vaddr_to_host:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue