1 #ifndef __LINUX_PREEMPT_H
2 #define __LINUX_PREEMPT_H
5 * include/linux/preempt.h - macros for accessing and manipulating
6 * preempt_count (used for kernel preemption, interrupt count, etc.)
9 #include <linux/config.h>
10 #include <linux/linkage.h>
12 #define preempt_count() (current_thread_info()->preempt_count)
14 #define inc_preempt_count() \
19 #define dec_preempt_count() \
26 asmlinkage
void preempt_schedule(void);
28 #define preempt_disable() \
30 inc_preempt_count(); \
34 #define preempt_enable_no_resched() \
37 dec_preempt_count(); \
40 #define preempt_check_resched() \
42 if (unlikely(test_thread_flag(TIF_NEED_RESCHED))) \
46 #define preempt_enable() \
48 preempt_enable_no_resched(); \
49 preempt_check_resched(); \
54 #define preempt_disable() do { } while (0)
55 #define preempt_enable_no_resched() do { } while (0)
56 #define preempt_enable() do { } while (0)
57 #define preempt_check_resched() do { } while (0)
61 #endif /* __LINUX_PREEMPT_H */