{"id":806164,"url":"http://patchwork.ozlabs.org/api/patches/806164/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20170826225110.7381-2-xypron.glpk@gmx.de/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170826225110.7381-2-xypron.glpk@gmx.de>","list_archive_url":null,"date":"2017-08-26T22:51:02","name":"[U-Boot,01/23] efi_loader: allow return value in EFI_CALL","commit_ref":null,"pull_url":null,"state":"superseded","archived":true,"hash":"afa94728e55eb42f95cce56e3666e3e88db977b1","submitter":{"id":61270,"url":"http://patchwork.ozlabs.org/api/people/61270/?format=json","name":"Heinrich Schuchardt","email":"xypron.glpk@gmx.de"},"delegate":{"id":3400,"url":"http://patchwork.ozlabs.org/api/users/3400/?format=json","username":"agraf","first_name":"Alexander","last_name":"Graf","email":"agraf@suse.de"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20170826225110.7381-2-xypron.glpk@gmx.de/mbox/","series":[],"comments":"http://patchwork.ozlabs.org/api/patches/806164/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/806164/checks/","tags":{},"related":[],"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xftc64v5Yz9s78\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSun, 27 Aug 2017 08:53:26 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 5381BC221B9; Sat, 26 Aug 2017 22:52:25 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 602F3C221B7;\n\tSat, 26 Aug 2017 22:52:09 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 29195C220F4; Sat, 26 Aug 2017 22:52:06 +0000 (UTC)","from mout.gmx.net (mout.gmx.net [212.227.17.21])\n\tby lists.denx.de (Postfix) with ESMTPS id 6D7C5C2211F\n\tfor <u-boot@lists.denx.de>; Sat, 26 Aug 2017 22:52:06 +0000 (UTC)","from localhost.localdomain ([84.118.154.110]) by mail.gmx.com\n\t(mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id\n\t0LosFD-1dJFb70Igd-00gqI1; Sun, 27 Aug 2017 00:51:22 +0200"],"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,\n\tRCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,\n\tRCVD_IN_MSPIKE_WL autolearn=unavailable\n\tautolearn_force=no version=3.4.0","From":"Heinrich Schuchardt <xypron.glpk@gmx.de>","To":"Alexander Graf <agraf@suse.de>","Date":"Sun, 27 Aug 2017 00:51:02 +0200","Message-Id":"<20170826225110.7381-2-xypron.glpk@gmx.de>","X-Mailer":"git-send-email 2.14.1","In-Reply-To":"<20170826225110.7381-1-xypron.glpk@gmx.de>","References":"<20170826225110.7381-1-xypron.glpk@gmx.de>","X-Provags-ID":"V03:K0:zrHeG8if+UZ1LQWOD2P5Ze2PjC6eepY6DxEWmQdjoeOKPMq/pwD\n\tD8iLWJPzYh9Ubmf6Tj5/q9uYL3wlNOjxbt/mxSBKtiSXzLIh3b0DQehM1hglWCn6C2gIz0E\n\ti+fck4M9UuFn55fjKhXowQ/TXE35NRBh1jLkes40Y+p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 01/23] efi_loader: allow return value in EFI_CALL","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"},"content":"Macro EFI_CALL was introduced to call an UEFI function.\nUnfortunately it does not support return values.\nMost UEFI functions have a return value.\n\nSo let's rename EFI_CALL to EFI_CALL_VOID and introduce a\nnew EFI_CALL macro that supports return values.\n\nCc: Rob Clark <robdclark@gmail.com>\nSigned-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>\n---\n include/efi_loader.h          | 17 +++++++++++++++--\n lib/efi_loader/efi_boottime.c |  3 ++-\n 2 files changed, 17 insertions(+), 3 deletions(-)","diff":"diff --git a/include/efi_loader.h b/include/efi_loader.h\nindex 1179234f68..6f71a6202b 100644\n--- a/include/efi_loader.h\n+++ b/include/efi_loader.h\n@@ -41,9 +41,22 @@ const char *__efi_nesting_dec(void);\n \t})\n \n /*\n- * Callback into UEFI world from u-boot:\n+ * Call non-void UEFI function from u-boot and retrieve return value:\n  */\n-#define EFI_CALL(exp) do { \\\n+#define EFI_CALL(exp) ({ \\\n+\tdebug(\"%sEFI: Call: %s\\n\", __efi_nesting_inc(), #exp); \\\n+\tassert(__efi_exit_check()); \\\n+\ttypeof(exp) _r = exp; \\\n+\tassert(__efi_entry_check()); \\\n+\tdebug(\"%sEFI: %lu returned by %s\\n\", __efi_nesting_dec(), \\\n+\t      (unsigned long)((uintptr_t)_r & ~EFI_ERROR_MASK), #exp); \\\n+\t_r; \\\n+})\n+\n+/*\n+ * Call void UEFI function from u-boot:\n+ */\n+#define EFI_CALL_VOID(exp) do { \\\n \tdebug(\"%sEFI: Call: %s\\n\", __efi_nesting_inc(), #exp); \\\n \tassert(__efi_exit_check()); \\\n \texp; \\\ndiff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c\nindex ea953dca82..ab26e2989b 100644\n--- a/lib/efi_loader/efi_boottime.c\n+++ b/lib/efi_loader/efi_boottime.c\n@@ -158,7 +158,8 @@ void efi_signal_event(struct efi_event *event)\n \t\treturn;\n \tevent->signaled = 1;\n \tif (event->type & EVT_NOTIFY_SIGNAL) {\n-\t\tEFI_CALL(event->notify_function(event, event->notify_context));\n+\t\tEFI_CALL_VOID(event->notify_function(event,\n+\t\t\t\t\t\t     event->notify_context));\n \t}\n }\n \n","prefixes":["U-Boot","01/23"]}