summaryrefslogtreecommitdiff
path: root/sys/sys/proc.h
diff options
context:
space:
mode:
Diffstat (limited to 'sys/sys/proc.h')
-rw-r--r--sys/sys/proc.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index f3dd3321e908..af931ab24263 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -306,7 +306,8 @@ struct thread {
TDS_RUNNING,
TDS_SUSPENDED, /* would have liked to have run */
TDS_IWAIT,
- TDS_SURPLUS
+ TDS_SURPLUS,
+ TDS_SWAPPED
} td_state;
struct callout td_slpcallout; /* (h) Callout for sleep. */
struct trapframe *td_frame; /* (k) */
@@ -587,6 +588,7 @@ struct proc {
#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. */
/* used only in legacy conversion code */
#define SIDL 1 /* Process being created by fork. */
@@ -711,8 +713,11 @@ sigonstack(size_t sp)
} while (0)
#define _PHOLD(p) do { \
PROC_LOCK_ASSERT((p), MA_OWNED); \
- if ((p)->p_lock++ == 0) \
+ if ((p)->p_lock++ == 0) { \
+ mtx_lock_spin(&sched_lock); \
faultin((p)); \
+ mtx_unlock_spin(&sched_lock); \
+ } \
} while (0)
#define PRELE(p) do { \