From patchwork Fri Aug 18 15:45:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 803320 X-Patchwork-Delegate: agraf@suse.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xYnVF22wKz9sQl for ; Sat, 19 Aug 2017 01:45:41 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id E8D9DC21FD3; Fri, 18 Aug 2017 15:45:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id C2415C21DA9; Fri, 18 Aug 2017 15:45:36 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 92359C21DA9; Fri, 18 Aug 2017 15:45:35 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.18]) by lists.denx.de (Postfix) with ESMTPS id 49053C21D90 for ; Fri, 18 Aug 2017 15:45:35 +0000 (UTC) Received: from workstation4.fritz.box ([84.118.154.110]) by mail.gmx.com (mrgmx001 [212.227.17.184]) with ESMTPSA (Nemesis) id 0LvV1X-1dZLSg3Slf-010gjc; Fri, 18 Aug 2017 17:45:33 +0200 From: Heinrich Schuchardt To: Alexander Graf Date: Fri, 18 Aug 2017 17:45:16 +0200 Message-Id: <20170818154516.12375-1-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.11.0 X-Provags-ID: V03:K0:+i9nouKIuMjaK5IkaU0OHEczitvi4zaA23Q46SS91IPq3xVJcHH bqdHnlSWAImar438d8th8s0WPyDIk0J9VVPEBS71GUxK4EZCkqpJfDTGUGTcQwVV7xxp0jy 6NeLdOOEbPs83bcdKFB7+R1AlULPKU3rDwo6MscbploUJm4OMJcocRSRIsdUrUMiUYnTUr5 lWwxvrognpS5hp4lgSW4A== X-UI-Out-Filterresults: notjunk:1; V01:K0:a0O1ats9ji4=:Jz+bW+HP59gncBHICQhCYU Xw90zbrQLsT6QnQigpC3VVmOjBPjNHGqucE5ZXByxofSKjdbVy3ZI5cSBdjvLxJnhXcwskYa6 /FLvKQMbzy2WSM2mX48rWwqMY7S+j/WIq15rLXyiLQIwWpTE57SveIncjF07kZXDfl6IQIB8l rLV6gyZgcK2UxbCcjMCxMNu791b5t0sbyQkDQYEGGw1oDb2Mfw0NI4z9KYhUxmhOv/6mZYubF 6dpSsG4KyulA/kvM0joMmrzbS+PyHVEkLGX/wkYY3JRc1pYUPFLw9zAM+sqovhtAOfV2dFVPc rIc2vPGiV9rycq+HimMbHo68HVaqO6jJYN2svMha0rRmZFUta3xu662fBnVALkt8BXDB7jgjr LS3+qyaoYC9RwpM6pniUOzJHQ3PiGTF4Pw/8EurvUurJl1Rl4RTZWB70cBBocSMdKLHnPaSfR 371Ah2CtxtpDbfTt+nyCfGNGjVsizO72cTfHZZ1AcFwEHRb8RFhxreyxo4XcTs1k63x5kjGtk 2dSNKBbhGHDO7108FKtxt8lmt/kCg4YmTYKjR9HMmu5OwDdzy2l8rlySrLOBC4+wl1D1l40Ef 3cqpZ6nCfknYDbsFAtNkZc4buP4b5kn3bHpfK1qaf/lVX87s5s1hs8DPFtlKp4EWfcFXZxyAA fKhwhjynGBwgent3XTNO+P4kujMk3FqybfahjFlqX0Xv6Dxy3qlH0dq6sZ/bAvewSwxP+ln16 mYSW+IYfMpfIVuEcFQWvx8pxGMU6TKWMaxdPEX9kFNrU15pNbDMTQaHarhUmU9jqKWxLLva8t zPB6kZYRPiCZFacQ2peb9bQsKhV/g== Cc: u-boot@lists.denx.de, Heinrich Schuchardt Subject: [U-Boot] [PATCH v4 1/1] efi_loader: write protocol GUID in OpenProtocol X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" To understand what is happening in OpenProtocol or LocateProtocol it is necessary to know the protocol interface GUID. Let's write a debug message. Cc: Rob Clark Signed-off-by: Heinrich Schuchardt --- v4: use %pUl format string correct indention of output v3: commit message changed v2: fix typo in commit message --- include/efi_loader.h | 8 ++++++++ lib/efi_loader/efi_boottime.c | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/include/efi_loader.h b/include/efi_loader.h index 870854fb61..5b20af808b 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -17,6 +17,7 @@ int __efi_entry_check(void); int __efi_exit_check(void); +const char *__efi_nesting(void); const char *__efi_nesting_inc(void); const char *__efi_nesting_dec(void); @@ -64,6 +65,13 @@ 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("%sEFI: %s %pUl\n", __efi_nesting(), txt, guid); \ + }) + 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 5aeaeeca75..6af033458b 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -112,6 +112,11 @@ static const char *indent_string(int level) return &indent[max - level]; } +const char *__efi_nesting(void) +{ + return indent_string(nesting_level); +} + const char *__efi_nesting_inc(void) { return indent_string(nesting_level++); @@ -1163,6 +1170,8 @@ static efi_status_t EFIAPI efi_locate_protocol(efi_guid_t *protocol, if (!protocol || !protocol_interface) return EFI_EXIT(EFI_INVALID_PARAMETER); + EFI_PRINT_GUID("protocol", protocol); + list_for_each(lhandle, &efi_obj_list) { struct efi_object *efiobj; @@ -1366,6 +1375,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: