Lines Matching refs:vaddr
77 unsigned long vaddr, in map_pte_uncached() argument
81 unsigned long orig_vaddr = vaddr; in map_pte_uncached()
83 vaddr &= ~PMD_MASK; in map_pte_uncached()
84 end = vaddr + size; in map_pte_uncached()
96 vaddr += PAGE_SIZE; in map_pte_uncached()
100 } while (vaddr < end); in map_pte_uncached()
104 static inline int map_pmd_uncached(pmd_t * pmd, unsigned long vaddr, in map_pmd_uncached() argument
108 unsigned long orig_vaddr = vaddr; in map_pmd_uncached()
110 vaddr &= ~PGDIR_MASK; in map_pmd_uncached()
111 end = vaddr + size; in map_pmd_uncached()
115 pte_t * pte = pte_alloc_kernel(pmd, vaddr); in map_pmd_uncached()
118 if (map_pte_uncached(pte, orig_vaddr, end - vaddr, paddr_ptr)) in map_pmd_uncached()
120 vaddr = (vaddr + PMD_SIZE) & PMD_MASK; in map_pmd_uncached()
123 } while (vaddr < end); in map_pmd_uncached()
127 static inline int map_uncached_pages(unsigned long vaddr, unsigned long size, in map_uncached_pages() argument
131 unsigned long end = vaddr + size; in map_uncached_pages()
133 dir = pgd_offset_k(vaddr); in map_uncached_pages()
139 p4d = p4d_offset(dir, vaddr); in map_uncached_pages()
140 pud = pud_offset(p4d, vaddr); in map_uncached_pages()
141 pmd = pmd_alloc(NULL, pud, vaddr); in map_uncached_pages()
145 if (map_pmd_uncached(pmd, vaddr, end - vaddr, &paddr)) in map_uncached_pages()
147 vaddr = vaddr + PGDIR_SIZE; in map_uncached_pages()
149 } while (vaddr && (vaddr < end)); in map_uncached_pages()
153 static inline void unmap_uncached_pte(pmd_t * pmd, unsigned long vaddr, in unmap_uncached_pte() argument
158 unsigned long orig_vaddr = vaddr; in unmap_uncached_pte()
167 pte = pte_offset_map(pmd, vaddr); in unmap_uncached_pte()
168 vaddr &= ~PMD_MASK; in unmap_uncached_pte()
169 end = vaddr + size; in unmap_uncached_pte()
176 pte_clear(&init_mm, vaddr, pte); in unmap_uncached_pte()
180 vaddr += PAGE_SIZE; in unmap_uncached_pte()
186 } while (vaddr < end); in unmap_uncached_pte()
189 static inline void unmap_uncached_pmd(pgd_t * dir, unsigned long vaddr, in unmap_uncached_pmd() argument
194 unsigned long orig_vaddr = vaddr; in unmap_uncached_pmd()
203 pmd = pmd_offset(pud_offset(p4d_offset(dir, vaddr), vaddr), vaddr); in unmap_uncached_pmd()
204 vaddr &= ~PGDIR_MASK; in unmap_uncached_pmd()
205 end = vaddr + size; in unmap_uncached_pmd()
209 unmap_uncached_pte(pmd, orig_vaddr, end - vaddr); in unmap_uncached_pmd()
210 vaddr = (vaddr + PMD_SIZE) & PMD_MASK; in unmap_uncached_pmd()
213 } while (vaddr < end); in unmap_uncached_pmd()
216 static void unmap_uncached_pages(unsigned long vaddr, unsigned long size) in unmap_uncached_pages() argument
219 unsigned long end = vaddr + size; in unmap_uncached_pages()
221 dir = pgd_offset_k(vaddr); in unmap_uncached_pages()
223 unmap_uncached_pmd(dir, vaddr, end - vaddr); in unmap_uncached_pages()
224 vaddr = vaddr + PGDIR_SIZE; in unmap_uncached_pages()
226 } while (vaddr && (vaddr < end)); in unmap_uncached_pages()
305 pcxl_free_range(unsigned long vaddr, size_t size) in pcxl_free_range() argument
308 unsigned int res_idx = (vaddr - pcxl_dma_start) >> (PAGE_SHIFT + 3); in pcxl_free_range()
404 unsigned long vaddr; in arch_dma_alloc() local
413 vaddr = pcxl_alloc_range(size); in arch_dma_alloc()
417 map_uncached_pages(vaddr, size, paddr); in arch_dma_alloc()
428 return (void *)vaddr; in arch_dma_alloc()
431 void arch_dma_free(struct device *dev, size_t size, void *vaddr, in arch_dma_free() argument
440 unmap_uncached_pages((unsigned long)vaddr, size); in arch_dma_free()
441 pcxl_free_range((unsigned long)vaddr, size); in arch_dma_free()