00001 00043 #ifndef GENERIC_DMA_NOMMU_H_INCLUDED 00044 #define GENERIC_DMA_NOMMU_H_INCLUDED 00045 00046 #include <physmem.h> 00047 #include <types.h> 00048 00060 typedef union { 00061 phys_addr_t phys; 00062 void *ptr; 00063 } dma_addr_t; 00064 00071 static inline dma_addr_t dma_addr_failure(void) 00072 { 00073 dma_addr_t addr; 00074 00075 addr.ptr = NULL; 00076 00077 return addr; 00078 } 00079 00086 static inline bool dma_addr_is_failed(dma_addr_t addr) 00087 { 00088 return addr.ptr == NULL; 00089 } 00090 00101 static inline void dma_sync_for_device(dma_addr_t addr, size_t size, 00102 enum dma_direction direction) 00103 { 00104 00105 } 00106 00117 static inline void dma_sync_for_cpu(dma_addr_t addr, size_t size, 00118 enum dma_direction direction) 00119 { 00120 00121 } 00122 00135 static inline dma_addr_t dma_map_single(const void *vaddr, size_t size, 00136 enum dma_direction direction) 00137 { 00138 dma_addr_t addr = { .ptr = (void *)vaddr }; 00139 00140 return addr; 00141 } 00142 00153 static inline void dma_unmap_single(dma_addr_t addr, size_t size, 00154 enum dma_direction direction) 00155 { 00156 00157 } 00158 00160 00161 #endif /* GENERIC_DMA_NOMMU_H_INCLUDED */
1.6.3