summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorPhilip Guenther <guenther@cvs.openbsd.org>2015-05-05 02:13:48 +0000
committerPhilip Guenther <guenther@cvs.openbsd.org>2015-05-05 02:13:48 +0000
commit40b409238afa7889605830c063f16b4d731eaec2 (patch)
tree07026cd7c5b72f5fe0c6ee04fa46812bcb5229c4 /sys/arch
parent8b8ca5671214b412eb81645a853cca97bd0c4963 (diff)
emul_native is only used for kernel threads which can't dump core, so
delete coredump_trad(), uvm_coredump(), cpu_coredump(), struct md_coredump, and various #includes that are superfluous. This leaves compat_linux processes without a coredump callback. If that ability is desired, someone should update it to use coredump_elf32() and verify the results... ok kettenis@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/alpha/alpha/vm_machdep.c50
-rw-r--r--sys/arch/alpha/include/pcb.h12
-rw-r--r--sys/arch/amd64/amd64/hibernate_machdep.c3
-rw-r--r--sys/arch/amd64/amd64/vm_machdep.c53
-rw-r--r--sys/arch/amd64/include/pcb.h10
-rw-r--r--sys/arch/arm/arm/vm_machdep.c52
-rw-r--r--sys/arch/arm/include/pcb.h9
-rw-r--r--sys/arch/armish/armish/armish_machdep.c3
-rw-r--r--sys/arch/hppa/hppa/vm_machdep.c44
-rw-r--r--sys/arch/hppa/include/pcb.h8
-rw-r--r--sys/arch/hppa64/hppa64/vm_machdep.c44
-rw-r--r--sys/arch/hppa64/include/pcb.h8
-rw-r--r--sys/arch/i386/i386/vm_machdep.c53
-rw-r--r--sys/arch/i386/include/pcb.h10
-rw-r--r--sys/arch/loongson/loongson/hibernate_machdep.c3
-rw-r--r--sys/arch/loongson/loongson/machdep.c3
-rw-r--r--sys/arch/m88k/include/pcb.h12
-rw-r--r--sys/arch/m88k/m88k/vm_machdep.c46
-rw-r--r--sys/arch/mips64/include/pcb.h10
-rw-r--r--sys/arch/mips64/mips64/vm_machdep.c52
-rw-r--r--sys/arch/powerpc/include/pcb.h6
-rw-r--r--sys/arch/powerpc/powerpc/vm_machdep.c40
-rw-r--r--sys/arch/sh/include/pcb.h5
-rw-r--r--sys/arch/sh/sh/sh_machdep.c4
-rw-r--r--sys/arch/sh/sh/vm_machdep.c60
-rw-r--r--sys/arch/sparc/include/pcb.h14
-rw-r--r--sys/arch/sparc/sparc/vm_machdep.c49
-rw-r--r--sys/arch/sparc64/include/pcb.h14
-rw-r--r--sys/arch/sparc64/sparc64/vm_machdep.c50
-rw-r--r--sys/arch/vax/include/pcb.h7
-rw-r--r--sys/arch/vax/vax/vm_machdep.c53
-rw-r--r--sys/arch/zaurus/zaurus/zaurus_machdep.c3
32 files changed, 32 insertions, 758 deletions
diff --git a/sys/arch/alpha/alpha/vm_machdep.c b/sys/arch/alpha/alpha/vm_machdep.c
index ef712b325b6..26385a93044 100644
--- a/sys/arch/alpha/alpha/vm_machdep.c
+++ b/sys/arch/alpha/alpha/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.42 2014/11/16 12:30:52 deraadt Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.43 2015/05/05 02:13:46 guenther Exp $ */
/* $NetBSD: vm_machdep.c,v 1.55 2000/03/29 03:49:48 simonb Exp $ */
/*
@@ -36,7 +36,6 @@
#include <sys/buf.h>
#include <sys/vnode.h>
#include <sys/user.h>
-#include <sys/core.h>
#include <sys/exec.h>
#include <uvm/uvm_extern.h>
@@ -47,53 +46,6 @@
/*
- * Dump the machine specific header information at the start of a core dump.
- */
-int
-cpu_coredump(p, vp, cred, chdr)
- struct proc *p;
- struct vnode *vp;
- struct ucred *cred;
- struct core *chdr;
-{
- int error;
- struct md_coredump cpustate;
- struct coreseg cseg;
-
- CORE_SETMAGIC(*chdr, COREMAGIC, MID_ALPHA, 0);
- chdr->c_hdrsize = ALIGN(sizeof(*chdr));
- chdr->c_seghdrsize = ALIGN(sizeof(cseg));
- chdr->c_cpusize = sizeof(cpustate);
-
- cpustate.md_tf = *p->p_md.md_tf;
- cpustate.md_tf.tf_regs[FRAME_SP] = alpha_pal_rdusp(); /* XXX */
- if (p->p_md.md_flags & MDP_FPUSED) {
- if (p->p_addr->u_pcb.pcb_fpcpu != NULL)
- fpusave_proc(p, 1);
- cpustate.md_fpstate = p->p_addr->u_pcb.pcb_fp;
- } else
- bzero(&cpustate.md_fpstate, sizeof(cpustate.md_fpstate));
-
- CORE_SETMAGIC(cseg, CORESEGMAGIC, MID_ALPHA, CORE_CPU);
- cseg.c_addr = 0;
- cseg.c_size = chdr->c_cpusize;
-
- error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cseg, chdr->c_seghdrsize,
- (off_t)chdr->c_hdrsize, UIO_SYSSPACE, IO_UNIT, cred, NULL, p);
- if (error)
- return error;
-
- error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cpustate, sizeof(cpustate),
- (off_t)(chdr->c_hdrsize + chdr->c_seghdrsize), UIO_SYSSPACE,
- IO_UNIT, cred, NULL, p);
-
- if (!error)
- chdr->c_nseg++;
-
- return error;
-}
-
-/*
* cpu_exit is called as the last action during exit.
*/
void
diff --git a/sys/arch/alpha/include/pcb.h b/sys/arch/alpha/include/pcb.h
index 6b5528852f2..97fa2d77b09 100644
--- a/sys/arch/alpha/include/pcb.h
+++ b/sys/arch/alpha/include/pcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcb.h,v 1.10 2014/03/29 18:09:28 guenther Exp $ */
+/* $OpenBSD: pcb.h,v 1.11 2015/05/05 02:13:46 guenther Exp $ */
/* $NetBSD: pcb.h,v 1.5 1996/11/13 22:21:00 cgd Exp $ */
/*
@@ -57,16 +57,6 @@ struct pcb {
struct cpu_info *volatile pcb_fpcpu; /* CPU with our FP state[SW] */
};
-/*
- * The pcb is augmented with machine-dependent additional data for
- * core dumps. For the Alpha, that's a trap frame and the floating
- * point registers.
- */
-struct md_coredump {
- struct trapframe md_tf;
- struct fpreg md_fpstate;
-};
-
#ifdef _KERNEL
void savectx(struct pcb *);
#endif
diff --git a/sys/arch/amd64/amd64/hibernate_machdep.c b/sys/arch/amd64/amd64/hibernate_machdep.c
index 4921343b70d..37b57d8ec8c 100644
--- a/sys/arch/amd64/amd64/hibernate_machdep.c
+++ b/sys/arch/amd64/amd64/hibernate_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hibernate_machdep.c,v 1.36 2015/03/14 03:38:46 jsg Exp $ */
+/* $OpenBSD: hibernate_machdep.c,v 1.37 2015/05/05 02:13:46 guenther Exp $ */
/*
* Copyright (c) 2012 Mike Larkin <mlarkin@openbsd.org>
@@ -35,7 +35,6 @@
#include <machine/cpu.h>
#include <machine/hibernate_var.h>
-#include <machine/kcore.h>
#include <machine/pte.h>
#include <machine/pmap.h>
diff --git a/sys/arch/amd64/amd64/vm_machdep.c b/sys/arch/amd64/amd64/vm_machdep.c
index eb609a4a987..52d0c5037f1 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.30 2015/03/14 03:38:46 jsg Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.31 2015/05/05 02:13:46 guenther Exp $ */
/* $NetBSD: vm_machdep.c,v 1.1 2003/04/26 18:39:33 fvdl Exp $ */
/*-
@@ -49,7 +49,6 @@
#include <sys/vnode.h>
#include <sys/buf.h>
#include <sys/user.h>
-#include <sys/core.h>
#include <sys/exec.h>
#include <sys/ptrace.h>
#include <sys/signalvar.h>
@@ -153,56 +152,6 @@ cpu_exit(struct proc *p)
}
/*
- * Dump the machine specific segment at the start of a core dump.
- */
-struct md_core {
- struct reg intreg;
- struct fpreg freg;
-};
-
-int
-cpu_coredump(struct proc *p, struct vnode *vp, struct ucred *cred,
- struct core *chdr)
-{
- struct md_core md_core;
- struct coreseg cseg;
- int error;
-
- CORE_SETMAGIC(*chdr, COREMAGIC, MID_MACHINE, 0);
- chdr->c_hdrsize = ALIGN(sizeof(*chdr));
- chdr->c_seghdrsize = ALIGN(sizeof(cseg));
- chdr->c_cpusize = sizeof(md_core);
-
- /* Save integer registers. */
- error = process_read_regs(p, &md_core.intreg);
- if (error)
- return error;
-
- /* Save floating point registers. */
- error = process_read_fpregs(p, &md_core.freg);
- if (error)
- return error;
-
- CORE_SETMAGIC(cseg, CORESEGMAGIC, MID_MACHINE, CORE_CPU);
- cseg.c_addr = 0;
- cseg.c_size = chdr->c_cpusize;
-
- error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cseg, chdr->c_seghdrsize,
- (off_t)chdr->c_hdrsize, UIO_SYSSPACE, IO_UNIT, cred, NULL, p);
- if (error)
- return error;
-
- error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&md_core, sizeof(md_core),
- (off_t)(chdr->c_hdrsize + chdr->c_seghdrsize), UIO_SYSSPACE,
- IO_UNIT, cred, NULL, p);
- if (error)
- return error;
-
- chdr->c_nseg++;
- return 0;
-}
-
-/*
* Set a red zone in the kernel stack after the u. area.
*/
void
diff --git a/sys/arch/amd64/include/pcb.h b/sys/arch/amd64/include/pcb.h
index 5bf1ab856f0..85efc564252 100644
--- a/sys/arch/amd64/include/pcb.h
+++ b/sys/arch/amd64/include/pcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcb.h,v 1.12 2011/07/10 18:12:03 deraadt Exp $ */
+/* $OpenBSD: pcb.h,v 1.13 2015/05/05 02:13:46 guenther Exp $ */
/* $NetBSD: pcb.h,v 1.1 2003/04/26 18:39:45 fvdl Exp $ */
/*-
@@ -89,12 +89,4 @@ struct pcb {
int pcb_cr0; /* saved image of CR0 */
};
-/*
- * The pcb is augmented with machine-dependent additional data for
- * core dumps. For the i386, there is nothing to add.
- */
-struct md_coredump {
- long md_pad[8];
-};
-
#endif /* _MACHINE_PCB_H_ */
diff --git a/sys/arch/arm/arm/vm_machdep.c b/sys/arch/arm/arm/vm_machdep.c
index 54b6cb22ff3..5e127281422 100644
--- a/sys/arch/arm/arm/vm_machdep.c
+++ b/sys/arch/arm/arm/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.14 2014/11/16 12:30:56 deraadt Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.15 2015/05/05 02:13:46 guenther Exp $ */
/* $NetBSD: vm_machdep.c,v 1.31 2004/01/04 11:33:29 jdolecek Exp $ */
/*
@@ -52,7 +52,6 @@
#include <sys/vnode.h>
#include <sys/buf.h>
#include <sys/user.h>
-#include <sys/core.h>
#include <sys/exec.h>
#include <sys/ptrace.h>
@@ -177,55 +176,6 @@ cpu_exit(struct proc *p)
}
/*
- * Dump the machine specific segment at the start of a core dump.
- */
-
-int
-cpu_coredump(struct proc *p, struct vnode *vp, struct ucred *cred,
- struct core *chdr)
-{
- int error;
- struct {
- struct reg regs;
- struct fpreg fpregs;
- } cpustate;
- struct coreseg cseg;
-
- CORE_SETMAGIC(*chdr, COREMAGIC, MID_MACHINE, 0);
- chdr->c_hdrsize = ALIGN(sizeof(*chdr));
- chdr->c_seghdrsize = ALIGN(sizeof(cseg));
- chdr->c_cpusize = sizeof(cpustate);
-
- /* Save integer registers. */
- error = process_read_regs(p, &cpustate.regs);
- if (error)
- return error;
- /* Save floating point registers. */
- error = process_read_fpregs(p, &cpustate.fpregs);
- if (error)
- return error;
-
- CORE_SETMAGIC(cseg, CORESEGMAGIC, MID_MACHINE, CORE_CPU);
- cseg.c_addr = 0;
- cseg.c_size = chdr->c_cpusize;
-
- error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cseg, chdr->c_seghdrsize,
- (off_t)chdr->c_hdrsize, UIO_SYSSPACE, IO_UNIT, cred, NULL, p);
- if (error)
- return error;
-
- error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cpustate, sizeof(cpustate),
- (off_t)(chdr->c_hdrsize + chdr->c_seghdrsize), UIO_SYSSPACE,
- IO_UNIT, cred, NULL, p);
- if (error)
- return error;
-
- chdr->c_nseg++;
-
- return error;
-}
-
-/*
* Map a user I/O request into kernel virtual address space.
* Note: the pages are already locked by uvm_vslock(), so we
* do not need to pass an access_type to pmap_enter().
diff --git a/sys/arch/arm/include/pcb.h b/sys/arch/arm/include/pcb.h
index 2ee7a801c93..8e0b06a3baf 100644
--- a/sys/arch/arm/include/pcb.h
+++ b/sys/arch/arm/include/pcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcb.h,v 1.5 2013/09/12 11:43:51 patrick Exp $ */
+/* $OpenBSD: pcb.h,v 1.6 2015/05/05 02:13:46 guenther Exp $ */
/* $NetBSD: pcb.h,v 1.10 2003/10/13 21:46:39 scw Exp $ */
/*
@@ -86,11 +86,4 @@ struct pcb {
struct fpe_sp_state pcb_fpstate; /* Floating Point state */
};
-/*
- * No additional data for core dumps.
- */
-struct md_coredump {
- int md_empty;
-};
-
#endif /* _ARM_PCB_H_ */
diff --git a/sys/arch/armish/armish/armish_machdep.c b/sys/arch/armish/armish/armish_machdep.c
index ece2c284508..9038d44f3b8 100644
--- a/sys/arch/armish/armish/armish_machdep.c
+++ b/sys/arch/armish/armish/armish_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: armish_machdep.c,v 1.36 2015/01/18 10:17:42 jsg Exp $ */
+/* $OpenBSD: armish_machdep.c,v 1.37 2015/05/05 02:13:46 guenther Exp $ */
/* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */
/*
@@ -89,7 +89,6 @@
#include <sys/msgbuf.h>
#include <sys/reboot.h>
#include <sys/termios.h>
-#include <sys/kcore.h>
#include <uvm/uvm_extern.h>
diff --git a/sys/arch/hppa/hppa/vm_machdep.c b/sys/arch/hppa/hppa/vm_machdep.c
index fca81111753..11bceafc94c 100644
--- a/sys/arch/hppa/hppa/vm_machdep.c
+++ b/sys/arch/hppa/hppa/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.80 2014/12/16 18:30:03 tedu Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.81 2015/05/05 02:13:46 guenther Exp $ */
/*
* Copyright (c) 1999-2004 Michael Shalayeff
@@ -37,7 +37,6 @@
#include <sys/user.h>
#include <sys/ptrace.h>
#include <sys/exec.h>
-#include <sys/core.h>
#include <sys/pool.h>
#include <uvm/uvm_extern.h>
@@ -49,47 +48,6 @@
extern struct pool hppa_fppl;
-/*
- * Dump the machine specific header information at the start of a core dump.
- */
-int
-cpu_coredump(struct proc *p, struct vnode *vp, struct ucred *cred,
- struct core *core)
-{
- struct md_coredump md_core;
- struct coreseg cseg;
- off_t off;
- int error;
-
- CORE_SETMAGIC(*core, COREMAGIC, MID_HPPA, 0);
- core->c_hdrsize = ALIGN(sizeof(*core));
- core->c_seghdrsize = ALIGN(sizeof(cseg));
- core->c_cpusize = sizeof(md_core);
-
- process_read_regs(p, &md_core.md_reg);
- process_read_fpregs(p, &md_core.md_fpreg);
-
- CORE_SETMAGIC(cseg, CORESEGMAGIC, MID_HPPA, CORE_CPU);
- cseg.c_addr = 0;
- cseg.c_size = core->c_cpusize;
-
-#define write(vp, addr, n) \
- vn_rdwr(UIO_WRITE, (vp), (caddr_t)(addr), (n), off, \
- UIO_SYSSPACE, IO_UNIT, cred, NULL, p)
-
- off = core->c_hdrsize;
- if ((error = write(vp, &cseg, core->c_seghdrsize)))
- return error;
- off += core->c_seghdrsize;
- if ((error = write(vp, &md_core, sizeof md_core)))
- return error;
-
-#undef write
- core->c_nseg++;
-
- return error;
-}
-
void
cpu_fork(struct proc *p1, struct proc *p2, void *stack, size_t stacksize,
void (*func)(void *), void *arg)
diff --git a/sys/arch/hppa/include/pcb.h b/sys/arch/hppa/include/pcb.h
index b24f037eac8..1c1a929285c 100644
--- a/sys/arch/hppa/include/pcb.h
+++ b/sys/arch/hppa/include/pcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcb.h,v 1.15 2011/11/10 22:48:13 deraadt Exp $ */
+/* $OpenBSD: pcb.h,v 1.16 2015/05/05 02:13:46 guenther Exp $ */
/*
* Copyright (c) 1999-2004 Michael Shalayeff
@@ -40,10 +40,4 @@ struct pcb {
pa_space_t pcb_space; /* copy pmap_space, for asm's sake */
};
-struct md_coredump {
- struct reg md_reg;
- struct fpreg md_fpreg;
-};
-
-
#endif /* _MACHINE_PCB_H_ */
diff --git a/sys/arch/hppa64/hppa64/vm_machdep.c b/sys/arch/hppa64/hppa64/vm_machdep.c
index f582b9167d0..fa9abd7fdf0 100644
--- a/sys/arch/hppa64/hppa64/vm_machdep.c
+++ b/sys/arch/hppa64/hppa64/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.21 2014/11/16 12:30:57 deraadt Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.22 2015/05/05 02:13:46 guenther Exp $ */
/*
* Copyright (c) 2005 Michael Shalayeff
@@ -28,7 +28,6 @@
#include <sys/user.h>
#include <sys/ptrace.h>
#include <sys/exec.h>
-#include <sys/core.h>
#include <sys/pool.h>
#include <uvm/uvm_extern.h>
@@ -39,47 +38,6 @@
extern struct pool hppa_fppl;
-/*
- * Dump the machine specific header information at the start of a core dump.
- */
-int
-cpu_coredump(struct proc *p, struct vnode *vp, struct ucred *cred,
- struct core *core)
-{
- struct md_coredump md_core;
- struct coreseg cseg;
- off_t off;
- int error;
-
- CORE_SETMAGIC(*core, COREMAGIC, MID_HPPA20, 0);
- core->c_hdrsize = ALIGN(sizeof(*core));
- core->c_seghdrsize = ALIGN(sizeof(cseg));
- core->c_cpusize = sizeof(md_core);
-
- process_read_regs(p, &md_core.md_reg);
- process_read_fpregs(p, &md_core.md_fpreg);
-
- CORE_SETMAGIC(cseg, CORESEGMAGIC, MID_HPPA20, CORE_CPU);
- cseg.c_addr = 0;
- cseg.c_size = core->c_cpusize;
-
-#define write(vp, addr, n) \
- vn_rdwr(UIO_WRITE, (vp), (caddr_t)(addr), (n), off, \
- UIO_SYSSPACE, IO_UNIT, cred, NULL, p)
-
- off = core->c_hdrsize;
- if ((error = write(vp, &cseg, core->c_seghdrsize)))
- return error;
- off += core->c_seghdrsize;
- if ((error = write(vp, &md_core, sizeof md_core)))
- return error;
-
-#undef write
- core->c_nseg++;
-
- return error;
-}
-
void
cpu_fork(struct proc *p1, struct proc *p2, void *stack, size_t stacksize,
void (*func)(void *), void *arg)
diff --git a/sys/arch/hppa64/include/pcb.h b/sys/arch/hppa64/include/pcb.h
index 8ed995f81f9..2a8cee8eb8b 100644
--- a/sys/arch/hppa64/include/pcb.h
+++ b/sys/arch/hppa64/include/pcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcb.h,v 1.4 2011/11/10 23:15:11 deraadt Exp $ */
+/* $OpenBSD: pcb.h,v 1.5 2015/05/05 02:13:46 guenther Exp $ */
/*
* Copyright (c) 2005 Michael Shalayeff
@@ -31,10 +31,4 @@ struct pcb {
pa_space_t pcb_space; /* copy pmap_space, for asm's sake */
};
-struct md_coredump {
- struct reg md_reg;
- struct fpreg md_fpreg;
-};
-
-
#endif /* _MACHINE_PCB_H_ */
diff --git a/sys/arch/i386/i386/vm_machdep.c b/sys/arch/i386/i386/vm_machdep.c
index 5dd07849c52..c5357f94a5c 100644
--- a/sys/arch/i386/i386/vm_machdep.c
+++ b/sys/arch/i386/i386/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.62 2015/03/31 04:35:50 guenther Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.63 2015/05/05 02:13:46 guenther Exp $ */
/* $NetBSD: vm_machdep.c,v 1.61 1996/05/03 19:42:35 christos Exp $ */
/*-
@@ -50,7 +50,6 @@
#include <sys/vnode.h>
#include <sys/buf.h>
#include <sys/user.h>
-#include <sys/core.h>
#include <sys/exec.h>
#include <sys/ptrace.h>
@@ -140,56 +139,6 @@ cpu_exit(struct proc *p)
}
/*
- * Dump the machine specific segment at the start of a core dump.
- */
-struct md_core {
- struct reg intreg;
- struct fpreg freg;
-};
-
-int
-cpu_coredump(struct proc *p, struct vnode *vp, struct ucred *cred,
- struct core *chdr)
-{
- struct md_core md_core;
- struct coreseg cseg;
- int error;
-
- CORE_SETMAGIC(*chdr, COREMAGIC, MID_I386, 0);
- chdr->c_hdrsize = ALIGN(sizeof(*chdr));
- chdr->c_seghdrsize = ALIGN(sizeof(cseg));
- chdr->c_cpusize = sizeof(md_core);
-
- /* Save integer registers. */
- error = process_read_regs(p, &md_core.intreg);
- if (error)
- return error;
-
- /* Save floating point registers. */
- error = process_read_fpregs(p, &md_core.freg);
- if (error)
- return error;
-
- CORE_SETMAGIC(cseg, CORESEGMAGIC, MID_I386, CORE_CPU);
- cseg.c_addr = 0;
- cseg.c_size = chdr->c_cpusize;
-
- error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cseg, chdr->c_seghdrsize,
- (off_t)chdr->c_hdrsize, UIO_SYSSPACE, IO_UNIT, cred, NULL, p);
- if (error)
- return error;
-
- error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&md_core, sizeof(md_core),
- (off_t)(chdr->c_hdrsize + chdr->c_seghdrsize), UIO_SYSSPACE,
- IO_UNIT, cred, NULL, p);
- if (error)
- return error;
-
- chdr->c_nseg++;
- return 0;
-}
-
-/*
* Convert kernel VA to physical address
*/
int
diff --git a/sys/arch/i386/include/pcb.h b/sys/arch/i386/include/pcb.h
index 0693d7becf3..8fd23c94a81 100644
--- a/sys/arch/i386/include/pcb.h
+++ b/sys/arch/i386/include/pcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcb.h,v 1.17 2013/05/08 15:36:30 tedu Exp $ */
+/* $OpenBSD: pcb.h,v 1.18 2015/05/05 02:13:46 guenther Exp $ */
/* $NetBSD: pcb.h,v 1.21 1996/01/08 13:51:42 mycroft Exp $ */
/*-
@@ -84,12 +84,4 @@ struct pcb {
#define TSEG_FS 0
#define TSEG_GS 1
-/*
- * The pcb is augmented with machine-dependent additional data for
- * core dumps. For the i386, there is nothing to add.
- */
-struct md_coredump {
- long md_pad[8];
-};
-
#endif /* _MACHINE_PCB_H_ */
diff --git a/sys/arch/loongson/loongson/hibernate_machdep.c b/sys/arch/loongson/loongson/hibernate_machdep.c
index c7c9fc77002..d0d565d759f 100644
--- a/sys/arch/loongson/loongson/hibernate_machdep.c
+++ b/sys/arch/loongson/loongson/hibernate_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hibernate_machdep.c,v 1.7 2014/07/20 19:47:53 deraadt Exp $ */
+/* $OpenBSD: hibernate_machdep.c,v 1.8 2015/05/05 02:13:46 guenther Exp $ */
/*
* Copyright (c) 2013 Paul Irofti.
@@ -26,7 +26,6 @@
#include <sys/hibernate.h>
#include <sys/timeout.h>
#include <sys/malloc.h>
-#include <sys/kcore.h>
#include <uvm/uvm_extern.h>
#include <uvm/uvm_pmemrange.h>
diff --git a/sys/arch/loongson/loongson/machdep.c b/sys/arch/loongson/loongson/machdep.c
index c1b99e72467..eaef59d6460 100644
--- a/sys/arch/loongson/loongson/machdep.c
+++ b/sys/arch/loongson/loongson/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.61 2014/12/10 15:29:53 mikeb Exp $ */
+/* $OpenBSD: machdep.c,v 1.62 2015/05/05 02:13:46 guenther Exp $ */
/*
* Copyright (c) 2009, 2010, 2014 Miodrag Vallat.
@@ -62,7 +62,6 @@
#ifdef SYSVSEM
#include <sys/sem.h>
#endif
-#include <sys/kcore.h>
#include <net/if.h>
diff --git a/sys/arch/m88k/include/pcb.h b/sys/arch/m88k/include/pcb.h
index 849e5113710..20504a9db61 100644
--- a/sys/arch/m88k/include/pcb.h
+++ b/sys/arch/m88k/include/pcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcb.h,v 1.6 2013/07/17 19:19:29 miod Exp $ */
+/* $OpenBSD: pcb.h,v 1.7 2015/05/05 02:13:46 guenther Exp $ */
/*
* Copyright (c) 1996 Nivas Madhur
* Mach Operating System
@@ -86,14 +86,4 @@ struct pcb
#define USER_REGS(p) \
(((struct reg *)(&((p)->p_addr->u_pcb.user_state))))
-/*
- * The pcb is augmented with machine-dependent additional data for
- * core dumps. Note that the trapframe here is a copy of the one
- * from the top of the kernel stack (included here so that the kernel
- * stack itself need not be dumped).
- */
-struct md_coredump {
- struct trapframe md_tf;
-};
-
#endif /* _M88K_PCB_H_ */
diff --git a/sys/arch/m88k/m88k/vm_machdep.c b/sys/arch/m88k/m88k/vm_machdep.c
index 08a27322e43..d4cb331f49b 100644
--- a/sys/arch/m88k/m88k/vm_machdep.c
+++ b/sys/arch/m88k/m88k/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.23 2014/11/16 12:30:58 deraadt Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.24 2015/05/05 02:13:47 guenther Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
@@ -49,7 +49,6 @@
#include <sys/buf.h>
#include <sys/user.h>
#include <sys/vnode.h>
-#include <sys/core.h>
#include <sys/exec.h>
#include <sys/ptrace.h>
@@ -132,49 +131,6 @@ cpu_exit(struct proc *p)
}
/*
- * Dump the machine specific header information at the start of a core dump.
- */
-int
-cpu_coredump(p, vp, cred, chdr)
- struct proc *p;
- struct vnode *vp;
- struct ucred *cred;
- struct core *chdr;
-{
- struct reg reg;
- struct coreseg cseg;
- int error;
-
- CORE_SETMAGIC(*chdr, COREMAGIC, MID_MACHINE, 0);
- chdr->c_hdrsize = ALIGN(sizeof(*chdr));
- chdr->c_seghdrsize = ALIGN(sizeof(cseg));
- chdr->c_cpusize = sizeof(reg);
-
- /* Save registers. */
- error = process_read_regs(p, &reg);
- if (error)
- return error;
-
- CORE_SETMAGIC(cseg, CORESEGMAGIC, MID_MACHINE, CORE_CPU);
- cseg.c_addr = 0;
- cseg.c_size = chdr->c_cpusize;
-
- error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cseg, chdr->c_seghdrsize,
- (off_t)chdr->c_hdrsize, UIO_SYSSPACE, IO_UNIT, cred, NULL, p);
- if (error)
- return error;
-
- error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&reg, sizeof(reg),
- (off_t)(chdr->c_hdrsize + chdr->c_seghdrsize), UIO_SYSSPACE,
- IO_UNIT, cred, NULL, p);
- if (error)
- return error;
-
- chdr->c_nseg++;
- return 0;
-}
-
-/*
* Map an IO request into kernel virtual address space via phys_map.
*/
void
diff --git a/sys/arch/mips64/include/pcb.h b/sys/arch/mips64/include/pcb.h
index 701ca2ae375..08c32512ecd 100644
--- a/sys/arch/mips64/include/pcb.h
+++ b/sys/arch/mips64/include/pcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcb.h,v 1.6 2014/03/22 00:01:04 miod Exp $ */
+/* $OpenBSD: pcb.h,v 1.7 2015/05/05 02:13:47 guenther Exp $ */
/*
* Copyright (c) 1988 University of Utah.
@@ -57,12 +57,4 @@ struct pcb {
vaddr_t pcb_wiredpc; /* last tracked pc value within above */
};
-/*
- * The pcb is augmented with machine-dependent additional data for
- * core dumps. For the MIPS, there is nothing to add.
- */
-struct md_coredump {
- long md_pad[8];
-};
-
#endif /* !_MIPS64_PCB_H_ */
diff --git a/sys/arch/mips64/mips64/vm_machdep.c b/sys/arch/mips64/mips64/vm_machdep.c
index 900785dc59f..fbc0ca5b491 100644
--- a/sys/arch/mips64/mips64/vm_machdep.c
+++ b/sys/arch/mips64/mips64/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.31 2014/12/16 18:30:03 tedu Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.32 2015/05/05 02:13:47 guenther Exp $ */
/*
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1992, 1993
@@ -48,7 +48,6 @@
#include <sys/buf.h>
#include <sys/vnode.h>
#include <sys/user.h>
-#include <sys/core.h>
#include <sys/exec.h>
#include <sys/signalvar.h>
@@ -162,55 +161,6 @@ cpu_exit(p)
sched_exit(p);
}
-/*
- * Dump the machine specific header information at the start of a core dump.
- */
-int
-cpu_coredump(p, vp, cred, chdr)
- struct proc *p;
- struct vnode *vp;
- struct ucred *cred;
- struct core *chdr;
-{
- struct cpu_info *ci = curcpu();
- int error;
- /*register struct user *up = p->p_addr;*/
- struct coreseg cseg;
-
- CORE_SETMAGIC(*chdr, COREMAGIC, MID_MIPS, 0);
- chdr->c_hdrsize = ALIGN(sizeof(*chdr));
- chdr->c_seghdrsize = ALIGN(sizeof(cseg));
- chdr->c_cpusize = sizeof (p -> p_addr -> u_pcb.pcb_regs);
-
- /*
- * Copy floating point state from the FP chip if this process
- * has state stored there.
- */
- if (p == ci->ci_fpuproc)
- save_fpu();
-
- CORE_SETMAGIC(cseg, CORESEGMAGIC, MID_MIPS, CORE_CPU);
- cseg.c_addr = 0;
- cseg.c_size = chdr->c_cpusize;
-
- error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cseg, chdr->c_seghdrsize,
- (off_t)chdr->c_hdrsize, UIO_SYSSPACE,
- IO_UNIT, cred, NULL, p);
- if (error)
- return error;
-
- error = vn_rdwr(UIO_WRITE, vp,
- (caddr_t)(&(p -> p_addr -> u_pcb.pcb_regs)),
- (off_t)chdr -> c_cpusize,
- (off_t)(chdr->c_hdrsize + chdr->c_seghdrsize),
- UIO_SYSSPACE, IO_UNIT, cred, NULL, p);
-
- if (!error)
- chdr->c_nseg++;
-
- return error;
-}
-
extern vm_map_t phys_map;
/*
diff --git a/sys/arch/powerpc/include/pcb.h b/sys/arch/powerpc/include/pcb.h
index edacac9d43f..c7b1a3823eb 100644
--- a/sys/arch/powerpc/include/pcb.h
+++ b/sys/arch/powerpc/include/pcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcb.h,v 1.13 2011/08/22 18:18:35 deraadt Exp $ */
+/* $OpenBSD: pcb.h,v 1.14 2015/05/05 02:13:47 guenther Exp $ */
/* $NetBSD: pcb.h,v 1.1 1996/09/30 16:34:29 ws Exp $ */
/*-
@@ -61,10 +61,6 @@ struct pcb {
struct cpu_info *pcb_veccpu;
};
-struct md_coredump {
- struct reg regs;
-};
-
#ifdef _KERNEL
extern struct proc *fpuproc;
int setfault(faultbuf *env) __returns_twice;
diff --git a/sys/arch/powerpc/powerpc/vm_machdep.c b/sys/arch/powerpc/powerpc/vm_machdep.c
index 475fe57504c..43e18f7401e 100644
--- a/sys/arch/powerpc/powerpc/vm_machdep.c
+++ b/sys/arch/powerpc/powerpc/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.47 2014/11/16 12:30:58 deraadt Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.48 2015/05/05 02:13:47 guenther Exp $ */
/* $NetBSD: vm_machdep.c,v 1.1 1996/09/30 16:34:57 ws Exp $ */
/*
@@ -32,7 +32,6 @@
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/param.h>
-#include <sys/core.h>
#include <sys/exec.h>
#include <sys/pool.h>
#include <sys/proc.h>
@@ -159,43 +158,6 @@ cpu_exit(struct proc *p)
}
/*
- * Write the machine-dependent part of a core dump.
- */
-int
-cpu_coredump(struct proc *p, struct vnode *vp, struct ucred *cred,
- struct core *chdr)
-{
- struct coreseg cseg;
- struct md_coredump md_core;
- int error;
-
- CORE_SETMAGIC(*chdr, COREMAGIC, MID_POWERPC, 0);
- chdr->c_hdrsize = ALIGN(sizeof *chdr);
- chdr->c_seghdrsize = ALIGN(sizeof cseg);
- chdr->c_cpusize = sizeof md_core;
-
- process_read_regs(p, &(md_core.regs));
-
- CORE_SETMAGIC(cseg, CORESEGMAGIC, MID_POWERPC, CORE_CPU);
- cseg.c_addr = 0;
- cseg.c_size = chdr->c_cpusize;
-
- error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cseg, chdr->c_seghdrsize,
- (off_t)chdr->c_hdrsize, UIO_SYSSPACE, IO_UNIT, cred, NULL, p);
- if (error)
- return error;
-
- error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&md_core, sizeof md_core,
- (off_t)(chdr->c_hdrsize + chdr->c_seghdrsize), UIO_SYSSPACE,
- IO_UNIT, cred, NULL, p);
- if (error)
- return error;
-
- chdr->c_nseg++;
- return 0;
-}
-
-/*
* Map an IO request into kernel virtual address space.
*/
void
diff --git a/sys/arch/sh/include/pcb.h b/sys/arch/sh/include/pcb.h
index e6d41940891..9b3262d4e97 100644
--- a/sys/arch/sh/include/pcb.h
+++ b/sys/arch/sh/include/pcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcb.h,v 1.3 2008/06/26 05:42:12 ray Exp $ */
+/* $OpenBSD: pcb.h,v 1.4 2015/05/05 02:13:47 guenther Exp $ */
/* $NetBSD: pcb.h,v 1.7 2002/05/09 12:28:08 uch Exp $ */
/*-
@@ -42,9 +42,6 @@ struct pcb {
struct fpreg pcb_fp; /* fp context for resume */
};
-struct md_coredump {
-};
-
extern struct pcb *curpcb;
#endif /* !_SH_PCB_H_ */
diff --git a/sys/arch/sh/sh/sh_machdep.c b/sys/arch/sh/sh/sh_machdep.c
index d8eccbfccae..7d32f59db92 100644
--- a/sys/arch/sh/sh/sh_machdep.c
+++ b/sys/arch/sh/sh/sh_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sh_machdep.c,v 1.38 2015/01/20 19:43:21 kettenis Exp $ */
+/* $OpenBSD: sh_machdep.c,v 1.39 2015/05/05 02:13:47 guenther Exp $ */
/* $NetBSD: sh3_machdep.c,v 1.59 2006/03/04 01:13:36 uwe Exp $ */
/*
@@ -95,8 +95,6 @@
#include <sys/sched.h>
#include <sys/msg.h>
#include <sys/conf.h>
-#include <sys/core.h>
-#include <sys/kcore.h>
#include <sys/reboot.h>
#include <uvm/uvm_extern.h>
diff --git a/sys/arch/sh/sh/vm_machdep.c b/sys/arch/sh/sh/vm_machdep.c
index b48aeba66d2..77b50487b5b 100644
--- a/sys/arch/sh/sh/vm_machdep.c
+++ b/sys/arch/sh/sh/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.12 2014/11/16 12:30:58 deraadt Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.13 2015/05/05 02:13:47 guenther Exp $ */
/* $NetBSD: vm_machdep.c,v 1.53 2006/08/31 16:49:21 matt Exp $ */
/*
@@ -103,7 +103,6 @@
#include <sys/vnode.h>
#include <sys/buf.h>
#include <sys/user.h>
-#include <sys/core.h>
#include <sys/exec.h>
#include <sys/ptrace.h>
#include <sys/signalvar.h>
@@ -246,63 +245,6 @@ cpu_fork(struct proc *p1, struct proc *p2, void *stack, size_t stacksize,
}
/*
- * Dump the machine specific segment at the start of a core dump.
- */
-struct md_core {
- struct reg intreg;
- struct fpreg fpreg;
-};
-
-int
-cpu_coredump(struct proc *p, struct vnode *vp, struct ucred *cred,
- struct core *chdr)
-{
- struct md_core md_core;
- struct coreseg cseg;
- int error;
-
- CORE_SETMAGIC(*chdr, COREMAGIC, MID_MACHINE, 0);
- chdr->c_hdrsize = ALIGN(sizeof(*chdr));
- chdr->c_seghdrsize = ALIGN(sizeof(cseg));
- chdr->c_cpusize = sizeof(md_core);
-
- /* Save integer registers. */
- error = process_read_regs(p, &md_core.intreg);
- if (error)
- return error;
-
-#ifdef SH4
- if (CPU_IS_SH4) {
- error = process_read_fpregs(p, &md_core.fpreg);
- if (error)
- return error;
- }
-#endif
-#ifdef SH3
- if (CPU_IS_SH3)
- bzero(&md_core.fpreg, sizeof(md_core.fpreg));
-#endif
-
- CORE_SETMAGIC(cseg, CORESEGMAGIC, MID_MACHINE, CORE_CPU);
- cseg.c_addr = 0;
- cseg.c_size = chdr->c_cpusize;
-
- error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cseg, chdr->c_seghdrsize,
- (off_t)chdr->c_hdrsize, UIO_SYSSPACE, IO_UNIT, cred, NULL, p);
- if (error)
- return error;
-
- error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&md_core, sizeof(md_core),
- (off_t)(chdr->c_hdrsize + chdr->c_seghdrsize), UIO_SYSSPACE,
- IO_UNIT, cred, NULL, p);
- if (error)
- return error;
-
- chdr->c_nseg++;
- return 0;
-}
-
-/*
* Map an IO request into kernel virtual address space.
* All requests are (re)mapped into kernel VA space via the phys_map
* (a name with only slightly more meaning than "kernel_map")
diff --git a/sys/arch/sparc/include/pcb.h b/sys/arch/sparc/include/pcb.h
index 6942c653e93..fc98d187d97 100644
--- a/sys/arch/sparc/include/pcb.h
+++ b/sys/arch/sparc/include/pcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcb.h,v 1.6 2011/03/23 16:54:37 pirofti Exp $ */
+/* $OpenBSD: pcb.h,v 1.7 2015/05/05 02:13:47 guenther Exp $ */
/* $NetBSD: pcb.h,v 1.4 1995/03/28 18:19:56 jtc Exp $ */
/*
@@ -107,18 +107,6 @@ struct pcb {
struct rwindow pcb_rw[PCB_MAXWIN]; /* saved windows */
};
-/*
- * The pcb is augmented with machine-dependent additional data for
- * core dumps. Note that the trapframe here is a copy of the one
- * from the top of the kernel stack (included here so that the kernel
- * stack itself need not be dumped).
- */
-struct md_coredump {
- struct trapframe md_tf;
- struct fpstate md_fpstate;
- u_int32_t md_wcookie;
-};
-
#ifdef _KERNEL
extern struct pcb *cpcb;
#endif /* _KERNEL */
diff --git a/sys/arch/sparc/sparc/vm_machdep.c b/sys/arch/sparc/sparc/vm_machdep.c
index d0d611dce3c..e70d8c01878 100644
--- a/sys/arch/sparc/sparc/vm_machdep.c
+++ b/sys/arch/sparc/sparc/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.59 2015/03/30 20:30:22 miod Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.60 2015/05/05 02:13:47 guenther Exp $ */
/* $NetBSD: vm_machdep.c,v 1.30 1997/03/10 23:55:40 pk Exp $ */
/*
@@ -54,7 +54,6 @@
#include <sys/proc.h>
#include <sys/signalvar.h>
#include <sys/user.h>
-#include <sys/core.h>
#include <sys/malloc.h>
#include <sys/buf.h>
#include <sys/exec.h>
@@ -285,49 +284,3 @@ cpu_exit(p)
pmap_deactivate(p);
sched_exit(p);
}
-
-/*
- * cpu_coredump is called to write a core dump header.
- * (should this be defined elsewhere? machdep.c?)
- */
-int
-cpu_coredump(p, vp, cred, chdr)
- struct proc *p;
- struct vnode *vp;
- struct ucred *cred;
- struct core *chdr;
-{
- int error;
- struct md_coredump md_core;
- struct coreseg cseg;
-
- CORE_SETMAGIC(*chdr, COREMAGIC, MID_SPARC, 0);
- chdr->c_hdrsize = ALIGN(sizeof(*chdr));
- chdr->c_seghdrsize = ALIGN(sizeof(cseg));
- chdr->c_cpusize = sizeof(md_core);
-
- md_core.md_tf = *p->p_md.md_tf;
- md_core.md_wcookie = p->p_addr->u_pcb.pcb_wcookie;
- if (p->p_md.md_fpstate) {
- if (p == cpuinfo.fpproc)
- savefpstate(p->p_md.md_fpstate);
- md_core.md_fpstate = *p->p_md.md_fpstate;
- } else
- bzero((caddr_t)&md_core.md_fpstate, sizeof(struct fpstate));
-
- CORE_SETMAGIC(cseg, CORESEGMAGIC, MID_SPARC, CORE_CPU);
- cseg.c_addr = 0;
- cseg.c_size = chdr->c_cpusize;
- error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cseg, chdr->c_seghdrsize,
- (off_t)chdr->c_hdrsize, UIO_SYSSPACE, IO_UNIT, cred, NULL, p);
- if (error)
- return error;
-
- error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&md_core, sizeof(md_core),
- (off_t)(chdr->c_hdrsize + chdr->c_seghdrsize), UIO_SYSSPACE,
- IO_UNIT, cred, NULL, p);
- if (!error)
- chdr->c_nseg++;
-
- return error;
-}
diff --git a/sys/arch/sparc64/include/pcb.h b/sys/arch/sparc64/include/pcb.h
index dc72ecad17a..108f669031c 100644
--- a/sys/arch/sparc64/include/pcb.h
+++ b/sys/arch/sparc64/include/pcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcb.h,v 1.9 2011/03/23 16:54:37 pirofti Exp $ */
+/* $OpenBSD: pcb.h,v 1.10 2015/05/05 02:13:47 guenther Exp $ */
/* $NetBSD: pcb.h,v 1.7 2000/12/29 17:12:05 eeh Exp $ */
/*
@@ -143,18 +143,6 @@ struct pcb {
u_int64_t pcb_rwsp[PCB_MAXWIN];
};
-/*
- * The pcb is augmented with machine-dependent additional data for
- * core dumps. Note that the trapframe here is a copy of the one
- * from the top of the kernel stack (included here so that the kernel
- * stack itself need not be dumped).
- */
-struct md_coredump {
- struct trapframe64 md_tf;
- struct fpstate64 md_fpstate;
- u_int64_t md_wcookie;
-};
-
#ifndef _KERNEL
/* Let gdb compile. We need fancier macros to make these make sense. */
#define pcb_psr pcb_pstate
diff --git a/sys/arch/sparc64/sparc64/vm_machdep.c b/sys/arch/sparc64/sparc64/vm_machdep.c
index 61494dd2856..e8484e52a43 100644
--- a/sys/arch/sparc64/sparc64/vm_machdep.c
+++ b/sys/arch/sparc64/sparc64/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.32 2014/11/16 12:30:59 deraadt Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.33 2015/05/05 02:13:47 guenther Exp $ */
/* $NetBSD: vm_machdep.c,v 1.38 2001/06/30 00:02:20 eeh Exp $ */
/*
@@ -53,7 +53,6 @@
#include <sys/systm.h>
#include <sys/proc.h>
#include <sys/user.h>
-#include <sys/core.h>
#include <sys/malloc.h>
#include <sys/buf.h>
#include <sys/exec.h>
@@ -369,50 +368,3 @@ cpu_exit(struct proc *p)
pmap_deactivate(p);
sched_exit(p);
}
-
-/*
- * cpu_coredump is called to write a core dump header.
- * (should this be defined elsewhere? machdep.c?)
- */
-int
-cpu_coredump(p, vp, cred, chdr)
- struct proc *p;
- struct vnode *vp;
- struct ucred *cred;
- struct core *chdr;
-{
- int error;
- struct md_coredump md_core;
- struct coreseg cseg;
-
- CORE_SETMAGIC(*chdr, COREMAGIC, MID_MACHINE, 0);
- chdr->c_hdrsize = ALIGN(sizeof(*chdr));
- chdr->c_seghdrsize = ALIGN(sizeof(cseg));
- chdr->c_cpusize = sizeof(md_core);
-
- md_core.md_tf = *p->p_md.md_tf;
- md_core.md_wcookie = p->p_addr->u_pcb.pcb_wcookie;
- if (p->p_md.md_fpstate) {
- fpusave_proc(p, 1);
- md_core.md_fpstate = *p->p_md.md_fpstate;
- } else
- bzero((caddr_t)&md_core.md_fpstate,
- sizeof(md_core.md_fpstate));
-
- CORE_SETMAGIC(cseg, CORESEGMAGIC, MID_MACHINE, CORE_CPU);
- cseg.c_addr = 0;
- cseg.c_size = chdr->c_cpusize;
- error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cseg, chdr->c_seghdrsize,
- (off_t)chdr->c_hdrsize, UIO_SYSSPACE, IO_UNIT, cred, NULL, p);
- if (error)
- return error;
-
- error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&md_core, sizeof(md_core),
- (off_t)(chdr->c_hdrsize + chdr->c_seghdrsize), UIO_SYSSPACE,
- IO_UNIT, cred, NULL, p);
- if (!error)
- chdr->c_nseg++;
-
- return error;
-}
-
diff --git a/sys/arch/vax/include/pcb.h b/sys/arch/vax/include/pcb.h
index b8732d54d10..bbc96b002b7 100644
--- a/sys/arch/vax/include/pcb.h
+++ b/sys/arch/vax/include/pcb.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcb.h,v 1.8 2013/11/24 22:08:23 miod Exp $ */
+/* $OpenBSD: pcb.h,v 1.9 2015/05/05 02:13:47 guenther Exp $ */
/* $NetBSD: pcb.h,v 1.10 1996/02/02 18:08:26 mycroft Exp $ */
/*
@@ -69,10 +69,5 @@ struct pcb {
#define AST_MASK 0x07000000
#define AST_PCB 0x04000000
-/* machine-specific core dump; save regs */
-struct md_coredump {
- struct reg md_reg;
-};
-
#endif /* _MACHINE_PCB_H_ */
diff --git a/sys/arch/vax/vax/vm_machdep.c b/sys/arch/vax/vax/vm_machdep.c
index 7ab91cfa425..a47c00ae0c3 100644
--- a/sys/arch/vax/vax/vm_machdep.c
+++ b/sys/arch/vax/vax/vm_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vm_machdep.c,v 1.42 2014/11/16 12:30:59 deraadt Exp $ */
+/* $OpenBSD: vm_machdep.c,v 1.43 2015/05/05 02:13:47 guenther Exp $ */
/* $NetBSD: vm_machdep.c,v 1.67 2000/06/29 07:14:34 mrg Exp $ */
/*
@@ -39,7 +39,6 @@
#include <sys/user.h>
#include <sys/exec.h>
#include <sys/vnode.h>
-#include <sys/core.h>
#include <sys/mount.h>
#include <sys/device.h>
@@ -179,56 +178,6 @@ sys_sysarch(p, v, retval)
};
/*
- * Dump the machine specific header information at the start of a core dump.
- * First put all regs in PCB for debugging purposes. This is not an good
- * way to do this, but good for my purposes so far.
- */
-int
-cpu_coredump(p, vp, cred, chdr)
- struct proc *p;
- struct vnode *vp;
- struct ucred *cred;
- struct core *chdr;
-{
- struct trapframe *tf;
- struct md_coredump state;
- struct reg *regs = &state.md_reg;
- struct coreseg cseg;
- int error;
-
- tf = p->p_addr->u_pcb.framep;
- CORE_SETMAGIC(*chdr, COREMAGIC, MID_MACHINE, 0);
- chdr->c_hdrsize = sizeof(struct core);
- chdr->c_seghdrsize = sizeof(struct coreseg);
- chdr->c_cpusize = sizeof(struct md_coredump);
-
- bcopy(&tf->r0, &regs->r0, 12 * sizeof(int));
- regs->ap = tf->ap;
- regs->fp = tf->fp;
- regs->sp = tf->sp;
- regs->pc = tf->pc;
- regs->psl = tf->psl;
-
- CORE_SETMAGIC(cseg, CORESEGMAGIC, MID_MACHINE, CORE_CPU);
- cseg.c_addr = 0;
- cseg.c_size = chdr->c_cpusize;
-
- error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&cseg, chdr->c_seghdrsize,
- (off_t)chdr->c_hdrsize, UIO_SYSSPACE, IO_UNIT, cred, NULL, p);
- if (error)
- return error;
-
- error = vn_rdwr(UIO_WRITE, vp, (caddr_t)&state, sizeof(state),
- (off_t)(chdr->c_hdrsize + chdr->c_seghdrsize), UIO_SYSSPACE,
- IO_UNIT, cred, NULL, p);
-
- if (!error)
- chdr->c_nseg++;
-
- return error;
-}
-
-/*
* Map in a bunch of pages read/writeable for the kernel.
*/
void
diff --git a/sys/arch/zaurus/zaurus/zaurus_machdep.c b/sys/arch/zaurus/zaurus/zaurus_machdep.c
index edc2c6e0325..55578bee94f 100644
--- a/sys/arch/zaurus/zaurus/zaurus_machdep.c
+++ b/sys/arch/zaurus/zaurus/zaurus_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zaurus_machdep.c,v 1.56 2015/01/18 10:17:42 jsg Exp $ */
+/* $OpenBSD: zaurus_machdep.c,v 1.57 2015/05/05 02:13:47 guenther Exp $ */
/* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */
/*
@@ -121,7 +121,6 @@
#include <sys/msgbuf.h>
#include <sys/reboot.h>
#include <sys/termios.h>
-#include <sys/kcore.h>
#include <uvm/uvm_extern.h>