On 17/06/2015 14:42, Pavel Dovgalyuk wrote: > 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. > > Signed-off-by: Pavel Dovgalyuk <pavel.dovga...@ispras.ru> > --- > include/exec/cpu_ldst_template.h | 42 > +++++++++++++++++++++++++++++++------- > include/exec/exec-all.h | 27 ++++++++++++++++++++++++ > softmmu_template.h | 18 ++++++++++++++++ > 3 files changed, 79 insertions(+), 8 deletions(-) > > diff --git a/include/exec/cpu_ldst_template.h > b/include/exec/cpu_ldst_template.h > index 95ab750..1847816 100644 > --- a/include/exec/cpu_ldst_template.h > +++ b/include/exec/cpu_ldst_template.h > @@ -62,7 +62,9 @@ > /* generic load/store macros */ > > static inline RES_TYPE > -glue(glue(cpu_ld, USUFFIX), MEMSUFFIX)(CPUArchState *env, target_ulong ptr) > +glue(glue(glue(cpu_ld, USUFFIX), MEMSUFFIX), _ra)(CPUArchState *env, > + target_ulong ptr, > + uintptr_t retaddr)
Would it make sense to call these helper_cpu_ld##USUFFIX##MEMSUFFIX? > diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h > index 856e698..b3aefde 100644 > --- a/include/exec/exec-all.h > +++ b/include/exec/exec-all.h > @@ -350,6 +350,33 @@ struct MemoryRegion *iotlb_to_region(CPUState *cpu, > void tlb_fill(CPUState *cpu, target_ulong addr, int is_write, int mmu_idx, > uintptr_t retaddr); > > +uint8_t helper_call_ldb_cmmu(CPUArchState *env, target_ulong addr, > + int mmu_idx, uintptr_t retaddr); Here we already have helper_ret_ldb_cmmu, so the new function is only needed if DATA_SIZE != 1. > +uint16_t helper_call_ldw_cmmu(CPUArchState *env, target_ulong addr, > + int mmu_idx, uintptr_t retaddr); What about helper_ret_ldw_cmmu for consistency with the DATA_SIZE == 1 case? Paolo