Index: sys/amd64/amd64/db_trace.c =================================================================== --- sys/amd64/amd64/db_trace.c +++ sys/amd64/amd64/db_trace.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -38,7 +39,6 @@ #include #include #include -#include #include #include Index: sys/amd64/amd64/gdb_machdep.c =================================================================== --- sys/amd64/amd64/gdb_machdep.c +++ sys/amd64/amd64/gdb_machdep.c @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -42,7 +43,6 @@ #include #include #include -#include #include #include #include Index: sys/amd64/amd64/machdep.c =================================================================== --- sys/amd64/amd64/machdep.c +++ sys/amd64/amd64/machdep.c @@ -83,6 +83,7 @@ #include #include #include +#include #include #include #include @@ -129,7 +130,6 @@ #include #include #include -#include #include #include #include Index: sys/amd64/ia32/ia32_reg.c =================================================================== --- sys/amd64/ia32/ia32_reg.c +++ sys/amd64/ia32/ia32_reg.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include Index: sys/amd64/include/db_machdep.h =================================================================== --- sys/amd64/include/db_machdep.h +++ sys/amd64/include/db_machdep.h @@ -30,7 +30,6 @@ #define _MACHINE_DB_MACHDEP_H_ #include -#include #include typedef vm_offset_t db_addr_t; /* address - unsigned */ Index: sys/amd64/linux/linux_ptrace.c =================================================================== --- sys/amd64/linux/linux_ptrace.c +++ sys/amd64/linux/linux_ptrace.c @@ -40,7 +40,6 @@ #include #include -#include #include #include Index: sys/amd64/linux32/linux32_machdep.c =================================================================== --- sys/amd64/linux32/linux32_machdep.c +++ sys/amd64/linux32/linux32_machdep.c @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -61,7 +62,6 @@ #include #include #include -#include #include #include #include Index: sys/amd64/vmm/amd/svm.c =================================================================== --- sys/amd64/vmm/amd/svm.c +++ sys/amd64/vmm/amd/svm.c @@ -38,6 +38,7 @@ #include #include #include +#include #include #include @@ -47,7 +48,6 @@ #include #include #include -#include #include #include #include Index: sys/amd64/vmm/intel/vmx.c =================================================================== --- sys/amd64/vmm/intel/vmx.c +++ sys/amd64/vmm/intel/vmx.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -50,7 +51,6 @@ #include #include #include -#include #include #include #include Index: sys/arm/arm/debug_monitor.c =================================================================== --- sys/arm/arm/debug_monitor.c +++ sys/arm/arm/debug_monitor.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -44,7 +45,6 @@ #include #include #include -#include #include #include Index: sys/arm/arm/machdep_kdb.c =================================================================== --- sys/arm/arm/machdep_kdb.c +++ sys/arm/arm/machdep_kdb.c @@ -35,10 +35,10 @@ #include #include +#include #include #include -#include #ifdef DDB #include Index: sys/arm/include/reg.h =================================================================== --- sys/arm/include/reg.h +++ sys/arm/include/reg.h @@ -30,13 +30,4 @@ unsigned int dbg_wvr[ARM_WR_MAX]; /* Watchpoint Value Registers */ }; -#ifdef _KERNEL -int fill_regs(struct thread *, struct reg *); -int set_regs(struct thread *, struct reg *); -int fill_fpregs(struct thread *, struct fpreg *); -int set_fpregs(struct thread *, struct fpreg *); -int fill_dbregs(struct thread *, struct dbreg *); -int set_dbregs(struct thread *, struct dbreg *); -#endif - #endif /* !MACHINE_REG_H */ Index: sys/arm64/arm64/machdep.c =================================================================== --- sys/arm64/arm64/machdep.c +++ sys/arm64/arm64/machdep.c @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include @@ -82,7 +83,6 @@ #include #include #include -#include #include #include Index: sys/arm64/include/reg.h =================================================================== --- sys/arm64/include/reg.h +++ sys/arm64/include/reg.h @@ -83,24 +83,4 @@ #define __HAVE_REG32 -#ifdef _KERNEL -/* - * XXX these interfaces are MI, so they should be declared in a MI place. - */ -int fill_regs(struct thread *, struct reg *); -int set_regs(struct thread *, struct reg *); -int fill_fpregs(struct thread *, struct fpreg *); -int set_fpregs(struct thread *, struct fpreg *); -int fill_dbregs(struct thread *, struct dbreg *); -int set_dbregs(struct thread *, struct dbreg *); -#ifdef COMPAT_FREEBSD32 -int fill_regs32(struct thread *, struct reg32 *); -int set_regs32(struct thread *, struct reg32 *); -int fill_fpregs32(struct thread *, struct fpreg32 *); -int set_fpregs32(struct thread *, struct fpreg32 *); -int fill_dbregs32(struct thread *, struct dbreg32 *); -int set_dbregs32(struct thread *, struct dbreg32 *); -#endif -#endif - #endif /* !_MACHINE_REG_H_ */ Index: sys/arm64/linux/linux_machdep.c =================================================================== --- sys/arm64/linux/linux_machdep.c +++ sys/arm64/linux/linux_machdep.c @@ -36,12 +36,11 @@ #include #include #include +#include #include #include -#include - #include #include #include Index: sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c =================================================================== --- sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c +++ sys/cddl/contrib/opensolaris/uts/intel/dtrace/fasttrap_isa.c @@ -36,11 +36,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include Index: sys/cddl/dev/dtrace/aarch64/dtrace_isa.c =================================================================== --- sys/cddl/dev/dtrace/aarch64/dtrace_isa.c +++ sys/cddl/dev/dtrace/aarch64/dtrace_isa.c @@ -35,7 +35,6 @@ #include #include -#include #include #include Index: sys/cddl/dev/dtrace/amd64/dtrace_isa.c =================================================================== --- sys/cddl/dev/dtrace/amd64/dtrace_isa.c +++ sys/cddl/dev/dtrace/amd64/dtrace_isa.c @@ -35,7 +35,6 @@ #include #include -#include #include #include Index: sys/cddl/dev/dtrace/arm/dtrace_isa.c =================================================================== --- sys/cddl/dev/dtrace/arm/dtrace_isa.c +++ sys/cddl/dev/dtrace/arm/dtrace_isa.c @@ -35,7 +35,6 @@ #include #include -#include #include #include Index: sys/cddl/dev/dtrace/mips/dtrace_isa.c =================================================================== --- sys/cddl/dev/dtrace/mips/dtrace_isa.c +++ sys/cddl/dev/dtrace/mips/dtrace_isa.c @@ -35,7 +35,6 @@ #include #include -#include #include #include Index: sys/cddl/dev/dtrace/powerpc/dtrace_isa.c =================================================================== --- sys/cddl/dev/dtrace/powerpc/dtrace_isa.c +++ sys/cddl/dev/dtrace/powerpc/dtrace_isa.c @@ -39,7 +39,6 @@ #include #include #include -#include #include #include Index: sys/cddl/dev/dtrace/riscv/dtrace_isa.c =================================================================== --- sys/cddl/dev/dtrace/riscv/dtrace_isa.c +++ sys/cddl/dev/dtrace/riscv/dtrace_isa.c @@ -37,7 +37,6 @@ #include #include -#include #include #include Index: sys/compat/linux/linux_elf.c =================================================================== --- sys/compat/linux/linux_elf.c +++ sys/compat/linux/linux_elf.c @@ -49,6 +49,7 @@ #include #include #include +#include #include #include #include Index: sys/ddb/db_run.c =================================================================== --- sys/ddb/db_run.c +++ sys/ddb/db_run.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include Index: sys/fs/procfs/procfs_dbregs.c =================================================================== --- sys/fs/procfs/procfs_dbregs.c +++ sys/fs/procfs/procfs_dbregs.c @@ -54,8 +54,6 @@ #include #include -#include - #include #include Index: sys/fs/procfs/procfs_fpregs.c =================================================================== --- sys/fs/procfs/procfs_fpregs.c +++ sys/fs/procfs/procfs_fpregs.c @@ -48,8 +48,6 @@ #include #include -#include - #include #include Index: sys/fs/procfs/procfs_regs.c =================================================================== --- sys/fs/procfs/procfs_regs.c +++ sys/fs/procfs/procfs_regs.c @@ -48,8 +48,6 @@ #include #include -#include - #include #include Index: sys/i386/i386/db_trace.c =================================================================== --- sys/i386/i386/db_trace.c +++ sys/i386/i386/db_trace.c @@ -31,13 +31,13 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include Index: sys/i386/i386/gdb_machdep.c =================================================================== --- sys/i386/i386/gdb_machdep.c +++ sys/i386/i386/gdb_machdep.c @@ -34,13 +34,13 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include Index: sys/i386/i386/machdep.c =================================================================== --- sys/i386/i386/machdep.c +++ sys/i386/i386/machdep.c @@ -82,6 +82,7 @@ #include #include #include +#include #include #include #include @@ -129,7 +130,6 @@ #include #include #include -#include #include #include #include Index: sys/i386/include/db_machdep.h =================================================================== --- sys/i386/include/db_machdep.h +++ sys/i386/include/db_machdep.h @@ -30,7 +30,6 @@ #define _MACHINE_DB_MACHDEP_H_ #include -#include #include typedef vm_offset_t db_addr_t; /* address - unsigned */ Index: sys/i386/linux/linux_ptrace.c =================================================================== --- sys/i386/linux/linux_ptrace.c +++ sys/i386/linux/linux_ptrace.c @@ -41,7 +41,6 @@ #include #include -#include #include #include Index: sys/kern/imgact_elf.c =================================================================== --- sys/kern/imgact_elf.c +++ sys/kern/imgact_elf.c @@ -54,6 +54,7 @@ #include #include #include +#include #include #include #include Index: sys/kern/kern_exec.c =================================================================== --- sys/kern/kern_exec.c +++ sys/kern/kern_exec.c @@ -56,6 +56,7 @@ #include #include #include +#include #include #include #include @@ -91,8 +92,6 @@ #include #endif -#include - #include #include Index: sys/kern/sys_process.c =================================================================== --- sys/kern/sys_process.c +++ sys/kern/sys_process.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -54,8 +55,6 @@ #include #include -#include - #include #include Index: sys/mips/include/md_var.h =================================================================== --- sys/mips/include/md_var.h +++ sys/mips/include/md_var.h @@ -36,7 +36,7 @@ #ifndef _MACHINE_MD_VAR_H_ #define _MACHINE_MD_VAR_H_ -#include +#include /* * Miscellaneous machine-dependent declarations. Index: sys/mips/include/reg.h =================================================================== --- sys/mips/include/reg.h +++ sys/mips/include/reg.h @@ -85,23 +85,7 @@ #define __HAVE_REG32 #endif -#ifdef _KERNEL -int fill_fpregs(struct thread *, struct fpreg *); -int fill_regs(struct thread *, struct reg *); -int set_fpregs(struct thread *, struct fpreg *); -int set_regs(struct thread *, struct reg *); -int fill_dbregs(struct thread *, struct dbreg *); -int set_dbregs(struct thread *, struct dbreg *); -#endif - #ifdef COMPAT_FREEBSD32 -struct image_params; - -int fill_regs32(struct thread *, struct reg32 *); -int set_regs32(struct thread *, struct reg32 *); -int fill_fpregs32(struct thread *, struct fpreg32 *); -int set_fpregs32(struct thread *, struct fpreg32 *); - #define fill_dbregs32(td, reg) 0 #define set_dbregs32(td, reg) 0 #endif Index: sys/mips/mips/freebsd32_machdep.c =================================================================== --- sys/mips/mips/freebsd32_machdep.c +++ sys/mips/mips/freebsd32_machdep.c @@ -48,6 +48,7 @@ #include #include #include +#include #include #include #include @@ -60,7 +61,6 @@ #include #include -#include #include #include #include Index: sys/mips/mips/gdb_machdep.c =================================================================== --- sys/mips/mips/gdb_machdep.c +++ sys/mips/mips/gdb_machdep.c @@ -101,7 +101,6 @@ #include #include -#include #include #include Index: sys/mips/mips/machdep.c =================================================================== --- sys/mips/mips/machdep.c +++ sys/mips/mips/machdep.c @@ -60,6 +60,7 @@ #include #include #include +#include #include #include #include Index: sys/mips/mips/pm_machdep.c =================================================================== --- sys/mips/mips/pm_machdep.c +++ sys/mips/mips/pm_machdep.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -62,7 +63,6 @@ #include #include #include -#include #include #include #include Index: sys/mips/nlm/cms.c =================================================================== --- sys/mips/nlm/cms.c +++ sys/mips/nlm/cms.c @@ -51,7 +51,6 @@ #include #include -#include #include #include #include Index: sys/mips/nlm/dev/net/xlpge.c =================================================================== --- sys/mips/nlm/dev/net/xlpge.c +++ sys/mips/nlm/dev/net/xlpge.c @@ -69,7 +69,6 @@ #include #include -#include #include #include #include Index: sys/powerpc/aim/aim_machdep.c =================================================================== --- sys/powerpc/aim/aim_machdep.c +++ sys/powerpc/aim/aim_machdep.c @@ -118,7 +118,6 @@ #include #include #include -#include #include #include #include Index: sys/powerpc/booke/booke_machdep.c =================================================================== --- sys/powerpc/booke/booke_machdep.c +++ sys/powerpc/booke/booke_machdep.c @@ -122,7 +122,6 @@ #include #include -#include #include #include #include Index: sys/powerpc/fpu/fpu_add.c =================================================================== --- sys/powerpc/fpu/fpu_add.c +++ sys/powerpc/fpu/fpu_add.c @@ -56,7 +56,6 @@ #include #include -#include #include #include Index: sys/powerpc/fpu/fpu_compare.c =================================================================== --- sys/powerpc/fpu/fpu_compare.c +++ sys/powerpc/fpu/fpu_compare.c @@ -56,7 +56,6 @@ #include #include -#include #include #include Index: sys/powerpc/fpu/fpu_div.c =================================================================== --- sys/powerpc/fpu/fpu_div.c +++ sys/powerpc/fpu/fpu_div.c @@ -53,7 +53,6 @@ #include #include -#include #include #include Index: sys/powerpc/fpu/fpu_emu.c =================================================================== --- sys/powerpc/fpu/fpu_emu.c +++ sys/powerpc/fpu/fpu_emu.c @@ -93,7 +93,6 @@ #include #include -#include #include #include Index: sys/powerpc/fpu/fpu_implode.c =================================================================== --- sys/powerpc/fpu/fpu_implode.c +++ sys/powerpc/fpu/fpu_implode.c @@ -56,7 +56,6 @@ #include #include #include -#include #include #include Index: sys/powerpc/fpu/fpu_mul.c =================================================================== --- sys/powerpc/fpu/fpu_mul.c +++ sys/powerpc/fpu/fpu_mul.c @@ -53,7 +53,6 @@ #include #include -#include #include #include Index: sys/powerpc/fpu/fpu_sqrt.c =================================================================== --- sys/powerpc/fpu/fpu_sqrt.c +++ sys/powerpc/fpu/fpu_sqrt.c @@ -53,7 +53,6 @@ #include #include -#include #include #include Index: sys/powerpc/fpu/fpu_subr.c =================================================================== --- sys/powerpc/fpu/fpu_subr.c +++ sys/powerpc/fpu/fpu_subr.c @@ -53,7 +53,6 @@ #include #include -#include #include #include Index: sys/powerpc/powerpc/elf32_machdep.c =================================================================== --- sys/powerpc/powerpc/elf32_machdep.c +++ sys/powerpc/powerpc/elf32_machdep.c @@ -42,6 +42,7 @@ #include #include #include +#include #include #include #include @@ -56,7 +57,6 @@ #include #include #include -#include #include #include Index: sys/powerpc/powerpc/exec_machdep.c =================================================================== --- sys/powerpc/powerpc/exec_machdep.c +++ sys/powerpc/powerpc/exec_machdep.c @@ -76,6 +76,7 @@ #include #include #include +#include #include #include #include @@ -89,7 +90,6 @@ #include #include #include -#include #include #include #include Index: sys/powerpc/powerpc/gdb_machdep.c =================================================================== --- sys/powerpc/powerpc/gdb_machdep.c +++ sys/powerpc/powerpc/gdb_machdep.c @@ -38,7 +38,6 @@ #include #include -#include #include #include Index: sys/powerpc/powerpc/machdep.c =================================================================== --- sys/powerpc/powerpc/machdep.c +++ sys/powerpc/powerpc/machdep.c @@ -83,6 +83,7 @@ #include #include #include +#include #include #include #include @@ -119,7 +120,6 @@ #include #include #include -#include #include #include #include Index: sys/riscv/include/reg.h =================================================================== --- sys/riscv/include/reg.h +++ sys/riscv/include/reg.h @@ -58,16 +58,4 @@ int dummy; }; -#ifdef _KERNEL -/* - * XXX these interfaces are MI, so they should be declared in a MI place. - */ -int fill_regs(struct thread *, struct reg *); -int set_regs(struct thread *, struct reg *); -int fill_fpregs(struct thread *, struct fpreg *); -int set_fpregs(struct thread *, struct fpreg *); -int fill_dbregs(struct thread *, struct dbreg *); -int set_dbregs(struct thread *, struct dbreg *); -#endif - #endif /* !_MACHINE_REG_H_ */ Index: sys/riscv/riscv/machdep.c =================================================================== --- sys/riscv/riscv/machdep.c +++ sys/riscv/riscv/machdep.c @@ -59,6 +59,7 @@ #include #include #include +#include #include #include #include @@ -86,7 +87,6 @@ #include #include #include -#include #include #include #include Index: sys/sys/reg.h =================================================================== --- sys/sys/reg.h +++ sys/sys/reg.h @@ -1,10 +1,11 @@ /*- - * Copyright (c) 2014 Andrew Turner - * Copyright (c) 2014-2015 The FreeBSD Foundation - * All rights reserved. + * SPDX-License-Identifier: BSD-2-Clause-FreeBSD * - * This software was developed by Andrew Turner under - * sponsorship from the FreeBSD Foundation. + * Copyright (C) 2019 Andrew Turner + * + * This software was developed by SRI International and the University of + * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-10-C-0237 + * ("CTSRD"), as part of the DARPA CRASH research programme. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -30,63 +31,12 @@ * $FreeBSD$ */ -#ifndef _MACHINE_REG_H_ -#define _MACHINE_REG_H_ - -struct reg { - uint64_t x[30]; - uint64_t lr; - uint64_t sp; - uint64_t elr; - uint32_t spsr; -}; - -struct reg32 { - unsigned int r[13]; - unsigned int r_sp; - unsigned int r_lr; - unsigned int r_pc; - unsigned int r_cpsr; -}; - -struct fpreg { - __uint128_t fp_q[32]; - uint32_t fp_sr; - uint32_t fp_cr; -}; - -struct fpreg32 { - int dummy; -}; - -struct dbreg { - uint8_t db_debug_ver; - uint8_t db_nbkpts; - uint8_t db_nwtpts; - uint8_t db_pad[5]; - - struct { - uint64_t dbr_addr; - uint32_t dbr_ctrl; - uint32_t dbr_pad; - } db_breakregs[16]; - struct { - uint64_t dbw_addr; - uint32_t dbw_ctrl; - uint32_t dbw_pad; - } db_watchregs[16]; -}; +#ifndef _SYS_REG_H_ +#define _SYS_REG_H_ -struct dbreg32 { - int dummy; -}; - -#define __HAVE_REG32 +#include #ifdef _KERNEL -/* - * XXX these interfaces are MI, so they should be declared in a MI place. - */ int fill_regs(struct thread *, struct reg *); int set_regs(struct thread *, struct reg *); int fill_fpregs(struct thread *, struct fpreg *); @@ -96,11 +46,19 @@ #ifdef COMPAT_FREEBSD32 int fill_regs32(struct thread *, struct reg32 *); int set_regs32(struct thread *, struct reg32 *); +#ifndef fill_fpregs32 int fill_fpregs32(struct thread *, struct fpreg32 *); +#endif +#ifndef set_fpregs32 int set_fpregs32(struct thread *, struct fpreg32 *); +#endif +#ifndef fill_dbregs32 int fill_dbregs32(struct thread *, struct dbreg32 *); +#endif +#ifndef set_dbregs32 int set_dbregs32(struct thread *, struct dbreg32 *); #endif #endif +#endif -#endif /* !_MACHINE_REG_H_ */ +#endif Index: sys/x86/include/reg.h =================================================================== --- sys/x86/include/reg.h +++ sys/x86/include/reg.h @@ -244,26 +244,10 @@ #undef __dbreg64 #ifdef _KERNEL -struct thread; - /* * XXX these interfaces are MI, so they should be declared in a MI place. */ -int fill_regs(struct thread *, struct reg *); int fill_frame_regs(struct trapframe *, struct reg *); -int set_regs(struct thread *, struct reg *); -int fill_fpregs(struct thread *, struct fpreg *); -int set_fpregs(struct thread *, struct fpreg *); -int fill_dbregs(struct thread *, struct dbreg *); -int set_dbregs(struct thread *, struct dbreg *); -#ifdef COMPAT_FREEBSD32 -int fill_regs32(struct thread *, struct reg32 *); -int set_regs32(struct thread *, struct reg32 *); -int fill_fpregs32(struct thread *, struct fpreg32 *); -int set_fpregs32(struct thread *, struct fpreg32 *); -int fill_dbregs32(struct thread *, struct dbreg32 *); -int set_dbregs32(struct thread *, struct dbreg32 *); -#endif #endif #endif /* !_MACHINE_REG_H_ */ Index: sys/x86/x86/dbreg.c =================================================================== --- sys/x86/x86/dbreg.c +++ sys/x86/x86/dbreg.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include