Module Name: src
Committed By: matt
Date: Sat Jan 9 06:01:18 UTC 2010
Modified Files:
src/sys/arch/mips/mips [matt-nb5-mips64]: mips_machdep.c pmap.c
Log Message:
On _LP64, allocate kernel memory from the first 4GB. Otherwise first 512MB.
Until we get full bounce buffer support, this should with device that only
support <4GB addresses.
To generate a diff of this commit:
cvs rdiff -u -r1.205.4.1.2.1.2.20 -r1.205.4.1.2.1.2.21 \
src/sys/arch/mips/mips/mips_machdep.c
cvs rdiff -u -r1.179.16.7 -r1.179.16.8 src/sys/arch/mips/mips/pmap.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/mips_machdep.c
diff -u src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.20 src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.21
--- src/sys/arch/mips/mips/mips_machdep.c:1.205.4.1.2.1.2.20 Wed Jan 6 04:25:46 2010
+++ src/sys/arch/mips/mips/mips_machdep.c Sat Jan 9 06:01:18 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.20 2010/01/06 04:25:46 matt Exp $ */
+/* $NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.21 2010/01/09 06:01:18 matt Exp $ */
/*
* Copyright 2002 Wasabi Systems, Inc.
@@ -112,7 +112,7 @@
#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
-__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.20 2010/01/06 04:25:46 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mips_machdep.c,v 1.205.4.1.2.1.2.21 2010/01/09 06:01:18 matt Exp $");
#include "opt_cputype.h"
#include "opt_compat_netbsd32.h"
@@ -1672,8 +1672,10 @@
*/
for (size_t i = 0; i < nseg; i++) {
#ifdef VM_FREELIST_FIRST4G
- if (round_page(segs[i].start + segs[i].size) > FOURGIG)
+ if (round_page(segs[i].start + segs[i].size) > FOURGIG) {
need4g = true;
+ mips_poolpage_vmfreelist = VM_FREELIST_FIRST4G;
+ }
#endif
#ifdef VM_FREELIST_FIRST512M
if (round_page(segs[i].start + segs[i].size) > HALFGIG) {
Index: src/sys/arch/mips/mips/pmap.c
diff -u src/sys/arch/mips/mips/pmap.c:1.179.16.7 src/sys/arch/mips/mips/pmap.c:1.179.16.8
--- src/sys/arch/mips/mips/pmap.c:1.179.16.7 Wed Dec 30 04:51:26 2009
+++ src/sys/arch/mips/mips/pmap.c Sat Jan 9 06:01:18 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.179.16.7 2009/12/30 04:51:26 matt Exp $ */
+/* $NetBSD: pmap.c,v 1.179.16.8 2010/01/09 06:01:18 matt Exp $ */
/*-
* Copyright (c) 1998, 2001 The NetBSD Foundation, Inc.
@@ -67,7 +67,7 @@
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.179.16.7 2009/12/30 04:51:26 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.179.16.8 2010/01/09 06:01:18 matt Exp $");
/*
* Manages physical address maps.
@@ -2128,16 +2128,16 @@
struct vm_page *
mips_pmap_alloc_poolpage(int flags)
{
-#ifndef _LP64
/*
* On 32bit kernels, we must make sure that we only allocate pages that
- * can be mapped via KSEG0. If all memory is in KSEG0, then we can just
+ * can be mapped via KSEG0. On 64bit kernels, try to allocated from
+ * the first 4G. If all memory is in KSEG0/4G, then we can just
* use the default freelist otherwise we must use the pool page list.
*/
if (mips_poolpage_vmfreelist != VM_FREELIST_DEFAULT)
return uvm_pagealloc_strat(NULL, 0, NULL, flags,
UVM_PGA_STRAT_ONLY, mips_poolpage_vmfreelist);
-#endif
+
return uvm_pagealloc(NULL, 0, NULL, flags);
}