// SPDX-License-Identifier: GPL-2.0 /* * syscore.c - Execution of system core operations. * * Copyright (C) 2011 Rafael J. Wysocki <[email protected]>, Novell Inc. */ #include <linux/syscore_ops.h> #include <linux/mutex.h> #include <linux/module.h> #include <linux/suspend.h> #include <trace/events/power.h> static LIST_HEAD(syscore_ops_list); static DEFINE_MUTEX(syscore_ops_lock); /** * register_syscore_ops - Register a set of system core operations. * @ops: System core operations to register. */ void register_syscore_ops(struct syscore_ops *ops) { … } EXPORT_SYMBOL_GPL(…); /** * unregister_syscore_ops - Unregister a set of system core operations. * @ops: System core operations to unregister. */ void unregister_syscore_ops(struct syscore_ops *ops) { … } EXPORT_SYMBOL_GPL(…); #ifdef CONFIG_PM_SLEEP /** * syscore_suspend - Execute all the registered system core suspend callbacks. * * This function is executed with one CPU on-line and disabled interrupts. */ int syscore_suspend(void) { … } EXPORT_SYMBOL_GPL(…); /** * syscore_resume - Execute all the registered system core resume callbacks. * * This function is executed with one CPU on-line and disabled interrupts. */ void syscore_resume(void) { … } EXPORT_SYMBOL_GPL(…); #endif /* CONFIG_PM_SLEEP */ /** * syscore_shutdown - Execute all the registered system core shutdown callbacks. */ void syscore_shutdown(void) { … }