git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
arch
/
sh
/
drivers
/
pci
/
dma-dreamcast.c
diff --git
a/arch/sh/drivers/pci/dma-dreamcast.c
b/arch/sh/drivers/pci/dma-dreamcast.c
index
ff61697
..
230d6ec
100644
(file)
--- a/
arch/sh/drivers/pci/dma-dreamcast.c
+++ b/
arch/sh/drivers/pci/dma-dreamcast.c
@@
-1,5
+1,5
@@
/*
/*
- * arch/sh/pci/dma-dreamcast.c
+ * arch/sh/
drivers/
pci/dma-dreamcast.c
*
* PCI DMA support for the Sega Dreamcast
*
*
* PCI DMA support for the Sega Dreamcast
*
@@
-15,7
+15,6
@@
* for more details.
*/
* for more details.
*/
-#include <linux/config.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/param.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/param.h>
@@
-23,6
+22,8
@@
#include <linux/init.h>
#include <linux/irq.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/irq.h>
#include <linux/pci.h>
+#include <linux/dma-mapping.h>
+#include <linux/device.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/io.h>
#include <asm/irq.h>
@@
-30,18
+31,21
@@
static int gapspci_dma_used = 0;
static int gapspci_dma_used = 0;
-void *
__pci_alloc_consistent(struct pci_dev *hw
dev, size_t size,
-
dma_addr_t * dma_handle
)
+void *
dreamcast_consistent_alloc(struct device *
dev, size_t size,
+
dma_addr_t *dma_handle, gfp_t flag
)
{
unsigned long buf;
{
unsigned long buf;
- if (
gapspci_dma_used+size > GAPSPCI_DMA_SIZE
)
+ if (
dev && dev->bus != &pci_bus_type
)
return NULL;
return NULL;
- buf = GAPSPCI_DMA_BASE+gapspci_dma_used;
+ if (gapspci_dma_used + size > GAPSPCI_DMA_SIZE)
+ return ERR_PTR(-EINVAL);
+
+ buf = GAPSPCI_DMA_BASE + gapspci_dma_used;
gapspci_dma_used = PAGE_ALIGN(gapspci_dma_used+size);
gapspci_dma_used = PAGE_ALIGN(gapspci_dma_used+size);
-
+
*dma_handle = (dma_addr_t)buf;
buf = P2SEGADDR(buf);
*dma_handle = (dma_addr_t)buf;
buf = P2SEGADDR(buf);
@@
-52,10
+56,15
@@
void *__pci_alloc_consistent(struct pci_dev *hwdev, size_t size,
return (void *)buf;
}
return (void *)buf;
}
-
void __pci_free_consistent(struct pci_dev *hw
dev, size_t size,
+
int dreamcast_consistent_free(struct device *
dev, size_t size,
void *vaddr, dma_addr_t dma_handle)
{
void *vaddr, dma_addr_t dma_handle)
{
+ if (dev && dev->bus != &pci_bus_type)
+ return -EINVAL;
+
/* XXX */
gapspci_dma_used = 0;
/* XXX */
gapspci_dma_used = 0;
+
+ return 0;
}
}