*参照元 [#obe78bd3] #backlinks *説明 [#z0d9ae7b] -パス: [[linux-4.4.1/sound/core/pcm_memory.c]] -FIXME: これは何? --説明 **引数 [#l1a5e6d1] -struct snd_pcm_substream *substream -- --[[linux-4.4.1/snd_pcm_substream]] -size_t size -- **返り値 [#u690817a] -int -- **参考 [#h8970f0b] *実装 [#h9e03d3e] /* * try to allocate as the large pages as possible. * stores the resultant memory size in *res_size. * * the minimum size is snd_minimum_buffer. it should be power of 2. */ static int preallocate_pcm_pages(struct snd_pcm_substream *substream, size_t size) { struct snd_dma_buffer *dmab = &substream->dma_buffer; size_t orig_size = size; int err; - --[[linux-4.4.1/snd_dma_buffer]] do { if ((err = snd_dma_alloc_pages(dmab->dev.type, dmab->dev.dev, size, dmab)) < 0) { if (err != -ENOMEM) return err; /* fatal error */ } else return 0; - -dmab->dev は struct snd_dma_device 型 --[[linux-4.4.1/snd_dma_device]] --[[linux-4.4.1/snd_dma_alloc_pages()]] size >>= 1; } while (size >= snd_minimum_buffer); dmab->bytes = 0; /* tell error */ pr_warn("ALSA pcmC%dD%d%c,%d:%s: cannot preallocate for size %zu\n", substream->pcm->card->number, substream->pcm->device, substream->stream ? 'c' : 'p', substream->number, substream->pcm->name, orig_size); - -substream->pcm は struct snd_pcm * 型 -substream->pcm->card は struct snd_card * 型 -substream->pcm->device は int 型 --[[linux-4.4.1/snd_pcm]] --[[linux-4.4.1/snd_card]] --[[linux-4.4.1/pr_warn()]] return 0; } *コメント [#g68aa953]