diff options
Diffstat (limited to 'include/linux/preempt.h')
-rw-r--r-- | include/linux/preempt.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/preempt.h b/include/linux/preempt.h index 7eeceac52dea..cae461224948 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h | |||
@@ -55,6 +55,27 @@ | |||
55 | /* We use the MSB mostly because its available */ | 55 | /* We use the MSB mostly because its available */ |
56 | #define PREEMPT_NEED_RESCHED 0x80000000 | 56 | #define PREEMPT_NEED_RESCHED 0x80000000 |
57 | 57 | ||
58 | #define PREEMPT_DISABLED (PREEMPT_DISABLE_OFFSET + PREEMPT_ENABLED) | ||
59 | |||
60 | /* | ||
61 | * Disable preemption until the scheduler is running -- use an unconditional | ||
62 | * value so that it also works on !PREEMPT_COUNT kernels. | ||
63 | * | ||
64 | * Reset by start_kernel()->sched_init()->init_idle()->init_idle_preempt_count(). | ||
65 | */ | ||
66 | #define INIT_PREEMPT_COUNT PREEMPT_OFFSET | ||
67 | |||
68 | /* | ||
69 | * Initial preempt_count value; reflects the preempt_count schedule invariant | ||
70 | * which states that during context switches: | ||
71 | * | ||
72 | * preempt_count() == 2*PREEMPT_DISABLE_OFFSET | ||
73 | * | ||
74 | * Note: PREEMPT_DISABLE_OFFSET is 0 for !PREEMPT_COUNT kernels. | ||
75 | * Note: See finish_task_switch(). | ||
76 | */ | ||
77 | #define FORK_PREEMPT_COUNT (2*PREEMPT_DISABLE_OFFSET + PREEMPT_ENABLED) | ||
78 | |||
58 | /* preempt_count() and related functions, depends on PREEMPT_NEED_RESCHED */ | 79 | /* preempt_count() and related functions, depends on PREEMPT_NEED_RESCHED */ |
59 | #include <asm/preempt.h> | 80 | #include <asm/preempt.h> |
60 | 81 | ||