patch-2.4.20 linux-2.4.20/arch/mips/kernel/pci-dma.c

Next file: linux-2.4.20/arch/mips/kernel/pci.c
Previous file: linux-2.4.20/arch/mips/kernel/old-time.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.19/arch/mips/kernel/pci-dma.c linux-2.4.20/arch/mips/kernel/pci-dma.c
@@ -22,17 +22,19 @@
 	void *ret;
 	int gfp = GFP_ATOMIC;
 
+#ifdef CONFIG_ISA
 	if (hwdev == NULL || hwdev->dma_mask != 0xffffffff)
 		gfp |= GFP_DMA;
+#endif
 	ret = (void *) __get_free_pages(gfp, get_order(size));
 
 	if (ret != NULL) {
 		memset(ret, 0, size);
+		*dma_handle = bus_to_baddr(hwdev->bus->number, __pa(ret));
 #ifdef CONFIG_NONCOHERENT_IO
 		dma_cache_wback_inv((unsigned long) ret, size);
-		ret = KSEG1ADDR(ret);
+		ret = UNCAC_ADDR(ret);
 #endif
-		*dma_handle = virt_to_bus(ret);
 	}
 
 	return ret;
@@ -44,7 +46,7 @@
 	unsigned long addr = (unsigned long) vaddr;
 
 #ifdef CONFIG_NONCOHERENT_IO
-	addr = KSEG0ADDR(addr);
+	addr = CAC_ADDR(addr);
 #endif
 	free_pages(addr, get_order(size));
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)