Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/usermode Fix VM_MAX_ADDRESS that is NOT the max add...
details: https://anonhg.NetBSD.org/src/rev/5fd245ad0db0
branches: trunk
changeset: 772236:5fd245ad0db0
user: reinoud <reinoud%NetBSD.org@localhost>
date: Sun Dec 25 21:10:00 2011 +0000
description:
Fix VM_MAX_ADDRESS that is NOT the max address BUT the max userland address
Fix VM_MAX_KERNEL_ADDRESS that is the absolute max address accesable by the
kernel...
diffstat:
sys/arch/usermode/include/vmparam.h | 6 +++---
sys/arch/usermode/usermode/pmap.c | 10 +++++-----
sys/arch/usermode/usermode/trap.c | 6 +++---
3 files changed, 11 insertions(+), 11 deletions(-)
diffs (94 lines):
diff -r f72726750ec2 -r 5fd245ad0db0 sys/arch/usermode/include/vmparam.h
--- a/sys/arch/usermode/include/vmparam.h Sun Dec 25 20:16:05 2011 +0000
+++ b/sys/arch/usermode/include/vmparam.h Sun Dec 25 21:10:00 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: vmparam.h,v 1.11 2011/08/26 11:01:32 jmcneill Exp $ */
+/* $NetBSD: vmparam.h,v 1.12 2011/12/25 21:10:00 reinoud Exp $ */
/*-
* Copyright (c) 2007 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -39,10 +39,10 @@
extern paddr_t kmem_user_start, kmem_user_end;
#define VM_MIN_KERNEL_ADDRESS kmem_k_start
-#define VM_MAX_KERNEL_ADDRESS kmem_k_end
+#define VM_MAX_KERNEL_ADDRESS kmem_ext_end
#define VM_MIN_ADDRESS kmem_user_start
#define VM_MAXUSER_ADDRESS kmem_user_end
-#define VM_MAX_ADDRESS kmem_ext_end
+#define VM_MAX_ADDRESS kmem_user_end
#define VM_PHYSSEG_STRAT VM_PSTRAT_BIGFIRST
#define VM_PHYSSEG_MAX 1
diff -r f72726750ec2 -r 5fd245ad0db0 sys/arch/usermode/usermode/pmap.c
--- a/sys/arch/usermode/usermode/pmap.c Sun Dec 25 20:16:05 2011 +0000
+++ b/sys/arch/usermode/usermode/pmap.c Sun Dec 25 21:10:00 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pmap.c,v 1.81 2011/12/20 21:01:39 jmcneill Exp $ */
+/* $NetBSD: pmap.c,v 1.82 2011/12/25 21:10:00 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.81 2011/12/20 21:01:39 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: pmap.c,v 1.82 2011/12/25 21:10:00 reinoud Exp $");
#include "opt_memsize.h"
#include "opt_kmempages.h"
@@ -281,7 +281,7 @@
fpos += pv_table_size;
/* set up kernel pmap */
- pm_nentries = (VM_MAX_ADDRESS - VM_MIN_ADDRESS) / PAGE_SIZE;
+ pm_nentries = (VM_MAX_KERNEL_ADDRESS - VM_MIN_ADDRESS) / PAGE_SIZE;
pm_entries_size = round_page(pm_nentries * sizeof(struct pv_entry *));
dprintf_debug("pmap va->pa lookup table is %"PRIu64" KB for %d logical pages\n",
pm_entries_size/1024, pm_nentries);
@@ -727,7 +727,7 @@
ppn = atop(pa);
lpn = atop(va - VM_MIN_ADDRESS); /* V->L */
#ifdef DIAGNOSTIC
- if ((va < VM_MIN_ADDRESS) || (va > VM_MAX_ADDRESS))
+ if ((va < VM_MIN_ADDRESS) || (va > VM_MAX_KERNEL_ADDRESS))
panic("pmap_do_enter: invalid va isued\n");
#endif
@@ -952,7 +952,7 @@
dprintf_debug("pmap_extract: extracting va %p\n", (void *) va);
#ifdef DIAGNOSTIC
- if ((va < VM_MIN_ADDRESS) || (va > VM_MAX_ADDRESS))
+ if ((va < VM_MIN_ADDRESS) || (va > VM_MAX_KERNEL_ADDRESS))
panic("pmap_extract: invalid va isued\n");
#endif
lpn = atop(va - VM_MIN_ADDRESS); /* V->L */
diff -r f72726750ec2 -r 5fd245ad0db0 sys/arch/usermode/usermode/trap.c
--- a/sys/arch/usermode/usermode/trap.c Sun Dec 25 20:16:05 2011 +0000
+++ b/sys/arch/usermode/usermode/trap.c Sun Dec 25 21:10:00 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: trap.c,v 1.45 2011/12/14 18:51:39 reinoud Exp $ */
+/* $NetBSD: trap.c,v 1.46 2011/12/25 21:10:00 reinoud Exp $ */
/*-
* Copyright (c) 2011 Reinoud Zandijk <reinoud%netbsd.org@localhost>
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.45 2011/12/14 18:51:39 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.46 2011/12/25 21:10:00 reinoud Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -147,7 +147,7 @@
#ifdef DIAGNOSTIC
/* sanity */
- if ((va < VM_MIN_ADDRESS) || (va >= VM_MAX_ADDRESS))
+ if ((va < VM_MIN_ADDRESS) || (va >= VM_MAX_KERNEL_ADDRESS))
panic("peeing outside the box! (va=%p)", (void *)va);
/* extra debug for now -> should issue signal */
Home |
Main Index |
Thread Index |
Old Index