Before adding even more GUIDs, let's tidy the existing ones up by not mixing GUIDs for protocols and events.
Signed-off-by: Ahmad Fatoum <[email protected]> --- efi/guid.c | 17 +++++++++----- include/efi/guid.h | 55 +++++++++++++++++++++++----------------------- 2 files changed, 39 insertions(+), 33 deletions(-) diff --git a/efi/guid.c b/efi/guid.c index 6b8e50741ec1..44f03c8046d9 100644 --- a/efi/guid.c +++ b/efi/guid.c @@ -3,6 +3,7 @@ #include <common.h> #include <efi/guid.h> +/* ---------- Protocol GUIDs ---------- */ efi_guid_t efi_file_info_id = EFI_FILE_INFO_GUID; efi_guid_t efi_simple_file_system_protocol_guid = EFI_SIMPLE_FILE_SYSTEM_GUID; efi_guid_t efi_file_system_info_guid = EFI_FILE_SYSTEM_INFO_GUID; @@ -25,6 +26,15 @@ const efi_guid_t efi_dt_fixup_protocol_guid = EFI_DT_FIXUP_PROTOCOL_GUID; /* GUID of the EFI_DRIVER_BINDING_PROTOCOL */ const efi_guid_t efi_driver_binding_protocol_guid = EFI_DRIVER_BINDING_PROTOCOL_GUID; +/* GUIDs of the Load File and Load File2 protocols */ +const efi_guid_t efi_load_file_protocol_guid = EFI_LOAD_FILE_PROTOCOL_GUID; +const efi_guid_t efi_load_file2_protocol_guid = EFI_LOAD_FILE2_PROTOCOL_GUID; +const efi_guid_t efi_device_path_utilities_protocol_guid = + EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID; +const efi_guid_t efi_linux_initrd_media_guid = EFI_LINUX_INITRD_MEDIA_GUID; + + +/* ---------- Event GUIDs ---------- */ /* event group ExitBootServices() invoked */ const efi_guid_t efi_guid_event_group_exit_boot_services = EFI_EVENT_GROUP_EXIT_BOOT_SERVICES; @@ -38,12 +48,7 @@ const efi_guid_t efi_guid_event_group_memory_map_change = const efi_guid_t efi_guid_event_group_ready_to_boot = EFI_EVENT_GROUP_READY_TO_BOOT; /* event group ResetSystem() invoked (before ExitBootServices) */ const efi_guid_t efi_guid_event_group_reset_system = EFI_EVENT_GROUP_RESET_SYSTEM; -/* GUIDs of the Load File and Load File2 protocols */ -const efi_guid_t efi_load_file_protocol_guid = EFI_LOAD_FILE_PROTOCOL_GUID; -const efi_guid_t efi_load_file2_protocol_guid = EFI_LOAD_FILE2_PROTOCOL_GUID; -const efi_guid_t efi_device_path_utilities_protocol_guid = - EFI_DEVICE_PATH_UTILITIES_PROTOCOL_GUID; -const efi_guid_t efi_linux_initrd_media_guid = EFI_LINUX_INITRD_MEDIA_GUID; + #define EFI_GUID_STRING(guid, short, long) do { \ if (!efi_guidcmp(guid, *g)) \ diff --git a/include/efi/guid.h b/include/efi/guid.h index a5b26d420f05..a2bf8638c2e2 100644 --- a/include/efi/guid.h +++ b/include/efi/guid.h @@ -14,6 +14,8 @@ efi_guidcmp (efi_guid_t left, efi_guid_t right) return memcmp(&left, &right, sizeof (efi_guid_t)); } + +/* ---------- Protocol GUIDs ---------- */ extern efi_guid_t efi_file_info_id; extern efi_guid_t efi_simple_file_system_protocol_guid; extern efi_guid_t efi_file_system_info_guid; @@ -32,38 +34,11 @@ extern efi_guid_t efi_loaded_image_device_path_guid; extern const efi_guid_t efi_device_path_to_text_protocol_guid; extern const efi_guid_t efi_dt_fixup_protocol_guid; extern const efi_guid_t efi_driver_binding_protocol_guid; -extern const efi_guid_t efi_guid_event_group_exit_boot_services; -extern const efi_guid_t efi_guid_event_group_virtual_address_change; -extern const efi_guid_t efi_guid_event_group_memory_map_change; -extern const efi_guid_t efi_guid_event_group_ready_to_boot; -extern const efi_guid_t efi_guid_event_group_reset_system; extern const efi_guid_t efi_load_file_protocol_guid; extern const efi_guid_t efi_load_file2_protocol_guid; extern const efi_guid_t efi_device_path_utilities_protocol_guid; extern const efi_guid_t efi_linux_initrd_media_guid; - -/* EFI event group GUID definitions */ -#define EFI_EVENT_GROUP_EXIT_BOOT_SERVICES \ - EFI_GUID(0x27abf055, 0xb1b8, 0x4c26, 0x80, 0x48, \ - 0x74, 0x8f, 0x37, 0xba, 0xa2, 0xdf) - -#define EFI_EVENT_GROUP_VIRTUAL_ADDRESS_CHANGE \ - EFI_GUID(0x13fa7698, 0xc831, 0x49c7, 0x87, 0xea, \ - 0x8f, 0x43, 0xfc, 0xc2, 0x51, 0x96) - -#define EFI_EVENT_GROUP_MEMORY_MAP_CHANGE \ - EFI_GUID(0x78bee926, 0x692f, 0x48fd, 0x9e, 0xdb, \ - 0x01, 0x42, 0x2e, 0xf0, 0xd7, 0xab) - -#define EFI_EVENT_GROUP_READY_TO_BOOT \ - EFI_GUID(0x7ce88fb3, 0x4bd7, 0x4679, 0x87, 0xa8, \ - 0xa8, 0xd8, 0xde, 0xe5, 0x0d, 0x2b) - -#define EFI_EVENT_GROUP_RESET_SYSTEM \ - EFI_GUID(0x62da6a56, 0x13fb, 0x485a, 0xa8, 0xda, \ - 0xa3, 0xdd, 0x79, 0x12, 0xcb, 0x6b) - /* * EFI Configuration Table and GUID definitions */ @@ -300,4 +275,30 @@ extern const efi_guid_t efi_linux_initrd_media_guid; #define EFI_RNG_ALGORITHM_RAW \ EFI_GUID(0xe43176d7, 0xb6e8, 0x4827, 0xb7, 0x84, 0x7f, 0xfd, 0xc4, 0xb6, 0x85, 0x61) + +/* ---------- Event GUIDs ---------- */ +extern const efi_guid_t efi_guid_event_group_exit_boot_services; +extern const efi_guid_t efi_guid_event_group_virtual_address_change; +extern const efi_guid_t efi_guid_event_group_memory_map_change; +extern const efi_guid_t efi_guid_event_group_ready_to_boot; +extern const efi_guid_t efi_guid_event_group_reset_system; + + +/* EFI event group GUID definitions */ +#define EFI_EVENT_GROUP_EXIT_BOOT_SERVICES \ + EFI_GUID(0x27abf055, 0xb1b8, 0x4c26, 0x80, 0x48, 0x74, 0x8f, 0x37, 0xba, 0xa2, 0xdf) + +#define EFI_EVENT_GROUP_VIRTUAL_ADDRESS_CHANGE \ + EFI_GUID(0x13fa7698, 0xc831, 0x49c7, 0x87, 0xea, 0x8f, 0x43, 0xfc, 0xc2, 0x51, 0x96) + +#define EFI_EVENT_GROUP_MEMORY_MAP_CHANGE \ + EFI_GUID(0x78bee926, 0x692f, 0x48fd, 0x9e, 0xdb, 0x01, 0x42, 0x2e, 0xf0, 0xd7, 0xab) + +#define EFI_EVENT_GROUP_READY_TO_BOOT \ + EFI_GUID(0x7ce88fb3, 0x4bd7, 0x4679, 0x87, 0xa8, 0xa8, 0xd8, 0xde, 0xe5, 0x0d, 0x2b) + +#define EFI_EVENT_GROUP_RESET_SYSTEM \ + EFI_GUID(0x62da6a56, 0x13fb, 0x485a, 0xa8, 0xda, 0xa3, 0xdd, 0x79, 0x12, 0xcb, 0x6b) + + #endif -- 2.47.3
