From c6b299df2047adb87fcfa3a132b6ff06633dbc90 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 3 Aug 2015 12:39:05 +0100 Subject: [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 Reported-by: John Clark Reported-by: wdriever@gmail.com Reported-by: Charlie Beima Signed-off-by: Michael Brown --- src/include/ipxe/efi/efi_watchdog.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/include/ipxe/efi/efi_watchdog.h (limited to 'src/include/ipxe/efi') 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 */ -- cgit v1.2.3-55-g7522