From 1170c9fca06e7cac1b2447546523cfa6418c2cd0 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Fri, 30 Dec 2005 00:18:31 +0000 Subject: Make PT_SETFPREGS work even if the process didn't use the fpu yet. ok miod@ --- sys/arch/sparc/sparc/process_machdep.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'sys') 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 #include #include +#include #include #include #include @@ -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. */ -- cgit v1.2.3