Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/proc.h
Show First 20 Lines • Show All 256 Lines • ▼ Show 20 Lines | |||||
#define td_siglist td_sigqueue.sq_signals | #define td_siglist td_sigqueue.sq_signals | ||||
u_char td_lend_user_pri; /* (t) Lend user pri. */ | u_char td_lend_user_pri; /* (t) Lend user pri. */ | ||||
u_char td_allocdomain; /* (b) NUMA domain backing this struct thread. */ | u_char td_allocdomain; /* (b) NUMA domain backing this struct thread. */ | ||||
struct kmsan_td *td_kmsan; /* (k) KMSAN state */ | struct kmsan_td *td_kmsan; /* (k) KMSAN state */ | ||||
/* Cleared during fork1() */ | /* Cleared during fork1() */ | ||||
#define td_startzero td_flags | #define td_startzero td_flags | ||||
int td_flags; /* (t) TDF_* flags. */ | int td_flags; /* (t) TDF_* flags. */ | ||||
int td_flags2; /* (t) TDF2_* flags. */ | |||||
int td_inhibitors; /* (t) Why can not run. */ | int td_inhibitors; /* (t) Why can not run. */ | ||||
int td_pflags; /* (k) Private thread (TDP_*) flags. */ | int td_pflags; /* (k) Private thread (TDP_*) flags. */ | ||||
int td_pflags2; /* (k) Private thread (TDP2_*) flags. */ | int td_pflags2; /* (k) Private thread (TDP2_*) flags. */ | ||||
int td_dupfd; /* (k) Ret value from fdopen. XXX */ | int td_dupfd; /* (k) Ret value from fdopen. XXX */ | ||||
int td_sqqueue; /* (t) Sleepqueue queue blocked on. */ | int td_sqqueue; /* (t) Sleepqueue queue blocked on. */ | ||||
const void *td_wchan; /* (t) Sleep address. */ | const void *td_wchan; /* (t) Sleep address. */ | ||||
const char *td_wmesg; /* (t) Reason for sleep. */ | const char *td_wmesg; /* (t) Reason for sleep. */ | ||||
volatile u_char td_owepreempt; /* (k*) Preempt on last critical_exit */ | volatile u_char td_owepreempt; /* (k*) Preempt on last critical_exit */ | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | #define td_startzero td_flags | ||||
u_int td_no_sleeping; /* (k) Sleeping disabled count. */ | u_int td_no_sleeping; /* (k) Sleeping disabled count. */ | ||||
void *td_su; /* (k) FFS SU private */ | void *td_su; /* (k) FFS SU private */ | ||||
sbintime_t td_sleeptimo; /* (t) Sleep timeout. */ | sbintime_t td_sleeptimo; /* (t) Sleep timeout. */ | ||||
int td_rtcgen; /* (s) rtc_generation of abs. sleep */ | int td_rtcgen; /* (s) rtc_generation of abs. sleep */ | ||||
int td_errno; /* (k) Error from last syscall. */ | int td_errno; /* (k) Error from last syscall. */ | ||||
size_t td_vslock_sz; /* (k) amount of vslock-ed space */ | size_t td_vslock_sz; /* (k) amount of vslock-ed space */ | ||||
struct kcov_info *td_kcov_info; /* (*) Kernel code coverage data */ | struct kcov_info *td_kcov_info; /* (*) Kernel code coverage data */ | ||||
u_int td_ucredref; /* (k) references on td_realucred */ | u_int td_ucredref; /* (k) references on td_realucred */ | ||||
uint32_t td_rseq_sig; /* (k) abort handler signature */ | |||||
void *td_rseq_abi; /* (k) usermode rseq */ | |||||
register_t td_rseq_start_ip;/* (k) */ | |||||
register_t td_rseq_end_ip; /* (k) */ | |||||
register_t td_rseq_abort_ip;/* (k) */ | |||||
#define td_endzero td_sigmask | #define td_endzero td_sigmask | ||||
/* Copied during fork1() or create_thread(). */ | /* Copied during fork1() or create_thread(). */ | ||||
#define td_startcopy td_endzero | #define td_startcopy td_endzero | ||||
sigset_t td_sigmask; /* (c) Current signal mask. */ | sigset_t td_sigmask; /* (c) Current signal mask. */ | ||||
u_char td_rqindex; /* (t) Run queue index. */ | u_char td_rqindex; /* (t) Run queue index. */ | ||||
u_char td_base_pri; /* (t) Thread base kernel priority. */ | u_char td_base_pri; /* (t) Thread base kernel priority. */ | ||||
u_char td_priority; /* (t) Thread active priority. */ | u_char td_priority; /* (t) Thread active priority. */ | ||||
▲ Show 20 Lines • Show All 130 Lines • ▼ Show 20 Lines | |||||
#define TDF_NEEDSUSPCHK 0x00008000 /* Thread may need to suspend. */ | #define TDF_NEEDSUSPCHK 0x00008000 /* Thread may need to suspend. */ | ||||
#define TDF_NEEDRESCHED 0x00010000 /* Thread needs to yield. */ | #define TDF_NEEDRESCHED 0x00010000 /* Thread needs to yield. */ | ||||
#define TDF_NEEDSIGCHK 0x00020000 /* Thread may need signal delivery. */ | #define TDF_NEEDSIGCHK 0x00020000 /* Thread may need signal delivery. */ | ||||
#define TDF_NOLOAD 0x00040000 /* Ignore during load avg calculations. */ | #define TDF_NOLOAD 0x00040000 /* Ignore during load avg calculations. */ | ||||
#define TDF_SERESTART 0x00080000 /* ERESTART on stop attempts. */ | #define TDF_SERESTART 0x00080000 /* ERESTART on stop attempts. */ | ||||
#define TDF_THRWAKEUP 0x00100000 /* Libthr thread must not suspend itself. */ | #define TDF_THRWAKEUP 0x00100000 /* Libthr thread must not suspend itself. */ | ||||
#define TDF_SEINTR 0x00200000 /* EINTR on stop attempts. */ | #define TDF_SEINTR 0x00200000 /* EINTR on stop attempts. */ | ||||
#define TDF_SWAPINREQ 0x00400000 /* Swapin request due to wakeup. */ | #define TDF_SWAPINREQ 0x00400000 /* Swapin request due to wakeup. */ | ||||
#define TDF_UNUSED23 0x00800000 /* --available-- */ | #define TDF_RSEQ 0x00800000 /* rseq active */ | ||||
#define TDF_SCHED0 0x01000000 /* Reserved for scheduler private use */ | #define TDF_SCHED0 0x01000000 /* Reserved for scheduler private use */ | ||||
#define TDF_SCHED1 0x02000000 /* Reserved for scheduler private use */ | #define TDF_SCHED1 0x02000000 /* Reserved for scheduler private use */ | ||||
#define TDF_SCHED2 0x04000000 /* Reserved for scheduler private use */ | #define TDF_SCHED2 0x04000000 /* Reserved for scheduler private use */ | ||||
#define TDF_SCHED3 0x08000000 /* Reserved for scheduler private use */ | #define TDF_SCHED3 0x08000000 /* Reserved for scheduler private use */ | ||||
#define TDF_ALRMPEND 0x10000000 /* Pending SIGVTALRM needs to be posted. */ | #define TDF_ALRMPEND 0x10000000 /* Pending SIGVTALRM needs to be posted. */ | ||||
#define TDF_PROFPEND 0x20000000 /* Pending SIGPROF needs to be posted. */ | #define TDF_PROFPEND 0x20000000 /* Pending SIGPROF needs to be posted. */ | ||||
#define TDF_MACPEND 0x40000000 /* AST-based MAC event pending. */ | #define TDF_MACPEND 0x40000000 /* AST-based MAC event pending. */ | ||||
#define TDF2_RSEQ_CLRCS 0x00000001 /* rseq clear rc */ | |||||
#define TDF2_RSEQ_MB 0x00000002 /* MEMBARRIER_RSEQ requested */ | |||||
/* Userland debug flags */ | /* Userland debug flags */ | ||||
#define TDB_SUSPEND 0x00000001 /* Thread is suspended by debugger */ | #define TDB_SUSPEND 0x00000001 /* Thread is suspended by debugger */ | ||||
#define TDB_XSIG 0x00000002 /* Thread is exchanging signal under trace */ | #define TDB_XSIG 0x00000002 /* Thread is exchanging signal under trace */ | ||||
#define TDB_USERWR 0x00000004 /* Debugger modified memory or registers */ | #define TDB_USERWR 0x00000004 /* Debugger modified memory or registers */ | ||||
#define TDB_SCE 0x00000008 /* Thread performs syscall enter */ | #define TDB_SCE 0x00000008 /* Thread performs syscall enter */ | ||||
#define TDB_SCX 0x00000010 /* Thread performs syscall exit */ | #define TDB_SCX 0x00000010 /* Thread performs syscall exit */ | ||||
#define TDB_EXEC 0x00000020 /* TDB_SCX from exec(2) family */ | #define TDB_EXEC 0x00000020 /* TDB_SCX from exec(2) family */ | ||||
#define TDB_FORK 0x00000040 /* TDB_SCX from fork(2) that created new | #define TDB_FORK 0x00000040 /* TDB_SCX from fork(2) that created new | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | |||||
#define TDP_UIOHELD 0x10000000 /* Current uio has pages held in td_ma */ | #define TDP_UIOHELD 0x10000000 /* Current uio has pages held in td_ma */ | ||||
#define TDP_UNUSED0 0x20000000 /* UNUSED */ | #define TDP_UNUSED0 0x20000000 /* UNUSED */ | ||||
#define TDP_EXECVMSPC 0x40000000 /* Execve destroyed old vmspace */ | #define TDP_EXECVMSPC 0x40000000 /* Execve destroyed old vmspace */ | ||||
#define TDP_SIGFASTPENDING 0x80000000 /* Pending signal due to sigfastblock */ | #define TDP_SIGFASTPENDING 0x80000000 /* Pending signal due to sigfastblock */ | ||||
#define TDP2_SBPAGES 0x00000001 /* Owns sbusy on some pages */ | #define TDP2_SBPAGES 0x00000001 /* Owns sbusy on some pages */ | ||||
#define TDP2_COMPAT32RB 0x00000002 /* compat32 ABI for robust lists */ | #define TDP2_COMPAT32RB 0x00000002 /* compat32 ABI for robust lists */ | ||||
#define TDP2_ACCT 0x00000004 /* Doing accounting */ | #define TDP2_ACCT 0x00000004 /* Doing accounting */ | ||||
#define TDP2_RSEQ_SIG 0x00000008 | |||||
/* | /* | ||||
* Reasons that the current thread can not be run yet. | * Reasons that the current thread can not be run yet. | ||||
* More than one may apply. | * More than one may apply. | ||||
*/ | */ | ||||
#define TDI_SUSPENDED 0x0001 /* On suspension queue. */ | #define TDI_SUSPENDED 0x0001 /* On suspension queue. */ | ||||
#define TDI_SLEEPING 0x0002 /* Actually asleep! (tricky). */ | #define TDI_SLEEPING 0x0002 /* Actually asleep! (tricky). */ | ||||
#define TDI_SWAPPED 0x0004 /* Stack not in mem. Bad juju if run. */ | #define TDI_SWAPPED 0x0004 /* Stack not in mem. Bad juju if run. */ | ||||
▲ Show 20 Lines • Show All 294 Lines • ▼ Show 20 Lines | #define P2_STKGAP_DISABLE 0x00000800 /* Disable stack gap for | ||||
MAP_STACK */ | MAP_STACK */ | ||||
#define P2_STKGAP_DISABLE_EXEC 0x00001000 /* Stack gap disabled | #define P2_STKGAP_DISABLE_EXEC 0x00001000 /* Stack gap disabled | ||||
after exec */ | after exec */ | ||||
#define P2_ITSTOPPED 0x00002000 | #define P2_ITSTOPPED 0x00002000 | ||||
#define P2_PTRACEREQ 0x00004000 /* Active ptrace req */ | #define P2_PTRACEREQ 0x00004000 /* Active ptrace req */ | ||||
#define P2_NO_NEW_PRIVS 0x00008000 /* Ignore setuid */ | #define P2_NO_NEW_PRIVS 0x00008000 /* Ignore setuid */ | ||||
#define P2_WXORX_DISABLE 0x00010000 /* WX mappings enabled */ | #define P2_WXORX_DISABLE 0x00010000 /* WX mappings enabled */ | ||||
#define P2_WXORX_ENABLE_EXEC 0x00020000 /* WXORX enabled after exec */ | #define P2_WXORX_ENABLE_EXEC 0x00020000 /* WXORX enabled after exec */ | ||||
#define P2_MEMBAR_PRIVE 0x00040000 /* membar private expedited | |||||
registered */ | |||||
#define P2_MEMBAR_PRIVE_SYNCORE 0x00080000 /* membar private expedited | |||||
sync core registered */ | |||||
#define P2_MEMBAR_GLOBE 0x00100000 /* membar global expedited | |||||
registered */ | |||||
#define P2_MEMBAR_PRIVE_RSEQ 0x00200000 /* membar private expedited | |||||
rseq registered */ | |||||
/* Flags protected by proctree_lock, kept in p_treeflags. */ | /* Flags protected by proctree_lock, kept in p_treeflags. */ | ||||
#define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */ | #define P_TREE_ORPHANED 0x00000001 /* Reparented, on orphan list */ | ||||
#define P_TREE_FIRST_ORPHAN 0x00000002 /* First element of orphan | #define P_TREE_FIRST_ORPHAN 0x00000002 /* First element of orphan | ||||
list */ | list */ | ||||
#define P_TREE_REAPER 0x00000004 /* Reaper of subtree */ | #define P_TREE_REAPER 0x00000004 /* Reaper of subtree */ | ||||
#define P_TREE_GRPEXITED 0x00000008 /* exit1() done with job ctl */ | #define P_TREE_GRPEXITED 0x00000008 /* exit1() done with job ctl */ | ||||
▲ Show 20 Lines • Show All 307 Lines • ▼ Show 20 Lines | |||||
struct thread *tdfind(lwpid_t, pid_t); | struct thread *tdfind(lwpid_t, pid_t); | ||||
void threadinit(void); | void threadinit(void); | ||||
void tidhash_add(struct thread *); | void tidhash_add(struct thread *); | ||||
void tidhash_remove(struct thread *); | void tidhash_remove(struct thread *); | ||||
void cpu_idle(int); | void cpu_idle(int); | ||||
int cpu_idle_wakeup(int); | int cpu_idle_wakeup(int); | ||||
extern void (*cpu_idle_hook)(sbintime_t); /* Hook to machdep CPU idler. */ | extern void (*cpu_idle_hook)(sbintime_t); /* Hook to machdep CPU idler. */ | ||||
void cpu_switch(struct thread *, struct thread *, struct mtx *); | void cpu_switch(struct thread *, struct thread *, struct mtx *); | ||||
void cpu_sync_core(void); | |||||
void cpu_throw(struct thread *, struct thread *) __dead2; | void cpu_throw(struct thread *, struct thread *) __dead2; | ||||
bool curproc_sigkilled(void); | bool curproc_sigkilled(void); | ||||
void userret(struct thread *, struct trapframe *); | void userret(struct thread *, struct trapframe *); | ||||
void cpu_exit(struct thread *); | void cpu_exit(struct thread *); | ||||
void exit1(struct thread *, int, int) __dead2; | void exit1(struct thread *, int, int) __dead2; | ||||
void cpu_copy_thread(struct thread *td, struct thread *td0); | void cpu_copy_thread(struct thread *td, struct thread *td0); | ||||
bool cpu_exec_vmspace_reuse(struct proc *p, struct vm_map *map); | bool cpu_exec_vmspace_reuse(struct proc *p, struct vm_map *map); | ||||
▲ Show 20 Lines • Show All 132 Lines • Show Last 20 Lines |