- 追加された行はこの色です。
- 削除された行はこの色です。
*参照元 [#hc3dc615]
#backlinks
*説明 [#if9de86c]
-パス: [[linux-4.4.1/sound/core/pcm_native.c]]
-FIXME: これは何?
--説明
**引数 [#u4efff76]
-struct snd_pcm_substream *substream
--
--[[linux-4.4.1/snd_pcm_substream]]
-struct vm_area_struct *area
--
--[[linux-4.4.1/vm_area_struct]]
**返り値 [#oa356611]
-int
--
**参考 [#abc16e4b]
*実装 [#s328591a]
/**
* snd_pcm_lib_default_mmap - Default PCM data mmap function
* @substream: PCM substream
* @area: VMA
*
* This is the default mmap handler for PCM data. When mmap pcm_ops is NULL,
* this function is invoked implicitly.
*/
int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream,
struct vm_area_struct *area)
{
area->vm_flags |= VM_DONTEXPAND | VM_DONTDUMP;
#ifdef CONFIG_GENERIC_ALLOCATOR
-
--[[linux-4.4.1/CONFIG_GENERIC_ALLOCATOR]]
if (substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV_IRAM) {
area->vm_page_prot = pgprot_writecombine(area->vm_page_prot);
return remap_pfn_range(area, area->vm_start,
substream->dma_buffer.addr >> PAGE_SHIFT,
area->vm_end - area->vm_start, area->vm_page_prot);
-
--[[linux-4.4.1/pgprot_writecombine()]]
--[[linux-4.4.1/remap_pfn_range()]]
}
#endif /* CONFIG_GENERIC_ALLOCATOR */
#ifndef CONFIG_X86 /* for avoiding warnings arch/x86/mm/pat.c */
-
--[[linux-4.4.1/CONFIG_X86]]
if (!substream->ops->page &&
substream->dma_buffer.dev.type == SNDRV_DMA_TYPE_DEV)
return dma_mmap_coherent(substream->dma_buffer.dev.dev,
area,
substream->runtime->dma_area,
substream->runtime->dma_addr,
area->vm_end - area->vm_start);
-
--[[linux-4.4.1/dma_mmap_coherent()]]
#endif /* CONFIG_X86 */
/* mmap with fault handler */
area->vm_ops = &snd_pcm_vm_ops_data_fault;
-
--[[linux-4.4.1/snd_pcm_vm_ops_data_fault(global)]]
return 0;
}
EXPORT_SYMBOL_GPL(snd_pcm_lib_default_mmap);
-
--[[linux-4.4.1/EXPORT_SYMBOL_GPL()]]
*コメント [#baa8708a]