summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe
diff options
context:
space:
mode:
authorMichael Brown2015-08-03 13:39:05 +0200
committerMichael Brown2015-08-03 13:48:02 +0200
commitc6b299df2047adb87fcfa3a132b6ff06633dbc90 (patch)
tree7ecdae5397b22e8ba88143eaee53091f2d49c272 /src/include/ipxe
parent[crypto] Support SHA-{224,384,512} in X.509 certificates (diff)
downloadipxe-c6b299df2047adb87fcfa3a132b6ff06633dbc90.tar.gz
ipxe-c6b299df2047adb87fcfa3a132b6ff06633dbc90.tar.xz
ipxe-c6b299df2047adb87fcfa3a132b6ff06633dbc90.zip
[efi] Hold off watchdog timer while running
UEFI platforms may provide a watchdog timer, which will reboot the machine if an operating system takes more than five minutes to load. This can cause long-lived iPXE downloads (or interactive shell sessions) to unexpectedly reboot. Fix by resetting the watchdog timer every ten seconds while the iPXE main processing loop continues to run. Reported-by: Bradley B Williams <bradleybwilliams@swbell.net> Reported-by: John Clark <john.r.clark.3@gmail.com> Reported-by: wdriever@gmail.com Reported-by: Charlie Beima <cbeima@indiana.edu> Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe')
-rw-r--r--src/include/ipxe/efi/efi_watchdog.h31
-rw-r--r--src/include/ipxe/errfile.h1
2 files changed, 32 insertions, 0 deletions
diff --git a/src/include/ipxe/efi/efi_watchdog.h b/src/include/ipxe/efi/efi_watchdog.h
new file mode 100644
index 000000000..4a56b9a29
--- /dev/null
+++ b/src/include/ipxe/efi/efi_watchdog.h
@@ -0,0 +1,31 @@
+#ifndef _IPXE_EFI_WATCHDOG_H
+#define _IPXE_EFI_WATCHDOG_H
+
+/** @file
+ *
+ * EFI watchdog holdoff timer
+ */
+
+FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
+
+extern struct retry_timer efi_watchdog;
+
+/**
+ * Start EFI watchdog holdoff timer
+ *
+ */
+static inline void efi_watchdog_start ( void ) {
+
+ start_timer_nodelay ( &efi_watchdog );
+}
+
+/**
+ * Stop EFI watchdog holdoff timer
+ *
+ */
+static inline void efi_watchdog_stop ( void ) {
+
+ stop_timer ( &efi_watchdog );
+}
+
+#endif /* _IPXE_EFI_WATCHDOG_H */
diff --git a/src/include/ipxe/errfile.h b/src/include/ipxe/errfile.h
index 9976387d6..b48d2a0ce 100644
--- a/src/include/ipxe/errfile.h
+++ b/src/include/ipxe/errfile.h
@@ -330,6 +330,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define ERRFILE_efi_wrap ( ERRFILE_OTHER | 0x00460000 )
#define ERRFILE_vmbus ( ERRFILE_OTHER | 0x00470000 )
#define ERRFILE_efi_time ( ERRFILE_OTHER | 0x00480000 )
+#define ERRFILE_efi_watchdog ( ERRFILE_OTHER | 0x00490000 )
/** @} */