diff options
author | jdp <jdp@FreeBSD.org> | 1998-09-14 22:43:40 +0000 |
---|---|---|
committer | jdp <jdp@FreeBSD.org> | 1998-09-14 22:43:40 +0000 |
commit | 60718890ae203c5e84c8b90f13763bf7a87e7afb (patch) | |
tree | 3631f22c088f449c222f0399cb2d77033762962b /sys/alpha | |
parent | bf32f01fb996d7e78702cb9d770b1459c413f597 (diff) | |
download | FreeBSD-src-60718890ae203c5e84c8b90f13763bf7a87e7afb.zip FreeBSD-src-60718890ae203c5e84c8b90f13763bf7a87e7afb.tar.gz |
Add new functions fill_fpregs() and set_fpregs(), like fill_regs()
and set_regs() but for the floating point register state. The code
is stolen from procfs_machdep.c, and moved out of there into
machdep.c.
These functions are needed for generating ELF core dumps.
Diffstat (limited to 'sys/alpha')
-rw-r--r-- | sys/alpha/alpha/machdep.c | 29 | ||||
-rw-r--r-- | sys/alpha/alpha/procfs_machdep.c | 19 | ||||
-rw-r--r-- | sys/alpha/include/md_var.h | 8 |
3 files changed, 38 insertions, 18 deletions
diff --git a/sys/alpha/alpha/machdep.c b/sys/alpha/alpha/machdep.c index 26b06d6..21a970e 100644 --- a/sys/alpha/alpha/machdep.c +++ b/sys/alpha/alpha/machdep.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: machdep.c,v 1.11 1998/08/10 07:53:58 dfr Exp $ + * $Id: machdep.c,v 1.12 1998/08/22 10:32:38 dfr Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -1732,6 +1732,33 @@ set_regs(p, regs) return (0); } +int +fill_fpregs(p, fpregs) + struct proc *p; + struct fpreg *fpregs; +{ + if (p == fpcurproc) { + alpha_pal_wrfen(1); + savefpstate(&p->p_addr->u_pcb.pcb_fp); + alpha_pal_wrfen(0); + } + + bcopy(&p->p_addr->u_pcb.pcb_fp, fpregs, sizeof *fpregs); + return (0); +} + +int +set_fpregs(p, fpregs) + struct proc *p; + struct fpreg *fpregs; +{ + if (p == fpcurproc) + fpcurproc = NULL; + + bcopy(fpregs, &p->p_addr->u_pcb.pcb_fp, sizeof *fpregs); + return (0); +} + #ifndef DDB void Debugger(const char *msg) diff --git a/sys/alpha/alpha/procfs_machdep.c b/sys/alpha/alpha/procfs_machdep.c index 11898d0..621280a 100644 --- a/sys/alpha/alpha/procfs_machdep.c +++ b/sys/alpha/alpha/procfs_machdep.c @@ -37,7 +37,7 @@ * @(#)procfs_machdep.c 8.3 (Berkeley) 1/27/94 * * From: - * $Id: procfs_machdep.c,v 1.10 1997/07/20 08:37:22 bde Exp $ + * $Id: procfs_machdep.c,v 1.1 1998/06/10 10:53:04 dfr Exp $ */ /* @@ -112,15 +112,7 @@ procfs_read_fpregs(p, fpregs) { if ((p->p_flag & P_INMEM) == 0) return (EIO); - - if (p == fpcurproc) { - alpha_pal_wrfen(1); - savefpstate(&p->p_addr->u_pcb.pcb_fp); - alpha_pal_wrfen(0); - } - - bcopy(&p->p_addr->u_pcb.pcb_fp, fpregs, sizeof *fpregs); - return (0); + return (fill_fpregs(p, fpregs)); } int @@ -130,12 +122,7 @@ procfs_write_fpregs(p, fpregs) { if ((p->p_flag & P_INMEM) == 0) return (EIO); - - if (p == fpcurproc) - fpcurproc = NULL; - - bcopy(fpregs, &p->p_addr->u_pcb.pcb_fp, sizeof *fpregs); - return (0); + return (set_fpregs(p, fpregs)); } int diff --git a/sys/alpha/include/md_var.h b/sys/alpha/include/md_var.h index 3dfdad2..cd2e667 100644 --- a/sys/alpha/include/md_var.h +++ b/sys/alpha/include/md_var.h @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: md_var.h,v 1.1 1998/06/10 10:55:11 dfr Exp $ + * $Id: md_var.h,v 1.2 1998/07/12 16:32:09 dfr Exp $ */ #ifndef _MACHINE_MD_VAR_H_ @@ -39,6 +39,10 @@ extern int szsigcode; extern int Maxmem; extern void (*netisrs[32]) __P((void)); +struct fpreg; +struct proc; +struct reg; + void cpu_power_down __P((void)); void cpu_halt __P((void)); void cpu_reset __P((void)); @@ -47,5 +51,7 @@ void swi_vm __P((void)); int vm_page_zero_idle __P((void)); int fill_regs __P((struct proc *, struct reg *)); int set_regs __P((struct proc *, struct reg *)); +int fill_fpregs __P((struct proc *, struct fpreg *)); +int set_fpregs __P((struct proc *, struct fpreg *)); #endif /* !_MACHINE_MD_VAR_H_ */ |