*参照元 [#zc032c09]
#backlinks

*説明 [#zd445570]
-パス: [[linux-4.4.1/drivers/base/dma-contiguous.c]]

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


**引数 [#hfd05d97]
-phys_addr_t limit
--
--[[linux-4.4.1/phys_addr_t]]


**返り値 [#w012b78a]
-void


**参考 [#n0705a6b]


*実装 [#j6d349ab]
 /**
  * dma_contiguous_reserve() - reserve area(s) for contiguous memory handling
  * @limit: End address of the reserved memory (optional, 0 for any).
  *
  * This function reserves memory from early allocator. It should be
  * called by arch specific code once the early allocator (memblock or bootmem)
  * has been activated and all other subsystems have already allocated/reserved
  * memory.
  */
 void __init dma_contiguous_reserve(phys_addr_t limit)
 {
 	phys_addr_t selected_size = 0;
 	phys_addr_t selected_base = 0;
 	phys_addr_t selected_limit = limit;
 	bool fixed = false;
 
 	pr_debug("%s(limit %08lx)\n", __func__, (unsigned long)limit);
 
-
--[[linux-4.4.1/pr_debug()]]

 	if (size_cmdline != -1) {
 		selected_size = size_cmdline;
 		selected_base = base_cmdline;
 		selected_limit = min_not_zero(limit_cmdline, limit);
 		if (base_cmdline + size_cmdline == limit_cmdline)
 			fixed = true;
-
--[[linux-4.4.1/min_not_zero()]]
--[[linux-4.4.1/size_cmdline(global)]]
--[[linux-4.4.1/base_cmdline(global)]]
--[[linux-4.4.1/limit_cmdline(global)]]

 	} else {
 #ifdef CONFIG_CMA_SIZE_SEL_MBYTES
 		selected_size = size_bytes;
 #elif defined(CONFIG_CMA_SIZE_SEL_PERCENTAGE)
 		selected_size = cma_early_percent_memory();
 #elif defined(CONFIG_CMA_SIZE_SEL_MIN)
 		selected_size = min(size_bytes, cma_early_percent_memory());
 #elif defined(CONFIG_CMA_SIZE_SEL_MAX)
 		selected_size = max(size_bytes, cma_early_percent_memory());
 #endif
-
--[[linux-4.4.1/CONFIG_CMA_SIZE_SEL_MBYTES]]
--[[linux-4.4.1/size_bytes(global)]]
--[[linux-4.4.1/CONFIG_CMA_SIZE_SEL_PERCENTAGE()]]
--[[linux-4.4.1/cma_early_percent_memory()]]
--[[linux-4.4.1/CONFIG_CMA_SIZE_SEL_MIN]]
--[[linux-4.4.1/CONFIG_CMA_SIZE_SEL_MAX]]

 	}
 
 	if (selected_size && !dma_contiguous_default_area) {
 		pr_debug("%s: reserving %ld MiB for global area\n", __func__,
 			 (unsigned long)selected_size / SZ_1M);
 
-
--[[linux-4.4.1/dma_contiguous_default_area(global)]]

 		dma_contiguous_reserve_area(selected_size, selected_base,
 					    selected_limit,
 					    &dma_contiguous_default_area,
 					    fixed);
 	}
-
--[[linux-4.4.1/dma_contiguous_reserve_area()]]

 }


*コメント [#u2722247]


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