17 #include <linux/slab.h>
18 #include <linux/bitmap.h>
19 #include <linux/bitops.h>
20 #include <linux/module.h>
37 static unsigned long *dma_bitmap;
45 static inline u32 __alloc_dma_pages(
int order)
52 spin_unlock_irqrestore(&dma_lock, flags);
62 if (addr < dma_base || (pos + (1 << order)) >= dma_pages) {
69 spin_unlock_irqrestore(&dma_lock, flags);
82 if (!dma_size || !size)
85 order = get_count_order(((size - 1) >>
PAGE_SHIFT) + 1);
87 paddr = __alloc_dma_pages(order);
107 if (!dma_size || !size)
110 order = get_count_order(((size - 1) >>
PAGE_SHIFT) + 1);
127 "Coherent memory (DMA) region start=0x%x size=0x%x\n",