*参照元 [#f29030a5]
#backlinks

*説明 [#e39f036c]
-パス: [[linux-4.4.1/include/linux/dma-contiguous.h]]

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


**引数 [#oeede878]
-struct device *dev
--
--[[linux-4.4.1/device]]
-phys_addr_t size
--
--[[linux-4.4.1/phys_addr_t]]
-phys_addr_t base
--
-phys_addr_t limit
--


**返り値 [#c46954c9]
-int
--


**参考 [#g795cee3]


*実装 [#d24e82c4]
 #ifdef CONFIG_DMA_CMA
 
-CONFIG_DMA_CMA が有効
--[[linux-4.4.1/CONFIG_DMA_CMA]]

 ...
 
 /**
  * dma_declare_contiguous() - reserve area for contiguous memory handling
  *			      for particular device
  * @dev:   Pointer to device structure.
  * @size:  Size of the reserved memory.
  * @base:  Start address of the reserved memory (optional, 0 for any).
  * @limit: End address of the reserved memory (optional, 0 for any).
  *
  * This function reserves memory for specified device. It should be
  * called by board specific code when early allocator (memblock or bootmem)
  * is still activate.
  */
 
 static inline int dma_declare_contiguous(struct device *dev, phys_addr_t size,
 					 phys_addr_t base, phys_addr_t limit)
 {
 	struct cma *cma;
 	int ret;
-
--[[linux-4.4.1/cma]]

 	ret = dma_contiguous_reserve_area(size, base, limit, &cma, true);
 	if (ret == 0)
 		dev_set_cma_area(dev, cma);
 
-
--[[linux-4.4.1/dma_contiguous_reserve_area()]]
--[[linux-4.4.1/dev_set_cma_area()]]

 	return ret;
 }
 
 #else
 
-CONFIG_DMA_CMA が無効

 ...
 
 static inline
 int dma_declare_contiguous(struct device *dev, phys_addr_t size,
 			   phys_addr_t base, phys_addr_t limit)
 {
 	return -ENOSYS;
 }


*コメント [#b114c2be]


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