Linux驱动开发之DMA驱动

64bit DMA on 32bit CPU

sg列表中使用dma_addr_t

struct scatterlist {
#ifdef CONFIG_DEBUG_SG
	unsigned long	sg_magic;
#endif
	unsigned long	page_link;
	unsigned int	offset;
	unsigned int	length;
	dma_addr_t	dma_address;
#ifdef CONFIG_NEED_SG_DMA_LENGTH
	unsigned int	dma_length;
#endif
};

dma_addr_t定义,

#ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
typedef u64 dma_addr_t;
#else
typedef u32 dma_addr_t;
#endif /* dma_addr_t */

CONFIG_ARCH_DMA_ADDR_T_64BIT在下面文件中使用,

---- ARCH_DMA_ADDR_T_64BIT Matches (5 in 4 files) ----
bus.c (drivers\pci) line 101 : #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
pci_bus_alloc_resource in bus.c (drivers\pci) : #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
tegra_cursor_plane_update in dc.c (drivers\gpu\drm\tegra) : #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
starfire.c (drivers\net\ethernet\adaptec) line 139 : #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT
types.h (include\linux) line 146 : #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT

你可能感兴趣的:(linux内核与驱动开发,linux,dma)