Module Name: src
Committed By: matt
Date: Sat Feb 19 20:19:54 UTC 2011
Modified Files:
src/sys/conf: files
src/sys/kern: subr_pcu.c
src/sys/sys: lwp.h pcu.h
Log Message:
Default PCU_UNIT_COUNT to 0. If 0, don't compile the contents of subr_pcu.c
and don't include the pcu related members into struct lwp.
To generate a diff of this commit:
cvs rdiff -u -r1.1000 -r1.1001 src/sys/conf/files
cvs rdiff -u -r1.2 -r1.3 src/sys/kern/subr_pcu.c
cvs rdiff -u -r1.147 -r1.148 src/sys/sys/lwp.h
cvs rdiff -u -r1.3 -r1.4 src/sys/sys/pcu.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/conf/files
diff -u src/sys/conf/files:1.1000 src/sys/conf/files:1.1001
--- src/sys/conf/files:1.1000 Fri Feb 18 22:49:03 2011
+++ src/sys/conf/files Sat Feb 19 20:19:54 2011
@@ -1,4 +1,4 @@
-# $NetBSD: files,v 1.1000 2011/02/18 22:49:03 rmind Exp $
+# $NetBSD: files,v 1.1001 2011/02/19 20:19:54 matt Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
version 20100430
@@ -1533,7 +1533,7 @@
file kern/subr_lwp_specificdata.c
file kern/subr_once.c
file kern/subr_optstr.c
-file kern/subr_pcu.c pcu
+file kern/subr_pcu.c
file kern/subr_percpu.c
file kern/subr_pool.c
file kern/subr_prf.c
Index: src/sys/kern/subr_pcu.c
diff -u src/sys/kern/subr_pcu.c:1.2 src/sys/kern/subr_pcu.c:1.3
--- src/sys/kern/subr_pcu.c:1.2 Thu Feb 17 18:44:54 2011
+++ src/sys/kern/subr_pcu.c Sat Feb 19 20:19:54 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: subr_pcu.c,v 1.2 2011/02/17 18:44:54 matt Exp $ */
+/* $NetBSD: subr_pcu.c,v 1.3 2011/02/19 20:19:54 matt Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -57,7 +57,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_pcu.c,v 1.2 2011/02/17 18:44:54 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_pcu.c,v 1.3 2011/02/19 20:19:54 matt Exp $");
#include <sys/param.h>
#include <sys/cpu.h>
@@ -65,6 +65,8 @@
#include <sys/pcu.h>
#include <sys/xcall.h>
+#if PCU_UNIT_COUNT > 0
+
#define PCU_SAVE 0x01 /* Save PCU state to the LWP. */
#define PCU_RELEASE 0x02 /* Release PCU state on the CPU. */
@@ -256,3 +258,5 @@
return l->l_pcu_used & (1 << id);
}
+
+#endif /* PCU_UNIT_COUNT > 0 */
Index: src/sys/sys/lwp.h
diff -u src/sys/sys/lwp.h:1.147 src/sys/sys/lwp.h:1.148
--- src/sys/sys/lwp.h:1.147 Sat Feb 19 00:22:50 2011
+++ src/sys/sys/lwp.h Sat Feb 19 20:19:54 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: lwp.h,v 1.147 2011/02/19 00:22:50 jakllsch Exp $ */
+/* $NetBSD: lwp.h,v 1.148 2011/02/19 20:19:54 matt Exp $ */
/*-
* Copyright (c) 2001, 2006, 2007, 2008, 2009, 2010
@@ -125,8 +125,10 @@
callout_t l_timeout_ch; /* !: callout for tsleep */
u_int l_emap_gen; /* !: emap generation number */
+#if PCU_UNIT_COUNT > 0
struct cpu_info * volatile l_pcu_cpu[PCU_UNIT_COUNT];
uint32_t l_pcu_used;
+#endif
/* Process level and global state, misc. */
LIST_ENTRY(lwp) l_list; /* a: entry on list of all LWPs */
Index: src/sys/sys/pcu.h
diff -u src/sys/sys/pcu.h:1.3 src/sys/sys/pcu.h:1.4
--- src/sys/sys/pcu.h:1.3 Thu Feb 17 19:58:34 2011
+++ src/sys/sys/pcu.h Sat Feb 19 20:19:54 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: pcu.h,v 1.3 2011/02/17 19:58:34 rmind Exp $ */
+/* $NetBSD: pcu.h,v 1.4 2011/02/19 20:19:54 matt Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@@ -33,10 +33,10 @@
#define _SYS_PCU_H_
/*
- * Default: one PCU for MD.
+ * Default: no PCU for MD.
*/
#ifndef PCU_UNIT_COUNT
-#define PCU_UNIT_COUNT 1
+#define PCU_UNIT_COUNT 0
#endif
#if defined(_KERNEL)