Lines Matching refs:res

55 static void __iomem *_sparc_ioremap(struct resource *res, u32 bus, u32 pa, int sz);
58 static void _sparc_free_io(struct resource *res);
128 struct resource *res; in iounmap() local
134 if ((res = lookup_resource(&sparc_iomap, vaddr)) == NULL) { in iounmap()
138 _sparc_free_io(res); in iounmap()
140 if ((char *)res >= (char*)xresv && (char *)res < (char *)&xresv[XNRES]) { in iounmap()
141 xres_free((struct xresource *)res); in iounmap()
143 kfree(res); in iounmap()
148 void __iomem *of_ioremap(struct resource *res, unsigned long offset, in of_ioremap() argument
151 return _sparc_alloc_io(res->flags & 0xF, in of_ioremap()
152 res->start + offset, in of_ioremap()
157 void of_iounmap(struct resource *res, void __iomem *base, unsigned long size) in of_iounmap() argument
171 struct resource *res; in _sparc_alloc_io() local
180 res = &xres->xres; in _sparc_alloc_io()
190 res = (struct resource *) tack; in _sparc_alloc_io()
195 res->name = tack; in _sparc_alloc_io()
197 va = _sparc_ioremap(res, busno, phys, size); in _sparc_alloc_io()
205 _sparc_ioremap(struct resource *res, u32 bus, u32 pa, int sz) in _sparc_ioremap() argument
209 if (allocate_resource(&sparc_iomap, res, in _sparc_ioremap()
214 (res->name != NULL)? res->name: "???"); in _sparc_ioremap()
219 srmmu_mapiorange(bus, pa, res->start, resource_size(res)); in _sparc_ioremap()
221 return (void __iomem *)(unsigned long)(res->start + offset); in _sparc_ioremap()
227 static void _sparc_free_io(struct resource *res) in _sparc_free_io() argument
231 plen = resource_size(res); in _sparc_free_io()
233 srmmu_unmapiorange(res->start, plen); in _sparc_free_io()
234 release_resource(res); in _sparc_free_io()
239 struct resource *res; in sparc_dma_alloc_resource() local
241 res = kzalloc(sizeof(*res), GFP_KERNEL); in sparc_dma_alloc_resource()
242 if (!res) in sparc_dma_alloc_resource()
244 res->name = dev->of_node->full_name; in sparc_dma_alloc_resource()
246 if (allocate_resource(&_sparc_dvma, res, len, _sparc_dvma.start, in sparc_dma_alloc_resource()
249 kfree(res); in sparc_dma_alloc_resource()
253 return res->start; in sparc_dma_alloc_resource()
259 struct resource *res; in sparc_dma_free_resource() local
261 res = lookup_resource(&_sparc_dvma, addr); in sparc_dma_free_resource()
262 if (!res) { in sparc_dma_free_resource()
273 if (resource_size(res) != size) { in sparc_dma_free_resource()
275 __func__, (long)resource_size(res), size); in sparc_dma_free_resource()
279 release_resource(res); in sparc_dma_free_resource()
280 kfree(res); in sparc_dma_free_resource()