summaryrefslogtreecommitdiffstats
path: root/sys/kern/sys_process.c
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2002-02-07 23:05:40 +0000
committerpeter <peter@FreeBSD.org>2002-02-07 23:05:40 +0000
commit59b80f66972f00d5e33ac1680065ae1ccf1808e3 (patch)
tree63984663cb6c4559e334c322dea1b6c51d818fdd /sys/kern/sys_process.c
parent5830d22764b027cd885c6f0c8e4e1cc2211e79c6 (diff)
downloadFreeBSD-src-59b80f66972f00d5e33ac1680065ae1ccf1808e3.zip
FreeBSD-src-59b80f66972f00d5e33ac1680065ae1ccf1808e3.tar.gz
Fix a whole bunch of long lines introduced by previous commit by using
td = FIRST_THREAD_IN_PROC(p) once, after we have identified the process that we are operating on.
Diffstat (limited to 'sys/kern/sys_process.c')
-rw-r--r--sys/kern/sys_process.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index ff7593c..68c226f 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -263,6 +263,7 @@ ptrace(struct thread *td, struct ptrace_args *uap)
{
struct proc *curp = td->td_proc;
struct proc *p;
+ struct thread *td;
struct iovec iov;
struct uio uio;
union {
@@ -378,12 +379,13 @@ ptrace(struct thread *td, struct ptrace_args *uap)
return (EINVAL);
}
+ td = FIRST_THREAD_IN_PROC(p);
PROC_UNLOCK(p);
#ifdef FIX_SSTEP
/*
* Single step fixup ala procfs
*/
- FIX_SSTEP(FIRST_THREAD_IN_PROC(p)); /* XXXKSE */
+ FIX_SSTEP(td); /* XXXKSE */
#endif
/*
@@ -425,7 +427,8 @@ ptrace(struct thread *td, struct ptrace_args *uap)
PHOLD(p);
if (uap->req == PT_STEP) {
- if ((error = ptrace_single_step(FIRST_THREAD_IN_PROC(p)))) {
+ error = ptrace_single_step(td);
+ if (error) {
PRELE(p);
return (error);
}
@@ -433,8 +436,9 @@ ptrace(struct thread *td, struct ptrace_args *uap)
if (uap->addr != (caddr_t)1) {
fill_kinfo_proc(p, &p->p_uarea->u_kproc);
- if ((error = ptrace_set_pc(FIRST_THREAD_IN_PROC(p),
- (u_long)(uintfptr_t)uap->addr))) {
+ error = ptrace_set_pc(td,
+ (u_long)(uintfptr_t)uap->addr);
+ if (error) {
PRELE(p);
return (error);
}
@@ -472,7 +476,7 @@ ptrace(struct thread *td, struct ptrace_args *uap)
mtx_lock_spin(&sched_lock);
if (p->p_stat == SSTOP) {
p->p_xstat = uap->data;
- setrunnable(FIRST_THREAD_IN_PROC(p)); /* XXXKSE */
+ setrunnable(td); /* XXXKSE */
mtx_unlock_spin(&sched_lock);
} else {
mtx_unlock_spin(&sched_lock);
@@ -525,7 +529,7 @@ ptrace(struct thread *td, struct ptrace_args *uap)
error = copyin(uap->addr, &r.reg, sizeof r.reg);
if (error == 0) {
PHOLD(p);
- error = proc_write_regs(FIRST_THREAD_IN_PROC(p), &r.reg);
+ error = proc_write_regs(td, &r.reg);
PRELE(p);
}
return (error);
@@ -534,7 +538,7 @@ ptrace(struct thread *td, struct ptrace_args *uap)
#ifdef PT_GETREGS
case PT_GETREGS:
PHOLD(p);
- error = proc_read_regs(FIRST_THREAD_IN_PROC(p), &r.reg);
+ error = proc_read_regs(td, &r.reg);
PRELE(p);
if (error == 0)
error = copyout(&r.reg, uap->addr, sizeof r.reg);
@@ -546,7 +550,7 @@ ptrace(struct thread *td, struct ptrace_args *uap)
error = copyin(uap->addr, &r.fpreg, sizeof r.fpreg);
if (error == 0) {
PHOLD(p);
- error = proc_write_fpregs(FIRST_THREAD_IN_PROC(p), &r.fpreg);
+ error = proc_write_fpregs(td, &r.fpreg);
PRELE(p);
}
return (error);
@@ -555,7 +559,7 @@ ptrace(struct thread *td, struct ptrace_args *uap)
#ifdef PT_GETFPREGS
case PT_GETFPREGS:
PHOLD(p);
- error = proc_read_fpregs(FIRST_THREAD_IN_PROC(p), &r.fpreg);
+ error = proc_read_fpregs(td, &r.fpreg);
PRELE(p);
if (error == 0)
error = copyout(&r.fpreg, uap->addr, sizeof r.fpreg);
@@ -567,7 +571,7 @@ ptrace(struct thread *td, struct ptrace_args *uap)
error = copyin(uap->addr, &r.dbreg, sizeof r.dbreg);
if (error == 0) {
PHOLD(p);
- error = proc_write_dbregs(FIRST_THREAD_IN_PROC(p), &r.dbreg);
+ error = proc_write_dbregs(td, &r.dbreg);
PRELE(p);
}
return (error);
@@ -576,7 +580,7 @@ ptrace(struct thread *td, struct ptrace_args *uap)
#ifdef PT_GETDBREGS
case PT_GETDBREGS:
PHOLD(p);
- error = proc_read_dbregs(FIRST_THREAD_IN_PROC(p), &r.dbreg);
+ error = proc_read_dbregs(td, &r.dbreg);
PRELE(p);
if (error == 0)
error = copyout(&r.dbreg, uap->addr, sizeof r.dbreg);
OpenPOWER on IntegriCloud