2 * Copyright (C) 2000 David J. Mckay (david.mckay@st.com)
4 * May be copied or modified under the terms of the GNU General Public
5 * License. See linux/COPYING for more information.
7 * Dynamic DMA mapping support.
9 * On the overdrive, we can only DMA from memory behind the PCI bus!
10 * this means that all DMA'able memory must come from there.
11 * this restriction will not apply to later boards.
14 #include <linux/types.h>
16 #include <linux/string.h>
17 #include <linux/pci.h>
20 void *pci_alloc_consistent(struct pci_dev
*hwdev
, size_t size
,
21 dma_addr_t
* dma_handle
)
26 printk("BUG: pci_alloc_consistent() called - not yet supported\n");
27 /* We ALWAYS need DMA memory on the overdrive hardware,
28 * due to it's extreme weirdness
29 * Need to flush the cache here as well, since the memory
30 * can still be seen through the cache!
33 ret
= (void *) __get_free_pages(gfp
, get_order(size
));
37 *dma_handle
= virt_to_bus(ret
);
42 void pci_free_consistent(struct pci_dev
*hwdev
, size_t size
,
43 void *vaddr
, dma_addr_t dma_handle
)
45 free_pages((unsigned long) vaddr
, get_order(size
));