On 2/7/21 11:57 PM, Philippe Mathieu-Daudé wrote:
> Keep MMU functions in "exec/cpu_ldst.h", and move TLB functions
> to "exec/exec-all.h". As tlb_addr_write() is only called in
> accel/tcg/cputlb.c, make move it there as a static function.
> 
> Doing so we removed the "tcg/tcg.h" dependency on "exec/cpu_ldst.h".
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4...@amsat.org>
> ---
>  include/exec/cpu_ldst.h | 52 -----------------------------------------
>  include/exec/exec-all.h | 38 ++++++++++++++++++++++++++++++
>  accel/tcg/cputlb.c      |  9 +++++++
>  3 files changed, 47 insertions(+), 52 deletions(-)

> diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h
> index c5e8e355b7f..5024b9abd4a 100644
> --- a/include/exec/exec-all.h
> +++ b/include/exec/exec-all.h
> @@ -297,6 +297,38 @@ void tlb_set_page(CPUState *cpu, target_ulong vaddr,
>                    hwaddr paddr, int prot,
>                    int mmu_idx, target_ulong size);
>  
> +/**
> + * tlb_vaddr_to_host:
> + * @env: CPUArchState
> + * @addr: guest virtual address to look up
> + * @access_type: 0 for read, 1 for write, 2 for execute
> + * @mmu_idx: MMU index to use for lookup
> + *
> + * Look up the specified guest virtual index in the TCG softmmu TLB.
> + * If we can translate a host virtual address suitable for direct RAM
> + * access, without causing a guest exception, then return it.
> + * Otherwise (TLB entry is for an I/O access, guest software
> + * TLB fill required, etc) return NULL.
> + */
> +void *tlb_vaddr_to_host(CPUArchState *env, abi_ptr addr,
> +                        MMUAccessType access_type, int mmu_idx);

Non-TCG build failure because abi_ptr is defined in "exec/cpu_ldst.h":

  typedef target_ulong abi_ptr;

Reply via email to