Lines Matching refs:res

66 static void __iomem *_sparc_ioremap(struct resource *res, u32 bus, u32 pa, int sz);
69 static void _sparc_free_io(struct resource *res);
139 struct resource *res; in iounmap() local
145 if ((res = lookup_resource(&sparc_iomap, vaddr)) == NULL) { in iounmap()
149 _sparc_free_io(res); in iounmap()
151 if ((char *)res >= (char*)xresv && (char *)res < (char *)&xresv[XNRES]) { in iounmap()
152 xres_free((struct xresource *)res); in iounmap()
154 kfree(res); in iounmap()
159 void __iomem *of_ioremap(struct resource *res, unsigned long offset, in of_ioremap() argument
162 return _sparc_alloc_io(res->flags & 0xF, in of_ioremap()
163 res->start + offset, in of_ioremap()
168 void of_iounmap(struct resource *res, void __iomem *base, unsigned long size) in of_iounmap() argument
182 struct resource *res; in _sparc_alloc_io() local
191 res = &xres->xres; in _sparc_alloc_io()
201 res = (struct resource *) tack; in _sparc_alloc_io()
206 res->name = tack; in _sparc_alloc_io()
208 va = _sparc_ioremap(res, busno, phys, size); in _sparc_alloc_io()
216 _sparc_ioremap(struct resource *res, u32 bus, u32 pa, int sz) in _sparc_ioremap() argument
220 if (allocate_resource(&sparc_iomap, res, in _sparc_ioremap()
225 (res->name != NULL)? res->name: "???"); in _sparc_ioremap()
230 srmmu_mapiorange(bus, pa, res->start, resource_size(res)); in _sparc_ioremap()
232 return (void __iomem *)(unsigned long)(res->start + offset); in _sparc_ioremap()
238 static void _sparc_free_io(struct resource *res) in _sparc_free_io() argument
242 plen = resource_size(res); in _sparc_free_io()
244 srmmu_unmapiorange(res->start, plen); in _sparc_free_io()
245 release_resource(res); in _sparc_free_io()
268 struct resource *res; in sbus_alloc_coherent() local
285 if ((res = kzalloc(sizeof(struct resource), GFP_KERNEL)) == NULL) in sbus_alloc_coherent()
288 if (allocate_resource(&_sparc_dvma, res, len_total, in sbus_alloc_coherent()
300 if (sbus_map_dma_area(dev, dma_addrp, va, res->start, len_total) != 0) in sbus_alloc_coherent()
303 res->name = op->dev.of_node->name; in sbus_alloc_coherent()
305 return (void *)(unsigned long)res->start; in sbus_alloc_coherent()
308 release_resource(res); in sbus_alloc_coherent()
310 kfree(res); in sbus_alloc_coherent()
320 struct resource *res; in sbus_free_coherent() local
323 if ((res = lookup_resource(&_sparc_dvma, in sbus_free_coherent()
335 if (resource_size(res) != n) { in sbus_free_coherent()
337 (long)resource_size(res), n); in sbus_free_coherent()
341 release_resource(res); in sbus_free_coherent()
342 kfree(res); in sbus_free_coherent()
436 struct resource *res; in pci32_alloc_coherent() local
453 if ((res = kzalloc(sizeof(struct resource), GFP_KERNEL)) == NULL) { in pci32_alloc_coherent()
458 if (allocate_resource(&_sparc_dvma, res, len_total, in pci32_alloc_coherent()
463 srmmu_mapiorange(0, virt_to_phys(va), res->start, len_total); in pci32_alloc_coherent()
466 return (void *) res->start; in pci32_alloc_coherent()
469 kfree(res); in pci32_alloc_coherent()
487 struct resource *res; in pci32_free_coherent() local
489 if ((res = lookup_resource(&_sparc_dvma, in pci32_free_coherent()
501 if (resource_size(res) != n) { in pci32_free_coherent()
503 (long)resource_size(res), (long)n); in pci32_free_coherent()
510 release_resource(res); in pci32_free_coherent()
511 kfree(res); in pci32_free_coherent()