12 #include <linux/types.h>
13 #include <linux/slab.h>
14 #include <linux/export.h>
16 #include <linux/list.h>
17 #include <linux/pci.h>
21 #define DMA_SRAM_START dma_coherent_mem_start
22 #define DMA_SRAM_END dma_coherent_mem_end
23 #else // Use video RAM on Matrox
24 #define DMA_SRAM_START 0xe8900000
25 #define DMA_SRAM_END 0xe8a00000
46 printk(
"%s called without any DMA area reserved!\n", __func__);
55 new->len = (size + 31) & ~31;
63 if (end - start >= size)
66 start = this_r->
ofs + this_r->
len;
70 this = &dma_alloc_list;
72 if (end - start >= size) {
76 spin_unlock_irqrestore(&dma_alloc_lock, flags);
83 spin_unlock_irqrestore(&dma_alloc_lock, flags);
97 if (rec->
ofs == dma_handle) {
100 spin_unlock_irqrestore(&dma_alloc_lock, flags);
104 spin_unlock_irqrestore(&dma_alloc_lock, flags);
127 for (i=0; i<nents; i++)