summaryrefslogtreecommitdiff
path: root/kernel/cpu.c
diff options
context:
space:
mode:
authorTodd Poynor <toddpoynor@google.com>2011-06-15 17:21:57 -0700
committerOctavian Purdila <octavian.purdila@nxp.com>2017-02-23 14:21:42 +0200
commitac9c69731969f9c4165591af201bed7d4d20c786 (patch)
tree392ae9e8a0bd3ad19a8a595d82978b2847e7e6b1 /kernel/cpu.c
parent2b62659582bb67e7b67c1cbea883d7e6c6783e8c (diff)
Move x86_64 idle notifiers to generic
Move the x86_64 idle notifiers originally by Andi Kleen and Venkatesh Pallipadi to generic. Change-Id: Idf29cda15be151f494ff245933c12462643388d5 Acked-by: Nicolas Pitre <nicolas.pitre@linaro.org> Signed-off-by: Todd Poynor <toddpoynor@google.com>
Diffstat (limited to 'kernel/cpu.c')
-rw-r--r--kernel/cpu.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 217fd2e7f435..3f7369bac680 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -1932,3 +1932,23 @@ void __init boot_cpu_state_init(void)
{
per_cpu_ptr(&cpuhp_state, smp_processor_id())->state = CPUHP_ONLINE;
}
+
+static ATOMIC_NOTIFIER_HEAD(idle_notifier);
+
+void idle_notifier_register(struct notifier_block *n)
+{
+ atomic_notifier_chain_register(&idle_notifier, n);
+}
+EXPORT_SYMBOL_GPL(idle_notifier_register);
+
+void idle_notifier_unregister(struct notifier_block *n)
+{
+ atomic_notifier_chain_unregister(&idle_notifier, n);
+}
+EXPORT_SYMBOL_GPL(idle_notifier_unregister);
+
+void idle_notifier_call_chain(unsigned long val)
+{
+ atomic_notifier_call_chain(&idle_notifier, val, NULL);
+}
+EXPORT_SYMBOL_GPL(idle_notifier_call_chain);