diff options
author | jhb <jhb@FreeBSD.org> | 2001-01-24 10:16:23 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-01-24 10:16:23 +0000 |
commit | 451c942dba11e15e22f6154a092b2cc92e411a9c (patch) | |
tree | f3c5646f1c02b224f998a6ebb95b37808acf4ec9 | |
parent | 8e27ac396affd4deac3eafe12d8d2d936e3137b1 (diff) | |
download | FreeBSD-src-451c942dba11e15e22f6154a092b2cc92e411a9c.zip FreeBSD-src-451c942dba11e15e22f6154a092b2cc92e411a9c.tar.gz |
- Proc locking.
- P_INMEM -> PS_INMEM.
-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)); } |