summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2005-12-30 00:18:31 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2005-12-30 00:18:31 +0000
commit1170c9fca06e7cac1b2447546523cfa6418c2cd0 (patch)
tree9cb8601f724cf1eeda7f2b970d1e7d991f7abc47 /sys
parent01e16e2f24ded20614205584a950cc987b937004 (diff)
Make PT_SETFPREGS work even if the process didn't use the fpu yet.
ok miod@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sparc/sparc/process_machdep.c10
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. */