mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
softmmu: add helper function to pass through retaddr
This patch introduces several helpers to pass return address which points to the TB. Correct return address allows correct restoring of the guest PC and icount. These functions should be used when helpers embedded into TB invoke memory operations. Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Pavel Dovgalyuk <pavel.dovgaluk@ispras.ru> Message-Id: <20150710095650.13280.32255.stgit@PASHA-ISP> Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
97ed5ccdee
commit
282dffc8a4
4 changed files with 99 additions and 14 deletions
|
@ -56,12 +56,28 @@ glue(glue(cpu_ld, USUFFIX), MEMSUFFIX)(CPUArchState *env, target_ulong ptr)
|
|||
return glue(glue(ld, USUFFIX), _p)(g2h(ptr));
|
||||
}
|
||||
|
||||
static inline RES_TYPE
|
||||
glue(glue(glue(cpu_ld, USUFFIX), MEMSUFFIX), _ra)(CPUArchState *env,
|
||||
target_ulong ptr,
|
||||
uintptr_t retaddr)
|
||||
{
|
||||
return glue(glue(cpu_ld, USUFFIX), MEMSUFFIX)(env, ptr);
|
||||
}
|
||||
|
||||
#if DATA_SIZE <= 2
|
||||
static inline int
|
||||
glue(glue(cpu_lds, SUFFIX), MEMSUFFIX)(CPUArchState *env, target_ulong ptr)
|
||||
{
|
||||
return glue(glue(lds, SUFFIX), _p)(g2h(ptr));
|
||||
}
|
||||
|
||||
static inline int
|
||||
glue(glue(glue(cpu_lds, SUFFIX), MEMSUFFIX), _ra)(CPUArchState *env,
|
||||
target_ulong ptr,
|
||||
uintptr_t retaddr)
|
||||
{
|
||||
return glue(glue(cpu_lds, SUFFIX), MEMSUFFIX)(env, ptr);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef CODE_ACCESS
|
||||
|
@ -71,6 +87,15 @@ glue(glue(cpu_st, SUFFIX), MEMSUFFIX)(CPUArchState *env, target_ulong ptr,
|
|||
{
|
||||
glue(glue(st, SUFFIX), _p)(g2h(ptr), v);
|
||||
}
|
||||
|
||||
static inline void
|
||||
glue(glue(glue(cpu_st, SUFFIX), MEMSUFFIX), _ra)(CPUArchState *env,
|
||||
target_ulong ptr,
|
||||
RES_TYPE v,
|
||||
uintptr_t retaddr)
|
||||
{
|
||||
glue(glue(cpu_st, SUFFIX), MEMSUFFIX)(env, ptr, v);
|
||||
}
|
||||
#endif
|
||||
|
||||
#undef RES_TYPE
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue