[U-Boot] [PATCH 1/1] efi_loader: write protocol GUID in OpenProtocol

Heinrich Schuchardt xypron.glpk at gmx.de
Sun Jul 30 14:11:10 UTC 2017


To understand what happens in OpenProtol it is necessary to know
the protocol interface GUID. Let's write a debug message.

Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
---
 include/efi_loader.h          | 14 ++++++++++++++
 lib/efi_loader/efi_boottime.c |  2 ++
 2 files changed, 16 insertions(+)

diff --git a/include/efi_loader.h b/include/efi_loader.h
index fb91d72afd..a08dfa26f9 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -51,6 +51,20 @@ const char *__efi_nesting_dec(void);
 	debug("%sEFI: Return From: %s\n", __efi_nesting_dec(), #exp); \
 	} while(0)
 
+/*
+ * Write GUID
+ */
+#define EFI_PRINT_GUID(txt, guid) ({ \
+	debug("EFI: %s %02x%02x%02x%02x-%02x%02x-%02x%02x-" \
+	      "%02x%02x%02x%02x%02x%02x%02x%02x\n", \
+	      txt, ((u8 *)guid)[3], \
+	      ((u8 *)guid)[2], ((u8 *)guid)[1], ((u8 *)guid)[0], \
+	      ((u8 *)guid)[5], ((u8 *)guid)[4], ((u8 *)guid)[7], \
+	      ((u8 *)guid)[6], ((u8 *)guid)[8], ((u8 *)guid)[9], \
+	      ((u8 *)guid)[10], ((u8 *)guid)[11], ((u8 *)guid)[12], \
+	      ((u8 *)guid)[13], ((u8 *)guid)[14], ((u8 *)guid)[15]); \
+	})
+
 extern struct efi_runtime_services efi_runtime_services;
 extern struct efi_system_table systab;
 
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index c29a9b0ad0..2a58c29998 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -1314,6 +1314,8 @@ static efi_status_t EFIAPI efi_open_protocol(
 		goto out;
 	}
 
+	EFI_PRINT_GUID("protocol:", protocol);
+
 	switch (attributes) {
 	case EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL:
 	case EFI_OPEN_PROTOCOL_GET_PROTOCOL:
-- 
2.13.2



More information about the U-Boot mailing list