summaryrefslogtreecommitdiff
path: root/include/linux/reboot.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/reboot.h')
-rw-r--r--include/linux/reboot.h30
1 files changed, 20 insertions, 10 deletions
diff --git a/include/linux/reboot.h b/include/linux/reboot.h
index e97f6b8e8586..aa08c3bbbf59 100644
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
@@ -181,24 +181,34 @@ extern void orderly_reboot(void);
/**
* enum hw_protection_action - Hardware protection action
*
+ * @HWPROT_ACT_DEFAULT:
+ * The default action should be taken. This is HWPROT_ACT_SHUTDOWN
+ * by default, but can be overridden.
* @HWPROT_ACT_SHUTDOWN:
* The system should be shut down (powered off) for HW protection.
* @HWPROT_ACT_REBOOT:
* The system should be rebooted for HW protection.
*/
-enum hw_protection_action { HWPROT_ACT_SHUTDOWN, HWPROT_ACT_REBOOT };
+enum hw_protection_action { HWPROT_ACT_DEFAULT, HWPROT_ACT_SHUTDOWN, HWPROT_ACT_REBOOT };
-void __hw_protection_shutdown(const char *reason, int ms_until_forced,
- enum hw_protection_action action);
+void __hw_protection_trigger(const char *reason, int ms_until_forced,
+ enum hw_protection_action action);
-static inline void hw_protection_reboot(const char *reason, int ms_until_forced)
-{
- __hw_protection_shutdown(reason, ms_until_forced, HWPROT_ACT_REBOOT);
-}
-
-static inline void hw_protection_shutdown(const char *reason, int ms_until_forced)
+/**
+ * hw_protection_trigger - Trigger default emergency system hardware protection action
+ *
+ * @reason: Reason of emergency shutdown or reboot to be printed.
+ * @ms_until_forced: Time to wait for orderly shutdown or reboot before
+ * triggering it. Negative value disables the forced
+ * shutdown or reboot.
+ *
+ * Initiate an emergency system shutdown or reboot in order to protect
+ * hardware from further damage. The exact action taken is controllable at
+ * runtime and defaults to shutdown.
+ */
+static inline void hw_protection_trigger(const char *reason, int ms_until_forced)
{
- __hw_protection_shutdown(reason, ms_until_forced, HWPROT_ACT_SHUTDOWN);
+ __hw_protection_trigger(reason, ms_until_forced, HWPROT_ACT_DEFAULT);
}
/*