Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm Add a PMAP_NEEDS_ALLOC_POOLPAGE / PMAP_ALLOC_PO...



details:   https://anonhg.NetBSD.org/src/rev/452188f3098b
branches:  trunk
changeset: 782124:452188f3098b
user:      matt <matt%NetBSD.org@localhost>
date:      Wed Oct 17 18:52:15 2012 +0000

description:
Add a PMAP_NEEDS_ALLOC_POOLPAGE / PMAP_ALLOC_POOLPAGE hook so systems can
allocate pool pages from a specific VM freelist.

diffstat:

 sys/arch/arm/arm32/pmap.c         |  23 +++++++++++++++++++++--
 sys/arch/arm/conf/files.arm       |   4 ++--
 sys/arch/arm/include/arm32/pmap.h |   7 ++++++-
 3 files changed, 29 insertions(+), 5 deletions(-)

diffs (94 lines):

diff -r 0a5e790b982c -r 452188f3098b sys/arch/arm/arm32/pmap.c
--- a/sys/arch/arm/arm32/pmap.c Wed Oct 17 18:30:33 2012 +0000
+++ b/sys/arch/arm/arm32/pmap.c Wed Oct 17 18:52:15 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.c,v 1.240 2012/10/17 18:29:10 matt Exp $  */
+/*     $NetBSD: pmap.c,v 1.241 2012/10/17 18:52:15 matt Exp $  */
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
@@ -212,7 +212,7 @@
 #include <arm/cpuconf.h>
 #include <arm/arm32/katelib.h>
 
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.240 2012/10/17 18:29:10 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.241 2012/10/17 18:52:15 matt Exp $");
 
 #ifdef PMAP_DEBUG
 
@@ -257,6 +257,9 @@
  */
 static struct pmap     kernel_pmap_store;
 struct pmap            *const kernel_pmap_ptr = &kernel_pmap_store;
+#ifdef PMAP_NEED_ALLOC_POOLPAGE
+int                    arm_poolpage_vmfreelist = VM_FREELIST_DEFAULT;
+#endif
 
 /*
  * Which pmap is currently 'live' in the cache
@@ -6853,3 +6856,19 @@
                        NULL, 0, &pmap_kmpages, 0,
                        CTL_MACHDEP, CTL_CREATE, CTL_EOL);
 }
+
+#ifdef PMAP_NEED_ALLOC_POOLPAGE
+struct vm_page *
+arm_pmap_alloc_poolpage(int flags)
+{
+       /*
+        * On some systems, only some pages may be "coherent" for dma and we
+        * want to use those for pool pages (think mbufs).
+        */
+       if (arm_poolpage_vmfreelist != VM_FREELIST_DEFAULT)
+               return uvm_pagealloc_strat(NULL, 0, NULL, flags,
+                   UVM_PGA_STRAT_ONLY, arm_poolpage_vmfreelist);
+
+       return uvm_pagealloc(NULL, 0, NULL, flags);
+}
+#endif
diff -r 0a5e790b982c -r 452188f3098b sys/arch/arm/conf/files.arm
--- a/sys/arch/arm/conf/files.arm       Wed Oct 17 18:30:33 2012 +0000
+++ b/sys/arch/arm/conf/files.arm       Wed Oct 17 18:52:15 2012 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.arm,v 1.111 2012/09/18 05:09:47 matt Exp $
+#      $NetBSD: files.arm,v 1.112 2012/10/17 18:52:16 matt Exp $
 
 # temporary define to allow easy moving to ../arch/arm/arm32
 defflag                                ARM32
@@ -61,7 +61,7 @@
 
 # New PMAP options
 defflag        opt_arm32_pmap.h        ARM32_NEW_VM_LAYOUT PMAPCOUNTERS
-                               PMAP_STEAL_MEMORY
+                               PMAP_STEAL_MEMORY PMAP_NEED_ALLOC_POOLPAGE
 
 # MI console support
 file   dev/cons.c
diff -r 0a5e790b982c -r 452188f3098b sys/arch/arm/include/arm32/pmap.h
--- a/sys/arch/arm/include/arm32/pmap.h Wed Oct 17 18:30:33 2012 +0000
+++ b/sys/arch/arm/include/arm32/pmap.h Wed Oct 17 18:52:15 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: pmap.h,v 1.112 2012/09/22 00:33:38 matt Exp $  */
+/*     $NetBSD: pmap.h,v 1.113 2012/10/17 18:52:15 matt Exp $  */
 
 /*
  * Copyright (c) 2002, 2003 Wasabi Systems, Inc.
@@ -269,6 +269,7 @@
  * Commonly referenced structures
  */
 extern int             pmap_debug_level; /* Only exists if PMAP_DEBUG */
+extern int             arm_poolpage_vmfreelist;
 
 /*
  * Macros that we need to export
@@ -885,6 +886,10 @@
  * Hooks for the pool allocator.
  */
 #define        POOL_VTOPHYS(va)        vtophys((vaddr_t) (va))
+#ifdef PMAP_NEED_ALLOC_POOLPAGE
+#define        PMAP_ALLOC_POOLPAGE     arm_pmap_alloc_poolpage
+struct vm_page *arm_pmap_alloc_poolpage(int);
+#endif
 
 #ifndef _LOCORE
 



Home | Main Index | Thread Index | Old Index