From 7cceef7bde3d78dbd0f85794fbda0c431bac39c0 Mon Sep 17 00:00:00 2001 From: AKASHI Takahiro Date: Tue, 17 Mar 2020 11:12:34 +0900 Subject: efi_loader: define OsIndicationsSupported flags These flags are expected to be set in OsIndicationsSupported variable if corresponding features are supported. See UEFI specification, section 8.5.4. In particular, capsule-related flags will be used in my capsule update patch. Signed-off-by: AKASHI Takahiro Fix misspelled EFI_OS_INDICATIONS_BOOT_TO_FW_UI. Reviewed-by: Heinrich Schuchardt Signed-off-by: Heinrich Schuchardt --- include/efi_api.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'include/efi_api.h') diff --git a/include/efi_api.h b/include/efi_api.h index 3d1a6beeeac..9162a27d2e1 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -57,6 +57,16 @@ typedef u16 efi_form_id_t; struct efi_event; +/* OsIndicationsSupported flags */ +#define EFI_OS_INDICATIONS_BOOT_TO_FW_UI 0x0000000000000001 +#define EFI_OS_INDICATIONS_TIMESTAMP_REVOCATION 0x0000000000000002 +#define EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED 0x0000000000000004 +#define EFI_OS_INDICATIONS_FMP_CAPSULE_SUPPORTED 0x0000000000000008 +#define EFI_OS_INDICATIONS_CAPSULE_RESULT_VAR_SUPPORTED 0x0000000000000010 +#define EFI_OS_INDICATIONS_START_OS_RECOVERY 0x0000000000000020 +#define EFI_OS_INDICATIONS_START_PLATFORM_RECOVERY 0x0000000000000040 +#define EFI_OS_INDICATIONS_JSON_CONFIG_DATA_REFRESH 0x0000000000000080 + /* EFI Boot Services table */ #define EFI_BOOT_SERVICES_SIGNATURE 0x56524553544f4f42 struct efi_boot_services { -- cgit v1.2.3 From b74d568d83689234f505726399e483d2dc509898 Mon Sep 17 00:00:00 2001 From: AKASHI Takahiro Date: Tue, 17 Mar 2020 11:12:35 +0900 Subject: efi_loader: define System Resource Table macros Some of those values will be used in an implementation of UEFI firmware management protocol as part of my capsule update patch. Signed-off-by: AKASHI Takahiro --- include/efi_api.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'include/efi_api.h') diff --git a/include/efi_api.h b/include/efi_api.h index 9162a27d2e1..3b0845aafda 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -1655,4 +1655,31 @@ struct efi_load_file_protocol { #define LOAD_OPTION_CATEGORY_BOOT 0x00000000 #define LOAD_OPTION_CATEGORY_APP 0x00000100 +/* + * System Resource Table + */ +/* Firmware Type Definitions */ +#define ESRT_FW_TYPE_UNKNOWN 0x00000000 +#define ESRT_FW_TYPE_SYSTEMFIRMWARE 0x00000001 +#define ESRT_FW_TYPE_DEVICEFIRMWARE 0x00000002 +#define ESRT_FW_TYPE_UEFIDRIVER 0x00000003 + +/* Last Attempt Status Values */ +#define LAST_ATTEMPT_STATUS_SUCCESS 0x00000000 +#define LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL 0x00000001 +#define LAST_ATTEMPT_STATUS_ERROR_INSUFFICIENT_RESOURCES 0x00000002 +#define LAST_ATTEMPT_STATUS_ERROR_INCORRECT_VERSION 0x00000003 +#define LAST_ATTEMPT_STATUS_ERROR_INVALID_FORMAT 0x00000004 +#define LAST_ATTEMPT_STATUS_ERROR_AUTH_ERROR 0x00000005 +#define LAST_ATTEMPT_STATUS_ERROR_PWR_EVT_AC 0x00000006 +#define LAST_ATTEMPT_STATUS_ERROR_PWR_EVT_BATT 0x00000007 +#define LAST_ATTEMPT_STATUS_ERROR_UNSATISFIED_DEPENDENCIES 0x00000008 + +/* + * The LastAttemptStatus values of 0x1000 - 0x4000 are reserved for vendor + * usage. + */ +#define LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL_VENDOR_RANGE_MIN 0x00001000 +#define LAST_ATTEMPT_STATUS_ERROR_UNSUCCESSFUL_VENDOR_RANGE_MAX 0x00004000 + #endif -- cgit v1.2.3 From 74b44875357378c83e4bd150c0b759ca6ae6563a Mon Sep 17 00:00:00 2001 From: AKASHI Takahiro Date: Tue, 17 Mar 2020 11:12:37 +0900 Subject: efi_loader: correct a definition of struct efi_capsule_header See UEFI specification, section 8.5.3. In addition, the structure, efi_capsule_header, should be "packed" as it is a serialized binary format in a capsule file. Signed-off-by: AKASHI Takahiro --- include/efi_api.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'include/efi_api.h') diff --git a/include/efi_api.h b/include/efi_api.h index 3b0845aafda..4713da2e1d0 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -217,11 +217,11 @@ enum efi_reset_type { #define CAPSULE_FLAGS_INITIATE_RESET 0x00040000 struct efi_capsule_header { - efi_guid_t *capsule_guid; + efi_guid_t capsule_guid; u32 header_size; u32 flags; u32 capsule_image_size; -}; +} __packed; #define EFI_RT_SUPPORTED_GET_TIME 0x0001 #define EFI_RT_SUPPORTED_SET_TIME 0x0002 -- cgit v1.2.3