iPXE
Defines | Functions | Variables
efi_watchdog.c File Reference

EFI watchdog holdoff timer. More...

#include <errno.h>
#include <string.h>
#include <ipxe/retry.h>
#include <ipxe/timer.h>
#include <ipxe/efi/efi.h>
#include <ipxe/efi/efi_watchdog.h>

Go to the source code of this file.

Defines

#define WATCHDOG_HOLDOFF_SECS   10
 Watchdog holdoff interval (in seconds)
#define WATCHDOG_TIMEOUT_SECS   ( 5 * 60 )
 Watchdog timeout (in seconds)
#define WATCHDOG_CODE   0x6950584544454144ULL
 Watchdog code (to be logged on watchdog timeout)
#define WATCHDOG_DATA   L"iPXE";
 Watchdog data (to be logged on watchdog timeout)

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
static void efi_watchdog_expired (struct retry_timer *timer, int over __unused)
 Hold off watchdog timer.

Variables

struct retry_timer efi_watchdog = TIMER_INIT ( efi_watchdog_expired )
 Watchdog holdoff timer.

Detailed Description

EFI watchdog holdoff timer.

Definition in file efi_watchdog.c.


Define Documentation

#define WATCHDOG_HOLDOFF_SECS   10

Watchdog holdoff interval (in seconds)

Definition at line 41 of file efi_watchdog.c.

Referenced by efi_watchdog_expired().

#define WATCHDOG_TIMEOUT_SECS   ( 5 * 60 )

Watchdog timeout (in seconds)

Definition at line 44 of file efi_watchdog.c.

Referenced by efi_watchdog_expired().

#define WATCHDOG_CODE   0x6950584544454144ULL

Watchdog code (to be logged on watchdog timeout)

Definition at line 47 of file efi_watchdog.c.

Referenced by efi_watchdog_expired().

#define WATCHDOG_DATA   L"iPXE";

Watchdog data (to be logged on watchdog timeout)

Definition at line 50 of file efi_watchdog.c.

Referenced by efi_watchdog_expired().


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
static void efi_watchdog_expired ( struct retry_timer timer,
int over  __unused 
) [static]

Hold off watchdog timer.

Parameters:
retryRetry timer
overFailure indicator

Definition at line 58 of file efi_watchdog.c.

References EFI_SYSTEM_TABLE::BootServices, data, DBGC, DBGC2, EEFI, efi_systab, rc, EFI_BOOT_SERVICES::SetWatchdogTimer, start_timer_fixed(), strerror(), TICKS_PER_SEC, WATCHDOG_CODE, WATCHDOG_DATA, WATCHDOG_HOLDOFF_SECS, and WATCHDOG_TIMEOUT_SECS.

                                                       {
        EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
        static CHAR16 data[] = WATCHDOG_DATA;
        EFI_STATUS efirc;
        int rc;

        DBGC2 ( timer, "EFI holding off watchdog timer\n" );

        /* Restart this holdoff timer */
        start_timer_fixed ( timer, ( WATCHDOG_HOLDOFF_SECS * TICKS_PER_SEC ) );

        /* Reset watchdog timer */
        if ( ( efirc = bs->SetWatchdogTimer ( WATCHDOG_TIMEOUT_SECS,
                                              WATCHDOG_CODE, sizeof ( data ),
                                              data ) ) != 0 ) {
                rc = -EEFI ( efirc );
                DBGC ( timer, "EFI could not set watchdog timer: %s\n",
                       strerror ( rc ) );
                return;
        }
}

Variable Documentation

Watchdog holdoff timer.

Definition at line 82 of file efi_watchdog.c.

Referenced by efi_watchdog_start(), and efi_watchdog_stop().