linux-4.4.1/dma_mmap_from_coherent()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#y2043c1b]
#backlinks
*説明 [#nd8166be]
-パス: [[linux-4.4.1/drivers/base/dma-coherent.c]]
-FIXME: これは何?
--説明
**引数 [#n79ae54f]
-struct device *dev
--
--[[linux-4.4.1/device]]
-struct vm_area_struct *vma
--
--[[linux-4.4.1/vm_area_struct]]
-void *vaddr
--
-size_t size
--
-int *ret
--
**返り値 [#s1fa12fc]
-int
--
**参考 [#l9badc66]
*実装 [#l1a72a51]
/**
* dma_mmap_from_coherent() - try to mmap the memory all...
* per-device coherent memory pool to userspace
* @dev: device from which the memory was allocated
* @vma: vm_area for the userspace memory
* @vaddr: cpu address returned by dma_alloc_from_c...
* @size: size of the memory buffer allocated by d...
* @ret: result from remap_pfn_range()
*
* This checks whether the memory was allocated from the...
* coherent memory pool and if so, maps that memory to t...
*
* Returns 1 if we correctly mapped the memory, or 0 if ...
* proceed with mapping memory from generic pools.
*/
int dma_mmap_from_coherent(struct device *dev, struct vm...
void *vaddr, size_t size, int...
{
struct dma_coherent_mem *mem = dev ? dev->dma_me...
-
--[[linux-4.4.1/dma_coherent_mem]]
if (mem && vaddr >= mem->virt_base && vaddr + si...
(mem->virt_base + (mem->size << PAGE_...
unsigned long off = vma->vm_pgoff;
int start = (vaddr - mem->virt_base) >> ...
int user_count = (vma->vm_end - vma->vm_...
int count = size >> PAGE_SHIFT;
*ret = -ENXIO;
if (off < count && user_count <= count -...
unsigned long pfn = mem->pfn_bas...
*ret = remap_pfn_range(vma, vma-...
user_coun...
vma->vm_p...
-
--[[linux-4.4.1/remap_pfn_range()]]
}
return 1;
}
return 0;
}
EXPORT_SYMBOL(dma_mmap_from_coherent);
-
--[[linux-4.4.1/EXPORT_SYMBOL()]]
*コメント [#w235093e]
終了行:
*参照元 [#y2043c1b]
#backlinks
*説明 [#nd8166be]
-パス: [[linux-4.4.1/drivers/base/dma-coherent.c]]
-FIXME: これは何?
--説明
**引数 [#n79ae54f]
-struct device *dev
--
--[[linux-4.4.1/device]]
-struct vm_area_struct *vma
--
--[[linux-4.4.1/vm_area_struct]]
-void *vaddr
--
-size_t size
--
-int *ret
--
**返り値 [#s1fa12fc]
-int
--
**参考 [#l9badc66]
*実装 [#l1a72a51]
/**
* dma_mmap_from_coherent() - try to mmap the memory all...
* per-device coherent memory pool to userspace
* @dev: device from which the memory was allocated
* @vma: vm_area for the userspace memory
* @vaddr: cpu address returned by dma_alloc_from_c...
* @size: size of the memory buffer allocated by d...
* @ret: result from remap_pfn_range()
*
* This checks whether the memory was allocated from the...
* coherent memory pool and if so, maps that memory to t...
*
* Returns 1 if we correctly mapped the memory, or 0 if ...
* proceed with mapping memory from generic pools.
*/
int dma_mmap_from_coherent(struct device *dev, struct vm...
void *vaddr, size_t size, int...
{
struct dma_coherent_mem *mem = dev ? dev->dma_me...
-
--[[linux-4.4.1/dma_coherent_mem]]
if (mem && vaddr >= mem->virt_base && vaddr + si...
(mem->virt_base + (mem->size << PAGE_...
unsigned long off = vma->vm_pgoff;
int start = (vaddr - mem->virt_base) >> ...
int user_count = (vma->vm_end - vma->vm_...
int count = size >> PAGE_SHIFT;
*ret = -ENXIO;
if (off < count && user_count <= count -...
unsigned long pfn = mem->pfn_bas...
*ret = remap_pfn_range(vma, vma-...
user_coun...
vma->vm_p...
-
--[[linux-4.4.1/remap_pfn_range()]]
}
return 1;
}
return 0;
}
EXPORT_SYMBOL(dma_mmap_from_coherent);
-
--[[linux-4.4.1/EXPORT_SYMBOL()]]
*コメント [#w235093e]
ページ名: