Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Fix __HAVE_MM_MD_CACHE_ALIASING case to use UVM_KMF_...
details: https://anonhg.NetBSD.org/src/rev/e93f3d4944a3
branches: trunk
changeset: 784120:e93f3d4944a3
user: matt <matt%NetBSD.org@localhost>
date: Sat Jan 19 00:27:34 2013 +0000
description:
Fix __HAVE_MM_MD_CACHE_ALIASING case to use UVM_KMF_COLORMATCH so that
uvm returns a page of the correct color.
diffstat:
sys/dev/mm.c | 17 ++++++-----------
1 files changed, 6 insertions(+), 11 deletions(-)
diffs (45 lines):
diff -r c7e32796ad9d -r e93f3d4944a3 sys/dev/mm.c
--- a/sys/dev/mm.c Sat Jan 19 00:15:09 2013 +0000
+++ b/sys/dev/mm.c Sat Jan 19 00:27:34 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mm.c,v 1.16 2012/02/21 21:57:06 rmind Exp $ */
+/* $NetBSD: mm.c,v 1.17 2013/01/19 00:27:34 matt Exp $ */
/*-
* Copyright (c) 2002, 2008, 2010 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mm.c,v 1.16 2012/02/21 21:57:06 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mm.c,v 1.17 2013/01/19 00:27:34 matt Exp $");
#include "opt_compat_netbsd.h"
@@ -113,11 +113,9 @@
dev_mem_getva(paddr_t pa)
{
#ifdef __HAVE_MM_MD_CACHE_ALIASING
- const vsize_t coloroff = trunc_page(pa) & ptoa(uvmexp.colormask);
- const vaddr_t kva = uvm_km_alloc(kernel_map, PAGE_SIZE + coloroff,
- ptoa(uvmexp.ncolors), UVM_KMF_VAONLY | UVM_KMF_WAITVA);
-
- return kva + coloroff;
+ return uvm_km_alloc(kernel_map, PAGE_SIZE,
+ atop(pa) & uvmexp.colormask,
+ UVM_KMF_VAONLY | UVM_KMF_WAITVA | UVM_KMF_COLORMATCH);
#else
return dev_mem_addr;
#endif
@@ -127,10 +125,7 @@
dev_mem_relva(paddr_t pa, vaddr_t va)
{
#ifdef __HAVE_MM_MD_CACHE_ALIASING
- const vsize_t coloroff = trunc_page(pa) & ptoa(uvmexp.colormask);
- const vaddr_t origva = va - coloroff;
-
- uvm_km_free(kernel_map, origva, PAGE_SIZE + coloroff, UVM_KMF_VAONLY);
+ uvm_km_free(kernel_map, va, PAGE_SIZE, UVM_KMF_VAONLY);
#else
KASSERT(dev_mem_addr == va);
#endif
Home |
Main Index |
Thread Index |
Old Index