Module Name:    src
Committed By:   matt
Date:           Wed Mar  5 05:35:55 UTC 2014

Modified Files:
        src/sys/uvm: uvm_map.c uvm_stat.h

Log Message:
Use UVMHIST_INITIALIZER (KERNHIST_INITIALIZER) to statically initialize
maphist.  This allows maphist to used very very early in boot well before
uvm has been initialized.


To generate a diff of this commit:
cvs rdiff -u -r1.327 -r1.328 src/sys/uvm/uvm_map.c
cvs rdiff -u -r1.51 -r1.52 src/sys/uvm/uvm_stat.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/uvm/uvm_map.c
diff -u src/sys/uvm/uvm_map.c:1.327 src/sys/uvm/uvm_map.c:1.328
--- src/sys/uvm/uvm_map.c:1.327	Thu Nov 14 12:07:11 2013
+++ src/sys/uvm/uvm_map.c	Wed Mar  5 05:35:55 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_map.c,v 1.327 2013/11/14 12:07:11 martin Exp $	*/
+/*	$NetBSD: uvm_map.c,v 1.328 2014/03/05 05:35:55 matt Exp $	*/
 
 /*
  * Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -66,7 +66,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.327 2013/11/14 12:07:11 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.328 2014/03/05 05:35:55 matt Exp $");
 
 #include "opt_ddb.h"
 #include "opt_uvmhist.h"
@@ -101,7 +101,8 @@ __KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 
 #endif
 
 #ifdef UVMHIST
-UVMHIST_DEFINE(maphist);
+static struct kern_history_ent maphistbuf[100];
+UVMHIST_DEFINE(maphist) = UVMHIST_INITIALIZER(maphist, maphistbuf);
 #endif
 
 #if !defined(UVMMAP_COUNTERS)
@@ -875,7 +876,6 @@ void
 uvm_map_init(void)
 {
 #if defined(UVMHIST)
-	static struct kern_history_ent maphistbuf[100];
 	static struct kern_history_ent pdhistbuf[100];
 #endif
 
@@ -884,7 +884,7 @@ uvm_map_init(void)
 	 */
 
 	UVMHIST_FUNC("uvm_map_init");
-	UVMHIST_INIT_STATIC(maphist, maphistbuf);
+	UVMHIST_LINK_STATIC(maphist);
 	UVMHIST_INIT_STATIC(pdhist, pdhistbuf);
 	UVMHIST_CALLED(maphist);
 	UVMHIST_LOG(maphist,"<starting uvm map system>", 0, 0, 0, 0);

Index: src/sys/uvm/uvm_stat.h
diff -u src/sys/uvm/uvm_stat.h:1.51 src/sys/uvm/uvm_stat.h:1.52
--- src/sys/uvm/uvm_stat.h:1.51	Mon Jul 30 23:56:48 2012
+++ src/sys/uvm/uvm_stat.h	Wed Mar  5 05:35:55 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: uvm_stat.h,v 1.51 2012/07/30 23:56:48 matt Exp $	*/
+/*	$NetBSD: uvm_stat.h,v 1.52 2014/03/05 05:35:55 matt Exp $	*/
 
 /*
  * Copyright (c) 2011 Matthew R. Green
@@ -55,6 +55,8 @@
 #define UVMHIST_DEFINE(NAME)		KERNHIST_DEFINE(NAME)
 #define UVMHIST_INIT(NAME,N)		KERNHIST_INIT(NAME,N)
 #define UVMHIST_INIT_STATIC(NAME,BUF)	KERNHIST_INIT_STATIC(NAME,BUF)
+#define UVMHIST_INITIALIZER(NAME,BUF)	KERNHIST_INITIALIZER(NAME,BUF)
+#define UVMHIST_LINK_STATIC(NAME)	KERNHIST_LINK_STATIC(NAME)
 #define UVMHIST_LOG(NAME,FMT,A,B,C,D)	KERNHIST_LOG(NAME,FMT,A,B,C,D)
 #define UVMHIST_CALLED(NAME)		KERNHIST_CALLED(NAME)
 #define UVMHIST_FUNC(FNAME)		KERNHIST_FUNC(FNAME)
@@ -65,6 +67,8 @@
 #define UVMHIST_DEFINE(NAME)
 #define UVMHIST_INIT(NAME,N)
 #define UVMHIST_INIT_STATIC(NAME,BUF)
+#define UVMHIST_INITIALIZER(NAME,BUF)
+#define UVMHIST_LINK_STATIC(NAME)
 #define UVMHIST_LOG(NAME,FMT,A,B,C,D)
 #define UVMHIST_CALLED(NAME)
 #define UVMHIST_FUNC(FNAME)

Reply via email to