*参照元 [#x35eba1c] #backlinks *説明 [#te8cf290] -パス: [[linux-4.4.1/drivers/staging/android/ion/ion.c]] -FIXME: これは何? --説明 **引数 [#fbc294fb] -struct dma_buf *dmabuf -- --[[linux-4.4.1/dma_buf]] -size_t start -- -size_t len -- -enum dma_data_direction direction -- --[[linux-4.4.1/dma_data_direction]] **返り値 [#h829771f] -int -- **参考 [#o68f1889] *実装 [#vd9ffd5e] static int ion_dma_buf_begin_cpu_access(struct dma_buf *dmabuf, size_t start, size_t len, enum dma_data_direction direction) { struct ion_buffer *buffer = dmabuf->priv; void *vaddr; - --[[linux-4.4.1/ion_buffer]] if (!buffer->heap->ops->map_kernel) { pr_err("%s: map kernel is not implemented by this heap.\n", __func__); return -ENODEV; } -buffer->heap->ops は 型 --[[linux-4.4.1/]] -buffer->heap->ops は struct ion_heap_ops * 型 --[[linux-4.4.1/ion_heap_ops]] mutex_lock(&buffer->lock); vaddr = ion_buffer_kmap_get(buffer); mutex_unlock(&buffer->lock); return PTR_ERR_OR_ZERO(vaddr); - --[[linux-4.4.1/mutex_lock()]] --[[linux-4.4.1/ion_buffer_kmap_get()]] --[[linux-4.4.1/mutex_unlock()]] --[[linux-4.4.1/PTR_ERR_OR_ZERO()]] } *コメント [#mb2fce17]