{"id":814127,"url":"http://patchwork.ozlabs.org/api/patches/814127/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20170915080619.25250-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":"<20170915080619.25250-2-xypron.glpk@gmx.de>","list_archive_url":null,"date":"2017-09-15T08:06:10","name":"[U-Boot,01/10] efi_loader: allow return value in EFI_CALL","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"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/20170915080619.25250-2-xypron.glpk@gmx.de/mbox/","series":[{"id":3244,"url":"http://patchwork.ozlabs.org/api/series/3244/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=3244","date":"2017-09-15T08:06:10","name":"efi_loader: event services & API test","version":1,"mbox":"http://patchwork.ozlabs.org/series/3244/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/814127/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/814127/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 3xtp0l0s2Hz9sBZ\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Sep 2017 18:07:33 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid A0A0BC21F0B; Fri, 15 Sep 2017 08:07:26 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 37033C21D65;\n\tFri, 15 Sep 2017 08:07:23 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 72342C21D7B; Fri, 15 Sep 2017 08:07:21 +0000 (UTC)","from mout.gmx.net (mout.gmx.net [212.227.17.20])\n\tby lists.denx.de (Postfix) with ESMTPS id 237A8C21D65\n\tfor <u-boot@lists.denx.de>; Fri, 15 Sep 2017 08:07:21 +0000 (UTC)","from laptop1.fritz.box ([94.197.120.111]) by mail.gmx.com (mrgmx102\n\t[212.227.17.174]) with ESMTPSA (Nemesis) id 0LuJDv-1dSc7702Fz-011i4c;\n\tFri, 15 Sep 2017 10:07:02 +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":"Fri, 15 Sep 2017 10:06:10 +0200","Message-Id":"<20170915080619.25250-2-xypron.glpk@gmx.de>","X-Mailer":"git-send-email 2.11.0","In-Reply-To":"<20170915080619.25250-1-xypron.glpk@gmx.de>","References":"<20170915080619.25250-1-xypron.glpk@gmx.de>","X-Provags-ID":"V03:K0:th/bVt3opJA+G2lMlg4BtSeaAkt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q6b66URAB+xfUxc2JqNJSm6eDLou98be36fXP65ChRZ\n\tCd3+Kske9SPCAim1SquuSZULMDCJg==","Cc":"=?utf-8?q?=C5=81ukasz_Majewski?= <l.majewski@samsung.com>,\n\tHeinrich Schuchardt <xypron.glpk@gmx.de>, Andy Shevchenko\n\t<andriy.shevchenko@linux.intel.com>, u-boot@lists.denx.de, Fabio Estevam\n\t<fabio.estevam@nxp.com>, Maxime Ripard <maxime.ripard@free-electrons.com>","Subject":"[U-Boot] [PATCH 01/10] 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 46d684f6df..f27192555e 100644\n--- a/include/efi_loader.h\n+++ b/include/efi_loader.h\n@@ -42,9 +42,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 90e9ead7b2..2c9379a8ae 100644\n--- a/lib/efi_loader/efi_boottime.c\n+++ b/lib/efi_loader/efi_boottime.c\n@@ -163,7 +163,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/10"]}