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.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/include/linux/reboot.h b/include/linux/reboot.h
index 53c64e31b3cf..79e02876f2ba 100644
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
@@ -181,16 +181,36 @@ 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_trigger(const char *reason, int ms_until_forced,
enum hw_protection_action action);
+/**
+ * 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_trigger(reason, ms_until_forced, HWPROT_ACT_DEFAULT);
+}
+
static inline void hw_protection_reboot(const char *reason, int ms_until_forced)
{
__hw_protection_trigger(reason, ms_until_forced, HWPROT_ACT_REBOOT);