*参照元 [#v6d5f8ac]
#backlinks

*説明 [#lf82efa4]
-パス: [[linux-4.4.1/drivers/media/v4l2-core/videobuf2-vmalloc.c]]

-FIXME: これは何?
--説明


**引数 [#cb3d2940]
-void *alloc_ctx
--
-unsigned long size
--
-enum dma_data_direction dma_dir
--
--[[linux-4.4.1/dma_data_direction]]
-gfp_t gfp_flags
--
--[[linux-4.4.1/gfp_t]]


**返り値 [#vcceae35]
-void *
--


**参考 [#a4ce5bfe]


*実装 [#jeb8d061]
 static void *vb2_vmalloc_alloc(void *alloc_ctx, unsigned long size,
                                enum dma_data_direction dma_dir, gfp_t gfp_flags)
 {
         struct vb2_vmalloc_buf *buf;
 
-
--[[linux-4.4.1/vb2_vmalloc_buf]]

         buf = kzalloc(sizeof(*buf), GFP_KERNEL | gfp_flags);
         if (!buf)
                 return NULL;
 
-
--[[linux-4.4.1/kzalloc()]]

         buf->size = size;
         buf->vaddr = vmalloc_user(buf->size);
         buf->dma_dir = dma_dir;
         buf->handler.refcount = &buf->refcount;
         buf->handler.put = vb2_vmalloc_put;
         buf->handler.arg = buf;
 
-
--[[linux-4.4.1/vmalloc_user()]]
--[[linux-4.4.1/vb2_vmalloc_put()]]

         if (!buf->vaddr) {
                 pr_debug("vmalloc of size %ld failed\n", buf->size);
                 kfree(buf);
                 return NULL;
         }
 
-
--[[linux-4.4.1/pr_debug()]]
--[[linux-4.4.1/kfree()]]

         atomic_inc(&buf->refcount);
-
--[[linux-4.4.1/atomic_inc()]]

         return buf;
 }


*コメント [#oab1bfc2]


トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS