diff options
author | Aurelien Jarno <aurelien@aurel32.net> | 2009-11-30 01:39:22 +0100 |
---|---|---|
committer | Aurelien Jarno <aurelien@aurel32.net> | 2009-11-30 16:10:04 +0100 |
commit | 25b91e32e0c93cb60cf9be43a52881de00c91be6 (patch) | |
tree | 688b9c16ae10aee944f72034d6de7c05128501d1 /target-mips/helper.c | |
parent | 1147e18994c39b462f20c7b28ac4bdf1891b9860 (diff) |
target-mips: add a function to do virtual -> physical translations
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Diffstat (limited to 'target-mips/helper.c')
-rw-r--r-- | target-mips/helper.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/target-mips/helper.c b/target-mips/helper.c index 0b5ec3e566..1e7e016084 100644 --- a/target-mips/helper.c +++ b/target-mips/helper.c @@ -310,6 +310,29 @@ int cpu_mips_handle_mmu_fault (CPUState *env, target_ulong address, int rw, return ret; } +#if !defined(CONFIG_USER_ONLY) +target_phys_addr_t do_translate_address(CPUState *env, target_ulong address, int rw) +{ + target_phys_addr_t physical; + int prot; + int access_type; + int ret = 0; + + rw &= 1; + + /* data access */ + access_type = ACCESS_INT; + ret = get_physical_address(env, &physical, &prot, + address, rw, access_type); + if (ret != TLBRET_MATCH) { + raise_mmu_exception(env, address, rw, ret); + cpu_loop_exit(); + } + + return physical; +} +#endif + static const char * const excp_names[EXCP_LAST + 1] = { [EXCP_RESET] = "reset", [EXCP_SRESET] = "soft reset", |