linux-4.4.1/swiotlb_map_page()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#v52e6933]
#backlinks
*説明 [#r1db2a79]
-パス: [[linux-4.4.1/lib/swiotlb.c]]
-FIXME: これは何?
--説明
**引数 [#a476b1c1]
-struct device *dev
--
--[[linux-4.4.1/device]]
-struct page *page
--
--[[linux-4.4.1/page]]
-unsigned long offset
--
-size_t size
--
-enum dma_data_direction dir
--
--[[linux-4.4.1/dma_data_direction]]
-struct dma_attrs *attrs
--
--[[linux-4.4.1/dma_attrs]]
**返り値 [#p697a70c]
-dma_addr_t
--
--[[linux-4.4.1/dma_addr_t]]
**参考 [#yc6f388f]
*実装 [#qbf45789]
/*
* Map a single buffer of the indicated size for DMA in ...
* physical address to use is returned.
*
* Once the device is given the dma address, the device ...
* either swiotlb_unmap_page or swiotlb_dma_sync_single ...
*/
dma_addr_t swiotlb_map_page(struct device *dev, struct p...
unsigned long offset, size_t...
enum dma_data_direction dir,
struct dma_attrs *attrs)
{
phys_addr_t map, phys = page_to_phys(page) + off...
dma_addr_t dev_addr = phys_to_dma(dev, phys);
-
--[[linux-4.4.1/phys_addr_t]]
--[[linux-4.4.1/page_to_phys()]]
--[[linux-4.4.1/dma_addr_t]]
--[[linux-4.4.1/phys_to_dma()]]
BUG_ON(dir == DMA_NONE);
-
--[[linux-4.4.1/BUG_ON()]]
/*
* If the address happens to be in the device's ...
* we can safely return the device addr and not ...
* buffering it.
*/
if (dma_capable(dev, dev_addr, size) && !swiotlb...
return dev_addr;
-
--[[linux-4.4.1/dma_capable()]]
--[[linux-4.4.1/swiotlb_force(global)]]
trace_swiotlb_bounced(dev, dev_addr, size, swiot...
-
--[[linux-4.4.1/trace_swiotlb_bounced()]]
/* Oh well, have to allocate and map a bounce bu...
map = map_single(dev, phys, size, dir);
if (map == SWIOTLB_MAP_ERROR) {
swiotlb_full(dev, size, dir, 1);
return phys_to_dma(dev, io_tlb_overflow_...
}
-
--[[linux-4.4.1/map_single()]]
--[[linux-4.4.1/swiotlb_full()]]
--[[linux-4.4.1/io_tlb_overflow_buffer(global)]]
dev_addr = phys_to_dma(dev, map);
/* Ensure that the address returned is DMA'ble */
if (!dma_capable(dev, dev_addr, size)) {
swiotlb_tbl_unmap_single(dev, map, size,...
return phys_to_dma(dev, io_tlb_overflow_...
}
-
--[[linux-4.4.1/swiotlb_tbl_unmap_single()]]
return dev_addr;
}
EXPORT_SYMBOL_GPL(swiotlb_map_page);
-
--[[linux-4.4.1/EXPORT_SYMBOL_GPL()]]
*コメント [#w29f4f1a]
終了行:
*参照元 [#v52e6933]
#backlinks
*説明 [#r1db2a79]
-パス: [[linux-4.4.1/lib/swiotlb.c]]
-FIXME: これは何?
--説明
**引数 [#a476b1c1]
-struct device *dev
--
--[[linux-4.4.1/device]]
-struct page *page
--
--[[linux-4.4.1/page]]
-unsigned long offset
--
-size_t size
--
-enum dma_data_direction dir
--
--[[linux-4.4.1/dma_data_direction]]
-struct dma_attrs *attrs
--
--[[linux-4.4.1/dma_attrs]]
**返り値 [#p697a70c]
-dma_addr_t
--
--[[linux-4.4.1/dma_addr_t]]
**参考 [#yc6f388f]
*実装 [#qbf45789]
/*
* Map a single buffer of the indicated size for DMA in ...
* physical address to use is returned.
*
* Once the device is given the dma address, the device ...
* either swiotlb_unmap_page or swiotlb_dma_sync_single ...
*/
dma_addr_t swiotlb_map_page(struct device *dev, struct p...
unsigned long offset, size_t...
enum dma_data_direction dir,
struct dma_attrs *attrs)
{
phys_addr_t map, phys = page_to_phys(page) + off...
dma_addr_t dev_addr = phys_to_dma(dev, phys);
-
--[[linux-4.4.1/phys_addr_t]]
--[[linux-4.4.1/page_to_phys()]]
--[[linux-4.4.1/dma_addr_t]]
--[[linux-4.4.1/phys_to_dma()]]
BUG_ON(dir == DMA_NONE);
-
--[[linux-4.4.1/BUG_ON()]]
/*
* If the address happens to be in the device's ...
* we can safely return the device addr and not ...
* buffering it.
*/
if (dma_capable(dev, dev_addr, size) && !swiotlb...
return dev_addr;
-
--[[linux-4.4.1/dma_capable()]]
--[[linux-4.4.1/swiotlb_force(global)]]
trace_swiotlb_bounced(dev, dev_addr, size, swiot...
-
--[[linux-4.4.1/trace_swiotlb_bounced()]]
/* Oh well, have to allocate and map a bounce bu...
map = map_single(dev, phys, size, dir);
if (map == SWIOTLB_MAP_ERROR) {
swiotlb_full(dev, size, dir, 1);
return phys_to_dma(dev, io_tlb_overflow_...
}
-
--[[linux-4.4.1/map_single()]]
--[[linux-4.4.1/swiotlb_full()]]
--[[linux-4.4.1/io_tlb_overflow_buffer(global)]]
dev_addr = phys_to_dma(dev, map);
/* Ensure that the address returned is DMA'ble */
if (!dma_capable(dev, dev_addr, size)) {
swiotlb_tbl_unmap_single(dev, map, size,...
return phys_to_dma(dev, io_tlb_overflow_...
}
-
--[[linux-4.4.1/swiotlb_tbl_unmap_single()]]
return dev_addr;
}
EXPORT_SYMBOL_GPL(swiotlb_map_page);
-
--[[linux-4.4.1/EXPORT_SYMBOL_GPL()]]
*コメント [#w29f4f1a]
ページ名: