*参照元 [#raba8d02]
#backlinks

*説明 [#s8c8a8b7]
-パス: [[linux-4.4.1/drivers/dma-buf/dma-buf.c]]

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


**引数 [#n6edc4fb]
-struct dma_buf_attachment *attach
--
--[[linux-4.4.1/dma_buf_attachment]]
-enum dma_data_direction direction
--
--[[linux-4.4.1/dma_data_direction]]


**返り値 [#p0365133]
-struct sg_table *
--
--[[linux-4.4.1/sg_table]]


**参考 [#cc923b87]


*実装 [#neb7fcb3]
 /**
  * dma_buf_map_attachment - Returns the scatterlist table of the attachment;
  * mapped into _device_ address space. Is a wrapper for map_dma_buf() of the
  * dma_buf_ops.
  * @attach:     [in]    attachment whose scatterlist is to be returned
  * @direction:  [in]    direction of DMA transfer
  *
  * Returns sg_table containing the scatterlist to be returned; returns ERR_PTR
  * on error.
  */
 struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach,
                                         enum dma_data_direction direction)
 {
         struct sg_table *sg_table = ERR_PTR(-EINVAL);
 
-
--[[linux-4.4.1/ERR_PTR()]]

         might_sleep();
 
-
--[[linux-4.4.1/might_sleep()]]

         if (WARN_ON(!attach || !attach->dmabuf))
                 return ERR_PTR(-EINVAL);
 
-
--[[linux-4.4.1/WARN_ON()]]

         sg_table = attach->dmabuf->ops->map_dma_buf(attach, direction);
         if (!sg_table)
                 sg_table = ERR_PTR(-ENOMEM);
 
-
-attach->dmabuf は struct dma_buf * 型
--attach->dmabuf は struct dma_buf * 型
--[[linux-4.4.1/dma_buf]]
--attach->dmabuf->ops は const struct dma_buf_ops * 型
--[[linux-4.4.1/dma_buf_ops]]

         return sg_table;
 }
 EXPORT_SYMBOL_GPL(dma_buf_map_attachment);
-
--[[linux-4.4.1/EXPORT_SYMBOL_GPL()]]


*コメント [#g929839d]

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