summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2017-10-14 04:44:44 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2017-10-14 04:44:44 +0000
commit4af4921d4c387e488fed1ed4002f3f79910f8d18 (patch)
treec0644dcf68905bd505560fda6843fc12e09bc24e /sys
parent232dec86d28c22a80c1401000069386949208567 (diff)
reduce the amount of includes in arch/amd64
ok mpi@ deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/amd64/amd64/acpi_machdep.c7
-rw-r--r--sys/arch/amd64/amd64/autoconf.c12
-rw-r--r--sys/arch/amd64/amd64/bios.c9
-rw-r--r--sys/arch/amd64/amd64/bus_dma.c3
-rw-r--r--sys/arch/amd64/amd64/codepatch.c3
-rw-r--r--sys/arch/amd64/amd64/consinit.c7
-rw-r--r--sys/arch/amd64/amd64/cpu.c3
-rw-r--r--sys/arch/amd64/amd64/fpu.c9
-rw-r--r--sys/arch/amd64/amd64/i8259.c6
-rw-r--r--sys/arch/amd64/amd64/identcpu.c3
-rw-r--r--sys/arch/amd64/amd64/intr.c7
-rw-r--r--sys/arch/amd64/amd64/ioapic.c7
-rw-r--r--sys/arch/amd64/amd64/lapic.c5
-rw-r--r--sys/arch/amd64/amd64/machdep.c11
-rw-r--r--sys/arch/amd64/amd64/mainbus.c4
-rw-r--r--sys/arch/amd64/amd64/mem.c5
-rw-r--r--sys/arch/amd64/amd64/mpbios.c6
-rw-r--r--sys/arch/amd64/amd64/pmap.c9
-rw-r--r--sys/arch/amd64/amd64/process_machdep.c7
-rw-r--r--sys/arch/amd64/amd64/sys_machdep.c14
-rw-r--r--sys/arch/amd64/amd64/trap.c4
-rw-r--r--sys/arch/amd64/amd64/tsc.c3
-rw-r--r--sys/arch/amd64/amd64/via.c18
-rw-r--r--sys/arch/amd64/amd64/vm_machdep.c9
-rw-r--r--sys/arch/amd64/amd64/wscons_machdep.c5
-rw-r--r--sys/arch/amd64/isa/clock.c4
-rw-r--r--sys/arch/amd64/isa/isa_machdep.c11
-rw-r--r--sys/arch/amd64/pci/pchb.c3
-rw-r--r--sys/arch/amd64/pci/pci_machdep.c7
-rw-r--r--sys/arch/amd64/pci/pciide_machdep.c4
30 files changed, 32 insertions, 173 deletions
diff --git a/sys/arch/amd64/amd64/acpi_machdep.c b/sys/arch/amd64/amd64/acpi_machdep.c
index 17d8fb205ef..5bd946454dc 100644
--- a/sys/arch/amd64/amd64/acpi_machdep.c
+++ b/sys/arch/amd64/amd64/acpi_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpi_machdep.c,v 1.78 2017/03/27 18:32:53 mlarkin Exp $ */
+/* $OpenBSD: acpi_machdep.c,v 1.79 2017/10/14 04:44:43 jsg Exp $ */
/*
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
*
@@ -17,7 +17,6 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <sys/device.h>
#include <sys/malloc.h>
#include <sys/memrange.h>
@@ -28,12 +27,9 @@
#include <uvm/uvm_extern.h>
-#include <machine/bus.h>
#include <machine/biosvar.h>
#include <machine/isa_machdep.h>
-#include <machine/cpu.h>
-#include <machine/cpufunc.h>
#include <machine/cpuvar.h>
#include <dev/isa/isareg.h>
@@ -53,7 +49,6 @@
#endif
#if NLAPIC > 0
-#include <machine/i82489reg.h>
#include <machine/i82489var.h>
#endif
diff --git a/sys/arch/amd64/amd64/autoconf.c b/sys/arch/amd64/amd64/autoconf.c
index 19dcd242fa0..ca8c9ad2877 100644
--- a/sys/arch/amd64/amd64/autoconf.c
+++ b/sys/arch/amd64/amd64/autoconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: autoconf.c,v 1.49 2017/06/20 21:05:46 deraadt Exp $ */
+/* $OpenBSD: autoconf.c,v 1.50 2017/10/14 04:44:43 jsg Exp $ */
/* $NetBSD: autoconf.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */
/*-
@@ -46,27 +46,19 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/buf.h>
-#include <sys/disklabel.h>
-#include <sys/conf.h>
#include <sys/device.h>
-#include <sys/malloc.h>
-#include <sys/vnode.h>
-#include <sys/fcntl.h>
-#include <sys/dkio.h>
#include <sys/reboot.h>
#include <sys/socket.h>
#include <sys/socketvar.h>
#include <sys/timeout.h>
#include <sys/hibernate.h>
-#include <uvm/uvm.h>
+#include <uvm/uvm_extern.h>
#include <net/if.h>
#include <net/if_types.h>
#include <netinet/in.h>
#include <netinet/if_ether.h>
-#include <machine/pte.h>
#include <machine/cpu.h>
#include <machine/cpufunc.h>
#include <machine/biosvar.h>
diff --git a/sys/arch/amd64/amd64/bios.c b/sys/arch/amd64/amd64/bios.c
index a2e0dc6648f..337262fc35e 100644
--- a/sys/arch/amd64/amd64/bios.c
+++ b/sys/arch/amd64/amd64/bios.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bios.c,v 1.34 2015/09/12 23:03:30 uebayasi Exp $ */
+/* $OpenBSD: bios.c,v 1.35 2017/10/14 04:44:43 jsg Exp $ */
/*
* Copyright (c) 2006 Gordon Willem Klok <gklok@cogeco.ca>
*
@@ -17,24 +17,17 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <sys/device.h>
-#include <sys/errno.h>
#include <sys/malloc.h>
#include <uvm/uvm_extern.h>
-#include <sys/sysctl.h>
-#include <machine/conf.h>
#include <machine/biosvar.h>
#include <machine/mpbiosvar.h>
#include <machine/smbiosvar.h>
#include <dev/isa/isareg.h>
#include <amd64/include/isa_machdep.h>
-#include <dev/pci/pcivar.h>
-
-#include <dev/acpi/acpivar.h>
#include <dev/rndvar.h>
diff --git a/sys/arch/amd64/amd64/bus_dma.c b/sys/arch/amd64/amd64/bus_dma.c
index 8eaa2e7dba4..60ffac293ca 100644
--- a/sys/arch/amd64/amd64/bus_dma.c
+++ b/sys/arch/amd64/amd64/bus_dma.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bus_dma.c,v 1.49 2015/12/17 17:16:04 tedu Exp $ */
+/* $OpenBSD: bus_dma.c,v 1.50 2017/10/14 04:44:43 jsg Exp $ */
/* $NetBSD: bus_dma.c,v 1.3 2003/05/07 21:33:58 fvdl Exp $ */
/*-
@@ -88,7 +88,6 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
#include <sys/proc.h>
diff --git a/sys/arch/amd64/amd64/codepatch.c b/sys/arch/amd64/amd64/codepatch.c
index a5bb847317e..a6a0194f51a 100644
--- a/sys/arch/amd64/amd64/codepatch.c
+++ b/sys/arch/amd64/amd64/codepatch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: codepatch.c,v 1.5 2017/07/10 00:59:24 mortimer Exp $ */
+/* $OpenBSD: codepatch.c,v 1.6 2017/10/14 04:44:43 jsg Exp $ */
/*
* Copyright (c) 2014-2015 Stefan Fritsch <sf@sfritsch.de>
*
@@ -16,7 +16,6 @@
*/
#include <sys/param.h>
-#include <machine/codepatch.h>
#include <uvm/uvm_extern.h>
#ifdef CODEPATCH_DEBUG
diff --git a/sys/arch/amd64/amd64/consinit.c b/sys/arch/amd64/amd64/consinit.c
index c8185d12517..20be020586f 100644
--- a/sys/arch/amd64/amd64/consinit.c
+++ b/sys/arch/amd64/amd64/consinit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: consinit.c,v 1.6 2016/03/06 22:41:24 naddy Exp $ */
+/* $OpenBSD: consinit.c,v 1.7 2017/10/14 04:44:43 jsg Exp $ */
/* $NetBSD: consinit.c,v 1.2 2003/03/02 18:27:14 fvdl Exp $ */
/*
@@ -27,11 +27,6 @@
*
*/
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/device.h>
-#include <machine/bus.h>
-
void
consinit(void)
{
diff --git a/sys/arch/amd64/amd64/cpu.c b/sys/arch/amd64/amd64/cpu.c
index ebc0f29d596..7afed65768f 100644
--- a/sys/arch/amd64/amd64/cpu.c
+++ b/sys/arch/amd64/amd64/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.107 2017/08/25 19:28:48 guenther Exp $ */
+/* $OpenBSD: cpu.c,v 1.108 2017/10/14 04:44:43 jsg Exp $ */
/* $NetBSD: cpu.c,v 1.1 2003/04/26 18:39:26 fvdl Exp $ */
/*-
@@ -95,7 +95,6 @@
#include <machine/vmmvar.h>
#if NLAPIC > 0
-#include <machine/apicvar.h>
#include <machine/i82489reg.h>
#include <machine/i82489var.h>
#endif
diff --git a/sys/arch/amd64/amd64/fpu.c b/sys/arch/amd64/amd64/fpu.c
index f9b55c648cf..9660c374674 100644
--- a/sys/arch/amd64/amd64/fpu.c
+++ b/sys/arch/amd64/amd64/fpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fpu.c,v 1.37 2017/10/04 02:10:33 guenther Exp $ */
+/* $OpenBSD: fpu.c,v 1.38 2017/10/14 04:44:43 jsg Exp $ */
/* $NetBSD: fpu.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */
/*-
@@ -34,17 +34,12 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/file.h>
#include <sys/proc.h>
#include <sys/user.h>
-#include <sys/ioctl.h>
-#include <sys/device.h>
#include <sys/signalvar.h>
#include <uvm/uvm_extern.h>
-#include <machine/bus.h>
#include <machine/cpu.h>
#include <machine/intr.h>
#include <machine/cpufunc.h>
@@ -53,8 +48,6 @@
#include <machine/specialreg.h>
#include <machine/fpu.h>
-#include <dev/isa/isavar.h>
-
int xrstor_user(struct savefpu *_addr, uint64_t _mask);
void trap(struct trapframe *);
diff --git a/sys/arch/amd64/amd64/i8259.c b/sys/arch/amd64/amd64/i8259.c
index b947a3a01b0..ac6fd735619 100644
--- a/sys/arch/amd64/amd64/i8259.c
+++ b/sys/arch/amd64/amd64/i8259.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: i8259.c,v 1.9 2015/09/02 13:39:23 mikeb Exp $ */
+/* $OpenBSD: i8259.c,v 1.10 2017/10/14 04:44:43 jsg Exp $ */
/* $NetBSD: i8259.c,v 1.2 2003/03/02 18:27:15 fvdl Exp $ */
/*
@@ -71,10 +71,6 @@
*/
#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/kernel.h>
-#include <sys/syslog.h>
-#include <sys/malloc.h>
#include <dev/isa/isareg.h>
diff --git a/sys/arch/amd64/amd64/identcpu.c b/sys/arch/amd64/amd64/identcpu.c
index 892eb25ac7e..b180ae9a3ff 100644
--- a/sys/arch/amd64/amd64/identcpu.c
+++ b/sys/arch/amd64/amd64/identcpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: identcpu.c,v 1.88 2017/10/06 13:33:53 mikeb Exp $ */
+/* $OpenBSD: identcpu.c,v 1.89 2017/10/14 04:44:43 jsg Exp $ */
/* $NetBSD: identcpu.c,v 1.1 2003/04/26 18:39:28 fvdl Exp $ */
/*
@@ -39,7 +39,6 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/sysctl.h>
-#include <sys/timetc.h>
#include "vmm.h"
diff --git a/sys/arch/amd64/amd64/intr.c b/sys/arch/amd64/amd64/intr.c
index 622a07fbde8..7d8947fa932 100644
--- a/sys/arch/amd64/amd64/intr.c
+++ b/sys/arch/amd64/amd64/intr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: intr.c,v 1.49 2017/08/08 15:53:55 visa Exp $ */
+/* $OpenBSD: intr.c,v 1.50 2017/10/14 04:44:43 jsg Exp $ */
/* $NetBSD: intr.c,v 1.3 2003/03/03 22:16:20 fvdl Exp $ */
/*
@@ -52,15 +52,10 @@
#include <machine/pio.h>
#include <machine/cpufunc.h>
-#include "ioapic.h"
#include "lapic.h"
#include "xen.h"
#include "hyperv.h"
-#if NIOAPIC > 0
-#include <machine/mpbiosvar.h>
-#endif
-
#if NLAPIC > 0
#include <machine/i82489var.h>
#endif
diff --git a/sys/arch/amd64/amd64/ioapic.c b/sys/arch/amd64/amd64/ioapic.c
index 1d61e25c875..b39c5f55a0f 100644
--- a/sys/arch/amd64/amd64/ioapic.c
+++ b/sys/arch/amd64/amd64/ioapic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ioapic.c,v 1.27 2017/08/29 15:19:57 deraadt Exp $ */
+/* $OpenBSD: ioapic.c,v 1.28 2017/10/14 04:44:43 jsg Exp $ */
/* $NetBSD: ioapic.c,v 1.6 2003/05/15 13:30:31 fvdl Exp $ */
/*-
@@ -71,16 +71,11 @@
#include <sys/malloc.h>
#include <machine/bus.h>
-#include <machine/isa_machdep.h> /* XXX intrhand */
#include <uvm/uvm_extern.h>
#include <machine/i82093reg.h>
#include <machine/i82093var.h>
-#include <machine/i82489var.h>
-
-#include <machine/pmap.h>
-
#include <machine/mpbiosvar.h>
/*
diff --git a/sys/arch/amd64/amd64/lapic.c b/sys/arch/amd64/amd64/lapic.c
index a4cbad1cb81..6a1086c2f62 100644
--- a/sys/arch/amd64/amd64/lapic.c
+++ b/sys/arch/amd64/amd64/lapic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lapic.c,v 1.48 2017/07/24 15:31:14 robert Exp $ */
+/* $OpenBSD: lapic.c,v 1.49 2017/10/14 04:44:43 jsg Exp $ */
/* $NetBSD: lapic.c,v 1.2 2003/05/08 01:04:35 fvdl Exp $ */
/*-
@@ -42,13 +42,10 @@
#include <machine/cpu.h>
#include <machine/cpufunc.h>
#include <machine/pmap.h>
-#include <machine/vmparam.h>
#include <machine/mpbiosvar.h>
-#include <machine/pcb.h>
#include <machine/specialreg.h>
#include <machine/segments.h>
-#include <machine/apicvar.h>
#include <machine/i82489reg.h>
#include <machine/i82489var.h>
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index 150d2d43112..a212ace2d2e 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.232 2017/10/10 07:04:05 mlarkin Exp $ */
+/* $OpenBSD: machdep.c,v 1.233 2017/10/14 04:44:43 jsg Exp $ */
/* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */
/*-
@@ -69,19 +69,14 @@
#include <sys/systm.h>
#include <sys/signal.h>
#include <sys/signalvar.h>
-#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/user.h>
#include <sys/exec.h>
#include <sys/buf.h>
#include <sys/reboot.h>
#include <sys/conf.h>
-#include <sys/file.h>
-#include <sys/malloc.h>
-#include <sys/mbuf.h>
#include <sys/msgbuf.h>
#include <sys/mount.h>
-#include <sys/vnode.h>
#include <sys/extent.h>
#include <sys/core.h>
#include <sys/kcore.h>
@@ -91,7 +86,7 @@
#include <stand/boot/bootarg.h>
#include <net/if.h>
-#include <uvm/uvm.h>
+#include <uvm/uvm_extern.h>
#include <sys/sysctl.h>
@@ -100,7 +95,6 @@
#include <machine/pio.h>
#include <machine/psl.h>
#include <machine/reg.h>
-#include <machine/specialreg.h>
#include <machine/fpu.h>
#include <machine/biosvar.h>
#include <machine/mpbiosvar.h>
@@ -108,7 +102,6 @@
#include <machine/tss.h>
#include <dev/isa/isareg.h>
-#include <machine/isa_machdep.h>
#include <dev/ic/i8042reg.h>
#ifdef DDB
diff --git a/sys/arch/amd64/amd64/mainbus.c b/sys/arch/amd64/amd64/mainbus.c
index fbc226bcc8b..ed6ab059329 100644
--- a/sys/arch/amd64/amd64/mainbus.c
+++ b/sys/arch/amd64/amd64/mainbus.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mainbus.c,v 1.39 2017/03/25 22:24:01 deraadt Exp $ */
+/* $OpenBSD: mainbus.c,v 1.40 2017/10/14 04:44:43 jsg Exp $ */
/* $NetBSD: mainbus.c,v 1.1 2003/04/26 18:39:29 fvdl Exp $ */
/*
@@ -41,8 +41,6 @@
#include <dev/isa/isavar.h>
#include <dev/pci/pcivar.h>
-#include <dev/isa/isareg.h>
-
#include "pci.h"
#include "isa.h"
#include "acpi.h"
diff --git a/sys/arch/amd64/amd64/mem.c b/sys/arch/amd64/amd64/mem.c
index 0dfe2300e08..15e30a7a29d 100644
--- a/sys/arch/amd64/amd64/mem.c
+++ b/sys/arch/amd64/amd64/mem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mem.c,v 1.31 2016/09/25 15:23:36 deraadt Exp $ */
+/* $OpenBSD: mem.c,v 1.32 2017/10/14 04:44:43 jsg Exp $ */
/*
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1982, 1986, 1990, 1993
@@ -46,13 +46,10 @@
#include <sys/param.h>
#include <sys/buf.h>
#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/exec.h>
#include <sys/uio.h>
#include <sys/ioccom.h>
#include <sys/malloc.h>
#include <sys/memrange.h>
-#include <sys/fcntl.h>
#include <machine/cpu.h>
diff --git a/sys/arch/amd64/amd64/mpbios.c b/sys/arch/amd64/amd64/mpbios.c
index 75382e93084..29fc18cfa2a 100644
--- a/sys/arch/amd64/amd64/mpbios.c
+++ b/sys/arch/amd64/amd64/mpbios.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpbios.c,v 1.27 2016/07/28 21:57:57 kettenis Exp $ */
+/* $OpenBSD: mpbios.c,v 1.28 2017/10/14 04:44:43 jsg Exp $ */
/* $NetBSD: mpbios.c,v 1.7 2003/05/15 16:32:50 fvdl Exp $ */
/*-
@@ -98,15 +98,12 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <sys/device.h>
#include <sys/malloc.h>
#include <uvm/uvm_extern.h>
-#include <machine/specialreg.h>
#include <machine/cpuvar.h>
-#include <machine/bus.h>
#include <machine/biosvar.h>
#include <machine/mpbiosvar.h>
@@ -116,7 +113,6 @@
#include <machine/i82489var.h>
#include <dev/isa/isareg.h>
-#include <dev/pci/pcivar.h>
#ifdef X86_MPBIOS_SUPPORT_EISA
#include <dev/eisa/eisavar.h> /* for ELCR* def'ns */
diff --git a/sys/arch/amd64/amd64/pmap.c b/sys/arch/amd64/amd64/pmap.c
index 5833da94304..100ab21175b 100644
--- a/sys/arch/amd64/amd64/pmap.c
+++ b/sys/arch/amd64/amd64/pmap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pmap.c,v 1.105 2017/07/24 15:31:14 robert Exp $ */
+/* $OpenBSD: pmap.c,v 1.106 2017/10/14 04:44:43 jsg Exp $ */
/* $NetBSD: pmap.c,v 1.3 2003/05/08 18:13:13 thorpej Exp $ */
/*
@@ -105,25 +105,18 @@
#include <sys/systm.h>
#include <sys/atomic.h>
#include <sys/proc.h>
-#include <sys/malloc.h>
#include <sys/pool.h>
#include <sys/user.h>
-#include <sys/kernel.h>
#include <sys/mutex.h>
-#include <sys/sched.h>
#include <uvm/uvm.h>
#include <machine/cpu.h>
-#include <machine/specialreg.h>
#ifdef MULTIPROCESSOR
#include <machine/i82489reg.h>
#include <machine/i82489var.h>
#endif
-
-#include <machine/isa_machdep.h>
-
#include "acpi.h"
/*
diff --git a/sys/arch/amd64/amd64/process_machdep.c b/sys/arch/amd64/amd64/process_machdep.c
index 38102f4f251..42eff548aae 100644
--- a/sys/arch/amd64/amd64/process_machdep.c
+++ b/sys/arch/amd64/amd64/process_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: process_machdep.c,v 1.14 2015/06/28 18:54:54 guenther Exp $ */
+/* $OpenBSD: process_machdep.c,v 1.15 2017/10/14 04:44:43 jsg Exp $ */
/* $NetBSD: process_machdep.c,v 1.1 2003/04/26 18:39:31 fvdl Exp $ */
/*-
@@ -55,16 +55,11 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/time.h>
-#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/user.h>
-#include <sys/vnode.h>
-#include <sys/ptrace.h>
#include <uvm/uvm_extern.h>
-#include <machine/psl.h>
#include <machine/reg.h>
#include <machine/fpu.h>
diff --git a/sys/arch/amd64/amd64/sys_machdep.c b/sys/arch/amd64/amd64/sys_machdep.c
index 55192033321..249fd466689 100644
--- a/sys/arch/amd64/amd64/sys_machdep.c
+++ b/sys/arch/amd64/amd64/sys_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_machdep.c,v 1.17 2017/09/27 05:43:55 guenther Exp $ */
+/* $OpenBSD: sys_machdep.c,v 1.18 2017/10/14 04:44:43 jsg Exp $ */
/* $NetBSD: sys_machdep.c,v 1.1 2003/04/26 18:39:32 fvdl Exp $ */
/*-
@@ -32,24 +32,12 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/ioctl.h>
-#include <sys/file.h>
-#include <sys/time.h>
#include <sys/proc.h>
-#include <sys/user.h>
-#include <sys/uio.h>
-#include <sys/kernel.h>
-#include <sys/buf.h>
-#include <sys/signal.h>
#include <sys/mount.h>
#include <sys/syscallargs.h>
-#include <uvm/uvm_extern.h>
-
-#include <machine/cpufunc.h>
#include <machine/psl.h>
-#include <machine/reg.h>
#include <machine/sysarch.h>
#include <machine/tcb.h>
diff --git a/sys/arch/amd64/amd64/trap.c b/sys/arch/amd64/amd64/trap.c
index 6bb389aad62..96565bd738d 100644
--- a/sys/arch/amd64/amd64/trap.c
+++ b/sys/arch/amd64/amd64/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.61 2017/10/04 02:10:33 guenther Exp $ */
+/* $OpenBSD: trap.c,v 1.62 2017/10/14 04:44:43 jsg Exp $ */
/* $NetBSD: trap.c,v 1.2 2003/05/04 23:51:56 fvdl Exp $ */
/*-
@@ -74,8 +74,6 @@
#include <sys/proc.h>
#include <sys/signalvar.h>
#include <sys/user.h>
-#include <sys/acct.h>
-#include <sys/kernel.h>
#include <sys/signal.h>
#include <sys/syscall.h>
#include <sys/syscall_mi.h>
diff --git a/sys/arch/amd64/amd64/tsc.c b/sys/arch/amd64/amd64/tsc.c
index ce91d5b95df..a6a324b7abf 100644
--- a/sys/arch/amd64/amd64/tsc.c
+++ b/sys/arch/amd64/amd64/tsc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tsc.c,v 1.1 2017/10/06 13:33:53 mikeb Exp $ */
+/* $OpenBSD: tsc.c,v 1.2 2017/10/14 04:44:43 jsg Exp $ */
/*
* Copyright (c) 2016,2017 Reyk Floeter <reyk@openbsd.org>
* Copyright (c) 2017 Adam Steen <adam@adamsteen.com.au>
@@ -19,7 +19,6 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/sysctl.h>
#include <sys/timetc.h>
#include <machine/cpu.h>
diff --git a/sys/arch/amd64/amd64/via.c b/sys/arch/amd64/amd64/via.c
index 35d467eed4c..f9cc747d827 100644
--- a/sys/arch/amd64/amd64/via.c
+++ b/sys/arch/amd64/amd64/via.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: via.c,v 1.23 2017/05/02 11:47:49 mikeb Exp $ */
+/* $OpenBSD: via.c,v 1.24 2017/10/14 04:44:43 jsg Exp $ */
/* $NetBSD: machdep.c,v 1.214 1996/11/10 03:16:17 thorpej Exp $ */
/*-
@@ -21,18 +21,9 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/signalvar.h>
-#include <sys/kernel.h>
-#include <sys/exec.h>
-#include <sys/buf.h>
-#include <sys/reboot.h>
-#include <sys/conf.h>
-#include <sys/file.h>
#include <sys/timeout.h>
#include <sys/malloc.h>
#include <sys/mbuf.h>
-#include <sys/extent.h>
-#include <sys/sysctl.h>
#ifdef CRYPTO
#include <crypto/cryptodev.h>
@@ -41,14 +32,7 @@
#include <crypto/cryptosoft.h>
#endif
-#include <uvm/uvm_extern.h>
-
-#include <machine/cpu.h>
#include <machine/cpufunc.h>
-#include <machine/pio.h>
-#include <machine/bus.h>
-#include <machine/psl.h>
-#include <machine/reg.h>
#include <machine/specialreg.h>
#include <dev/rndvar.h>
diff --git a/sys/arch/amd64/amd64/vm_machdep.c b/sys/arch/amd64/amd64/vm_machdep.c
index a3f8ec2f730..58a23136a49 100644
--- a/sys/arch/amd64/amd64/vm_machdep.c
+++ b/sys/arch/amd64/amd64/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.40 2017/09/12 02:58:08 dlg Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.41 2017/10/14 04:44:43 jsg Exp $ */
/* $NetBSD: vm_machdep.c,v 1.1 2003/04/26 18:39:33 fvdl Exp $ */
/*-
@@ -45,20 +45,13 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/proc.h>
-#include <sys/malloc.h>
-#include <sys/vnode.h>
#include <sys/buf.h>
#include <sys/user.h>
-#include <sys/exec.h>
-#include <sys/ptrace.h>
-#include <sys/signalvar.h>
#include <uvm/uvm_extern.h>
#include <machine/cpu.h>
-#include <machine/reg.h>
#include <machine/fpu.h>
-#include <machine/tcb.h>
void setguardpage(struct proc *);
diff --git a/sys/arch/amd64/amd64/wscons_machdep.c b/sys/arch/amd64/amd64/wscons_machdep.c
index 461441c4d43..afa9a4dc3ef 100644
--- a/sys/arch/amd64/amd64/wscons_machdep.c
+++ b/sys/arch/amd64/amd64/wscons_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wscons_machdep.c,v 1.13 2016/06/21 15:24:55 jcs Exp $ */
+/* $OpenBSD: wscons_machdep.c,v 1.14 2017/10/14 04:44:43 jsg Exp $ */
/*
* Copyright (c) 2001 Aaron Campbell
@@ -28,10 +28,7 @@
#include <sys/param.h>
#include <sys/systm.h>
-#include <sys/kernel.h>
#include <sys/conf.h>
-#include <sys/device.h>
-#include <sys/extent.h>
#include <machine/bus.h>
diff --git a/sys/arch/amd64/isa/clock.c b/sys/arch/amd64/isa/clock.c
index 5c22ebeb6fa..2aa35cf7767 100644
--- a/sys/arch/amd64/isa/clock.c
+++ b/sys/arch/amd64/isa/clock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: clock.c,v 1.25 2017/08/11 21:18:11 jcs Exp $ */
+/* $OpenBSD: clock.c,v 1.26 2017/10/14 04:44:43 jsg Exp $ */
/* $NetBSD: clock.c,v 1.1 2003/04/26 18:39:50 fvdl Exp $ */
/*-
@@ -93,7 +93,6 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <sys/systm.h>
#include <sys/time.h>
#include <sys/kernel.h>
-#include <sys/device.h>
#include <sys/timeout.h>
#include <sys/timetc.h>
@@ -107,7 +106,6 @@ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <dev/ic/mc146818reg.h>
#include <dev/ic/i8253reg.h>
#include <amd64/isa/nvram.h>
-#include <machine/specialreg.h>
/* Timecounter on the i8254 */
u_int32_t i8254_lastcount;
diff --git a/sys/arch/amd64/isa/isa_machdep.c b/sys/arch/amd64/isa/isa_machdep.c
index 74dc90762e5..e1579d9bc90 100644
--- a/sys/arch/amd64/isa/isa_machdep.c
+++ b/sys/arch/amd64/isa/isa_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isa_machdep.c,v 1.28 2015/09/27 10:12:09 semarie Exp $ */
+/* $OpenBSD: isa_machdep.c,v 1.29 2017/10/14 04:44:43 jsg Exp $ */
/* $NetBSD: isa_machdep.c,v 1.22 1997/06/12 23:57:32 thorpej Exp $ */
#define ISA_DMA_STATS
@@ -72,7 +72,6 @@
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/syslog.h>
-#include <sys/device.h>
#include <sys/malloc.h>
#include <sys/proc.h>
@@ -85,18 +84,10 @@
#include <machine/mpbiosvar.h>
#endif
-#include <machine/bus.h>
-
#include <machine/intr.h>
-#include <machine/pio.h>
-#include <machine/cpufunc.h>
#include <machine/i8259.h>
#include <dev/isa/isavar.h>
-#if 0
-#include <dev/isa/isadmavar.h>
-#endif
-#include <i386/isa/isa_machdep.h>
#include "isadma.h"
diff --git a/sys/arch/amd64/pci/pchb.c b/sys/arch/amd64/pci/pchb.c
index 4549c6b085f..591523e4b45 100644
--- a/sys/arch/amd64/pci/pchb.c
+++ b/sys/arch/amd64/pci/pchb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pchb.c,v 1.41 2014/03/26 14:41:41 mpi Exp $ */
+/* $OpenBSD: pchb.c,v 1.42 2017/10/14 04:44:43 jsg Exp $ */
/* $NetBSD: pchb.c,v 1.1 2003/04/26 18:39:50 fvdl Exp $ */
/*
* Copyright (c) 2000 Michael Shalayeff
@@ -58,7 +58,6 @@
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/timeout.h>
-#include <sys/rwlock.h>
#include <machine/bus.h>
diff --git a/sys/arch/amd64/pci/pci_machdep.c b/sys/arch/amd64/pci/pci_machdep.c
index 4acd9cb79a7..2ea97e1ab36 100644
--- a/sys/arch/amd64/pci/pci_machdep.c
+++ b/sys/arch/amd64/pci/pci_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pci_machdep.c,v 1.66 2017/09/08 05:36:51 deraadt Exp $ */
+/* $OpenBSD: pci_machdep.c,v 1.67 2017/10/14 04:44:43 jsg Exp $ */
/* $NetBSD: pci_machdep.c,v 1.3 2003/05/07 21:33:58 fvdl Exp $ */
/*-
@@ -66,15 +66,10 @@
*/
#include <sys/param.h>
-#include <sys/time.h>
#include <sys/systm.h>
-#include <sys/errno.h>
-#include <sys/device.h>
#include <sys/extent.h>
#include <sys/malloc.h>
-#include <uvm/uvm_extern.h>
-
#include <machine/bus.h>
#include <machine/pio.h>
diff --git a/sys/arch/amd64/pci/pciide_machdep.c b/sys/arch/amd64/pci/pciide_machdep.c
index 00be7386171..08ce9787ca2 100644
--- a/sys/arch/amd64/pci/pciide_machdep.c
+++ b/sys/arch/amd64/pci/pciide_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pciide_machdep.c,v 1.3 2007/01/15 23:19:05 jsg Exp $ */
+/* $OpenBSD: pciide_machdep.c,v 1.4 2017/10/14 04:44:43 jsg Exp $ */
/* $NetBSD: pciide_machdep.c,v 1.2 1999/02/19 18:01:27 mycroft Exp $ */
/*
@@ -42,13 +42,11 @@
*/
#include <sys/param.h>
-#include <sys/systm.h>
#include <sys/device.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h>
#include <dev/pci/pciidereg.h>
-#include <dev/pci/pciidevar.h>
#include <dev/isa/isavar.h>