2 * arch/sh/pci/dma-dreamcast.c
4 * PCI DMA support for the Sega Dreamcast
6 * Copyright (C) 2001, 2002 M. R. Brown
7 * Copyright (C) 2002, 2003 Paul Mundt
9 * This file originally bore the message (with enclosed-$):
10 * Id: pci.c,v 1.3 2003/05/04 19:29:46 lethal Exp
11 * Dreamcast PCI: Supports SEGA Broadband Adaptor only.
13 * This file is subject to the terms and conditions of the GNU General Public
14 * License. See the file "COPYING" in the main directory of this archive
18 #include <linux/config.h>
19 #include <linux/sched.h>
20 #include <linux/kernel.h>
21 #include <linux/param.h>
22 #include <linux/interrupt.h>
23 #include <linux/init.h>
24 #include <linux/irq.h>
25 #include <linux/pci.h>
29 #include <asm/mach/pci.h>
31 static int gapspci_dma_used = 0;
33 void *__pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
34 dma_addr_t * dma_handle)
38 if (gapspci_dma_used+size > GAPSPCI_DMA_SIZE)
41 buf = GAPSPCI_DMA_BASE+gapspci_dma_used;
43 gapspci_dma_used = PAGE_ALIGN(gapspci_dma_used+size);
45 *dma_handle = (dma_addr_t)buf;
49 /* Flush the dcache before we hand off the buffer */
50 dma_cache_wback_inv((void *)buf, size);
55 void __pci_free_consistent(struct pci_dev *hwdev, size_t size,
56 void *vaddr, dma_addr_t dma_handle)