Lines Matching refs:page
140 struct pci_page *page; in pool_alloc_page() local
147 page = (struct pci_page *) kmalloc (mapsize + sizeof *page, mem_flags); in pool_alloc_page()
148 if (!page) in pool_alloc_page()
150 page->vaddr = pci_alloc_consistent (pool->dev, in pool_alloc_page()
152 &page->dma); in pool_alloc_page()
153 if (page->vaddr) { in pool_alloc_page()
154 memset (page->bitmap, 0xff, mapsize); // bit set == free in pool_alloc_page()
156 memset (page->vaddr, POOL_POISON_BYTE, pool->allocation); in pool_alloc_page()
158 list_add (&page->page_list, &pool->page_list); in pool_alloc_page()
160 kfree (page); in pool_alloc_page()
161 page = 0; in pool_alloc_page()
163 return page; in pool_alloc_page()
179 pool_free_page (struct pci_pool *pool, struct pci_page *page) in pool_free_page() argument
181 dma_addr_t dma = page->dma; in pool_free_page()
184 memset (page->vaddr, POOL_POISON_BYTE, pool->allocation); in pool_free_page()
186 pci_free_consistent (pool->dev, pool->allocation, page->vaddr, dma); in pool_free_page()
187 list_del (&page->page_list); in pool_free_page()
188 kfree (page); in pool_free_page()
211 struct pci_page *page; in pci_pool_destroy() local
212 page = list_entry (pool->page_list.next, in pci_pool_destroy()
214 if (is_page_busy (pool->blocks_per_page, page->bitmap)) { in pci_pool_destroy()
216 slot_name(pool), pool->name, page->vaddr); in pci_pool_destroy()
218 list_del (&page->page_list); in pci_pool_destroy()
219 kfree (page); in pci_pool_destroy()
221 pool_free_page (pool, page); in pci_pool_destroy()
243 struct pci_page *page; in pci_pool_alloc() local
252 page = list_entry (entry, struct pci_page, page_list); in pci_pool_alloc()
257 if (page->bitmap [map] == 0) in pci_pool_alloc()
259 block = ffz (~ page->bitmap [map]); in pci_pool_alloc()
261 clear_bit (block, &page->bitmap [map]); in pci_pool_alloc()
268 if (!(page = pool_alloc_page (pool, mem_flags))) { in pci_pool_alloc()
286 clear_bit (0, &page->bitmap [0]); in pci_pool_alloc()
289 retval = offset + page->vaddr; in pci_pool_alloc()
290 *handle = offset + page->dma; in pci_pool_alloc()
302 struct pci_page *page; in pool_find_page() local
306 page = list_entry (entry, struct pci_page, page_list); in pool_find_page()
307 if (dma < page->dma) in pool_find_page()
309 if (dma < (page->dma + pool->allocation)) in pool_find_page()
312 page = 0; in pool_find_page()
315 return page; in pool_find_page()
331 struct pci_page *page; in pci_pool_free() local
335 if ((page = pool_find_page (pool, dma)) == 0) { in pci_pool_free()
342 block = dma - page->dma; in pci_pool_free()
348 if (((dma - page->dma) + (void *)page->vaddr) != vaddr) { in pci_pool_free()
354 if (page->bitmap [map] & (1UL << block)) { in pci_pool_free()
364 set_bit (block, &page->bitmap [map]); in pci_pool_free()