diff options
author | Todd Poynor <toddpoynor@google.com> | 2011-06-15 17:21:57 -0700 |
---|---|---|
committer | Leonard Crestez <leonard.crestez@nxp.com> | 2018-08-24 12:40:51 +0300 |
commit | eec97cd2016a74928f7a3c7bd2be07d731303cc5 (patch) | |
tree | 1fb08c7f473abf6236935a73f8bd4d790b6244c1 /kernel | |
parent | 32408ca54c6cd718cf4ce5af448298460353b099 (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')
-rw-r--r-- | kernel/cpu.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c index b5a0165b7300..bf875e94ac9e 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -2206,3 +2206,23 @@ void __init boot_cpu_hotplug_init(void) #endif this_cpu_write(cpuhp_state.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); |