aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-07-03 09:30:07 -0400
committerThomas Gleixner <tglx@linutronix.de>2009-07-29 17:30:38 -0400
commite9888fb95225bb3b786d79fd983eb67e1acad338 (patch)
treed09bc138fec534e17b57a559f36a5d8c7e49973f /include/linux
parent94b3cbf2548a023b4187e252043eac367f84740c (diff)
rt: core implementation
Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/hardirq.h6
-rw-r--r--include/linux/kernel.h9
-rw-r--r--include/linux/profile.h11
-rw-r--r--include/linux/radix-tree.h13
-rw-r--r--include/linux/smp.h11
-rw-r--r--include/linux/smp_lock.h2
-rw-r--r--include/linux/workqueue.h3
7 files changed, 46 insertions, 9 deletions
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index 70b12547cfb2..16966fbab185 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -77,9 +77,9 @@
77 * Are we doing bottom half or hardware interrupt processing? 77 * Are we doing bottom half or hardware interrupt processing?
78 * Are we in a softirq context? Interrupt context? 78 * Are we in a softirq context? Interrupt context?
79 */ 79 */
80#define in_irq() (hardirq_count()) 80#define in_irq() (hardirq_count() || (current->flags & PF_HARDIRQ))
81#define in_softirq() (softirq_count()) 81#define in_softirq() (softirq_count() || (current->flags & PF_SOFTIRQ))
82#define in_interrupt() (irq_count()) 82#define in_interrupt() (irq_count())
83 83
84/* 84/*
85 * Are we in NMI context? 85 * Are we in NMI context?
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index d6320a3e8def..4651e0971d75 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -124,7 +124,7 @@ extern int _cond_resched(void);
124# define might_resched() do { } while (0) 124# define might_resched() do { } while (0)
125#endif 125#endif
126 126
127#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP 127#if defined(CONFIG_DEBUG_SPINLOCK_SLEEP) || defined(CONFIG_DEBUG_PREEMPT)
128 void __might_sleep(char *file, int line); 128 void __might_sleep(char *file, int line);
129/** 129/**
130 * might_sleep - annotation for functions that can sleep 130 * might_sleep - annotation for functions that can sleep
@@ -284,6 +284,12 @@ extern void printk_tick(void);
284extern void asmlinkage __attribute__((format(printf, 1, 2))) 284extern void asmlinkage __attribute__((format(printf, 1, 2)))
285 early_printk(const char *fmt, ...); 285 early_printk(const char *fmt, ...);
286 286
287#ifdef CONFIG_PREEMPT_RT
288extern void zap_rt_locks(void);
289#else
290# define zap_rt_locks() do { } while (0)
291#endif
292
287unsigned long int_sqrt(unsigned long); 293unsigned long int_sqrt(unsigned long);
288 294
289static inline void console_silent(void) 295static inline void console_silent(void)
@@ -313,6 +319,7 @@ extern int root_mountflags;
313/* Values used for system_state */ 319/* Values used for system_state */
314extern enum system_states { 320extern enum system_states {
315 SYSTEM_BOOTING, 321 SYSTEM_BOOTING,
322 SYSTEM_BOOTING_SCHEDULER_OK,
316 SYSTEM_RUNNING, 323 SYSTEM_RUNNING,
317 SYSTEM_HALT, 324 SYSTEM_HALT,
318 SYSTEM_POWER_OFF, 325 SYSTEM_POWER_OFF,
diff --git a/include/linux/profile.h b/include/linux/profile.h
index a0fc32279fc0..5b72082c273e 100644
--- a/include/linux/profile.h
+++ b/include/linux/profile.h
@@ -8,10 +8,11 @@
8 8
9#include <asm/errno.h> 9#include <asm/errno.h>
10 10
11#define CPU_PROFILING 1 11#define CPU_PROFILING 1
12#define SCHED_PROFILING 2 12#define SCHED_PROFILING 2
13#define SLEEP_PROFILING 3 13#define SLEEP_PROFILING 3
14#define KVM_PROFILING 4 14#define KVM_PROFILING 4
15#define PREEMPT_PROFILING 5
15 16
16struct proc_dir_entry; 17struct proc_dir_entry;
17struct pt_regs; 18struct pt_regs;
@@ -36,6 +37,8 @@ enum profile_type {
36 PROFILE_MUNMAP 37 PROFILE_MUNMAP
37}; 38};
38 39
40extern int prof_pid;
41
39#ifdef CONFIG_PROFILING 42#ifdef CONFIG_PROFILING
40 43
41extern int prof_on __read_mostly; 44extern int prof_on __read_mostly;
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h
index c5da74918096..9eb17f95857b 100644
--- a/include/linux/radix-tree.h
+++ b/include/linux/radix-tree.h
@@ -169,7 +169,18 @@ unsigned long radix_tree_next_hole(struct radix_tree_root *root,
169 unsigned long index, unsigned long max_scan); 169 unsigned long index, unsigned long max_scan);
170unsigned long radix_tree_prev_hole(struct radix_tree_root *root, 170unsigned long radix_tree_prev_hole(struct radix_tree_root *root,
171 unsigned long index, unsigned long max_scan); 171 unsigned long index, unsigned long max_scan);
172/*
173 * On a mutex based kernel we can freely schedule within the radix code:
174 */
175#ifdef CONFIG_PREEMPT_RT
176static inline int radix_tree_preload(gfp_t gfp_mask)
177{
178 return 0;
179}
180#else
172int radix_tree_preload(gfp_t gfp_mask); 181int radix_tree_preload(gfp_t gfp_mask);
182#endif
183
173void radix_tree_init(void); 184void radix_tree_init(void);
174void *radix_tree_tag_set(struct radix_tree_root *root, 185void *radix_tree_tag_set(struct radix_tree_root *root,
175 unsigned long index, unsigned int tag); 186 unsigned long index, unsigned int tag);
@@ -189,7 +200,9 @@ int radix_tree_tagged(struct radix_tree_root *root, unsigned int tag);
189 200
190static inline void radix_tree_preload_end(void) 201static inline void radix_tree_preload_end(void)
191{ 202{
203#ifndef CONFIG_PREEMPT_RT
192 preempt_enable(); 204 preempt_enable();
205#endif
193} 206}
194 207
195#endif /* _LINUX_RADIX_TREE_H */ 208#endif /* _LINUX_RADIX_TREE_H */
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 9e3d8af09207..378005121d60 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -50,6 +50,16 @@ extern void smp_send_stop(void);
50 */ 50 */
51extern void smp_send_reschedule(int cpu); 51extern void smp_send_reschedule(int cpu);
52 52
53/*
54 * trigger a reschedule on all other CPUs:
55 */
56extern void smp_send_reschedule_allbutself(void);
57
58/*
59 * trigger a reschedule on all other CPUs:
60 */
61extern void smp_send_reschedule_allbutself(void);
62
53 63
54/* 64/*
55 * Prepare machine for booting other CPUs. 65 * Prepare machine for booting other CPUs.
@@ -142,6 +152,7 @@ static inline int up_smp_call_function(void (*func)(void *), void *info)
142 0; \ 152 0; \
143 }) 153 })
144static inline void smp_send_reschedule(int cpu) { } 154static inline void smp_send_reschedule(int cpu) { }
155static inline void smp_send_reschedule_allbutself(void) { }
145#define num_booting_cpus() 1 156#define num_booting_cpus() 1
146#define smp_prepare_boot_cpu() do {} while (0) 157#define smp_prepare_boot_cpu() do {} while (0)
147#define smp_call_function_mask(mask, func, info, wait) \ 158#define smp_call_function_mask(mask, func, info, wait) \
diff --git a/include/linux/smp_lock.h b/include/linux/smp_lock.h
index 813be59bf345..0cb3cf9a68ef 100644
--- a/include/linux/smp_lock.h
+++ b/include/linux/smp_lock.h
@@ -45,7 +45,7 @@ static inline void cycle_kernel_lock(void)
45#define unlock_kernel() do { } while(0) 45#define unlock_kernel() do { } while(0)
46#define release_kernel_lock(task) do { } while(0) 46#define release_kernel_lock(task) do { } while(0)
47#define cycle_kernel_lock() do { } while(0) 47#define cycle_kernel_lock() do { } while(0)
48#define reacquire_kernel_lock(task) 0 48#define reacquire_kernel_lock(task) do { } while(0)
49#define kernel_locked() 1 49#define kernel_locked() 1
50 50
51#endif /* CONFIG_LOCK_KERNEL */ 51#endif /* CONFIG_LOCK_KERNEL */
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index 13e1adf55c4c..3f363b7168c4 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -195,6 +195,9 @@ __create_workqueue_key(const char *name, int singlethread,
195#define create_freezeable_workqueue(name) __create_workqueue((name), 1, 1, 0) 195#define create_freezeable_workqueue(name) __create_workqueue((name), 1, 1, 0)
196#define create_singlethread_workqueue(name) __create_workqueue((name), 1, 0, 0) 196#define create_singlethread_workqueue(name) __create_workqueue((name), 1, 0, 0)
197 197
198extern void set_workqueue_prio(struct workqueue_struct *wq, int policy,
199 int rt_priority, int nice);
200
198extern void destroy_workqueue(struct workqueue_struct *wq); 201extern void destroy_workqueue(struct workqueue_struct *wq);
199 202
200extern int queue_work(struct workqueue_struct *wq, struct work_struct *work); 203extern int queue_work(struct workqueue_struct *wq, struct work_struct *work);