linux-2.6.33/dma_alloc_from_coherent()
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
*参照元 [#r366bf96]
#backlinks
*説明 [#zc8145c8]
-パス: [[linux-2.6.33/include/asm-generic/dma-coherent.h]]
-FIXME: これは何?
--確保した領域は 0 データで埋められる。
--コンフィグにより、マクロの場合と関数の場合の 2通りある。
**引数 [#d5af6009]
-struct device *dev
--デバイス
--[[linux-2.6.33/device]]
-ssize_t size
--確保する領域のサイズ
-dma_addr_t *dma_handle
--確保した領域の DMA アドレスを返すためのポインタ
--失敗したときは不定値が返る
--[[linux-2.6.33/dma_addr_t]]
-void **ret
--確保した領域の仮想アドレスを返すためのポインタ
--失敗したときは不定値が返る
**返り値 [#f8c12ac4]
-int
--成功なら 0以外、失敗なら 0
**参考 [#h5efe1a3]
汎用の関数を利用するようにコンフィグを定義しているアーキ...
arm, mips, sh, x86 の一部に存在する。
arch/arm/configs/acs5k_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/arm/configs/acs5k_tiny_defconfig:CONFIG_HAVE_GENERI...
arch/arm/configs/afeb9260_defconfig:CONFIG_HAVE_GENERIC_...
arch/arm/configs/am3517_evm_defconfig:CONFIG_HAVE_GENERI...
arch/arm/configs/bcmring_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/cm_t35_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/arm/configs/cm_x2xx_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/cm_x300_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/colibri_pxa270_defconfig:CONFIG_HAVE_GE...
arch/arm/configs/colibri_pxa300_defconfig:CONFIG_HAVE_GE...
arch/arm/configs/corgi_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/arm/configs/cpu9260_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/cpu9g20_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/cpuat91_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/da8xx_omapl_defconfig:CONFIG_HAVE_GENER...
arch/arm/configs/davinci_all_defconfig:CONFIG_HAVE_GENER...
arch/arm/configs/dove_defconfig:CONFIG_HAVE_GENERIC_DMA_...
arch/arm/configs/em_x270_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/ep93xx_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/arm/configs/eseries_pxa_defconfig:CONFIG_HAVE_GENER...
arch/arm/configs/ezx_defconfig:CONFIG_HAVE_GENERIC_DMA_C...
arch/arm/configs/h3600_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/arm/configs/h5000_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/arm/configs/htcherald_defconfig:CONFIG_HAVE_GENERIC...
arch/arm/configs/igep0020_defconfig:CONFIG_HAVE_GENERIC_...
arch/arm/configs/iop33x_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/arm/configs/jornada720_defconfig:CONFIG_HAVE_GENERI...
arch/arm/configs/kb9202_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/arm/configs/kirkwood_defconfig:CONFIG_HAVE_GENERIC_...
arch/arm/configs/ks8695_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/arm/configs/magician_defconfig:CONFIG_HAVE_GENERIC_...
arch/arm/configs/mini2440_defconfig:CONFIG_HAVE_GENERIC_...
arch/arm/configs/mv78xx0_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/mx1_defconfig:CONFIG_HAVE_GENERIC_DMA_C...
arch/arm/configs/mx21_defconfig:CONFIG_HAVE_GENERIC_DMA_...
arch/arm/configs/mx27_defconfig:CONFIG_HAVE_GENERIC_DMA_...
arch/arm/configs/mx31pdk_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/mx3_defconfig:CONFIG_HAVE_GENERIC_DMA_C...
arch/arm/configs/n8x0_defconfig:CONFIG_HAVE_GENERIC_DMA_...
arch/arm/configs/neocore926_defconfig:CONFIG_HAVE_GENERI...
arch/arm/configs/nhk8815_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/nuc910_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/arm/configs/nuc950_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/arm/configs/nuc960_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/arm/configs/omap3_beagle_defconfig:CONFIG_HAVE_GENE...
arch/arm/configs/omap3_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/arm/configs/omap3_evm_defconfig:CONFIG_HAVE_GENERIC...
arch/arm/configs/omap3_pandora_defconfig:CONFIG_HAVE_GEN...
arch/arm/configs/omap3_touchbook_defconfig:CONFIG_HAVE_G...
arch/arm/configs/omap_3430sdp_defconfig:CONFIG_HAVE_GENE...
arch/arm/configs/omap_3630sdp_defconfig:CONFIG_HAVE_GENE...
arch/arm/configs/omap_4430sdp_defconfig:CONFIG_HAVE_GENE...
arch/arm/configs/omap_ldp_defconfig:CONFIG_HAVE_GENERIC_...
arch/arm/configs/omap_zoom2_defconfig:CONFIG_HAVE_GENERI...
arch/arm/configs/omap_zoom3_defconfig:CONFIG_HAVE_GENERI...
arch/arm/configs/orion5x_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/overo_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/arm/configs/palmz72_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/pxa168_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/arm/configs/pxa3xx_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/arm/configs/pxa910_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/arm/configs/realview-smp_defconfig:CONFIG_HAVE_GENE...
arch/arm/configs/realview_defconfig:CONFIG_HAVE_GENERIC_...
arch/arm/configs/rx51_defconfig:CONFIG_HAVE_GENERIC_DMA_...
arch/arm/configs/s3c2410_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/s3c6400_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/s5pc100_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/shark_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/arm/configs/spitz_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/arm/configs/stmp378x_defconfig:CONFIG_HAVE_GENERIC_...
arch/arm/configs/stmp37xx_defconfig:CONFIG_HAVE_GENERIC_...
arch/arm/configs/u300_defconfig:CONFIG_HAVE_GENERIC_DMA_...
arch/arm/configs/u8500_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/arm/configs/viper_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/arm/configs/xcep_defconfig:CONFIG_HAVE_GENERIC_DMA_...
arch/arm/configs/zeus_defconfig:CONFIG_HAVE_GENERIC_DMA_...
arch/mips/configs/fuloong2e_defconfig:CONFIG_HAVE_GENERI...
arch/mips/configs/ip27_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/mips/configs/lemote2f_defconfig:CONFIG_HAVE_GENERIC...
arch/mips/configs/rbtx49xx_defconfig:CONFIG_HAVE_GENERIC...
arch/sh/configs/ap325rxa_defconfig:CONFIG_HAVE_GENERIC_D...
arch/sh/configs/cayman_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/sh/configs/dreamcast_defconfig:CONFIG_HAVE_GENERIC_...
arch/sh/configs/ecovec24-romimage_defconfig:CONFIG_HAVE_...
arch/sh/configs/ecovec24_defconfig:CONFIG_HAVE_GENERIC_D...
arch/sh/configs/edosk7705_defconfig:CONFIG_HAVE_GENERIC_...
arch/sh/configs/edosk7760_defconfig:CONFIG_HAVE_GENERIC_...
arch/sh/configs/espt_defconfig:CONFIG_HAVE_GENERIC_DMA_C...
arch/sh/configs/hp6xx_defconfig:CONFIG_HAVE_GENERIC_DMA_...
arch/sh/configs/kfr2r09-romimage_defconfig:CONFIG_HAVE_G...
arch/sh/configs/kfr2r09_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/sh/configs/landisk_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/sh/configs/lboxre2_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/sh/configs/magicpanelr2_defconfig:CONFIG_HAVE_GENER...
arch/sh/configs/microdev_defconfig:CONFIG_HAVE_GENERIC_D...
arch/sh/configs/migor_defconfig:CONFIG_HAVE_GENERIC_DMA_...
arch/sh/configs/polaris_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/sh/configs/r7780mp_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/sh/configs/r7785rp_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/sh/configs/rsk7201_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/sh/configs/rsk7203_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/sh/configs/rts7751r2d1_defconfig:CONFIG_HAVE_GENERI...
arch/sh/configs/rts7751r2dplus_defconfig:CONFIG_HAVE_GEN...
arch/sh/configs/sdk7780_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/sh/configs/se7206_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/sh/configs/se7343_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/sh/configs/se7619_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/sh/configs/se7705_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/sh/configs/se7712_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/sh/configs/se7721_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/sh/configs/se7722_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/sh/configs/se7724_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/sh/configs/se7750_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/sh/configs/se7751_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/sh/configs/se7780_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/sh/configs/sh03_defconfig:CONFIG_HAVE_GENERIC_DMA_C...
arch/sh/configs/sh7710voipgw_defconfig:CONFIG_HAVE_GENER...
arch/sh/configs/sh7724_generic_defconfig:CONFIG_HAVE_GEN...
arch/sh/configs/sh7763rdp_defconfig:CONFIG_HAVE_GENERIC_...
arch/sh/configs/sh7770_generic_defconfig:CONFIG_HAVE_GEN...
arch/sh/configs/sh7785lcr_32bit_defconfig:CONFIG_HAVE_GE...
arch/sh/configs/sh7785lcr_defconfig:CONFIG_HAVE_GENERIC_...
arch/sh/configs/shmin_defconfig:CONFIG_HAVE_GENERIC_DMA_...
arch/sh/configs/shx3_defconfig:CONFIG_HAVE_GENERIC_DMA_C...
arch/sh/configs/snapgear_defconfig:CONFIG_HAVE_GENERIC_D...
arch/sh/configs/systemh_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/sh/configs/titan_defconfig:CONFIG_HAVE_GENERIC_DMA_...
arch/sh/configs/ul2_defconfig:CONFIG_HAVE_GENERIC_DMA_CO...
arch/sh/configs/urquell_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/x86/configs/i386_defconfig:CONFIG_HAVE_GENERIC_DMA_...
*実装 [#fd489f93]
** ヘッダ [#raa13539]
#ifdef CONFIG_HAVE_GENERIC_DMA_COHERENT
-
--[[linux-2.6.33/CONFIG_HAVE_GENERIC_DMA_COHERENT]]
/*
* These two functions are only for dma allocator.
* Don't use them in device drivers.
*/
int dma_alloc_from_coherent(struct device *dev, ssize_t ...
dma_addr_t *dma_handle, void **ret);
(...中略...)
#else
#define dma_alloc_from_coherent(dev, size, handle, ret) ...
(...中略...)
#endif
** drivers/base/dma-coherent.c: CONFIG_HAVE_GENERIC_DMA_C...
/**
* dma_alloc_from_coherent() - try to allocate memory fr...
*
* @dev: device from which we allocate memory
* @size: size of requested memory area
* @dma_handle: This will be filled with the correct dma...
* @ret: This pointer will be filled with the virtual ad...
* to allocated area.
*
* This function should be only called from per-arch dma...
* to support allocation from per-device coherent memory...
*
* Returns 0 if dma_alloc_coherent should continue with ...
* generic memory areas, or !0 if dma_alloc_coherent sho...
*/
int dma_alloc_from_coherent(struct device *dev, ssize_t ...
dma_addr_t *dma_handle, void **ret)
{
struct dma_coherent_mem *mem;
int order = get_order(size);
int pageno;
-
--[[linux-2.6.33/dma_coherent_mem]]
-
--[[linux-2.6.33/get_order()]]
if (!dev)
return 0;
mem = dev->dma_mem;
if (!mem)
return 0;
*ret = NULL;
if (unlikely(size > (mem->size << PAGE_SHIFT)))
goto err;
-
--[[linux-2.6.33/PAGE_SHIFT]]
pageno = bitmap_find_free_region(mem->bitmap, mem->size...
if (unlikely(pageno < 0))
goto err;
-
--[[linux-2.6.33/bitmap_find_free_region()]]
-
--[[linux-2.6.33/unlikely()]]
/*
* Memory was found in the per-device area.
*/
*dma_handle = mem->device_base + (pageno << PAGE_SHIFT);
*ret = mem->virt_base + (pageno << PAGE_SHIFT);
memset(*ret, 0, size);
return 1;
err:
/*
* In the case where the allocation can not be satisfie...
* per-device area, try to fall back to generic memory ...
* constraints allow it.
*/
return mem->flags & DMA_MEMORY_EXCLUSIVE;
-
--[[linux-2.6.33/DMA_MEMORY_EXCLUSIVE]]
}
EXPORT_SYMBOL(dma_alloc_from_coherent);
-ライセンスに関係なくシンボルを公開する。
--[[linux-2.6.33/EXPORT_SYMBOL()]]
** include/asm-generic/dma-coherent.h: CONFIG_HAVE_GENERI...
#define dma_alloc_from_coherent(dev, size, handle, ret) ...
-何もせず、失敗を返す。
*コメント [#v7a5513c]
終了行:
*参照元 [#r366bf96]
#backlinks
*説明 [#zc8145c8]
-パス: [[linux-2.6.33/include/asm-generic/dma-coherent.h]]
-FIXME: これは何?
--確保した領域は 0 データで埋められる。
--コンフィグにより、マクロの場合と関数の場合の 2通りある。
**引数 [#d5af6009]
-struct device *dev
--デバイス
--[[linux-2.6.33/device]]
-ssize_t size
--確保する領域のサイズ
-dma_addr_t *dma_handle
--確保した領域の DMA アドレスを返すためのポインタ
--失敗したときは不定値が返る
--[[linux-2.6.33/dma_addr_t]]
-void **ret
--確保した領域の仮想アドレスを返すためのポインタ
--失敗したときは不定値が返る
**返り値 [#f8c12ac4]
-int
--成功なら 0以外、失敗なら 0
**参考 [#h5efe1a3]
汎用の関数を利用するようにコンフィグを定義しているアーキ...
arm, mips, sh, x86 の一部に存在する。
arch/arm/configs/acs5k_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/arm/configs/acs5k_tiny_defconfig:CONFIG_HAVE_GENERI...
arch/arm/configs/afeb9260_defconfig:CONFIG_HAVE_GENERIC_...
arch/arm/configs/am3517_evm_defconfig:CONFIG_HAVE_GENERI...
arch/arm/configs/bcmring_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/cm_t35_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/arm/configs/cm_x2xx_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/cm_x300_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/colibri_pxa270_defconfig:CONFIG_HAVE_GE...
arch/arm/configs/colibri_pxa300_defconfig:CONFIG_HAVE_GE...
arch/arm/configs/corgi_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/arm/configs/cpu9260_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/cpu9g20_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/cpuat91_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/da8xx_omapl_defconfig:CONFIG_HAVE_GENER...
arch/arm/configs/davinci_all_defconfig:CONFIG_HAVE_GENER...
arch/arm/configs/dove_defconfig:CONFIG_HAVE_GENERIC_DMA_...
arch/arm/configs/em_x270_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/ep93xx_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/arm/configs/eseries_pxa_defconfig:CONFIG_HAVE_GENER...
arch/arm/configs/ezx_defconfig:CONFIG_HAVE_GENERIC_DMA_C...
arch/arm/configs/h3600_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/arm/configs/h5000_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/arm/configs/htcherald_defconfig:CONFIG_HAVE_GENERIC...
arch/arm/configs/igep0020_defconfig:CONFIG_HAVE_GENERIC_...
arch/arm/configs/iop33x_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/arm/configs/jornada720_defconfig:CONFIG_HAVE_GENERI...
arch/arm/configs/kb9202_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/arm/configs/kirkwood_defconfig:CONFIG_HAVE_GENERIC_...
arch/arm/configs/ks8695_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/arm/configs/magician_defconfig:CONFIG_HAVE_GENERIC_...
arch/arm/configs/mini2440_defconfig:CONFIG_HAVE_GENERIC_...
arch/arm/configs/mv78xx0_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/mx1_defconfig:CONFIG_HAVE_GENERIC_DMA_C...
arch/arm/configs/mx21_defconfig:CONFIG_HAVE_GENERIC_DMA_...
arch/arm/configs/mx27_defconfig:CONFIG_HAVE_GENERIC_DMA_...
arch/arm/configs/mx31pdk_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/mx3_defconfig:CONFIG_HAVE_GENERIC_DMA_C...
arch/arm/configs/n8x0_defconfig:CONFIG_HAVE_GENERIC_DMA_...
arch/arm/configs/neocore926_defconfig:CONFIG_HAVE_GENERI...
arch/arm/configs/nhk8815_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/nuc910_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/arm/configs/nuc950_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/arm/configs/nuc960_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/arm/configs/omap3_beagle_defconfig:CONFIG_HAVE_GENE...
arch/arm/configs/omap3_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/arm/configs/omap3_evm_defconfig:CONFIG_HAVE_GENERIC...
arch/arm/configs/omap3_pandora_defconfig:CONFIG_HAVE_GEN...
arch/arm/configs/omap3_touchbook_defconfig:CONFIG_HAVE_G...
arch/arm/configs/omap_3430sdp_defconfig:CONFIG_HAVE_GENE...
arch/arm/configs/omap_3630sdp_defconfig:CONFIG_HAVE_GENE...
arch/arm/configs/omap_4430sdp_defconfig:CONFIG_HAVE_GENE...
arch/arm/configs/omap_ldp_defconfig:CONFIG_HAVE_GENERIC_...
arch/arm/configs/omap_zoom2_defconfig:CONFIG_HAVE_GENERI...
arch/arm/configs/omap_zoom3_defconfig:CONFIG_HAVE_GENERI...
arch/arm/configs/orion5x_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/overo_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/arm/configs/palmz72_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/pxa168_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/arm/configs/pxa3xx_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/arm/configs/pxa910_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/arm/configs/realview-smp_defconfig:CONFIG_HAVE_GENE...
arch/arm/configs/realview_defconfig:CONFIG_HAVE_GENERIC_...
arch/arm/configs/rx51_defconfig:CONFIG_HAVE_GENERIC_DMA_...
arch/arm/configs/s3c2410_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/s3c6400_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/s5pc100_defconfig:CONFIG_HAVE_GENERIC_D...
arch/arm/configs/shark_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/arm/configs/spitz_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/arm/configs/stmp378x_defconfig:CONFIG_HAVE_GENERIC_...
arch/arm/configs/stmp37xx_defconfig:CONFIG_HAVE_GENERIC_...
arch/arm/configs/u300_defconfig:CONFIG_HAVE_GENERIC_DMA_...
arch/arm/configs/u8500_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/arm/configs/viper_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/arm/configs/xcep_defconfig:CONFIG_HAVE_GENERIC_DMA_...
arch/arm/configs/zeus_defconfig:CONFIG_HAVE_GENERIC_DMA_...
arch/mips/configs/fuloong2e_defconfig:CONFIG_HAVE_GENERI...
arch/mips/configs/ip27_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/mips/configs/lemote2f_defconfig:CONFIG_HAVE_GENERIC...
arch/mips/configs/rbtx49xx_defconfig:CONFIG_HAVE_GENERIC...
arch/sh/configs/ap325rxa_defconfig:CONFIG_HAVE_GENERIC_D...
arch/sh/configs/cayman_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/sh/configs/dreamcast_defconfig:CONFIG_HAVE_GENERIC_...
arch/sh/configs/ecovec24-romimage_defconfig:CONFIG_HAVE_...
arch/sh/configs/ecovec24_defconfig:CONFIG_HAVE_GENERIC_D...
arch/sh/configs/edosk7705_defconfig:CONFIG_HAVE_GENERIC_...
arch/sh/configs/edosk7760_defconfig:CONFIG_HAVE_GENERIC_...
arch/sh/configs/espt_defconfig:CONFIG_HAVE_GENERIC_DMA_C...
arch/sh/configs/hp6xx_defconfig:CONFIG_HAVE_GENERIC_DMA_...
arch/sh/configs/kfr2r09-romimage_defconfig:CONFIG_HAVE_G...
arch/sh/configs/kfr2r09_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/sh/configs/landisk_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/sh/configs/lboxre2_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/sh/configs/magicpanelr2_defconfig:CONFIG_HAVE_GENER...
arch/sh/configs/microdev_defconfig:CONFIG_HAVE_GENERIC_D...
arch/sh/configs/migor_defconfig:CONFIG_HAVE_GENERIC_DMA_...
arch/sh/configs/polaris_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/sh/configs/r7780mp_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/sh/configs/r7785rp_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/sh/configs/rsk7201_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/sh/configs/rsk7203_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/sh/configs/rts7751r2d1_defconfig:CONFIG_HAVE_GENERI...
arch/sh/configs/rts7751r2dplus_defconfig:CONFIG_HAVE_GEN...
arch/sh/configs/sdk7780_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/sh/configs/se7206_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/sh/configs/se7343_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/sh/configs/se7619_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/sh/configs/se7705_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/sh/configs/se7712_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/sh/configs/se7721_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/sh/configs/se7722_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/sh/configs/se7724_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/sh/configs/se7750_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/sh/configs/se7751_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/sh/configs/se7780_defconfig:CONFIG_HAVE_GENERIC_DMA...
arch/sh/configs/sh03_defconfig:CONFIG_HAVE_GENERIC_DMA_C...
arch/sh/configs/sh7710voipgw_defconfig:CONFIG_HAVE_GENER...
arch/sh/configs/sh7724_generic_defconfig:CONFIG_HAVE_GEN...
arch/sh/configs/sh7763rdp_defconfig:CONFIG_HAVE_GENERIC_...
arch/sh/configs/sh7770_generic_defconfig:CONFIG_HAVE_GEN...
arch/sh/configs/sh7785lcr_32bit_defconfig:CONFIG_HAVE_GE...
arch/sh/configs/sh7785lcr_defconfig:CONFIG_HAVE_GENERIC_...
arch/sh/configs/shmin_defconfig:CONFIG_HAVE_GENERIC_DMA_...
arch/sh/configs/shx3_defconfig:CONFIG_HAVE_GENERIC_DMA_C...
arch/sh/configs/snapgear_defconfig:CONFIG_HAVE_GENERIC_D...
arch/sh/configs/systemh_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/sh/configs/titan_defconfig:CONFIG_HAVE_GENERIC_DMA_...
arch/sh/configs/ul2_defconfig:CONFIG_HAVE_GENERIC_DMA_CO...
arch/sh/configs/urquell_defconfig:CONFIG_HAVE_GENERIC_DM...
arch/x86/configs/i386_defconfig:CONFIG_HAVE_GENERIC_DMA_...
*実装 [#fd489f93]
** ヘッダ [#raa13539]
#ifdef CONFIG_HAVE_GENERIC_DMA_COHERENT
-
--[[linux-2.6.33/CONFIG_HAVE_GENERIC_DMA_COHERENT]]
/*
* These two functions are only for dma allocator.
* Don't use them in device drivers.
*/
int dma_alloc_from_coherent(struct device *dev, ssize_t ...
dma_addr_t *dma_handle, void **ret);
(...中略...)
#else
#define dma_alloc_from_coherent(dev, size, handle, ret) ...
(...中略...)
#endif
** drivers/base/dma-coherent.c: CONFIG_HAVE_GENERIC_DMA_C...
/**
* dma_alloc_from_coherent() - try to allocate memory fr...
*
* @dev: device from which we allocate memory
* @size: size of requested memory area
* @dma_handle: This will be filled with the correct dma...
* @ret: This pointer will be filled with the virtual ad...
* to allocated area.
*
* This function should be only called from per-arch dma...
* to support allocation from per-device coherent memory...
*
* Returns 0 if dma_alloc_coherent should continue with ...
* generic memory areas, or !0 if dma_alloc_coherent sho...
*/
int dma_alloc_from_coherent(struct device *dev, ssize_t ...
dma_addr_t *dma_handle, void **ret)
{
struct dma_coherent_mem *mem;
int order = get_order(size);
int pageno;
-
--[[linux-2.6.33/dma_coherent_mem]]
-
--[[linux-2.6.33/get_order()]]
if (!dev)
return 0;
mem = dev->dma_mem;
if (!mem)
return 0;
*ret = NULL;
if (unlikely(size > (mem->size << PAGE_SHIFT)))
goto err;
-
--[[linux-2.6.33/PAGE_SHIFT]]
pageno = bitmap_find_free_region(mem->bitmap, mem->size...
if (unlikely(pageno < 0))
goto err;
-
--[[linux-2.6.33/bitmap_find_free_region()]]
-
--[[linux-2.6.33/unlikely()]]
/*
* Memory was found in the per-device area.
*/
*dma_handle = mem->device_base + (pageno << PAGE_SHIFT);
*ret = mem->virt_base + (pageno << PAGE_SHIFT);
memset(*ret, 0, size);
return 1;
err:
/*
* In the case where the allocation can not be satisfie...
* per-device area, try to fall back to generic memory ...
* constraints allow it.
*/
return mem->flags & DMA_MEMORY_EXCLUSIVE;
-
--[[linux-2.6.33/DMA_MEMORY_EXCLUSIVE]]
}
EXPORT_SYMBOL(dma_alloc_from_coherent);
-ライセンスに関係なくシンボルを公開する。
--[[linux-2.6.33/EXPORT_SYMBOL()]]
** include/asm-generic/dma-coherent.h: CONFIG_HAVE_GENERI...
#define dma_alloc_from_coherent(dev, size, handle, ret) ...
-何もせず、失敗を返す。
*コメント [#v7a5513c]
ページ名: