diff options
author | 2005-12-30 00:18:30 +0000 | |
---|---|---|
committer | 2005-12-30 00:18:30 +0000 | |
commit | 9970856ad97cbeddc8e1b2359a56f5c7db902fbb (patch) | |
tree | d718cf7efa2c1b523b3fd6feec3202181c4c9b5b | |
parent | W^X for G5 (diff) | |
download | wireguard-openbsd-9970856ad97cbeddc8e1b2359a56f5c7db902fbb.tar.xz wireguard-openbsd-9970856ad97cbeddc8e1b2359a56f5c7db902fbb.zip |
Make PT_SETFPREGS work even if the process didn't use the fpu yet.
ok miod@
-rw-r--r-- | sys/arch/sparc/sparc/process_machdep.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/arch/sparc/sparc/process_machdep.c b/sys/arch/sparc/sparc/process_machdep.c index db8c15aa190..6a42d97e2a4 100644 --- a/sys/arch/sparc/sparc/process_machdep.c +++ b/sys/arch/sparc/sparc/process_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: process_machdep.c,v 1.11 2005/12/17 03:54:30 deraadt Exp $ */ +/* $OpenBSD: process_machdep.c,v 1.12 2005/12/30 00:18:30 kettenis Exp $ */ /* $NetBSD: process_machdep.c,v 1.6 1996/03/14 21:09:26 christos Exp $ */ /* @@ -62,6 +62,7 @@ #include <sys/systm.h> #include <sys/time.h> #include <sys/kernel.h> +#include <sys/malloc.h> #include <sys/proc.h> #include <sys/user.h> #include <sys/vnode.h> @@ -145,8 +146,11 @@ process_write_fpregs(p, regs) struct proc *p; struct fpreg *regs; { - if (p->p_md.md_fpstate == NULL) - return EINVAL; + /* NOTE: struct fpreg == struct fpstate */ + if (p->p_md.md_fpstate == NULL) { + p->p_md.md_fpstate = malloc(sizeof(struct fpstate), + M_SUBPROC, M_WAITOK); + } if (p == cpuinfo.fpproc) { /* Release the fpu. */ |