Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/amd64 provide propert address defaults for topdown ...
details: https://anonhg.NetBSD.org/src/rev/d303d48dc134
branches: trunk
changeset: 326301:d303d48dc134
user: christos <christos%NetBSD.org@localhost>
date: Sat Jan 25 05:09:59 2014 +0000
description:
provide propert address defaults for topdown and bottomup allocation
diffstat:
sys/arch/amd64/amd64/netbsd32_machdep.c | 11 +++++++----
sys/arch/amd64/include/vmparam.h | 14 ++++++++++----
2 files changed, 17 insertions(+), 8 deletions(-)
diffs (62 lines):
diff -r fdbd818a1102 -r d303d48dc134 sys/arch/amd64/amd64/netbsd32_machdep.c
--- a/sys/arch/amd64/amd64/netbsd32_machdep.c Sat Jan 25 03:31:12 2014 +0000
+++ b/sys/arch/amd64/amd64/netbsd32_machdep.c Sat Jan 25 05:09:59 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: netbsd32_machdep.c,v 1.87 2014/01/04 00:10:02 dsl Exp $ */
+/* $NetBSD: netbsd32_machdep.c,v 1.88 2014/01/25 05:09:59 christos Exp $ */
/*
* Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.87 2014/01/04 00:10:02 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.88 2014/01/25 05:09:59 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -1042,9 +1042,12 @@
}
vaddr_t
-netbsd32_vm_default_addr(struct proc *p, vaddr_t base, vsize_t size)
+netbsd32_vm_default_addr(struct proc *p, vaddr_t base, vsize_t sz)
{
- return VM_DEFAULT_ADDRESS32(base, size);
+ if (p->p_vmspace->vm_map.flags & VM_MAP_TOPDOWN)
+ return VM_DEFAULT_ADDRESS32_TOPDOWN(base, sz);
+ else
+ return VM_DEFAULT_ADDRESS32_BOTTOMUP(base, sz);
}
#ifdef COMPAT_13
diff -r fdbd818a1102 -r d303d48dc134 sys/arch/amd64/include/vmparam.h
--- a/sys/arch/amd64/include/vmparam.h Sat Jan 25 03:31:12 2014 +0000
+++ b/sys/arch/amd64/include/vmparam.h Sat Jan 25 05:09:59 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.32 2012/11/13 14:10:24 chs Exp $ */
+/* $NetBSD: vmparam.h,v 1.33 2014/01/25 05:09:59 christos Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -133,10 +133,16 @@
#include "opt_uvm.h"
#endif
#define __USE_TOPDOWN_VM
-#define VM_DEFAULT_ADDRESS(da, sz) \
- trunc_page(USRSTACK - MAXSSIZ - (sz))
-#define VM_DEFAULT_ADDRESS32(da, sz) \
+#define VM_DEFAULT_ADDRESS_TOPDOWN(da, sz) \
+ trunc_page(USRSTACK - MAXSSIZ - (sz))
+#define VM_DEFAULT_ADDRESS(da, sz) VM_DEFAULT_ADDRESS_TOPDOWN(da, sz)
+
+#define VM_DEFAULT_ADDRESS_BOTTOMUP(da, sz) \
+ round_page((vaddr_t)(da) + (vsize_t)maxdmap)
+#define VM_DEFAULT_ADDRESS32_TOPDOWN(da, sz) \
trunc_page(USRSTACK32 - MAXSSIZ32 - (sz))
+#define VM_DEFAULT_ADDRESS32_BOTTOMUP(da, sz) \
+ round_page((vaddr_t)(da) + (vsize_t)MAXDSIZ32)
/*
* XXXfvdl we have plenty of KVM now, remove this.
Home |
Main Index |
Thread Index |
Old Index