Make cpu_setmcontext() fix up the passed-in MSR value.

This commit is contained in:
shige 2006-03-26 16:15:57 +00:00
parent 862d1d4e18
commit 205ee851c8
1 changed files with 8 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: sig_machdep.c,v 1.24 2005/12/11 12:18:46 christos Exp $ */
/* $NetBSD: sig_machdep.c,v 1.25 2006/03/26 16:15:57 shige Exp $ */
/*
* Copyright (C) 1995, 1996 Wolfgang Solfrank.
@ -32,7 +32,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.24 2005/12/11 12:18:46 christos Exp $");
__KERNEL_RCSID(0, "$NetBSD: sig_machdep.c,v 1.25 2006/03/26 16:15:57 shige Exp $");
#include "opt_compat_netbsd.h"
#include "opt_ppcarch.h"
@ -223,8 +223,12 @@ cpu_setmcontext(struct lwp *l, const mcontext_t *mcp, unsigned int flags)
/* Restore GPR context, if any. */
if (flags & _UC_CPU) {
if (!PSL_USEROK_P(gr[_REG_MSR]))
return (EINVAL);
/*
* Accept all user-settable bits without complaint;
* userland should not need to know the machine-specific
* MSR value.
*/
gr[_REG_MSR] = (gr[_REG_MSR] & PSL_USERMOD) | PSL_USERSET;
#ifdef PPC_HAVE_FPU
/*