xref: /qemu/include/accel/tcg/iommu.h (revision cc1f4b34d011e908dcaf24721f1d5808e02ab0bd)
1 /*
2  * TCG IOMMU translations.
3  *
4  * Copyright (c) 2003 Fabrice Bellard
5  * SPDX-License-Identifier: LGPL-2.1-or-later
6  */
7 #ifndef ACCEL_TCG_IOMMU_H
8 #define ACCEL_TCG_IOMMU_H
9 
10 #ifdef CONFIG_USER_ONLY
11 #error Cannot include accel/tcg/iommu.h from user emulation
12 #endif
13 
14 #include "exec/hwaddr.h"
15 #include "exec/memattrs.h"
16 
17 /**
18  * iotlb_to_section:
19  * @cpu: CPU performing the access
20  * @index: TCG CPU IOTLB entry
21  *
22  * Given a TCG CPU IOTLB entry, return the MemoryRegionSection that
23  * it refers to. @index will have been initially created and returned
24  * by memory_region_section_get_iotlb().
25  */
26 MemoryRegionSection *iotlb_to_section(CPUState *cpu,
27                                       hwaddr index, MemTxAttrs attrs);
28 
29 MemoryRegionSection *address_space_translate_for_iotlb(CPUState *cpu,
30                                                        int asidx,
31                                                        hwaddr addr,
32                                                        hwaddr *xlat,
33                                                        hwaddr *plen,
34                                                        MemTxAttrs attrs,
35                                                        int *prot);
36 
37 hwaddr memory_region_section_get_iotlb(CPUState *cpu,
38                                        MemoryRegionSection *section);
39 
40 #endif
41 
42