summaryrefslogtreecommitdiff
path: root/sys/sys/proc.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/sys/proc.h')
-rw-r--r--sys/sys/proc.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index e16fdd846ab8..b0c90a2d3bc8 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -415,6 +415,17 @@ sigonstack(size_t sp)
#define AP_EXCLUSIVE LK_EXCLUSIVE
#define AP_RELEASE LK_RELEASE
+/* Lock and unlock the proc child and sibling lists. */
+#define PROCTREE_LOCK(how) \
+ lockmgr(&proctree_lock, (how), NULL, CURPROC)
+
+#define PROCTREE_ASSERT(what) \
+ LOCKMGR_ASSERT(&proctree_lock, (what), CURPROC)
+
+#define PT_SHARED LK_SHARED
+#define PT_EXCLUSIVE LK_EXCLUSIVE
+#define PT_RELEASE LK_RELEASE
+
/* Hold process U-area in memory, normally for ptrace/procfs work. */
#define PHOLD(p) do { \
PROC_LOCK(p); \
@@ -439,6 +450,7 @@ extern LIST_HEAD(pgrphashhead, pgrp) *pgrphashtbl;
extern u_long pgrphash;
extern struct lock allproc_lock;
+extern struct lock proctree_lock;
extern struct proc proc0; /* Process slot for swapper. */
extern int hogticks; /* Limit on kernel cpu hogs. */
extern int nprocs, maxproc; /* Current and max number of procs. */