aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/proc.h
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2020-02-22 20:43:04 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2020-02-22 20:43:04 +0000
commit04869b812b8e19fbfbfd75299f3b00c186edb0d3 (patch)
tree39855f3d75b35e3806f47a54fb47c2cd79149854 /sys/sys/proc.h
parent9b48a7bbebd72cdfa759ca66f786b7d3f23ace44 (diff)
downloadsrc-04869b812b8e19fbfbfd75299f3b00c186edb0d3.tar.gz
src-04869b812b8e19fbfbfd75299f3b00c186edb0d3.zip
Add td_pflags2, yet another thread-private flags word.
There is no more free bits in td_pflags. Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week
Notes
Notes: svn path=/head/; revision=358251
Diffstat (limited to 'sys/sys/proc.h')
-rw-r--r--sys/sys/proc.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index f657a4cc7af5..2b574cb1c7b2 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -250,6 +250,7 @@ struct thread {
int td_flags; /* (t) TDF_* flags. */
int td_inhibitors; /* (t) Why can not run. */
int td_pflags; /* (k) Private thread (TDP_*) flags. */
+ int td_pflags2; /* (k) Private thread (TDP2_*) flags. */
int td_dupfd; /* (k) Ret value from fdopen. XXX */
int td_sqqueue; /* (t) Sleepqueue queue blocked on. */
const void *td_wchan; /* (t) Sleep address. */
@@ -1197,6 +1198,25 @@ curthread_pflags_restore(int save)
curthread->td_pflags &= save;
}
+static __inline int
+curthread_pflags2_set(int flags)
+{
+ struct thread *td;
+ int save;
+
+ td = curthread;
+ save = ~flags | (td->td_pflags2 & flags);
+ td->td_pflags2 |= flags;
+ return (save);
+}
+
+static __inline void
+curthread_pflags2_restore(int save)
+{
+
+ curthread->td_pflags2 &= save;
+}
+
static __inline __pure2 struct td_sched *
td_get_sched(struct thread *td)
{