diff options
-rw-r--r-- | sys/alpha/alpha/procfs_machdep.c | 28 | ||||
-rw-r--r-- | sys/powerpc/powerpc/procfs_machdep.c | 28 |
2 files changed, 48 insertions, 8 deletions
diff --git a/sys/alpha/alpha/procfs_machdep.c b/sys/alpha/alpha/procfs_machdep.c index 000eb02..229d2f9 100644 --- a/sys/alpha/alpha/procfs_machdep.c +++ b/sys/alpha/alpha/procfs_machdep.c @@ -85,8 +85,13 @@ procfs_read_regs(p, regs) struct proc *p; struct reg *regs; { - if ((p->p_flag & P_INMEM) == 0) + + mtx_enter(&sched_lock, MTX_SPIN); + if ((p->p_sflag & PS_INMEM) == 0) { + mtx_exit(&sched_lock, MTX_SPIN); return (EIO); + } + mtx_exit(&sched_lock, MTX_SPIN); return (fill_regs(p, regs)); } @@ -95,8 +100,13 @@ procfs_write_regs(p, regs) struct proc *p; struct reg *regs; { - if ((p->p_flag & P_INMEM) == 0) + + mtx_enter(&sched_lock, MTX_SPIN); + if ((p->p_sflag & PS_INMEM) == 0) { + mtx_exit(&sched_lock, MTX_SPIN); return (EIO); + } + mtx_exit(&sched_lock, MTX_SPIN); return (set_regs(p, regs)); } @@ -110,8 +120,13 @@ procfs_read_fpregs(p, fpregs) struct proc *p; struct fpreg *fpregs; { - if ((p->p_flag & P_INMEM) == 0) + + mtx_enter(&sched_lock, MTX_SPIN); + if ((p->p_sflag & PS_INMEM) == 0) { + mtx_exit(&sched_lock, MTX_SPIN); return (EIO); + } + mtx_exit(&sched_lock, MTX_SPIN); return (fill_fpregs(p, fpregs)); } @@ -120,8 +135,13 @@ procfs_write_fpregs(p, fpregs) struct proc *p; struct fpreg *fpregs; { - if ((p->p_flag & P_INMEM) == 0) + + mtx_enter(&sched_lock, MTX_SPIN); + if ((p->p_sflag & PS_INMEM) == 0) { + mtx_exit(&sched_lock, MTX_SPIN); return (EIO); + } + mtx_exit(&sched_lock, MTX_SPIN); return (set_fpregs(p, fpregs)); } diff --git a/sys/powerpc/powerpc/procfs_machdep.c b/sys/powerpc/powerpc/procfs_machdep.c index 000eb02..229d2f9 100644 --- a/sys/powerpc/powerpc/procfs_machdep.c +++ b/sys/powerpc/powerpc/procfs_machdep.c @@ -85,8 +85,13 @@ procfs_read_regs(p, regs) struct proc *p; struct reg *regs; { - if ((p->p_flag & P_INMEM) == 0) + + mtx_enter(&sched_lock, MTX_SPIN); + if ((p->p_sflag & PS_INMEM) == 0) { + mtx_exit(&sched_lock, MTX_SPIN); return (EIO); + } + mtx_exit(&sched_lock, MTX_SPIN); return (fill_regs(p, regs)); } @@ -95,8 +100,13 @@ procfs_write_regs(p, regs) struct proc *p; struct reg *regs; { - if ((p->p_flag & P_INMEM) == 0) + + mtx_enter(&sched_lock, MTX_SPIN); + if ((p->p_sflag & PS_INMEM) == 0) { + mtx_exit(&sched_lock, MTX_SPIN); return (EIO); + } + mtx_exit(&sched_lock, MTX_SPIN); return (set_regs(p, regs)); } @@ -110,8 +120,13 @@ procfs_read_fpregs(p, fpregs) struct proc *p; struct fpreg *fpregs; { - if ((p->p_flag & P_INMEM) == 0) + + mtx_enter(&sched_lock, MTX_SPIN); + if ((p->p_sflag & PS_INMEM) == 0) { + mtx_exit(&sched_lock, MTX_SPIN); return (EIO); + } + mtx_exit(&sched_lock, MTX_SPIN); return (fill_fpregs(p, fpregs)); } @@ -120,8 +135,13 @@ procfs_write_fpregs(p, fpregs) struct proc *p; struct fpreg *fpregs; { - if ((p->p_flag & P_INMEM) == 0) + + mtx_enter(&sched_lock, MTX_SPIN); + if ((p->p_sflag & PS_INMEM) == 0) { + mtx_exit(&sched_lock, MTX_SPIN); return (EIO); + } + mtx_exit(&sched_lock, MTX_SPIN); return (set_fpregs(p, fpregs)); } |