Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/arm32 With PMAP_NEED_ALLOC_POOLPAGE, before usi...



details:   https://anonhg.NetBSD.org/src/rev/22bb20f89479
branches:  trunk
changeset: 332145:22bb20f89479
user:      matt <matt%NetBSD.org@localhost>
date:      Mon Sep 08 22:12:12 2014 +0000

description:
With PMAP_NEED_ALLOC_POOLPAGE, before using pmap_map_poolpage make sure
the page comes from the same freelist that pmap_map_poolpage uses.

diffstat:

 sys/arch/arm/arm32/bus_dma.c |  17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diffs (38 lines):

diff -r 4034ffb932d1 -r 22bb20f89479 sys/arch/arm/arm32/bus_dma.c
--- a/sys/arch/arm/arm32/bus_dma.c      Mon Sep 08 22:01:24 2014 +0000
+++ b/sys/arch/arm/arm32/bus_dma.c      Mon Sep 08 22:12:12 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bus_dma.c,v 1.86 2014/04/10 02:44:05 matt Exp $        */
+/*     $NetBSD: bus_dma.c,v 1.87 2014/09/08 22:12:12 matt Exp $        */
 
 /*-
  * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
 #include "opt_arm_bus_space.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.86 2014/04/10 02:44:05 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bus_dma.c,v 1.87 2014/09/08 22:12:12 matt Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1305,6 +1305,19 @@
                        }
                }
 
+#ifdef PMAP_NEED_ALLOC_POOLPAGE
+               /*
+                * The page can only be direct mapped if was allocated out
+                * of the arm poolpage vm freelist.  
+                */
+               int lcv = vm_physseg_find(atop(pa), NULL);
+               KASSERT(lcv != -1);
+               if (direct_mapable) {
+                       direct_mapable =
+                           (arm_poolpage_vmfreelist == VM_PHYSMEM_PTR(lcv)->free_list);
+               }
+#endif
+
                if (direct_mapable) {
                        *kvap = (void *)PMAP_MAP_POOLPAGE(pa);
 #ifdef DEBUG_DMA



Home | Main Index | Thread Index | Old Index