Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/usermode/usermode Give malloc(3) a barrier to alloc...
details: https://anonhg.NetBSD.org/src/rev/2d6ae833ab81
branches: trunk
changeset: 768652:2d6ae833ab81
user: reinoud <reinoud%NetBSD.org@localhost>
date: Tue Aug 23 18:37:51 2011 +0000
description:
Give malloc(3) a barrier to allocate OVER... i.e. let the space at ease!
Note that it could use an extra barrier too.
diffstat:
sys/arch/usermode/usermode/pmap.c | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diffs (34 lines):
diff -r 3d963bb3ac07 -r 2d6ae833ab81 sys/arch/usermode/usermode/pmap.c
--- a/sys/arch/usermode/usermode/pmap.c Tue Aug 23 18:36:08 2011 +0000
+++ b/sys/arch/usermode/usermode/pmap.c Tue Aug 23 18:37:51 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.24 2011/08/23 16:16:26 jmcneill Exp $ */
+/* $NetBSD: pmap.c,v 1.25 2011/08/23 18:37:51 reinoud Exp $ */
/*-
* Copyright (c) 2011 Reinoud Zandijk <reinoud%NetBSD.org@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.24 2011/08/23 16:16:26 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.25 2011/08/23 18:37:51 reinoud Exp $");
#include "opt_memsize.h"
#include "opt_kmempages.h"
@@ -159,6 +159,15 @@
kmem_user_end = kmem_user_start + 1024 * MEMSIZE;
/* TODO make a better user space size estimate */
+ /* claim dummy space over all we need just to make fun of sbrk */
+ addr = thunk_mmap((void*) kmem_data_end,
+ kmem_user_end - kmem_data_end,
+ PROT_NONE,
+ MAP_ANON | MAP_FIXED,
+ -1, 0);
+ if (addr != (void *) kmem_data_end)
+ panic("pmap_bootstrap: protection barrier failed\n");
+
if (kmem_user_end < kmem_user_start)
panic("pmap_bootstrap: to small memorysize specified");
Home |
Main Index |
Thread Index |
Old Index