All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 08/16] efi_loader: debug output installed device path
Date: Thu, 11 Jan 2018 08:16:01 +0100	[thread overview]
Message-ID: <20180111071609.4058-9-xypron.glpk@gmx.de> (raw)
In-Reply-To: <20180111071609.4058-1-xypron.glpk@gmx.de>

When a device path protocol is installed write the device
path to the console in debug mode.

For printing the new macro EFI_PRINT is used, which can be reused
for future diagnostic output.

Remove unused EFI_PRINT_GUID macro

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
v3
	Avoid memory leak. Use printf("%pD") for device path output.
v2
	Remove unused EFI_PRINT_GUID macro.
	Use new macro EFI_PRINT to output device path.
---
 include/efi_loader.h          | 7 ++++---
 lib/efi_loader/efi_boottime.c | 2 ++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/include/efi_loader.h b/include/efi_loader.h
index 637e6e166d..4198329230 100644
--- a/include/efi_loader.h
+++ b/include/efi_loader.h
@@ -69,10 +69,11 @@ const char *__efi_nesting_dec(void);
 	} while(0)
 
 /*
- * Write GUID
+ * Write an indented message with EFI prefix
  */
-#define EFI_PRINT_GUID(txt, guid) ({ \
-	debug("%sEFI: %s %pUl\n", __efi_nesting(), txt, guid); \
+#define EFI_PRINT(format, ...) ({ \
+	debug("%sEFI: " format, __efi_nesting(), \
+		##__VA_ARGS__); \
 	})
 
 extern struct efi_runtime_services efi_runtime_services;
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 44c9da0a7c..d232ed2c70 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -876,6 +876,8 @@ efi_status_t efi_add_protocol(const void *handle, const efi_guid_t *protocol,
 	handler->protocol_interface = protocol_interface;
 	INIT_LIST_HEAD(&handler->open_infos);
 	list_add_tail(&handler->link, &efiobj->protocols);
+	if (!guidcmp(&efi_guid_device_path, protocol))
+		EFI_PRINT("installed device path '%pD'\n", protocol_interface);
 	return EFI_SUCCESS;
 }
 
-- 
2.14.2

  parent reply	other threads:[~2018-01-11  7:16 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-11  7:15 [U-Boot] [PATCH v3 00/16] efi_loader: implement driver management Heinrich Schuchardt
2018-01-11  7:15 ` [U-Boot] [PATCH v3 01/16] efi_selftest: colored test output Heinrich Schuchardt
2018-01-16 14:56   ` Simon Glass
2018-01-11  7:15 ` [U-Boot] [PATCH v3 02/16] efi_loader: simplify efi_remove_all_protocols Heinrich Schuchardt
2018-01-16 14:56   ` Simon Glass
2018-01-11  7:15 ` [U-Boot] [PATCH v3 03/16] efi_selftest: do not try to close device path protocol Heinrich Schuchardt
2018-01-16 14:56   ` Simon Glass
2018-01-11  7:15 ` [U-Boot] [PATCH v3 04/16] efi_loader: list of open protocol infos Heinrich Schuchardt
2018-01-11  7:15 ` [U-Boot] [PATCH v3 05/16] efi_loader: open_info in OpenProtocol Heinrich Schuchardt
2018-01-11  7:15 ` [U-Boot] [PATCH v3 06/16] efi_loader: open_info in CloseProtocol Heinrich Schuchardt
2018-01-11  7:16 ` [U-Boot] [PATCH v3 07/16] efi_loader: implement OpenProtocolInformation Heinrich Schuchardt
2018-01-19 16:30   ` Alexander Graf
2018-01-11  7:16 ` Heinrich Schuchardt [this message]
2018-01-11  7:16 ` [U-Boot] [PATCH v3 09/16] efi_loader: implement ConnectController Heinrich Schuchardt
2018-01-11  7:16 ` [U-Boot] [PATCH v3 10/16] efi_loader: fix signature of efi_disconnect_controller Heinrich Schuchardt
2018-01-11  7:16 ` [U-Boot] [PATCH v3 11/16] efi_loader: implement DisconnectController Heinrich Schuchardt
2018-01-11  7:16 ` [U-Boot] [PATCH v3 12/16] efi_loader: disconnect controllers in UninstallProtocol Heinrich Schuchardt
2018-01-11  7:16 ` [U-Boot] [PATCH v3 13/16] efi_selftest: remove todo in manage protocols Heinrich Schuchardt
2018-01-11  7:16 ` [U-Boot] [PATCH v3 14/16] efi_selftest: remove todo in device path test Heinrich Schuchardt
2018-01-11  7:16 ` [U-Boot] [PATCH v3 15/16] efi_selftest: test for (Dis)ConnectController Heinrich Schuchardt
2018-01-11  7:16 ` [U-Boot] [PATCH v3 16/16] efi_loader: consistently use efi_handle_t for handles Heinrich Schuchardt
2018-01-16 14:56   ` Simon Glass

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=20180111071609.4058-9-xypron.glpk@gmx.de \
    --to=xypron.glpk@gmx.de \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.