Module Name: src
Committed By: ad
Date: Sun Mar 22 19:57:11 UTC 2009
Modified Files:
src/sys/arch/amd64/amd64: machdep.c
Log Message:
Set up module_map correctly so that the system does not panic if it
becomes full.
To generate a diff of this commit:
cvs rdiff -u -r1.129 -r1.130 src/sys/arch/amd64/amd64/machdep.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/amd64/amd64/machdep.c
diff -u src/sys/arch/amd64/amd64/machdep.c:1.129 src/sys/arch/amd64/amd64/machdep.c:1.130
--- src/sys/arch/amd64/amd64/machdep.c:1.129 Sat Mar 21 14:41:29 2009
+++ src/sys/arch/amd64/amd64/machdep.c Sun Mar 22 19:57:11 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.129 2009/03/21 14:41:29 ad Exp $ */
+/* $NetBSD: machdep.c,v 1.130 2009/03/22 19:57:11 ad Exp $ */
/*-
* Copyright (c) 1996, 1997, 1998, 2000, 2006, 2007, 2008
@@ -112,7 +112,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.129 2009/03/21 14:41:29 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.130 2009/03/22 19:57:11 ad Exp $");
/* #define XENDEBUG_LOW */
@@ -258,7 +258,7 @@
paddr_t lo32_paddr;
vaddr_t module_start, module_end;
-static struct vm_map module_map_store;
+static struct vm_map_kernel module_map_store;
extern struct vm_map *module_map;
vaddr_t kern_end;
@@ -359,9 +359,9 @@
mb_map = uvm_km_suballoc(kernel_map, &minaddr, &maxaddr,
nmbclusters * mclbytes, VM_MAP_INTRSAFE, false, NULL);
- uvm_map_setup(&module_map_store, module_start, module_end, 0);
- module_map_store.pmap = pmap_kernel();
- module_map = &module_map_store;
+ uvm_map_setup_kernel(&module_map_store, module_start, module_end, 0);
+ module_map_store.vmk_map.pmap = pmap_kernel();
+ module_map = &module_map_store.vmk_map;
format_bytes(pbuf, sizeof(pbuf), ptoa(uvmexp.free));
printf("avail memory = %s\n", pbuf);