diff options
author | davidxu <davidxu@FreeBSD.org> | 2004-08-08 22:26:11 +0000 |
---|---|---|
committer | davidxu <davidxu@FreeBSD.org> | 2004-08-08 22:26:11 +0000 |
commit | 6412ad5b2e1e497180ded0b4e5d9c99f9416d91a (patch) | |
tree | 9e1981e868076e52c9eefabd3262c4b3711b352d /sys | |
parent | b337473ecd472257d9df25550d249e600f5b98c4 (diff) | |
download | FreeBSD-src-6412ad5b2e1e497180ded0b4e5d9c99f9416d91a.zip FreeBSD-src-6412ad5b2e1e497180ded0b4e5d9c99f9416d91a.tar.gz |
Add pl_flags to ptrace_lwpinfo, two flags PL_FLAG_SA and PL_FLAG_BOUND
indicate that a thread is in UTS critical region.
Reviewed by: deischen
Approved by: marcel
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/sys_process.c | 7 | ||||
-rw-r--r-- | sys/sys/ptrace.h | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 9dad83a..7063ed3 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -807,6 +807,13 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) else pl->pl_event = 0; } + if (td2->td_pflags & TDP_SA) { + pl->pl_flags = PL_FLAG_SA; + if (td2->td_upcall && !TD_CAN_UNBIND(td2)) + pl->pl_flags |= PL_FLAG_BOUND; + } else { + pl->pl_flags = 0; + } _PRELE(p); PROC_UNLOCK(p); return (0); diff --git a/sys/sys/ptrace.h b/sys/sys/ptrace.h index e9493d3..5596790 100644 --- a/sys/sys/ptrace.h +++ b/sys/sys/ptrace.h @@ -89,6 +89,9 @@ struct ptrace_lwpinfo { int pl_event; /* Event that stopped the LWP. */ #define PL_EVENT_NONE 0 #define PL_EVENT_SIGNAL 1 + int pl_flags; /* LWP flags. */ +#define PL_FLAG_SA 0x01 /* M:N thread */ +#define PL_FLAG_BOUND 0x02 /* M:N bound thread */ }; #ifdef _KERNEL |