linux-2.6.33/dmabounce_sync_for_cpu(arm)
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#u692c950]
#backlinks
*説明 [#vb9b7b1f]
-パス:
--CONFIG_DMABOUNCE 有効時: [[linux-2.6.33/arch/arm/common...
--CONFIG_DMABOUNCE 無効時: [[linux-2.6.33/arch/arm/includ...
-FIXME: これは何?
--説明
**引数 [#ce7ecf78]
-struct device *dev
--
--[[linux-2.6.33/device]]
-dma_addr_t addr
--
--[[linux-2.6.33/dma_addr_t]]
-unsigned long off
--
-size_t sz
--
-enum dma_data_direction dir
--
--[[linux-2.6.33/dma_data_direction]]
**返り値 [#fda0200e]
-int
--
**参考 [#d310da54]
*実装 [#g7281733]
**CONFIG_DMABOUNCE 有効時: linux-2.6.33/arch/arm/common/d...
int dmabounce_sync_for_cpu(struct device *dev, dma_addr_...
unsigned long off, size_t sz, enum dma_data_direction ...
{
struct safe_buffer *buf;
-
--[[linux-2.6.33/safe_buffer]]
dev_dbg(dev, "%s(dma=%#x,off=%#lx,sz=%zx,dir=%x)\n",
__func__, addr, off, sz, dir);
-
--[[linux-2.6.33/dev_dbg()]]
buf = find_safe_buffer_dev(dev, addr, __func__);
if (!buf)
return 1;
-
--[[linux-2.6.33/find_safe_buffer_dev()]]
BUG_ON(buf->direction != dir);
-
--[[linux-2.6.33/BUG_ON()]]
dev_dbg(dev, "%s: unsafe buffer %p (dma=%#x) mapped to ...
__func__, buf->ptr, virt_to_dma(dev, buf->ptr),
buf->safe, buf->safe_dma_addr);
DO_STATS(dev->archdata.dmabounce->bounce_count++);
-
--[[linux-2.6.33/DO_STATS]]
if (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL) {
dev_dbg(dev, "%s: copy back safe %p to unsafe %p size ...
__func__, buf->safe + off, buf->ptr + off, sz);
memcpy(buf->ptr + off, buf->safe + off, sz);
}
-
--[[linux-2.6.33/memcpy()]]
-
--[[linux-2.6.33/DMA_FROM_DEVICE]]
-
--[[linux-2.6.33/DMA_BIDIRECTIONAL]]
return 0;
}
EXPORT_SYMBOL(dmabounce_sync_for_cpu);
-ライセンスに関係なくシンボルを公開する。
--[[linux-2.6.33/EXPORT_SYMBOL()]]
**CONFIG_DMABOUNCE 無効時: linux-2.6.33/arch/arm/include/...
static inline int dmabounce_sync_for_cpu(struct device *...
unsigned long offset, size_t size, enum dma_data_direct...
{
return 1;
}
*コメント [#mf63c152]
終了行:
*参照元 [#u692c950]
#backlinks
*説明 [#vb9b7b1f]
-パス:
--CONFIG_DMABOUNCE 有効時: [[linux-2.6.33/arch/arm/common...
--CONFIG_DMABOUNCE 無効時: [[linux-2.6.33/arch/arm/includ...
-FIXME: これは何?
--説明
**引数 [#ce7ecf78]
-struct device *dev
--
--[[linux-2.6.33/device]]
-dma_addr_t addr
--
--[[linux-2.6.33/dma_addr_t]]
-unsigned long off
--
-size_t sz
--
-enum dma_data_direction dir
--
--[[linux-2.6.33/dma_data_direction]]
**返り値 [#fda0200e]
-int
--
**参考 [#d310da54]
*実装 [#g7281733]
**CONFIG_DMABOUNCE 有効時: linux-2.6.33/arch/arm/common/d...
int dmabounce_sync_for_cpu(struct device *dev, dma_addr_...
unsigned long off, size_t sz, enum dma_data_direction ...
{
struct safe_buffer *buf;
-
--[[linux-2.6.33/safe_buffer]]
dev_dbg(dev, "%s(dma=%#x,off=%#lx,sz=%zx,dir=%x)\n",
__func__, addr, off, sz, dir);
-
--[[linux-2.6.33/dev_dbg()]]
buf = find_safe_buffer_dev(dev, addr, __func__);
if (!buf)
return 1;
-
--[[linux-2.6.33/find_safe_buffer_dev()]]
BUG_ON(buf->direction != dir);
-
--[[linux-2.6.33/BUG_ON()]]
dev_dbg(dev, "%s: unsafe buffer %p (dma=%#x) mapped to ...
__func__, buf->ptr, virt_to_dma(dev, buf->ptr),
buf->safe, buf->safe_dma_addr);
DO_STATS(dev->archdata.dmabounce->bounce_count++);
-
--[[linux-2.6.33/DO_STATS]]
if (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL) {
dev_dbg(dev, "%s: copy back safe %p to unsafe %p size ...
__func__, buf->safe + off, buf->ptr + off, sz);
memcpy(buf->ptr + off, buf->safe + off, sz);
}
-
--[[linux-2.6.33/memcpy()]]
-
--[[linux-2.6.33/DMA_FROM_DEVICE]]
-
--[[linux-2.6.33/DMA_BIDIRECTIONAL]]
return 0;
}
EXPORT_SYMBOL(dmabounce_sync_for_cpu);
-ライセンスに関係なくシンボルを公開する。
--[[linux-2.6.33/EXPORT_SYMBOL()]]
**CONFIG_DMABOUNCE 無効時: linux-2.6.33/arch/arm/include/...
static inline int dmabounce_sync_for_cpu(struct device *...
unsigned long offset, size_t size, enum dma_data_direct...
{
return 1;
}
*コメント [#mf63c152]
ページ名: