diff options
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/procfs/procfs_ctl.c | 13 | ||||
-rw-r--r-- | sys/fs/procfs/procfs_dbregs.c | 4 | ||||
-rw-r--r-- | sys/fs/procfs/procfs_fpregs.c | 4 | ||||
-rw-r--r-- | sys/fs/procfs/procfs_ioctl.c | 2 | ||||
-rw-r--r-- | sys/fs/procfs/procfs_regs.c | 4 | ||||
-rw-r--r-- | sys/fs/procfs/procfs_status.c | 6 |
6 files changed, 19 insertions, 14 deletions
diff --git a/sys/fs/procfs/procfs_ctl.c b/sys/fs/procfs/procfs_ctl.c index d4c37fe..e4a6244 100644 --- a/sys/fs/procfs/procfs_ctl.c +++ b/sys/fs/procfs/procfs_ctl.c @@ -190,7 +190,7 @@ out: /* * do single-step fixup if needed */ - FIX_SSTEP(&p->p_thread); /* XXXKSE */ + FIX_SSTEP(FIRST_THREAD_IN_PROC(p)); /* XXXKSE */ #endif /* @@ -242,10 +242,11 @@ out: /* * Step. Let the target process execute a single instruction. + * What does it mean to single step a threaded program? */ case PROCFS_CTL_STEP: PROC_UNLOCK(p); - error = proc_sstep(&p->p_thread); /* XXXKSE */ + error = proc_sstep(FIRST_THREAD_IN_PROC(p)); /* XXXKSE */ PRELE(p); if (error) return (error); @@ -299,7 +300,7 @@ out: mtx_lock_spin(&sched_lock); if (p->p_stat == SSTOP) - setrunnable(&p->p_thread); /* XXXKSE */ + setrunnable(FIRST_THREAD_IN_PROC(p)); /* XXXKSE */ mtx_unlock_spin(&sched_lock); return (0); } @@ -347,12 +348,14 @@ procfs_doprocctl(PFS_FILL_ARGS) printf("procfs: got a sig%s\n", sbuf_data(sb)); PROC_LOCK(p); mtx_lock_spin(&sched_lock); + +/* This is very broken XXXKSE */ if (TRACE_WAIT_P(td->td_proc, p)) { p->p_xstat = nm->nm_val; #ifdef FIX_SSTEP - FIX_SSTEP(&p->p_thread); /* XXXKSE */ + FIX_SSTEP(FIRST_THREAD_IN_PROC(p)); /* XXXKSE */ #endif - setrunnable(&p->p_thread); /* XXXKSE */ + setrunnable(FIRST_THREAD_IN_PROC(p)); /* XXXKSE */ mtx_unlock_spin(&sched_lock); } else { mtx_unlock_spin(&sched_lock); diff --git a/sys/fs/procfs/procfs_dbregs.c b/sys/fs/procfs/procfs_dbregs.c index 8977955..19e16dd 100644 --- a/sys/fs/procfs/procfs_dbregs.c +++ b/sys/fs/procfs/procfs_dbregs.c @@ -77,14 +77,14 @@ procfs_doprocdbregs(PFS_FILL_ARGS) if (kl < 0) error = EINVAL; else - error = proc_read_dbregs(&p->p_thread, &r); /* XXXKSE */ + error = proc_read_dbregs(FIRST_THREAD_IN_PROC(p), &r); /* XXXKSE */ if (error == 0) error = uiomove(kv, kl, uio); if (error == 0 && uio->uio_rw == UIO_WRITE) { if (p->p_stat != SSTOP) error = EBUSY; else - error = proc_write_dbregs(&p->p_thread, &r); /* XXXKSE */ + error = proc_write_dbregs(FIRST_THREAD_IN_PROC(p), &r); /* XXXKSE */ } uio->uio_offset = 0; diff --git a/sys/fs/procfs/procfs_fpregs.c b/sys/fs/procfs/procfs_fpregs.c index 23be296..f1ba6f6 100644 --- a/sys/fs/procfs/procfs_fpregs.c +++ b/sys/fs/procfs/procfs_fpregs.c @@ -76,14 +76,14 @@ procfs_doprocfpregs(PFS_FILL_ARGS) if (kl < 0) error = EINVAL; else - error = proc_read_fpregs(&p->p_thread, &r); + error = proc_read_fpregs(FIRST_THREAD_IN_PROC(p), &r); if (error == 0) error = uiomove(kv, kl, uio); if (error == 0 && uio->uio_rw == UIO_WRITE) { if (p->p_stat != SSTOP) error = EBUSY; else - error = proc_write_fpregs(&p->p_thread, &r); + error = proc_write_fpregs(FIRST_THREAD_IN_PROC(p), &r); } PRELE(p); diff --git a/sys/fs/procfs/procfs_ioctl.c b/sys/fs/procfs/procfs_ioctl.c index 6055eee..1d1124c 100644 --- a/sys/fs/procfs/procfs_ioctl.c +++ b/sys/fs/procfs/procfs_ioctl.c @@ -96,7 +96,7 @@ procfs_ioctl(PFS_IOCTL_ARGS) p->p_step = 0; if (p->p_stat == SSTOP) { p->p_xstat = sig; - setrunnable(&p->p_thread); + setrunnable(FIRST_THREAD_IN_PROC(p)); mtx_unlock_spin(&sched_lock); } else { mtx_unlock_spin(&sched_lock); diff --git a/sys/fs/procfs/procfs_regs.c b/sys/fs/procfs/procfs_regs.c index 623eb45..62a0bc0 100644 --- a/sys/fs/procfs/procfs_regs.c +++ b/sys/fs/procfs/procfs_regs.c @@ -76,14 +76,14 @@ procfs_doprocregs(PFS_FILL_ARGS) if (kl < 0) error = EINVAL; else - error = proc_read_regs(&p->p_thread, &r); /* XXXKSE */ + error = proc_read_regs(FIRST_THREAD_IN_PROC(p), &r); /* XXXKSE */ if (error == 0) error = uiomove(kv, kl, uio); if (error == 0 && uio->uio_rw == UIO_WRITE) { if (p->p_stat != SSTOP) error = EBUSY; else - error = proc_write_regs(&p->p_thread, &r); /* XXXKSE */ + error = proc_write_regs(FIRST_THREAD_IN_PROC(p), &r); /* XXXKSE */ } PRELE(p); diff --git a/sys/fs/procfs/procfs_status.c b/sys/fs/procfs/procfs_status.c index 44772d3..1b8de12 100644 --- a/sys/fs/procfs/procfs_status.c +++ b/sys/fs/procfs/procfs_status.c @@ -127,9 +127,11 @@ procfs_doprocstatus(PFS_FILL_ARGS) if (p->p_flag & P_KSES) { sbuf_printf(sb, " %s", "-kse- "); } else { + struct thread *td; + td = FIRST_THREAD_IN_PROC(p); sbuf_printf(sb, " %s", - (p->p_thread.td_wchan && p->p_thread.td_wmesg) ? - p->p_thread.td_wmesg : "nochan"); + (td->td_wchan && td->td_wmesg) ? + td->td_wmesg : "nochan"); } cr = p->p_ucred; |