Lines Matching refs:map

70 static inline void sq_mapping_list_add(struct sq_mapping *map)  in sq_mapping_list_add()  argument
80 map->next = tmp; in sq_mapping_list_add()
81 *p = map; in sq_mapping_list_add()
86 static inline void sq_mapping_list_del(struct sq_mapping *map) in sq_mapping_list_del() argument
93 if (tmp == map) { in sq_mapping_list_del()
101 static int __sq_remap(struct sq_mapping *map, pgprot_t prot) in __sq_remap() argument
106 vma = __get_vm_area_caller(map->size, VM_IOREMAP, map->sq_addr, in __sq_remap()
111 vma->phys_addr = map->addr; in __sq_remap()
114 (unsigned long)vma->addr + map->size, in __sq_remap()
125 __raw_writel(((map->addr >> 26) << 2) & 0x1c, SQ_QACR0); in __sq_remap()
126 __raw_writel(((map->addr >> 26) << 2) & 0x1c, SQ_QACR1); in __sq_remap()
146 struct sq_mapping *map; in sq_remap() local
162 map = kmem_cache_alloc(sq_cache, GFP_KERNEL); in sq_remap()
163 if (unlikely(!map)) in sq_remap()
166 map->addr = phys; in sq_remap()
167 map->size = size; in sq_remap()
168 map->name = name; in sq_remap()
171 get_order(map->size)); in sq_remap()
177 map->sq_addr = P4SEG_STORE_QUE + (page << PAGE_SHIFT); in sq_remap()
179 ret = __sq_remap(map, prot); in sq_remap()
185 likely(map->name) ? map->name : "???", in sq_remap()
187 map->sq_addr, map->addr); in sq_remap()
189 sq_mapping_list_add(map); in sq_remap()
191 return map->sq_addr; in sq_remap()
194 kmem_cache_free(sq_cache, map); in sq_remap()
209 struct sq_mapping **p, *map; in sq_unmap() local
212 for (p = &sq_mapping_list; (map = *p); p = &map->next) in sq_unmap()
213 if (map->sq_addr == vaddr) in sq_unmap()
216 if (unlikely(!map)) { in sq_unmap()
222 page = (map->sq_addr - P4SEG_STORE_QUE) >> PAGE_SHIFT; in sq_unmap()
223 bitmap_release_region(sq_bitmap, page, get_order(map->size)); in sq_unmap()
232 vma = remove_vm_area((void *)(map->sq_addr & PAGE_MASK)); in sq_unmap()
235 __func__, map->sq_addr); in sq_unmap()
241 sq_mapping_list_del(map); in sq_unmap()
243 kmem_cache_free(sq_cache, map); in sq_unmap()