Create sys/reg.h for the common code previously in machine/reg.h

Move the common kernel function signatures from machine/reg.h to a new
sys/reg.h. This is in preperation for adding PT_GETREGSET to ptrace(2).

Reviewed by:	imp, markj
Sponsored by:	DARPA, AFRL (original work)
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D19830
This commit is contained in:
Andrew Turner 2021-08-27 09:38:40 +00:00
parent a947203221
commit b792434150
62 changed files with 97 additions and 129 deletions

View file

@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <sys/kdb.h>
#include <sys/proc.h>
#include <sys/reg.h>
#include <sys/smp.h>
#include <sys/stack.h>
#include <sys/sysent.h>
@ -38,7 +39,6 @@ __FBSDID("$FreeBSD$");
#include <machine/cpu.h>
#include <machine/md_var.h>
#include <machine/pcb.h>
#include <machine/reg.h>
#include <machine/stack.h>
#include <vm/vm.h>

View file

@ -34,6 +34,7 @@ __FBSDID("$FreeBSD$");
#include <sys/kdb.h>
#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/reg.h>
#include <sys/signal.h>
#include <machine/cpufunc.h>
@ -42,7 +43,6 @@ __FBSDID("$FreeBSD$");
#include <machine/md_var.h>
#include <machine/pcb.h>
#include <machine/psl.h>
#include <machine/reg.h>
#include <machine/specialreg.h>
#include <machine/trap.h>
#include <machine/frame.h>

View file

@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$");
#include <sys/pcpu.h>
#include <sys/ptrace.h>
#include <sys/reboot.h>
#include <sys/reg.h>
#include <sys/rwlock.h>
#include <sys/sched.h>
#include <sys/signalvar.h>
@ -129,7 +130,6 @@ __FBSDID("$FreeBSD$");
#include <machine/pc/bios.h>
#include <machine/pcb.h>
#include <machine/proc.h>
#include <machine/reg.h>
#include <machine/sigframe.h>
#include <machine/specialreg.h>
#include <machine/trap.h>

View file

@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$");
#include <sys/namei.h>
#include <sys/proc.h>
#include <sys/procfs.h>
#include <sys/reg.h>
#include <sys/resourcevar.h>
#include <sys/systm.h>
#include <sys/signalvar.h>

View file

@ -30,7 +30,6 @@
#define _MACHINE_DB_MACHDEP_H_
#include <machine/frame.h>
#include <machine/reg.h>
#include <machine/trap.h>
typedef vm_offset_t db_addr_t; /* address - unsigned */

View file

@ -40,7 +40,6 @@ __FBSDID("$FreeBSD$");
#include <sys/syscallsubr.h>
#include <machine/pcb.h>
#include <machine/reg.h>
#include <amd64/linux/linux.h>
#include <amd64/linux/linux_proto.h>

View file

@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$");
#include <sys/mutex.h>
#include <sys/priv.h>
#include <sys/proc.h>
#include <sys/reg.h>
#include <sys/resource.h>
#include <sys/resourcevar.h>
#include <sys/syscallsubr.h>
@ -61,7 +62,6 @@ __FBSDID("$FreeBSD$");
#include <machine/md_var.h>
#include <machine/pcb.h>
#include <machine/psl.h>
#include <machine/reg.h>
#include <machine/segments.h>
#include <machine/specialreg.h>
#include <x86/ifunc.h>

View file

@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
#include <sys/malloc.h>
#include <sys/pcpu.h>
#include <sys/proc.h>
#include <sys/reg.h>
#include <sys/smr.h>
#include <sys/sysctl.h>
@ -47,7 +48,6 @@ __FBSDID("$FreeBSD$");
#include <machine/cpufunc.h>
#include <machine/psl.h>
#include <machine/md_var.h>
#include <machine/reg.h>
#include <machine/specialreg.h>
#include <machine/smp.h>
#include <machine/vmm.h>

View file

@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
#include <sys/malloc.h>
#include <sys/pcpu.h>
#include <sys/proc.h>
#include <sys/reg.h>
#include <sys/smr.h>
#include <sys/sysctl.h>
@ -50,7 +51,6 @@ __FBSDID("$FreeBSD$");
#include <machine/psl.h>
#include <machine/cpufunc.h>
#include <machine/md_var.h>
#include <machine/reg.h>
#include <machine/segments.h>
#include <machine/smp.h>
#include <machine/specialreg.h>

View file

@ -35,6 +35,7 @@ __FBSDID("$FreeBSD$");
#include <sys/types.h>
#include <sys/kdb.h>
#include <sys/pcpu.h>
#include <sys/reg.h>
#include <sys/smp.h>
#include <sys/systm.h>
@ -44,7 +45,6 @@ __FBSDID("$FreeBSD$");
#include <machine/debug_monitor.h>
#include <machine/kdb.h>
#include <machine/pcb.h>
#include <machine/reg.h>
#include <ddb/ddb.h>
#include <ddb/db_access.h>

View file

@ -35,10 +35,10 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/reg.h>
#include <sys/systm.h>
#include <machine/cpu.h>
#include <machine/reg.h>
#ifdef DDB
#include <ddb/ddb.h>

View file

@ -30,13 +30,4 @@ struct dbreg {
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 */

View file

@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$");
#include <sys/proc.h>
#include <sys/ptrace.h>
#include <sys/reboot.h>
#include <sys/reg.h>
#include <sys/rwlock.h>
#include <sys/sched.h>
#include <sys/signalvar.h>
@ -82,7 +83,6 @@ __FBSDID("$FreeBSD$");
#include <machine/metadata.h>
#include <machine/md_var.h>
#include <machine/pcb.h>
#include <machine/reg.h>
#include <machine/undefined.h>
#include <machine/vmparam.h>

View file

@ -83,24 +83,4 @@ struct dbreg32 {
#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_ */

View file

@ -36,12 +36,11 @@ __FBSDID("$FreeBSD$");
#include <sys/imgact.h>
#include <sys/ktr.h>
#include <sys/proc.h>
#include <sys/reg.h>
#include <sys/sdt.h>
#include <security/audit/audit.h>
#include <machine/reg.h>
#include <arm64/linux/linux.h>
#include <arm64/linux/linux_proto.h>
#include <compat/linux/linux_dtrace.h>

View file

@ -36,11 +36,11 @@
#include <sys/types.h>
#include <sys/dtrace_bsd.h>
#include <sys/proc.h>
#include <sys/reg.h>
#include <sys/rmlock.h>
#include <cddl/dev/dtrace/dtrace_cddl.h>
#include <cddl/dev/dtrace/x86/regset.h>
#include <machine/segments.h>
#include <machine/reg.h>
#include <machine/pcb.h>
#include <machine/trap.h>
#include <sys/sysmacros.h>

View file

@ -35,7 +35,6 @@
#include <machine/frame.h>
#include <machine/md_var.h>
#include <machine/reg.h>
#include <vm/vm.h>
#include <vm/vm_param.h>

View file

@ -35,7 +35,6 @@
#include <machine/frame.h>
#include <machine/md_var.h>
#include <machine/reg.h>
#include <machine/stack.h>
#include <x86/ifunc.h>

View file

@ -35,7 +35,6 @@
#include <machine/frame.h>
#include <machine/md_var.h>
#include <machine/reg.h>
#include <vm/vm.h>
#include <vm/vm_param.h>

View file

@ -35,7 +35,6 @@
#include <machine/frame.h>
#include <machine/md_var.h>
#include <machine/reg.h>
#include <vm/vm.h>
#include <vm/vm_param.h>

View file

@ -39,7 +39,6 @@
#include <machine/frame.h>
#include <machine/md_var.h>
#include <machine/psl.h>
#include <machine/reg.h>
#include <machine/stack.h>
#include <vm/vm.h>

View file

@ -37,7 +37,6 @@
#include <machine/frame.h>
#include <machine/md_var.h>
#include <machine/reg.h>
#include <vm/vm.h>
#include <vm/vm_param.h>

View file

@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$");
#include <sys/proc.h>
#include <sys/procfs.h>
#include <sys/ptrace.h>
#include <sys/reg.h>
#include <sys/sbuf.h>
#include <sys/sysent.h>
#include <sys/user.h>

View file

@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/kdb.h>
#include <sys/proc.h>
#include <sys/reg.h>
#include <sys/systm.h>
#include <machine/kdb.h>

View file

@ -54,8 +54,6 @@
#include <sys/sysent.h>
#include <sys/uio.h>
#include <machine/reg.h>
#include <fs/pseudofs/pseudofs.h>
#include <fs/procfs/procfs.h>

View file

@ -48,8 +48,6 @@
#include <sys/sysent.h>
#include <sys/uio.h>
#include <machine/reg.h>
#include <fs/pseudofs/pseudofs.h>
#include <fs/procfs/procfs.h>

View file

@ -48,8 +48,6 @@
#include <sys/sysent.h>
#include <sys/uio.h>
#include <machine/reg.h>
#include <fs/pseudofs/pseudofs.h>
#include <fs/procfs/procfs.h>

View file

@ -31,13 +31,13 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <sys/kdb.h>
#include <sys/proc.h>
#include <sys/reg.h>
#include <sys/sysent.h>
#include <machine/cpu.h>
#include <machine/frame.h>
#include <machine/md_var.h>
#include <machine/pcb.h>
#include <machine/reg.h>
#include <machine/stack.h>
#include <vm/vm.h>

View file

@ -34,13 +34,13 @@ __FBSDID("$FreeBSD$");
#include <sys/kdb.h>
#include <sys/kernel.h>
#include <sys/proc.h>
#include <sys/reg.h>
#include <sys/signal.h>
#include <machine/endian.h>
#include <machine/frame.h>
#include <machine/gdb_machdep.h>
#include <machine/pcb.h>
#include <machine/reg.h>
#include <machine/trap.h>
#include <gdb/gdb.h>

View file

@ -82,6 +82,7 @@ __FBSDID("$FreeBSD$");
#include <sys/pcpu.h>
#include <sys/ptrace.h>
#include <sys/reboot.h>
#include <sys/reg.h>
#include <sys/rwlock.h>
#include <sys/sched.h>
#include <sys/signalvar.h>
@ -129,7 +130,6 @@ __FBSDID("$FreeBSD$");
#include <machine/pcb.h>
#include <machine/pcb_ext.h>
#include <machine/proc.h>
#include <machine/reg.h>
#include <machine/sigframe.h>
#include <machine/specialreg.h>
#include <machine/sysarch.h>

View file

@ -30,7 +30,6 @@
#define _MACHINE_DB_MACHDEP_H_
#include <machine/frame.h>
#include <machine/reg.h>
#include <machine/trap.h>
typedef vm_offset_t db_addr_t; /* address - unsigned */

View file

@ -41,7 +41,6 @@ __FBSDID("$FreeBSD$");
#include <machine/md_var.h>
#include <machine/pcb.h>
#include <machine/reg.h>
#include <i386/linux/linux.h>
#include <i386/linux/linux_proto.h>

View file

@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$");
#include <sys/procfs.h>
#include <sys/ptrace.h>
#include <sys/racct.h>
#include <sys/reg.h>
#include <sys/resourcevar.h>
#include <sys/rwlock.h>
#include <sys/sbuf.h>

View file

@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$");
#include <sys/priv.h>
#include <sys/proc.h>
#include <sys/ptrace.h>
#include <sys/reg.h>
#include <sys/resourcevar.h>
#include <sys/rwlock.h>
#include <sys/sched.h>
@ -91,8 +92,6 @@ __FBSDID("$FreeBSD$");
#include <sys/pmckern.h>
#endif
#include <machine/reg.h>
#include <security/audit/audit.h>
#include <security/mac/mac_framework.h>

View file

@ -40,6 +40,7 @@ __FBSDID("$FreeBSD$");
#include <sys/limits.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/reg.h>
#include <sys/syscallsubr.h>
#include <sys/sysent.h>
#include <sys/sysproto.h>
@ -54,8 +55,6 @@ __FBSDID("$FreeBSD$");
#include <sys/caprights.h>
#include <sys/filedesc.h>
#include <machine/reg.h>
#include <security/audit/audit.h>
#include <vm/vm.h>

View file

@ -36,7 +36,7 @@
#ifndef _MACHINE_MD_VAR_H_
#define _MACHINE_MD_VAR_H_
#include <machine/reg.h>
#include <machine/regnum.h>
/*
* Miscellaneous machine-dependent declarations.

View file

@ -85,23 +85,7 @@ struct dbreg32 {
#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

View file

@ -48,6 +48,7 @@
#include <sys/fcntl.h>
#include <sys/sysent.h>
#include <sys/imgact_elf.h>
#include <sys/reg.h>
#include <sys/syscall.h>
#include <sys/syscallsubr.h>
#include <sys/sysproto.h>
@ -60,7 +61,6 @@
#include <machine/cpuinfo.h>
#include <machine/md_var.h>
#include <machine/reg.h>
#include <machine/sigframe.h>
#include <machine/sysarch.h>
#include <machine/tls.h>

View file

@ -101,7 +101,6 @@
#include <machine/gdb_machdep.h>
#include <machine/pcb.h>
#include <machine/reg.h>
#include <machine/trap.h>
#include <gdb/gdb.h>

View file

@ -60,6 +60,7 @@ __FBSDID("$FreeBSD$");
#include <sys/mbuf.h>
#include <sys/msgbuf.h>
#include <sys/reboot.h>
#include <sys/reg.h>
#include <sys/rwlock.h>
#include <sys/sched.h>
#include <sys/sysctl.h>

View file

@ -44,6 +44,7 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <sys/sysent.h>
#include <sys/proc.h>
#include <sys/reg.h>
#include <sys/signalvar.h>
#include <sys/exec.h>
#include <sys/ktr.h>
@ -62,7 +63,6 @@ __FBSDID("$FreeBSD$");
#include <sys/uio.h>
#include <machine/abi.h>
#include <machine/cpuinfo.h>
#include <machine/reg.h>
#include <machine/md_var.h>
#include <machine/sigframe.h>
#include <machine/tls.h>

View file

@ -51,7 +51,6 @@ __FBSDID("$FreeBSD$");
#include <sys/sysctl.h>
#include <sys/malloc.h>
#include <machine/reg.h>
#include <machine/cpu.h>
#include <machine/hwfunc.h>
#include <machine/mips_opcode.h>

View file

@ -69,7 +69,6 @@ __FBSDID("$FreeBSD$");
#include <vm/pmap.h>
#include <vm/uma.h>
#include <machine/reg.h>
#include <machine/cpu.h>
#include <machine/mips_opcode.h>
#include <machine/asm.h>

View file

@ -118,7 +118,6 @@ __FBSDID("$FreeBSD$");
#include <machine/metadata.h>
#include <machine/mmuvar.h>
#include <machine/pcb.h>
#include <machine/reg.h>
#include <machine/sigframe.h>
#include <machine/spr.h>
#include <machine/trap.h>

View file

@ -122,7 +122,6 @@ __FBSDID("$FreeBSD$");
#include <machine/cpu.h>
#include <machine/kdb.h>
#include <machine/reg.h>
#include <machine/vmparam.h>
#include <machine/spr.h>
#include <machine/hid.h>

View file

@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$");
#include <machine/fpu.h>
#include <machine/ieeefp.h>
#include <machine/reg.h>
#include <powerpc/fpu/fpu_arith.h>
#include <powerpc/fpu/fpu_emu.h>

View file

@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <machine/fpu.h>
#include <machine/reg.h>
#include <powerpc/fpu/fpu_arith.h>
#include <powerpc/fpu/fpu_emu.h>

View file

@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <machine/fpu.h>
#include <machine/reg.h>
#include <powerpc/fpu/fpu_arith.h>
#include <powerpc/fpu/fpu_emu.h>

View file

@ -93,7 +93,6 @@ __FBSDID("$FreeBSD$");
#include <sys/signalvar.h>
#include <machine/fpu.h>
#include <machine/reg.h>
#include <powerpc/fpu/fpu_emu.h>
#include <powerpc/fpu/fpu_extern.h>

View file

@ -56,7 +56,6 @@ __FBSDID("$FreeBSD$");
#include <machine/fpu.h>
#include <machine/ieee.h>
#include <machine/ieeefp.h>
#include <machine/reg.h>
#include <powerpc/fpu/fpu_arith.h>
#include <powerpc/fpu/fpu_emu.h>

View file

@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <machine/fpu.h>
#include <machine/reg.h>
#include <powerpc/fpu/fpu_arith.h>
#include <powerpc/fpu/fpu_emu.h>

View file

@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <machine/fpu.h>
#include <machine/reg.h>
#include <powerpc/fpu/fpu_arith.h>
#include <powerpc/fpu/fpu_emu.h>

View file

@ -53,7 +53,6 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <machine/fpu.h>
#include <machine/reg.h>
#include <powerpc/fpu/fpu_arith.h>
#include <powerpc/fpu/fpu_emu.h>

View file

@ -42,6 +42,7 @@
#include <sys/sysent.h>
#include <sys/imgact_elf.h>
#include <sys/jail.h>
#include <sys/reg.h>
#include <sys/smp.h>
#include <sys/syscall.h>
#include <sys/sysctl.h>
@ -56,7 +57,6 @@
#include <machine/cpu.h>
#include <machine/fpu.h>
#include <machine/elf.h>
#include <machine/reg.h>
#include <machine/md_var.h>
#include <powerpc/powerpc/elf_common.c>

View file

@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$");
#include <sys/lock.h>
#include <sys/malloc.h>
#include <sys/mutex.h>
#include <sys/reg.h>
#include <sys/signalvar.h>
#include <sys/syscallsubr.h>
#include <sys/syscall.h>
@ -89,7 +90,6 @@ __FBSDID("$FreeBSD$");
#include <machine/elf.h>
#include <machine/fpu.h>
#include <machine/pcb.h>
#include <machine/reg.h>
#include <machine/sigframe.h>
#include <machine/trap.h>
#include <machine/vmparam.h>

View file

@ -38,7 +38,6 @@ __FBSDID("$FreeBSD$");
#include <machine/gdb_machdep.h>
#include <machine/pcb.h>
#include <machine/reg.h>
#include <machine/hid.h>
#include <machine/spr.h>

View file

@ -83,6 +83,7 @@ __FBSDID("$FreeBSD$");
#include <sys/mutex.h>
#include <sys/ptrace.h>
#include <sys/reboot.h>
#include <sys/reg.h>
#include <sys/rwlock.h>
#include <sys/signalvar.h>
#include <sys/syscallsubr.h>
@ -119,7 +120,6 @@ __FBSDID("$FreeBSD$");
#include <machine/metadata.h>
#include <machine/mmuvar.h>
#include <machine/pcb.h>
#include <machine/reg.h>
#include <machine/sigframe.h>
#include <machine/spr.h>
#include <machine/trap.h>

View file

@ -58,16 +58,4 @@ struct dbreg {
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_ */

View file

@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$");
#include <sys/proc.h>
#include <sys/ptrace.h>
#include <sys/reboot.h>
#include <sys/reg.h>
#include <sys/rwlock.h>
#include <sys/sched.h>
#include <sys/signalvar.h>
@ -86,7 +87,6 @@ __FBSDID("$FreeBSD$");
#include <machine/metadata.h>
#include <machine/pcb.h>
#include <machine/pte.h>
#include <machine/reg.h>
#include <machine/riscvreg.h>
#include <machine/sbi.h>
#include <machine/trap.h>

68
sys/sys/reg.h Normal file
View file

@ -0,0 +1,68 @@
/*-
* SPDX-License-Identifier: BSD-2-Clause-FreeBSD
*
* Copyright (C) 2014,2019 Andrew Turner
* Copyright (c) 2014-2015 The FreeBSD Foundation
*
* This software was developed by Andrew Turner under
* sponsorship from the FreeBSD Foundation.
*
* 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
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $FreeBSD$
*/
#ifndef _SYS_REG_H_
#define _SYS_REG_H_
#include <machine/reg.h>
#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 *);
#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

View file

@ -244,26 +244,10 @@ struct __dbreg64 {
#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_ */

View file

@ -29,6 +29,7 @@
#include <sys/types.h>
#include <sys/kdb.h>
#include <sys/pcpu.h>
#include <sys/reg.h>
#include <sys/smp.h>
#include <sys/systm.h>