diff options
| -rw-r--r-- | include/linux/iova.h | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/include/linux/iova.h b/include/linux/iova.h index f27bb2c62fca..548982ad5f2f 100644 --- a/include/linux/iova.h +++ b/include/linux/iova.h | |||
| @@ -82,6 +82,7 @@ static inline unsigned long iova_pfn(struct iova_domain *iovad, dma_addr_t iova) | |||
| 82 | return iova >> iova_shift(iovad); | 82 | return iova >> iova_shift(iovad); |
| 83 | } | 83 | } |
| 84 | 84 | ||
| 85 | #ifdef CONFIG_IOMMU_IOVA | ||
| 85 | int iova_cache_get(void); | 86 | int iova_cache_get(void); |
| 86 | void iova_cache_put(void); | 87 | void iova_cache_put(void); |
| 87 | 88 | ||
| @@ -106,5 +107,95 @@ void put_iova_domain(struct iova_domain *iovad); | |||
| 106 | struct iova *split_and_remove_iova(struct iova_domain *iovad, | 107 | struct iova *split_and_remove_iova(struct iova_domain *iovad, |
| 107 | struct iova *iova, unsigned long pfn_lo, unsigned long pfn_hi); | 108 | struct iova *iova, unsigned long pfn_lo, unsigned long pfn_hi); |
| 108 | void free_cpu_cached_iovas(unsigned int cpu, struct iova_domain *iovad); | 109 | void free_cpu_cached_iovas(unsigned int cpu, struct iova_domain *iovad); |
| 110 | #else | ||
| 111 | static inline int iova_cache_get(void) | ||
| 112 | { | ||
| 113 | return -ENOTSUPP; | ||
| 114 | } | ||
| 115 | |||
| 116 | static inline void iova_cache_put(void) | ||
| 117 | { | ||
| 118 | } | ||
| 119 | |||
| 120 | static inline struct iova *alloc_iova_mem(void) | ||
| 121 | { | ||
| 122 | return NULL; | ||
| 123 | } | ||
| 124 | |||
| 125 | static inline void free_iova_mem(struct iova *iova) | ||
| 126 | { | ||
| 127 | } | ||
| 128 | |||
| 129 | static inline void free_iova(struct iova_domain *iovad, unsigned long pfn) | ||
| 130 | { | ||
| 131 | } | ||
| 132 | |||
| 133 | static inline void __free_iova(struct iova_domain *iovad, struct iova *iova) | ||
| 134 | { | ||
| 135 | } | ||
| 136 | |||
| 137 | static inline struct iova *alloc_iova(struct iova_domain *iovad, | ||
| 138 | unsigned long size, | ||
| 139 | unsigned long limit_pfn, | ||
| 140 | bool size_aligned) | ||
| 141 | { | ||
| 142 | return NULL; | ||
| 143 | } | ||
| 144 | |||
| 145 | static inline void free_iova_fast(struct iova_domain *iovad, | ||
| 146 | unsigned long pfn, | ||
| 147 | unsigned long size) | ||
| 148 | { | ||
| 149 | } | ||
| 150 | |||
| 151 | static inline unsigned long alloc_iova_fast(struct iova_domain *iovad, | ||
| 152 | unsigned long size, | ||
| 153 | unsigned long limit_pfn) | ||
| 154 | { | ||
| 155 | return 0; | ||
| 156 | } | ||
| 157 | |||
| 158 | static inline struct iova *reserve_iova(struct iova_domain *iovad, | ||
| 159 | unsigned long pfn_lo, | ||
| 160 | unsigned long pfn_hi) | ||
| 161 | { | ||
| 162 | return NULL; | ||
| 163 | } | ||
| 164 | |||
| 165 | static inline void copy_reserved_iova(struct iova_domain *from, | ||
| 166 | struct iova_domain *to) | ||
| 167 | { | ||
| 168 | } | ||
| 169 | |||
| 170 | static inline void init_iova_domain(struct iova_domain *iovad, | ||
| 171 | unsigned long granule, | ||
| 172 | unsigned long start_pfn, | ||
| 173 | unsigned long pfn_32bit) | ||
| 174 | { | ||
| 175 | } | ||
| 176 | |||
| 177 | static inline struct iova *find_iova(struct iova_domain *iovad, | ||
| 178 | unsigned long pfn) | ||
| 179 | { | ||
| 180 | return NULL; | ||
| 181 | } | ||
| 182 | |||
| 183 | static inline void put_iova_domain(struct iova_domain *iovad) | ||
| 184 | { | ||
| 185 | } | ||
| 186 | |||
| 187 | static inline struct iova *split_and_remove_iova(struct iova_domain *iovad, | ||
| 188 | struct iova *iova, | ||
| 189 | unsigned long pfn_lo, | ||
| 190 | unsigned long pfn_hi) | ||
| 191 | { | ||
| 192 | return NULL; | ||
| 193 | } | ||
| 194 | |||
| 195 | static inline void free_cpu_cached_iovas(unsigned int cpu, | ||
| 196 | struct iova_domain *iovad) | ||
| 197 | { | ||
| 198 | } | ||
| 199 | #endif | ||
| 109 | 200 | ||
| 110 | #endif | 201 | #endif |
