mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 11/16] efi: guid: don't interleave protocol and event GUIDs
Date: Thu, 11 Dec 2025 21:30:02 +0100	[thread overview]
Message-ID: <20251211203056.2014710-12-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20251211203056.2014710-1-a.fatoum@pengutronix.de>

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 <a.fatoum@pengutronix.de>
---
 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




  parent reply	other threads:[~2025-12-11 20:37 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-11 20:29 [PATCH 00/16] efi: restructure for reuse from loader code Ahmad Fatoum
2025-12-11 20:29 ` [PATCH 01/16] efi: payload: restructure Kconfig Ahmad Fatoum
2025-12-11 20:29 ` [PATCH 02/16] efi: payload: populate $global.efi.payload variable Ahmad Fatoum
2025-12-11 20:29 ` [PATCH 03/16] efi: mode: add efi_get_runtime_services helper Ahmad Fatoum
2025-12-11 20:29 ` [PATCH 04/16] efi: payload: make EFI variable helpers usable for loader as well Ahmad Fatoum
2025-12-11 20:29 ` [PATCH 05/16] fs: efivarfs: prepare for use with barebox as EFI loader Ahmad Fatoum
2025-12-11 20:29 ` [PATCH 06/16] efi: handle: build for both EFI payload and loader Ahmad Fatoum
2025-12-11 20:29 ` [PATCH 07/16] efi: provide populate $efi.payload_default_path depending on arch Ahmad Fatoum
2025-12-11 20:29 ` [PATCH 08/16] efi: tidy up header includes for reuse Ahmad Fatoum
2025-12-11 20:30 ` [PATCH 09/16] efi: types: add efi_intn_t/efi_uintn_t definition Ahmad Fatoum
2025-12-11 20:30 ` [PATCH 10/16] efi: devicepath: make fully usable for loader Ahmad Fatoum
2025-12-11 20:30 ` Ahmad Fatoum [this message]
2025-12-11 20:30 ` [PATCH 12/16] efi: guid: add some more GUIDs Ahmad Fatoum
2025-12-15  8:30   ` [PATCH] fixup! " Ahmad Fatoum
2025-12-15  9:03     ` Sascha Hauer
2025-12-11 20:30 ` [PATCH 13/16] efi: guid: move static GUIDs out of drivers Ahmad Fatoum
2025-12-11 20:30 ` [PATCH 14/16] efi: gop: flesh out efi_graphics_output_protocol::blt definition Ahmad Fatoum
2025-12-11 20:30 ` [PATCH 15/16] efi: payload: initrd: move into common efi code Ahmad Fatoum
2025-12-11 20:30 ` [PATCH 16/16] efi: add missing EFIAPI to functions Ahmad Fatoum
2025-12-13 10:42 ` [PATCH] fixup! efi: payload: restructure Kconfig Ahmad Fatoum
2025-12-15  9:03   ` (subset) " Sascha Hauer
2025-12-15  9:03 ` [PATCH 00/16] efi: restructure for reuse from loader code Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251211203056.2014710-12-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox