- Proc locking.

- P_INMEM -> PS_INMEM.
This commit is contained in:
John Baldwin 2001-01-24 10:16:23 +00:00
parent 0a8ec7a3bd
commit 1d64ccdcbb
2 changed files with 48 additions and 8 deletions

View File

@ -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));
}

View File

@ -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));
}