From: miod Date: Mon, 28 Jul 2008 18:48:25 +0000 (+0000) Subject: In addition to cop0 sr, prevent cop0 ic from being modified in X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b8aeba210c15deca1674c14602193f192e130698;p=openbsd In addition to cop0 sr, prevent cop0 ic from being modified in process_write_regs(). --- diff --git a/sys/arch/mips64/mips64/process_machdep.c b/sys/arch/mips64/mips64/process_machdep.c index 94324f33f58..06f48d09ac6 100644 --- a/sys/arch/mips64/mips64/process_machdep.c +++ b/sys/arch/mips64/mips64/process_machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: process_machdep.c,v 1.8 2007/10/18 04:32:25 miod Exp $ */ +/* $OpenBSD: process_machdep.c,v 1.9 2008/07/28 18:48:25 miod Exp $ */ /* * Copyright (c) 1994 Adam Glass @@ -40,7 +40,7 @@ * From: * Id: procfs_i386.c,v 4.1 1993/12/17 10:47:45 jsp Rel * - * $Id: process_machdep.c,v 1.8 2007/10/18 04:32:25 miod Exp $ + * $Id: process_machdep.c,v 1.9 2008/07/28 18:48:25 miod Exp $ */ /* @@ -104,7 +104,7 @@ process_write_regs(p, regs) struct proc *p; struct reg *regs; { - register_t sr; + register_t sr, ic, cpl; extern struct proc *machFPCurProcPtr; if (p == machFPCurProcPtr) { @@ -114,8 +114,12 @@ process_write_regs(p, regs) MipsSaveCurFPState16(p); } sr = p->p_md.md_regs->sr; + ic = p->p_md.md_regs->ic; + cpl = p->p_md.md_regs->cpl; bcopy((caddr_t)regs, (caddr_t)p->p_md.md_regs, REGSIZE); p->p_md.md_regs->sr = sr; + p->p_md.md_regs->ic = ic; + p->p_md.md_regs->cpl = cpl; return (0); }