1 /* SPDX-License-Identifier: GPL-2.0 */
9 /* This flag contains garbage if preempt_disable_count is 0. */
10 extern __thread
int thread_cpu_id
;
12 /* Support recursive preemption disabling. */
13 extern __thread
int preempt_disable_count
;
15 void preempt_disable(void);
16 void preempt_enable(void);
18 static inline void preempt_disable_notrace(void)
23 static inline void preempt_enable_no_resched(void)
28 static inline void preempt_enable_notrace(void)
33 static inline int preempt_count(void)
35 return preempt_disable_count
;
38 static inline bool preemptible(void)
40 return !preempt_count();
43 static inline int get_cpu(void)
49 static inline void put_cpu(void)
54 static inline void might_sleep(void)
56 BUG_ON(preempt_disable_count
);