Lines Matching refs:blk
133 #define firstpg(blk) (((struct snd_trident_memblk_arg *)snd_util_memblk_argptr(blk))->first_page) argument
134 #define lastpg(blk) (((struct snd_trident_memblk_arg *)snd_util_memblk_argptr(blk))->last_page) argument
142 struct snd_util_memblk *blk, *prev; in search_empty() local
150 blk = list_entry(p, struct snd_util_memblk, list); in search_empty()
151 if (page + psize <= firstpg(blk)) in search_empty()
153 page = lastpg(blk) + 1; in search_empty()
160 blk = __snd_util_memblk_new(hdr, psize * ALIGN_PAGE_SIZE, p->prev); in search_empty()
161 if (blk == NULL) in search_empty()
163 blk->offset = aligned_page_offset(page); /* set aligned offset */ in search_empty()
164 firstpg(blk) = page; in search_empty()
165 lastpg(blk) = page + psize - 1; in search_empty()
166 return blk; in search_empty()
194 struct snd_util_memblk *blk; in snd_trident_alloc_sg_pages() local
209 blk = search_empty(hdr, runtime->dma_bytes); in snd_trident_alloc_sg_pages()
210 if (blk == NULL) { in snd_trident_alloc_sg_pages()
217 for (page = firstpg(blk); page <= lastpg(blk); page++, idx++) { in snd_trident_alloc_sg_pages()
223 __snd_util_mem_free(hdr, blk); in snd_trident_alloc_sg_pages()
230 return blk; in snd_trident_alloc_sg_pages()
241 struct snd_util_memblk *blk; in snd_trident_alloc_cont_pages() local
256 blk = search_empty(hdr, runtime->dma_bytes); in snd_trident_alloc_cont_pages()
257 if (blk == NULL) { in snd_trident_alloc_cont_pages()
265 for (page = firstpg(blk); page <= lastpg(blk); page++, in snd_trident_alloc_cont_pages()
268 __snd_util_mem_free(hdr, blk); in snd_trident_alloc_cont_pages()
275 return blk; in snd_trident_alloc_cont_pages()
298 struct snd_util_memblk *blk) in snd_trident_free_pages() argument
303 if (snd_BUG_ON(!trident || !blk)) in snd_trident_free_pages()
309 for (page = firstpg(blk); page <= lastpg(blk); page++) in snd_trident_free_pages()
312 __snd_util_mem_free(hdr, blk); in snd_trident_free_pages()