Module Name:    src
Committed By:   matt
Date:           Wed Oct 17 18:52:16 UTC 2012

Modified Files:
        src/sys/arch/arm/arm32: pmap.c
        src/sys/arch/arm/conf: files.arm
        src/sys/arch/arm/include/arm32: pmap.h

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


To generate a diff of this commit:
cvs rdiff -u -r1.240 -r1.241 src/sys/arch/arm/arm32/pmap.c
cvs rdiff -u -r1.111 -r1.112 src/sys/arch/arm/conf/files.arm
cvs rdiff -u -r1.112 -r1.113 src/sys/arch/arm/include/arm32/pmap.h

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/arm/arm32/pmap.c
diff -u src/sys/arch/arm/arm32/pmap.c:1.240 src/sys/arch/arm/arm32/pmap.c:1.241
--- src/sys/arch/arm/arm32/pmap.c:1.240	Wed Oct 17 18:29:10 2012
+++ src/sys/arch/arm/arm32/pmap.c	Wed Oct 17 18:52:15 2012
@@ -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 @@ int pmapdebug = 0; 
  */
 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 @@ SYSCTL_SETUP(sysctl_machdep_pmap_setup, 
 			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

Index: src/sys/arch/arm/conf/files.arm
diff -u src/sys/arch/arm/conf/files.arm:1.111 src/sys/arch/arm/conf/files.arm:1.112
--- src/sys/arch/arm/conf/files.arm:1.111	Tue Sep 18 05:09:47 2012
+++ src/sys/arch/arm/conf/files.arm	Wed Oct 17 18:52:16 2012
@@ -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 @@ defflag				PMAP_DEBUG
 
 # 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

Index: src/sys/arch/arm/include/arm32/pmap.h
diff -u src/sys/arch/arm/include/arm32/pmap.h:1.112 src/sys/arch/arm/include/arm32/pmap.h:1.113
--- src/sys/arch/arm/include/arm32/pmap.h:1.112	Sat Sep 22 00:33:38 2012
+++ src/sys/arch/arm/include/arm32/pmap.h	Wed Oct 17 18:52:15 2012
@@ -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 @@ extern pv_addr_t kernel_l1pt;
  * 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 @@ extern void (*pmap_zero_page_func)(paddr
  * 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
 

Reply via email to