Jonathan Zhang | 6d27778 | 2020-06-09 17:56:53 -0700 | [diff] [blame] | 1 | /** @file |
| 2 | ACPI Watchdog Action Table (WADT) as defined at |
| 3 | Microsoft Hardware Watchdog Timers Design Specification. |
| 4 | |
| 5 | Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR> |
| 6 | SPDX-License-Identifier: BSD-2-Clause-Patent |
| 7 | **/ |
| 8 | |
| 9 | |
| 10 | #ifndef _WATCHDOG_ACTION_TABLE_H_ |
| 11 | #define _WATCHDOG_ACTION_TABLE_H_ |
| 12 | |
| 13 | #include <IndustryStandard/Acpi.h> |
| 14 | |
| 15 | // |
| 16 | // Ensure proper structure formats |
| 17 | // |
| 18 | #pragma pack(1) |
| 19 | /// |
| 20 | /// Watchdog Action Table definition. |
| 21 | /// |
| 22 | typedef struct { |
| 23 | EFI_ACPI_DESCRIPTION_HEADER Header; |
| 24 | UINT32 WatchdogHeaderLength; |
| 25 | UINT16 PCISegment; |
| 26 | UINT8 PCIBusNumber; |
| 27 | UINT8 PCIDeviceNumber; |
| 28 | UINT8 PCIFunctionNumber; |
| 29 | UINT8 Reserved_45[3]; |
| 30 | UINT32 TimerPeriod; |
| 31 | UINT32 MaxCount; |
| 32 | UINT32 MinCount; |
| 33 | UINT8 WatchdogFlags; |
| 34 | UINT8 Reserved_61[3]; |
| 35 | UINT32 NumberWatchdogInstructionEntries; |
| 36 | } EFI_ACPI_WATCHDOG_ACTION_1_0_TABLE; |
| 37 | |
| 38 | /// |
| 39 | /// Watchdog Instruction Entries |
| 40 | /// |
| 41 | typedef struct { |
| 42 | UINT8 WatchdogAction; |
| 43 | UINT8 InstructionFlags; |
| 44 | UINT8 Reserved_2[2]; |
| 45 | EFI_ACPI_2_0_GENERIC_ADDRESS_STRUCTURE RegisterRegion; |
| 46 | UINT32 Value; |
| 47 | UINT32 Mask; |
| 48 | } EFI_ACPI_WATCHDOG_ACTION_1_0_WATCHDOG_ACTION_INSTRUCTION_ENTRY; |
| 49 | |
| 50 | #pragma pack() |
| 51 | |
| 52 | /// |
| 53 | /// WDAT Revision (defined in spec) |
| 54 | /// |
| 55 | #define EFI_ACPI_WATCHDOG_ACTION_1_0_TABLE_REVISION 0x01 |
| 56 | |
| 57 | // |
| 58 | // WDAT 1.0 Flags |
| 59 | // |
| 60 | #define EFI_ACPI_WDAT_1_0_WATCHDOG_ENABLED 0x1 |
| 61 | #define EFI_ACPI_WDAT_1_0_WATCHDOG_STOPPED_IN_SLEEP_STATE 0x80 |
| 62 | |
| 63 | // |
| 64 | // WDAT 1.0 Watchdog Actions |
| 65 | // |
| 66 | #define EFI_ACPI_WDAT_1_0_WATCHDOG_ACTION_RESET 0x1 |
| 67 | #define EFI_ACPI_WDAT_1_0_WATCHDOG_ACTION_QUERY_CURRENT_COUNTDOWN_PERIOD 0x4 |
| 68 | #define EFI_ACPI_WDAT_1_0_WATCHDOG_ACTION_QUERY_COUNTDOWN_PERIOD 0x5 |
| 69 | #define EFI_ACPI_WDAT_1_0_WATCHDOG_ACTION_SET_COUNTDOWN_PERIOD 0x6 |
| 70 | #define EFI_ACPI_WDAT_1_0_WATCHDOG_ACTION_QUERY_RUNNING_STATE 0x8 |
| 71 | #define EFI_ACPI_WDAT_1_0_WATCHDOG_ACTION_SET_RUNNING_STATE 0x9 |
| 72 | #define EFI_ACPI_WDAT_1_0_WATCHDOG_ACTION_QUERY_STOPPED_STATE 0xA |
| 73 | #define EFI_ACPI_WDAT_1_0_WATCHDOG_ACTION_SET_STOPPED_STATE 0xB |
| 74 | #define EFI_ACPI_WDAT_1_0_WATCHDOG_ACTION_QUERY_REBOOT 0x10 |
| 75 | #define EFI_ACPI_WDAT_1_0_WATCHDOG_ACTION_SET_REBOOT 0x11 |
| 76 | #define EFI_ACPI_WDAT_1_0_WATCHDOG_ACTION_QUERY_SHUTDOWN 0x12 |
| 77 | #define EFI_ACPI_WDAT_1_0_WATCHDOG_ACTION_SET_SHUTDOWN 0x13 |
| 78 | #define EFI_ACPI_WDAT_1_0_WATCHDOG_ACTION_QUERY_WATCHDOG_STATUS 0x20 |
| 79 | #define EFI_ACPI_WDAT_1_0_WATCHDOG_ACTION_SET_WATCHDOG_STATUS 0x21 |
| 80 | |
| 81 | // |
| 82 | // WDAT 1.0 Watchdog Action Entry Instruction Flags |
| 83 | // |
| 84 | #define EFI_ACPI_WDAT_1_0_WATCHDOG_INSTRUCTION_READ_VALUE 0x0 |
| 85 | #define EFI_ACPI_WDAT_1_0_WATCHDOG_INSTRUCTION_READ_COUNTDOWN 0x1 |
| 86 | #define EFI_ACPI_WDAT_1_0_WATCHDOG_INSTRUCTION_WRITE_VALUE 0x2 |
| 87 | #define EFI_ACPI_WDAT_1_0_WATCHDOG_INSTRUCTION_WRITE_COUNTDOWN 0x3 |
| 88 | #define EFI_ACPI_WDAT_1_0_WATCHDOG_INSTRUCTION_PRESERVE_REGISTER 0x80 |
| 89 | |
| 90 | #endif |