aboutsummaryrefslogtreecommitdiff
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
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
-rw-r--r--sys/kern/kern_thread.c8
-rw-r--r--sys/sys/proc.h20
2 files changed, 24 insertions, 4 deletions
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c
index b3746553f2ac..e234b4056a18 100644
--- a/sys/kern/kern_thread.c
+++ b/sys/kern/kern_thread.c
@@ -82,9 +82,9 @@ _Static_assert(offsetof(struct thread, td_flags) == 0xfc,
"struct thread KBI td_flags");
_Static_assert(offsetof(struct thread, td_pflags) == 0x104,
"struct thread KBI td_pflags");
-_Static_assert(offsetof(struct thread, td_frame) == 0x490,
+_Static_assert(offsetof(struct thread, td_frame) == 0x498,
"struct thread KBI td_frame");
-_Static_assert(offsetof(struct thread, td_emuldata) == 0x6a0,
+_Static_assert(offsetof(struct thread, td_emuldata) == 0x6b0,
"struct thread KBI td_emuldata");
_Static_assert(offsetof(struct proc, p_flag) == 0xb0,
"struct proc KBI p_flag");
@@ -102,9 +102,9 @@ _Static_assert(offsetof(struct thread, td_flags) == 0x98,
"struct thread KBI td_flags");
_Static_assert(offsetof(struct thread, td_pflags) == 0xa0,
"struct thread KBI td_pflags");
-_Static_assert(offsetof(struct thread, td_frame) == 0x2f8,
+_Static_assert(offsetof(struct thread, td_frame) == 0x2fc,
"struct thread KBI td_frame");
-_Static_assert(offsetof(struct thread, td_emuldata) == 0x340,
+_Static_assert(offsetof(struct thread, td_emuldata) == 0x344,
"struct thread KBI td_emuldata");
_Static_assert(offsetof(struct proc, p_flag) == 0x68,
"struct proc KBI p_flag");
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)
{