mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
target-mips: add a function to do virtual -> physical translations
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
This commit is contained in:
parent
1147e18994
commit
25b91e32e0
2 changed files with 25 additions and 0 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue