diff options
author | Aurelien Jarno | 2015-06-13 00:45:49 +0200 |
---|---|---|
committer | Alexander Graf | 2015-06-17 12:40:51 +0200 |
commit | 2e83c496261c799b0fe6b8e18ac80cdc0a5c97ce (patch) | |
tree | c75990d7c32e66d5447a0bfcda7461f90887cd0f /include | |
parent | target-s390x: wire up I/O instructions in TCG mode (diff) | |
download | qemu-2e83c496261c799b0fe6b8e18ac80cdc0a5c97ce.tar.gz qemu-2e83c496261c799b0fe6b8e18ac80cdc0a5c97ce.tar.xz qemu-2e83c496261c799b0fe6b8e18ac80cdc0a5c97ce.zip |
softmmu: provide tlb_vaddr_to_host function for user mode
To avoid to many #ifdef in target code, provide a tlb_vaddr_to_host for
both user and softmmu modes. In the first case the function always
succeed and just call the g2h function.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/exec/cpu_ldst.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h index 0ec398c0f8..1239c60f23 100644 --- a/include/exec/cpu_ldst.h +++ b/include/exec/cpu_ldst.h @@ -399,6 +399,8 @@ uint64_t helper_ldq_cmmu(CPUArchState *env, target_ulong addr, int mmu_idx); #undef MEMSUFFIX #undef SOFTMMU_CODE_ACCESS +#endif /* defined(CONFIG_USER_ONLY) */ + /** * tlb_vaddr_to_host: * @env: CPUArchState @@ -417,6 +419,9 @@ uint64_t helper_ldq_cmmu(CPUArchState *env, target_ulong addr, int mmu_idx); static inline void *tlb_vaddr_to_host(CPUArchState *env, target_ulong addr, int access_type, int mmu_idx) { +#if defined(CONFIG_USER_ONLY) + return g2h(vaddr); +#else int index = (addr >> TARGET_PAGE_BITS) & (CPU_TLB_SIZE - 1); CPUTLBEntry *tlbentry = &env->tlb_table[mmu_idx][index]; target_ulong tlb_addr; @@ -449,8 +454,7 @@ static inline void *tlb_vaddr_to_host(CPUArchState *env, target_ulong addr, haddr = addr + env->tlb_table[mmu_idx][index].addend; return (void *)haddr; -} - #endif /* defined(CONFIG_USER_ONLY) */ +} #endif /* CPU_LDST_H */ |