diff options
-rw-r--r-- | sys/sys/proc.h | 1 | ||||
-rw-r--r-- | sys/sys/sched.h | 16 |
2 files changed, 15 insertions, 2 deletions
diff --git a/sys/sys/proc.h b/sys/sys/proc.h index 0930460..47a4f4b 100644 --- a/sys/sys/proc.h +++ b/sys/sys/proc.h @@ -284,6 +284,7 @@ struct thread { LIST_HEAD(, mtx) td_contested; /* (j) Contested locks. */ struct lock_list_entry *td_sleeplocks; /* (k) Held sleep locks. */ int td_intr_nesting_level; /* (k) Interrupt recursion. */ + int td_pinned; /* (k) Temporary cpu pin count. */ struct kse_thr_mailbox *td_mailbox; /* (*) Userland mailbox address */ struct ucred *td_ucred; /* (k) Reference to credentials. */ struct thread *td_standin; /* (*) Use this for an upcall */ diff --git a/sys/sys/sched.h b/sys/sys/sched.h index 1f8f338..1cefda7 100644 --- a/sys/sys/sched.h +++ b/sys/sys/sched.h @@ -76,9 +76,9 @@ void sched_rem(struct thread *td); * hold a thread on a particular CPU. */ void sched_bind(struct thread *td, int cpu); -void sched_pin(struct thread *td); +static __inline void sched_pin(struct thread *td); void sched_unbind(struct thread *td); -void sched_unpin(struct thread *td); +static __inline void sched_unpin(struct thread *td); /* * These interfaces will eventually be removed. @@ -100,4 +100,16 @@ extern struct kg_sched *ksegrp0_sched; extern struct p_sched *proc0_sched; extern struct td_sched *thread0_sched; +static __inline void +sched_pin(struct thread *td) +{ + td->td_pinned++; +} + +static __inline void +sched_unpin(struct thread *td) +{ + td->td_pinned--; +} + #endif /* !_SYS_SCHED_H_ */ |