From 04869b812b8e19fbfbfd75299f3b00c186edb0d3 Mon Sep 17 00:00:00 2001 From: Konstantin Belousov Date: Sat, 22 Feb 2020 20:43:04 +0000 Subject: 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 --- sys/sys/proc.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'sys/sys/proc.h') 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) { -- cgit v1.2.3