Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src Only expose the bulk of sys/proc.h and sys/lwp.h if _KERNEL ...
details: https://anonhg.NetBSD.org/src/rev/5ab71404e755
branches: trunk
changeset: 783662:5ab71404e755
user: dsl <dsl%NetBSD.org@localhost>
date: Wed Jan 02 19:39:04 2013 +0000
description:
Only expose the bulk of sys/proc.h and sys/lwp.h if _KERNEL or _KMEMUSER
is defined.
i386 and amd64 build ok.
diffstat:
sys/sys/lwp.h | 8 +++++---
sys/sys/proc.h | 13 +++++++++----
usr.bin/kdump/kdump.c | 9 ++++-----
3 files changed, 18 insertions(+), 12 deletions(-)
diffs (127 lines):
diff -r cdb71e5d0462 -r 5ab71404e755 sys/sys/lwp.h
--- a/sys/sys/lwp.h Wed Jan 02 19:35:43 2013 +0000
+++ b/sys/sys/lwp.h Wed Jan 02 19:39:04 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lwp.h,v 1.166 2012/12/26 18:30:22 matt Exp $ */
+/* $NetBSD: lwp.h,v 1.167 2013/01/02 19:39:04 dsl Exp $ */
/*-
* Copyright (c) 2001, 2006, 2007, 2008, 2009, 2010
@@ -33,6 +33,8 @@
#ifndef _SYS_LWP_H_
#define _SYS_LWP_H_
+#if defined(_KERNEL) || defined(_KMEMUSER)
+
#include <sys/param.h>
#include <sys/time.h>
#include <sys/queue.h>
@@ -67,7 +69,6 @@
* Fields are clustered together by usage (to increase the likelyhood
* of cache hits) and by size (to reduce dead space in the structure).
*/
-#if defined(_KERNEL) || defined(_KMEMUSER)
#include <sys/pcu.h>
@@ -196,7 +197,6 @@
struct kdtrace_thread *l_dtrace; /* (: DTrace-specific data. */
};
-#endif /* _KERNEL || _KMEMUSER */
/*
* UAREA_PCB_OFFSET: an offset of PCB structure in the uarea. MD code may
@@ -220,6 +220,8 @@
#endif
#endif
+#endif /* _KERNEL || _KMEMUSER */
+
/* These flags are kept in l_flag. */
#define LW_IDLE 0x00000001 /* Idle lwp. */
#define LW_LWPCTL 0x00000002 /* Adjust lwpctl in userret */
diff -r cdb71e5d0462 -r 5ab71404e755 sys/sys/proc.h
--- a/sys/sys/proc.h Wed Jan 02 19:35:43 2013 +0000
+++ b/sys/sys/proc.h Wed Jan 02 19:39:04 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: proc.h,v 1.318 2012/12/05 08:05:54 msaitoh Exp $ */
+/* $NetBSD: proc.h,v 1.319 2013/01/02 19:39:04 dsl Exp $ */
/*-
* Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -68,6 +68,10 @@
#ifndef _SYS_PROC_H_
#define _SYS_PROC_H_
+#include <sys/lwp.h>
+
+#if defined(_KMEMUSER) || defined(_KERNEL)
+
#if defined(_KERNEL_OPT)
#include "opt_multiprocessor.h"
#include "opt_kstack.h"
@@ -81,7 +85,6 @@
#include <sys/mqueue.h>
#include <sys/mutex.h>
#include <sys/condvar.h>
-#include <sys/lwp.h>
#include <sys/queue.h>
#include <sys/signalvar.h>
#include <sys/siginfo.h>
@@ -324,6 +327,8 @@
#define p_session p_pgrp->pg_session
#define p_pgid p_pgrp->pg_id
+#endif /* _KMEMUSER || _KERNEL */
+
/*
* Status values.
*/
@@ -390,6 +395,8 @@
#define PL_SIGCOMPAT 0x00000200 /* Has used compat signal trampoline */
#define PL_ORPHANPG 0x20000000 /* Member of an orphaned pgrp */
+#if defined(_KMEMUSER) || defined(_KERNEL)
+
/*
* Macro to compute the exit signal to be delivered.
*/
@@ -538,8 +545,6 @@
#endif /* _KERNEL */
-#if defined(_KMEMUSER) || defined(_KERNEL)
-
/*
* Kernel stack parameters.
*
diff -r cdb71e5d0462 -r 5ab71404e755 usr.bin/kdump/kdump.c
--- a/usr.bin/kdump/kdump.c Wed Jan 02 19:35:43 2013 +0000
+++ b/usr.bin/kdump/kdump.c Wed Jan 02 19:39:04 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: kdump.c,v 1.115 2011/09/28 16:28:27 christos Exp $ */
+/* $NetBSD: kdump.c,v 1.116 2013/01/02 19:39:04 dsl Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -39,16 +39,15 @@
#if 0
static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: kdump.c,v 1.115 2011/09/28 16:28:27 christos Exp $");
+__RCSID("$NetBSD: kdump.c,v 1.116 2013/01/02 19:39:04 dsl Exp $");
#endif
#endif /* not lint */
#include <sys/param.h>
-#include <sys/proc.h> /* XXX #include <sys/file.h> fails without this header */
-#define _KERNEL
#include <sys/file.h>
+#define _KMEMUSER /* To get the pseudo errors defined */
#include <sys/errno.h>
-#undef _KERNEL
+#undef _KMEMUSER
#include <sys/time.h>
#include <sys/uio.h>
#include <sys/ktrace.h>
Home |
Main Index |
Thread Index |
Old Index