Lines Matching refs:block

28 snd_gf1_mem_xalloc(struct snd_gf1_mem *alloc, struct snd_gf1_mem_block *block,  in snd_gf1_mem_xalloc()  argument
36 *nblock = *block; in snd_gf1_mem_xalloc()
70 int snd_gf1_mem_xfree(struct snd_gf1_mem * alloc, struct snd_gf1_mem_block * block) in snd_gf1_mem_xfree() argument
72 if (block->share) { /* ok.. shared block */ in snd_gf1_mem_xfree()
73 block->share--; in snd_gf1_mem_xfree()
77 if (alloc->first == block) { in snd_gf1_mem_xfree()
78 alloc->first = block->next; in snd_gf1_mem_xfree()
79 if (block->next) in snd_gf1_mem_xfree()
80 block->next->prev = NULL; in snd_gf1_mem_xfree()
82 block->prev->next = block->next; in snd_gf1_mem_xfree()
83 if (block->next) in snd_gf1_mem_xfree()
84 block->next->prev = block->prev; in snd_gf1_mem_xfree()
86 if (alloc->last == block) { in snd_gf1_mem_xfree()
87 alloc->last = block->prev; in snd_gf1_mem_xfree()
88 if (block->prev) in snd_gf1_mem_xfree()
89 block->prev->next = NULL; in snd_gf1_mem_xfree()
91 block->next->prev = block->prev; in snd_gf1_mem_xfree()
92 if (block->prev) in snd_gf1_mem_xfree()
93 block->prev->next = block->next; in snd_gf1_mem_xfree()
95 kfree(block->name); in snd_gf1_mem_xfree()
96 kfree(block); in snd_gf1_mem_xfree()
103 struct snd_gf1_mem_block *block; in snd_gf1_mem_look() local
105 for (block = alloc->first; block; block = block->next) { in snd_gf1_mem_look()
106 if (block->ptr == address) { in snd_gf1_mem_look()
107 return block; in snd_gf1_mem_look()
116 struct snd_gf1_mem_block *block; in snd_gf1_mem_share() local
121 for (block = alloc->first; block; block = block->next) in snd_gf1_mem_share()
122 if (!memcmp(share_id, block->share_id, in snd_gf1_mem_share()
123 sizeof(block->share_id))) in snd_gf1_mem_share()
124 return block; in snd_gf1_mem_share()
129 struct snd_gf1_mem_block * block, in snd_gf1_mem_find() argument
140 block->flags = w_16 ? SNDRV_GF1_MEM_BLOCK_16BIT : 0; in snd_gf1_mem_find()
141 block->owner = SNDRV_GF1_MEM_OWNER_DRIVER; in snd_gf1_mem_find()
142 block->share = 0; in snd_gf1_mem_find()
143 block->share_id[0] = block->share_id[1] = in snd_gf1_mem_find()
144 block->share_id[2] = block->share_id[3] = 0; in snd_gf1_mem_find()
145 block->name = NULL; in snd_gf1_mem_find()
146 block->prev = block->next = NULL; in snd_gf1_mem_find()
164 block->ptr = ptr1; in snd_gf1_mem_find()
165 block->size = size; in snd_gf1_mem_find()
172 block->ptr = info[idx].address; in snd_gf1_mem_find()
173 block->size = size; in snd_gf1_mem_find()
184 struct snd_gf1_mem_block block, *nblock; in snd_gf1_mem_alloc() local
201 if (snd_gf1_mem_find(alloc, &block, size, w_16, align) < 0) { in snd_gf1_mem_alloc()
206 memcpy(&block.share_id, share_id, sizeof(block.share_id)); in snd_gf1_mem_alloc()
207 block.owner = owner; in snd_gf1_mem_alloc()
208 nblock = snd_gf1_mem_xalloc(alloc, &block, name); in snd_gf1_mem_alloc()
216 struct snd_gf1_mem_block *block; in snd_gf1_mem_free() local
219 block = snd_gf1_mem_look(alloc, address); in snd_gf1_mem_free()
220 if (block) { in snd_gf1_mem_free()
221 result = snd_gf1_mem_xfree(alloc, block); in snd_gf1_mem_free()
232 struct snd_gf1_mem_block block; in snd_gf1_mem_init() local
240 memset(&block, 0, sizeof(block)); in snd_gf1_mem_init()
241 block.owner = SNDRV_GF1_MEM_OWNER_DRIVER; in snd_gf1_mem_init()
243 block.ptr = 0; in snd_gf1_mem_init()
244 block.size = 1024; in snd_gf1_mem_init()
245 if (!snd_gf1_mem_xalloc(alloc, &block, "InterWave LFOs")) in snd_gf1_mem_init()
248 block.ptr = gus->gf1.default_voice_address; in snd_gf1_mem_init()
249 block.size = 4; in snd_gf1_mem_init()
250 if (!snd_gf1_mem_xalloc(alloc, &block, "Voice default (NULL's)")) in snd_gf1_mem_init()
261 struct snd_gf1_mem_block *block, *nblock; in snd_gf1_mem_done() local
264 block = alloc->first; in snd_gf1_mem_done()
265 while (block) { in snd_gf1_mem_done()
266 nblock = block->next; in snd_gf1_mem_done()
267 snd_gf1_mem_xfree(alloc, block); in snd_gf1_mem_done()
268 block = nblock; in snd_gf1_mem_done()
279 struct snd_gf1_mem_block *block; in snd_gf1_mem_info_read() local
297 for (block = alloc->first, i = 0; block; block = block->next, i++) { in snd_gf1_mem_info_read()
298 used += block->size; in snd_gf1_mem_info_read()
299 …snd_iprintf(buffer, "Block %i onboard 0x%x size %i (0x%x):\n", i, block->ptr, block->size, block->… in snd_gf1_mem_info_read()
300 if (block->share || in snd_gf1_mem_info_read()
301 block->share_id[0] || block->share_id[1] || in snd_gf1_mem_info_read()
302 block->share_id[2] || block->share_id[3]) in snd_gf1_mem_info_read()
304 block->share, in snd_gf1_mem_info_read()
305 block->share_id[0], block->share_id[1], in snd_gf1_mem_info_read()
306 block->share_id[2], block->share_id[3]); in snd_gf1_mem_info_read()
308 block->flags & SNDRV_GF1_MEM_BLOCK_16BIT ? " 16-bit" : ""); in snd_gf1_mem_info_read()
310 switch (block->owner) { in snd_gf1_mem_info_read()
312 snd_iprintf(buffer, "driver - %s\n", block->name); in snd_gf1_mem_info_read()