- Main Page
- Related Pages
- Data Structures
- Files

- File List
- Globals

# cpu/uc3/include/cpu/dmapool.h

Go to the documentation of this file.

    00001
    00045 #ifndef CPU_DMAPOOL_H_INCLUDED
    00046 #define CPU_DMAPOOL_H_INCLUDED
    00047
    00048 #include <dma.h>
    00049 #include <mempool.h>
    00050
    00057 struct dma_pool {
    00062         struct mem_pool mempool;
    00063 };
    00064
    00065 static inline void dma_pool_init_coherent(struct dma_pool *pool,
    00066                 phys_addr_t phys_start, size_t size, size_t objsize,
    00067                 unsigned int align_order)
    00068 {
    00069         mem_pool_init(&pool->mempool, (void *)phys_start, size, objsize,
    00070                         align_order);
    00071 }
    00072
    00073 static inline void dma_pool_init_noncoherent(struct dma_pool *pool,
    00074                 void *start, size_t size, size_t objsize,
    00075                 unsigned int align_order)
    00076 {
    00077         mem_pool_init(&pool->mempool, start, size, objsize, align_order);
    00078 }
    00079
    00080 static inline void *dma_pool_alloc(struct dma_pool *pool, phys_addr_t *paddr)
    00081 {
    00082         void            *obj;
    00083
    00084         obj = mem_pool_alloc(&pool->mempool);
    00085         *paddr = (phys_addr_t)obj;
    00086
    00087         return obj;
    00088 }
    00089
    00090 static inline void dma_pool_free(struct dma_pool *pool, const void *obj)
    00091 {
    00092         mem_pool_free(&pool->mempool, obj);
    00093 }
    00094
    00095 static inline void dma_pool_object_map(struct dma_pool *pool, const void *obj,
    00096                 enum dma_direction direction)
    00097 {
    00098
    00099 }
    00100
    00101 static inline void dma_pool_object_unmap(struct dma_pool *pool, const void *obj,
    00102                 enum dma_direction direction)
    00103 {
    00104
    00105 }
    00106
    00107 #endif /* CPU_DMAPOOL_H_INCLUDED */