- Move the NEEDSIGCHK and OLDMASK flags from proc to thread.
- Move the signal mask to the thread. - Adjust a few comments.
This commit is contained in:
parent
4093529dee
commit
c5c34c0a76
@ -304,6 +304,9 @@ struct thread {
|
||||
u_int td_uuticks; /* Statclock hits in user, for UTS */
|
||||
u_int td_usticks; /* Statclock hits in kernel, for UTS */
|
||||
u_int td_critnest; /* (k) Critical section nest level. */
|
||||
sigset_t td_oldsigmask; /* (c) Saved mask from pre sigpause. */
|
||||
sigset_t td_sigmask; /* (c) Current signal mask. */
|
||||
sigset_t td_siglist; /* (c) Sigs arrived, not delivered. */
|
||||
#define td_endzero td_base_pri
|
||||
|
||||
/* Copied during fork1() or thread_sched_upcall() */
|
||||
@ -336,7 +339,8 @@ struct thread {
|
||||
struct mdthread td_md; /* (k) Any machine-dependent fields. */
|
||||
struct td_sched *td_sched; /* Scheduler specific data */
|
||||
};
|
||||
/* flags kept in td_flags */
|
||||
/* flags kept in td_flags */
|
||||
#define TDF_OLDMASK 0x000001 /* Need to restore mask after suspend. */
|
||||
#define TDF_INPANIC 0x000002 /* Caused a panic, let it drive crashdump. */
|
||||
#define TDF_CAN_UNBIND 0x000004 /* Only temporarily bound. */
|
||||
#define TDF_SINTR 0x000008 /* Sleep is interruptible. */
|
||||
@ -351,7 +355,8 @@ struct thread {
|
||||
#define TDF_INTERRUPT 0x002000 /* Thread is marked as interrupted. */
|
||||
#define TDF_USTATCLOCK 0x004000 /* Stat clock hits in userland. */
|
||||
#define TDF_OWEUPC 0x008000 /* Owe thread an addupc() call at next AST. */
|
||||
#define TDF_NEEDRESCHED 0x010000 /* Process needs to yield. */
|
||||
#define TDF_NEEDRESCHED 0x010000 /* Thread needs to yield. */
|
||||
#define TDF_NEEDSIGCHK 0x020000 /* Thread may need signal delivery. */
|
||||
#define TDF_DEADLKTREAT 0x800000 /* Lock aquisition - deadlock treatment. */
|
||||
|
||||
#define TDI_SUSPENDED 0x0001 /* On suspension queue. */
|
||||
@ -557,13 +562,12 @@ struct proc {
|
||||
int p_traceflag; /* (o) Kernel trace points. */
|
||||
struct vnode *p_tracevp; /* (c + o) Trace to vnode. */
|
||||
struct ucred *p_tracecred; /* (o) Credentials to trace with. */
|
||||
sigset_t p_siglist; /* (c) Sigs arrived, not delivered. */
|
||||
struct vnode *p_textvp; /* (b) Vnode of executable. */
|
||||
sigset_t p_siglist; /* (c) Sigs not delivered to a td. */
|
||||
char p_lock; /* (c) Proclock (prevent swap) count. */
|
||||
struct klist p_klist; /* (c) Knotes attached to this proc. */
|
||||
struct sigiolst p_sigiolst; /* (c) List of sigio sources. */
|
||||
int p_sigparent; /* (c) Signal to parent on exit. */
|
||||
sigset_t p_oldsigmask; /* (c) Saved mask from pre sigpause. */
|
||||
int p_sig; /* (n) For core dump/debugger XXX. */
|
||||
u_long p_code; /* (n) For core dump/debugger XXX. */
|
||||
u_int p_stops; /* (c) Stop event bitmask. */
|
||||
@ -575,11 +579,10 @@ struct proc {
|
||||
struct thread *p_singlethread;/* (j) If single threading this is it */
|
||||
int p_suspcount; /* (j) # threads in suspended mode */
|
||||
/* End area that is zeroed on creation. */
|
||||
#define p_endzero p_sigmask
|
||||
#define p_endzero p_sigstk
|
||||
|
||||
/* The following fields are all copied upon creation in fork. */
|
||||
#define p_startcopy p_endzero
|
||||
sigset_t p_sigmask; /* (c) Current signal mask. */
|
||||
stack_t p_sigstk; /* (c) Stack ptr and on-stack flag. */
|
||||
u_int p_magic; /* (b) Magic number. */
|
||||
char p_comm[MAXCOMLEN + 1]; /* (b) Process name. */
|
||||
@ -647,9 +650,8 @@ struct proc {
|
||||
#define P_COWINPROGRESS 0x400000 /* Snapshot copy-on-write in progress. */
|
||||
|
||||
#define P_JAILED 0x1000000 /* Process is in jail. */
|
||||
#define P_OLDMASK 0x2000000 /* Need to restore mask after suspend. */
|
||||
#define P_ALTSTACK 0x4000000 /* Have alternate signal stack. */
|
||||
#define P_INEXEC 0x8000000 /* Process is in execve(). */
|
||||
#define P_ALTSTACK 0x2000000 /* Have alternate signal stack. */
|
||||
#define P_INEXEC 0x4000000 /* Process is in execve(). */
|
||||
|
||||
/* These flags are kept in p_sflag and are protected with sched_lock. */
|
||||
#define PS_INMEM 0x00001 /* Loaded into memory. */
|
||||
@ -660,7 +662,6 @@ struct proc {
|
||||
#define PS_PROFPEND 0x00040 /* Pending SIGPROF needs to be posted. */
|
||||
#define PS_SWAPINREQ 0x00100 /* Swapin request due to wakeup. */
|
||||
#define PS_SWAPPING 0x00200 /* Process is being swapped. */
|
||||
#define PS_NEEDSIGCHK 0x02000 /* Process may need signal delivery. */
|
||||
#define PS_SWAPPINGIN 0x04000 /* Swapin in progress. */
|
||||
#define PS_MACPEND 0x08000 /* Ast()-based MAC event pending. */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user