patch-2.1.34 linux/arch/sparc64/kernel/ioport.c
Next file: linux/arch/sparc64/kernel/irq.c
Previous file: linux/arch/sparc64/kernel/head.S
Back to the patch index
Back to the overall index
- Lines: 58
- Date:
Fri Apr 11 10:47:36 1997
- Orig file:
v2.1.33/linux/arch/sparc64/kernel/ioport.c
- Orig date:
Thu Mar 27 14:40:00 1997
diff -u --recursive --new-file v2.1.33/linux/arch/sparc64/kernel/ioport.c linux/arch/sparc64/kernel/ioport.c
@@ -1,4 +1,4 @@
-/* $Id: ioport.c,v 1.2 1997/03/18 17:59:31 jj Exp $
+/* $Id: ioport.c,v 1.7 1997/04/10 05:13:01 davem Exp $
* ioport.c: Simple io mapping allocator.
*
* Copyright (C) 1995,1996 David S. Miller (davem@caip.rutgers.edu)
@@ -22,6 +22,8 @@
static unsigned long dvma_next_free = DVMA_VADDR;
unsigned long sparc_iobase_vaddr = IOBASE_VADDR;
+extern void mmu_map_dma_area(unsigned long addr, int len, __u32 *dvma_addr);
+
/*
* sparc_alloc_io:
* Map and allocates an obio device.
@@ -39,8 +41,8 @@
* The virtual address where the mapping actually took place.
*/
-void *sparc_alloc_io (void *address, void *virtual, int len, char *name,
- unsigned bus_type, int rdonly)
+void *sparc_alloc_io (u32 address, void *virtual, int len, char *name,
+ u32 bus_type, int rdonly)
{
unsigned long vaddr, base_address;
unsigned long addr = ((unsigned long) address) + (((unsigned long) bus_type) << 32);
@@ -74,7 +76,7 @@
base_address = vaddr;
/* Do the actual mapping */
for (; len > 0; len -= PAGE_SIZE) {
- mapioaddr(addr, vaddr, rdonly);
+ mapioaddr(addr, vaddr, bus_type, rdonly);
vaddr += PAGE_SIZE;
addr += PAGE_SIZE;
}
@@ -103,8 +105,11 @@
* at addresses above DVMA_VADDR it will grab them, this way it does not
* now have to know the peculiarities of where to read the Lance data
* from. (for example)
+ *
+ * Returns CPU visible address for the buffer returned, dvma_addr is
+ * set to the DVMA visible address.
*/
-void *sparc_dvma_malloc (int len, char *name)
+void *sparc_dvma_malloc (int len, char *name, __u32 *dvma_addr)
{
unsigned long vaddr, base_address;
@@ -123,7 +128,8 @@
* pages are now mapped dynamically to save space.
*/
base_address = vaddr;
- mmu_map_dma_area(base_address, len);
+ mmu_map_dma_area(base_address, len, dvma_addr);
+
/* Assign the memory area. */
dvma_next_free = PAGE_ALIGN(dvma_next_free+len);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov