summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2021-12-01 16:53:29 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2021-12-01 16:53:29 +0000
commita0d4e04c64bbb5a5849131015c3936080606edcd (patch)
tree4e18bc8ceb56e551cdef20c8b4c6f3a8cf2e9f44 /lib
parentaa2cbba45cd60d64ae13954f2749bfe6a0914572 (diff)
Reduce use of sys/param.h, or annotate the reason why it is needed
(pretty much MAXCOMLEN for struct process or struct core), and remove sys/vnode.h where not needed
Diffstat (limited to 'lib')
-rw-r--r--lib/libkvm/kvm_alpha.c7
-rw-r--r--lib/libkvm/kvm_amd64.c5
-rw-r--r--lib/libkvm/kvm_arm.c6
-rw-r--r--lib/libkvm/kvm_arm64.c6
-rw-r--r--lib/libkvm/kvm_hppa.c5
-rw-r--r--lib/libkvm/kvm_i386.c6
-rw-r--r--lib/libkvm/kvm_m88k.c6
-rw-r--r--lib/libkvm/kvm_mips64.c5
-rw-r--r--lib/libkvm/kvm_powerpc.c7
-rw-r--r--lib/libkvm/kvm_powerpc64.c6
-rw-r--r--lib/libkvm/kvm_riscv64.c6
-rw-r--r--lib/libkvm/kvm_sh.c6
-rw-r--r--lib/libkvm/kvm_sparc64.c5
13 files changed, 42 insertions, 34 deletions
diff --git a/lib/libkvm/kvm_alpha.c b/lib/libkvm/kvm_alpha.c
index 7f3169e52ef..22803b3648b 100644
--- a/lib/libkvm/kvm_alpha.c
+++ b/lib/libkvm/kvm_alpha.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kvm_alpha.c,v 1.16 2015/12/19 18:40:30 mmcc Exp $ */
+/* $OpenBSD: kvm_alpha.c,v 1.17 2021/12/01 16:53:28 deraadt Exp $ */
/* $NetBSD: kvm_alpha.c,v 1.5 1996/10/01 21:12:05 cgd Exp $ */
/*
@@ -30,7 +30,8 @@
#define __KVM_ALPHA_PRIVATE /* see <machine/pte.h> */
-#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/signal.h>
#include <sys/proc.h>
#include <sys/stat.h>
#include <sys/kcore.h>
@@ -194,7 +195,7 @@ _kvm_pa2off(kvm_t *kd, paddr_t pa)
int i;
cpu_kh = kd->cpu_data;
- ramsegs = (phys_ram_seg_t *)((char *)cpu_kh + ALIGN(sizeof *cpu_kh));
+ ramsegs = (phys_ram_seg_t *)((char *)cpu_kh + _ALIGN(sizeof *cpu_kh));
off = 0;
for (i = 0; i < cpu_kh->nmemsegs; i++) {
diff --git a/lib/libkvm/kvm_amd64.c b/lib/libkvm/kvm_amd64.c
index 9a33bf11f80..bdffdbc4240 100644
--- a/lib/libkvm/kvm_amd64.c
+++ b/lib/libkvm/kvm_amd64.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kvm_amd64.c,v 1.14 2021/09/10 00:02:43 deraadt Exp $ */
+/* $OpenBSD: kvm_amd64.c,v 1.15 2021/12/01 16:53:28 deraadt Exp $ */
/* $NetBSD: kvm_x86_64.c,v 1.3 2002/06/05 22:01:55 fvdl Exp $ */
/*-
@@ -38,7 +38,6 @@
* x86-64 machine dependent routines for kvm.
*/
-#include <sys/param.h> /* MAXCOMLEN ALIGN */
#include <sys/types.h>
#include <sys/signal.h>
#include <sys/proc.h>
@@ -194,7 +193,7 @@ _kvm_pa2off(kvm_t *kd, paddr_t pa)
int i;
cpu_kh = kd->cpu_data;
- ramsegs = (void *)((char *)(void *)cpu_kh + ALIGN(sizeof *cpu_kh));
+ ramsegs = (void *)((char *)(void *)cpu_kh + _ALIGN(sizeof *cpu_kh));
off = 0;
for (i = 0; i < cpu_kh->nmemsegs; i++) {
diff --git a/lib/libkvm/kvm_arm.c b/lib/libkvm/kvm_arm.c
index d49aaff38ef..faa860a856b 100644
--- a/lib/libkvm/kvm_arm.c
+++ b/lib/libkvm/kvm_arm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kvm_arm.c,v 1.10 2018/05/15 10:04:44 otto Exp $ */
+/* $OpenBSD: kvm_arm.c,v 1.11 2021/12/01 16:53:28 deraadt Exp $ */
/*
* Copyright (c) 2006 Miodrag Vallat.
*
@@ -50,10 +50,10 @@
* ARM machine dependent routines for kvm.
*/
-#include <sys/param.h>
+#include <sys/param.h> /* MAXCOMLEN */
+#include <sys/types.h>
#include <sys/core.h>
#include <sys/kcore.h>
-#include <sys/vnode.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/lib/libkvm/kvm_arm64.c b/lib/libkvm/kvm_arm64.c
index d10c1604f91..dab933bb82f 100644
--- a/lib/libkvm/kvm_arm64.c
+++ b/lib/libkvm/kvm_arm64.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kvm_arm64.c,v 1.1 2017/01/11 14:32:36 patrick Exp $ */
+/* $OpenBSD: kvm_arm64.c,v 1.2 2021/12/01 16:53:28 deraadt Exp $ */
/*
* Copyright (c) 2006 Miodrag Vallat.
*
@@ -50,10 +50,10 @@
* ARM64 machine dependent routines for kvm.
*/
-#include <sys/param.h>
+#include <sys/param.h> /* MAXCOMLEN for sys/core.h */
+#include <sys/types.h>
#include <sys/core.h>
#include <sys/kcore.h>
-#include <sys/vnode.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/lib/libkvm/kvm_hppa.c b/lib/libkvm/kvm_hppa.c
index a82379edbef..3dd1d2286f6 100644
--- a/lib/libkvm/kvm_hppa.c
+++ b/lib/libkvm/kvm_hppa.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kvm_hppa.c,v 1.10 2015/12/19 18:40:30 mmcc Exp $ */
+/* $OpenBSD: kvm_hppa.c,v 1.11 2021/12/01 16:53:28 deraadt Exp $ */
/*
* Copyright (c) 2002, Miodrag Vallat.
@@ -25,7 +25,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/signal.h>
#include <sys/proc.h>
#include <sys/stat.h>
diff --git a/lib/libkvm/kvm_i386.c b/lib/libkvm/kvm_i386.c
index 5c68c43c1f6..6114af4efab 100644
--- a/lib/libkvm/kvm_i386.c
+++ b/lib/libkvm/kvm_i386.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kvm_i386.c,v 1.27 2015/12/19 18:40:30 mmcc Exp $ */
+/* $OpenBSD: kvm_i386.c,v 1.28 2021/12/01 16:53:28 deraadt Exp $ */
/* $NetBSD: kvm_i386.c,v 1.9 1996/03/18 22:33:38 thorpej Exp $ */
/*-
@@ -39,7 +39,8 @@
* vm code will one day obsolete this module.
*/
-#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/signal.h>
#include <sys/proc.h>
#include <sys/stat.h>
#include <stdlib.h>
@@ -48,6 +49,7 @@
#include <kvm.h>
#include <uvm/uvm_extern.h>
+#include <machine/param.h>
#include <machine/vmparam.h>
#include <machine/pmap.h>
diff --git a/lib/libkvm/kvm_m88k.c b/lib/libkvm/kvm_m88k.c
index 0d5df390e41..ea471152213 100644
--- a/lib/libkvm/kvm_m88k.c
+++ b/lib/libkvm/kvm_m88k.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kvm_m88k.c,v 1.6 2015/12/19 18:40:30 mmcc Exp $ */
+/* $OpenBSD: kvm_m88k.c,v 1.7 2021/12/01 16:53:28 deraadt Exp $ */
/* $NetBSD: kvm_alpha.c,v 1.2 1995/09/29 03:57:48 cgd Exp $ */
/*
@@ -28,7 +28,9 @@
* rights to redistribute these changes.
*/
-#include <sys/param.h>
+#include <sys/param.h> /* MAXCOMLEN */
+#include <sys/types.h>
+#include <sys/signal.h>
#include <sys/proc.h>
#include <sys/stat.h>
#include <unistd.h>
diff --git a/lib/libkvm/kvm_mips64.c b/lib/libkvm/kvm_mips64.c
index 6ab067725de..ea619bb218d 100644
--- a/lib/libkvm/kvm_mips64.c
+++ b/lib/libkvm/kvm_mips64.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kvm_mips64.c,v 1.16 2018/05/03 16:42:07 zhuk Exp $ */
+/* $OpenBSD: kvm_mips64.c,v 1.17 2021/12/01 16:53:28 deraadt Exp $ */
/* $NetBSD: kvm_mips.c,v 1.3 1996/03/18 22:33:44 thorpej Exp $ */
/*-
@@ -39,7 +39,8 @@
* vm code will one day obsolete this module.
*/
-#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/signal.h>
#include <sys/proc.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
diff --git a/lib/libkvm/kvm_powerpc.c b/lib/libkvm/kvm_powerpc.c
index 7bfc421651c..8693c565ba4 100644
--- a/lib/libkvm/kvm_powerpc.c
+++ b/lib/libkvm/kvm_powerpc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kvm_powerpc.c,v 1.10 2015/12/19 18:40:30 mmcc Exp $ */
+/* $OpenBSD: kvm_powerpc.c,v 1.11 2021/12/01 16:53:28 deraadt Exp $ */
/*-
* Copyright (C) 1996 Wolfgang Solfrank.
@@ -35,8 +35,9 @@
* PowerPC machine dependent routines for kvm.
*/
-#include <sys/param.h>
-#include <sys/exec.h>
+#include <sys/param.h> /* MAXCOMLEN */
+#include <sys/types.h>
+#include <sys/signal.h>
#include <sys/proc.h>
#include <sys/stat.h>
#include <sys/core.h>
diff --git a/lib/libkvm/kvm_powerpc64.c b/lib/libkvm/kvm_powerpc64.c
index 1be4f922dcd..80239b8f0b1 100644
--- a/lib/libkvm/kvm_powerpc64.c
+++ b/lib/libkvm/kvm_powerpc64.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kvm_powerpc64.c,v 1.1 2020/06/28 09:46:58 kettenis Exp $ */
+/* $OpenBSD: kvm_powerpc64.c,v 1.2 2021/12/01 16:53:28 deraadt Exp $ */
/*
* Copyright (c) 2007 Miodrag Vallat.
@@ -17,10 +17,10 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
+#include <sys/param.h> /* MAXCOMLEN */
+#include <sys/types.h>
#include <sys/core.h>
#include <sys/kcore.h>
-#include <sys/vnode.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/lib/libkvm/kvm_riscv64.c b/lib/libkvm/kvm_riscv64.c
index 10d3d6b570c..68a5d64422a 100644
--- a/lib/libkvm/kvm_riscv64.c
+++ b/lib/libkvm/kvm_riscv64.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kvm_riscv64.c,v 1.1 2021/04/29 20:00:18 drahn Exp $ */
+/* $OpenBSD: kvm_riscv64.c,v 1.2 2021/12/01 16:53:28 deraadt Exp $ */
/*
* Copyright (c) 2006 Miodrag Vallat.
*
@@ -50,10 +50,10 @@
* RISCV machine dependent routines for kvm.
*/
-#include <sys/param.h>
+#include <sys/param.h> /* MAXCOMLEN */
+#include <sys/types.h>
#include <sys/core.h>
#include <sys/kcore.h>
-#include <sys/vnode.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/lib/libkvm/kvm_sh.c b/lib/libkvm/kvm_sh.c
index e4a72c7b7bc..4017e85b394 100644
--- a/lib/libkvm/kvm_sh.c
+++ b/lib/libkvm/kvm_sh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kvm_sh.c,v 1.7 2020/06/28 09:45:12 kettenis Exp $ */
+/* $OpenBSD: kvm_sh.c,v 1.8 2021/12/01 16:53:28 deraadt Exp $ */
/*
* Copyright (c) 2007 Miodrag Vallat.
@@ -17,10 +17,10 @@
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#include <sys/param.h>
+#include <sys/param.h> /* MAXCOMLEN */
+#include <sys/types.h>
#include <sys/core.h>
#include <sys/kcore.h>
-#include <sys/vnode.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/lib/libkvm/kvm_sparc64.c b/lib/libkvm/kvm_sparc64.c
index 3cf5c7e2145..d73b80f7b4a 100644
--- a/lib/libkvm/kvm_sparc64.c
+++ b/lib/libkvm/kvm_sparc64.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kvm_sparc64.c,v 1.11 2021/10/06 00:42:47 deraadt Exp $ */
+/* $OpenBSD: kvm_sparc64.c,v 1.12 2021/12/01 16:53:28 deraadt Exp $ */
/* $NetBSD: kvm_sparc64.c,v 1.7 2001/08/05 03:33:15 matt Exp $ */
/*-
@@ -39,7 +39,7 @@
* vm code will one day obsolete this module.
*/
-#include <sys/param.h> /* MAXCOMLEN PAGE_SIZE */
+#include <sys/param.h> /* MAXCOMLEN */
#include <sys/types.h>
#include <sys/signal.h>
#include <sys/exec.h>
@@ -53,6 +53,7 @@
#include <uvm/uvm_extern.h>
+#include <machine/param.h>
#include <machine/vmparam.h>
#include <machine/pmap.h>
#include <machine/kcore.h>