Module Name: src Committed By: matt Date: Mon Sep 7 22:28:24 UTC 2009
Modified Files: src/sys/arch/mips/mips [matt-nb5-mips64]: bus_dma.c Log Message: Use/Compare CCA from MIPS3_PG_{UNCACHED,CACHED} To generate a diff of this commit: cvs rdiff -u -r1.22.16.3 -r1.22.16.4 src/sys/arch/mips/mips/bus_dma.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/mips/mips/bus_dma.c diff -u src/sys/arch/mips/mips/bus_dma.c:1.22.16.3 src/sys/arch/mips/mips/bus_dma.c:1.22.16.4 --- src/sys/arch/mips/mips/bus_dma.c:1.22.16.3 Sun Sep 6 22:58:59 2009 +++ src/sys/arch/mips/mips/bus_dma.c Mon Sep 7 22:28:24 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: bus_dma.c,v 1.22.16.3 2009/09/06 22:58:59 matt Exp $ */ +/* $NetBSD: bus_dma.c,v 1.22.16.4 2009/09/07 22:28:24 matt Exp $ */ /*- * Copyright (c) 1997, 1998, 2001 The NetBSD Foundation, Inc. @@ -32,7 +32,7 @@ #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.22.16.3 2009/09/06 22:58:59 matt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.22.16.4 2009/09/07 22:28:24 matt Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -45,6 +45,9 @@ #include <uvm/uvm_extern.h> #include <mips/cache.h> +#ifdef _LP64 +#include <mips/mips3_pte.h> +#endif #define _MIPS_BUS_DMA_PRIVATE #include <machine/bus.h> @@ -267,7 +270,7 @@ map->_dm_flags |= MIPS_DMAMAP_COHERENT; #ifdef _LP64 else if (MIPS_XKPHYS_P((vaddr_t)buf) - && MIPS_XKPHYS_TO_CCA((vaddr_t)buf) == CCA_UNCACHED) + && MIPS_XKPHYS_TO_CCA((vaddr_t)buf) == MIPS3_PG_TO_CCA(MIPS3_PG_UNCACHED)) map->_dm_flags |= MIPS_DMAMAP_COHERENT; #endif } @@ -660,11 +663,11 @@ if (segs[0].ds_addr + segs[0].ds_len > MIPS_PHYS_MASK) { unsigned long cca; if (flags & BUS_DMA_COHERENT) - cca = CCA_UNCACHED; + cca = MIPS3_PG_TO_CCA(MIPS3_PG_UNCACHED); else - cca = CCA_CACHEABLE; - *kvap = (void *)MIPS_PHYS_TO_XKPHYS(segs[0].ds_addr, - cca); + cca = MIPS3_PG_TO_CCA(MIPS3_PG_CACHED); + *kvap = (void *)MIPS_PHYS_TO_XKPHYS(cca, + segs[0].ds_addr); } else #endif if (flags & BUS_DMA_COHERENT)