#include <linux/cache.h>
-void rcu_sched_qs(int cpu);
-void rcu_bh_qs(int cpu);
-static inline void rcu_note_context_switch(int cpu)
+static inline void rcu_init(void)
{
- rcu_sched_qs(cpu);
}
-#define __rcu_read_lock() preempt_disable()
-#define __rcu_read_unlock() preempt_enable()
-#define __rcu_read_lock_bh() local_bh_disable()
-#define __rcu_read_unlock_bh() local_bh_enable()
-#define call_rcu_sched call_rcu
-
-#define rcu_init_sched() do { } while (0)
-extern void rcu_check_callbacks(int cpu, int user);
+#ifdef CONFIG_TINY_RCU
-static inline int rcu_needs_cpu(int cpu)
+static inline void synchronize_rcu_expedited(void)
{
- return 0;
+ synchronize_sched(); /* Only one CPU, so pretty fast anyway!!! */
}
-/*
- * Return the number of grace periods.
- */
-static inline long rcu_batches_completed(void)
+static inline void rcu_barrier(void)
{
- return 0;
+ rcu_barrier_sched(); /* Only one CPU, so only one list of callbacks! */
}
-/*
- * Return the number of bottom-half grace periods.
- */
-static inline long rcu_batches_completed_bh(void)
-{
- return 0;
-}
+#else /* #ifdef CONFIG_TINY_RCU */
-static inline void rcu_force_quiescent_state(void)
+void rcu_barrier(void);
+void synchronize_rcu_expedited(void);
+
+#endif /* #else #ifdef CONFIG_TINY_RCU */
+
+static inline void synchronize_rcu_bh(void)
{
+ synchronize_sched();
}
-static inline void rcu_bh_force_quiescent_state(void)
+static inline void synchronize_rcu_bh_expedited(void)
{
+ synchronize_sched();
}
-static inline void rcu_sched_force_quiescent_state(void)
+static inline void synchronize_sched_expedited(void)
{
+ synchronize_sched();
}
-extern void synchronize_sched(void);
+#ifdef CONFIG_TINY_RCU
-static inline void synchronize_rcu(void)
+static inline void rcu_preempt_note_context_switch(void)
{
- synchronize_sched();
}
-static inline void synchronize_rcu_bh(void)
+static inline void exit_rcu(void)
{
- synchronize_sched();
}
-static inline void synchronize_rcu_expedited(void)
+static inline int rcu_needs_cpu(int cpu)
{
- synchronize_sched();
+ return 0;
}
-static inline void synchronize_rcu_bh_expedited(void)
+#else /* #ifdef CONFIG_TINY_RCU */
+
+void rcu_preempt_note_context_switch(void);
+extern void exit_rcu(void);
+int rcu_preempt_needs_cpu(void);
+
+static inline int rcu_needs_cpu(int cpu)
{
- synchronize_sched();
+ return rcu_preempt_needs_cpu();
}
-struct notifier_block;
-
-#ifdef CONFIG_NO_HZ
+#endif /* #else #ifdef CONFIG_TINY_RCU */
-extern void rcu_enter_nohz(void);
-extern void rcu_exit_nohz(void);
+static inline void rcu_note_context_switch(int cpu)
+{
+ rcu_sched_qs(cpu);
+ rcu_preempt_note_context_switch();
+}
-#else /* #ifdef CONFIG_NO_HZ */
+/*
+ * Return the number of grace periods.
+ */
+static inline long rcu_batches_completed(void)
+{
+ return 0;
+}
-static inline void rcu_enter_nohz(void)
+/*
+ * Return the number of bottom-half grace periods.
+ */
+static inline long rcu_batches_completed_bh(void)
{
+ return 0;
}
-static inline void rcu_exit_nohz(void)
+static inline void rcu_force_quiescent_state(void)
{
}
-#endif /* #else #ifdef CONFIG_NO_HZ */
+static inline void rcu_bh_force_quiescent_state(void)
+{
+}
-static inline void exit_rcu(void)
+static inline void rcu_sched_force_quiescent_state(void)
{
}
-static inline int rcu_preempt_depth(void)
+static inline void rcu_cpu_stall_reset(void)
{
- return 0;
}
#ifdef CONFIG_DEBUG_LOCK_ALLOC
-
extern int rcu_scheduler_active __read_mostly;
extern void rcu_scheduler_starting(void);
-
#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
-
static inline void rcu_scheduler_starting(void)
{
}
-
#endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */
#endif /* __LINUX_RCUTINY_H */