Lines Matching full:block
28 struct snd_gf1_mem_block * block) in snd_gf1_mem_xalloc() argument
35 *nblock = *block; in snd_gf1_mem_xalloc()
63 int snd_gf1_mem_xfree(struct snd_gf1_mem * alloc, struct snd_gf1_mem_block * block) in snd_gf1_mem_xfree() argument
65 if (block->share) { /* ok.. shared block */ in snd_gf1_mem_xfree()
66 block->share--; in snd_gf1_mem_xfree()
70 if (alloc->first == block) { in snd_gf1_mem_xfree()
71 alloc->first = block->next; in snd_gf1_mem_xfree()
72 if (block->next) in snd_gf1_mem_xfree()
73 block->next->prev = NULL; in snd_gf1_mem_xfree()
75 block->prev->next = block->next; in snd_gf1_mem_xfree()
76 if (block->next) in snd_gf1_mem_xfree()
77 block->next->prev = block->prev; in snd_gf1_mem_xfree()
79 if (alloc->last == block) { in snd_gf1_mem_xfree()
80 alloc->last = block->prev; in snd_gf1_mem_xfree()
81 if (block->prev) in snd_gf1_mem_xfree()
82 block->prev->next = NULL; in snd_gf1_mem_xfree()
84 block->next->prev = block->prev; in snd_gf1_mem_xfree()
85 if (block->prev) in snd_gf1_mem_xfree()
86 block->prev->next = block->next; in snd_gf1_mem_xfree()
88 kfree(block->name); in snd_gf1_mem_xfree()
89 kfree(block); in snd_gf1_mem_xfree()
96 struct snd_gf1_mem_block *block; in snd_gf1_mem_look() local
98 for (block = alloc->first; block; block = block->next) { in snd_gf1_mem_look()
99 if (block->ptr == address) { in snd_gf1_mem_look()
100 return block; in snd_gf1_mem_look()
109 struct snd_gf1_mem_block *block; in snd_gf1_mem_share() local
114 for (block = alloc->first; block; block = block->next) in snd_gf1_mem_share()
115 if (!memcmp(share_id, block->share_id, in snd_gf1_mem_share()
116 sizeof(block->share_id))) in snd_gf1_mem_share()
117 return block; in snd_gf1_mem_share()
122 struct snd_gf1_mem_block * block, in snd_gf1_mem_find() argument
133 block->flags = w_16 ? SNDRV_GF1_MEM_BLOCK_16BIT : 0; in snd_gf1_mem_find()
134 block->owner = SNDRV_GF1_MEM_OWNER_DRIVER; in snd_gf1_mem_find()
135 block->share = 0; in snd_gf1_mem_find()
136 block->share_id[0] = block->share_id[1] = in snd_gf1_mem_find()
137 block->share_id[2] = block->share_id[3] = 0; in snd_gf1_mem_find()
138 block->name = NULL; in snd_gf1_mem_find()
139 block->prev = block->next = NULL; in snd_gf1_mem_find()
157 block->ptr = ptr1; in snd_gf1_mem_find()
158 block->size = size; in snd_gf1_mem_find()
165 block->ptr = info[idx].address; in snd_gf1_mem_find()
166 block->size = size; in snd_gf1_mem_find()
177 struct snd_gf1_mem_block block, *nblock; in snd_gf1_mem_alloc() local
194 if (snd_gf1_mem_find(alloc, &block, size, w_16, align) < 0) { in snd_gf1_mem_alloc()
199 memcpy(&block.share_id, share_id, sizeof(block.share_id)); in snd_gf1_mem_alloc()
200 block.owner = owner; in snd_gf1_mem_alloc()
201 block.name = kstrdup(name, GFP_KERNEL); in snd_gf1_mem_alloc()
202 nblock = snd_gf1_mem_xalloc(alloc, &block); in snd_gf1_mem_alloc()
210 struct snd_gf1_mem_block *block; in snd_gf1_mem_free() local
213 if ((block = snd_gf1_mem_look(alloc, address)) != NULL) { in snd_gf1_mem_free()
214 result = snd_gf1_mem_xfree(alloc, block); in snd_gf1_mem_free()
225 struct snd_gf1_mem_block block; in snd_gf1_mem_init() local
233 memset(&block, 0, sizeof(block)); in snd_gf1_mem_init()
234 block.owner = SNDRV_GF1_MEM_OWNER_DRIVER; in snd_gf1_mem_init()
236 block.ptr = 0; in snd_gf1_mem_init()
237 block.size = 1024; in snd_gf1_mem_init()
238 block.name = kstrdup("InterWave LFOs", GFP_KERNEL); in snd_gf1_mem_init()
239 if (snd_gf1_mem_xalloc(alloc, &block) == NULL) in snd_gf1_mem_init()
242 block.ptr = gus->gf1.default_voice_address; in snd_gf1_mem_init()
243 block.size = 4; in snd_gf1_mem_init()
244 block.name = kstrdup("Voice default (NULL's)", GFP_KERNEL); in snd_gf1_mem_init()
245 if (snd_gf1_mem_xalloc(alloc, &block) == NULL) in snd_gf1_mem_init()
256 struct snd_gf1_mem_block *block, *nblock; in snd_gf1_mem_done() local
259 block = alloc->first; in snd_gf1_mem_done()
260 while (block) { in snd_gf1_mem_done()
261 nblock = block->next; in snd_gf1_mem_done()
262 snd_gf1_mem_xfree(alloc, block); in snd_gf1_mem_done()
263 block = nblock; in snd_gf1_mem_done()
274 struct snd_gf1_mem_block *block; in snd_gf1_mem_info_read() local
292 for (block = alloc->first, i = 0; block; block = block->next, i++) { in snd_gf1_mem_info_read()
293 used += block->size; in snd_gf1_mem_info_read()
294 …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()
295 if (block->share || in snd_gf1_mem_info_read()
296 block->share_id[0] || block->share_id[1] || in snd_gf1_mem_info_read()
297 block->share_id[2] || block->share_id[3]) in snd_gf1_mem_info_read()
299 block->share, in snd_gf1_mem_info_read()
300 block->share_id[0], block->share_id[1], in snd_gf1_mem_info_read()
301 block->share_id[2], block->share_id[3]); in snd_gf1_mem_info_read()
303 block->flags & SNDRV_GF1_MEM_BLOCK_16BIT ? " 16-bit" : ""); in snd_gf1_mem_info_read()
305 switch (block->owner) { in snd_gf1_mem_info_read()
307 snd_iprintf(buffer, "driver - %s\n", block->name); in snd_gf1_mem_info_read()
326 ultra_iprintf(buffer, " Verify: free = %i, max 8-bit block = %i, max 16-bit block = %i\n", in snd_gf1_mem_info_read()