From patchwork Sun Mar 12 08:26:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Gray X-Patchwork-Id: 737793 X-Patchwork-Delegate: agraf@suse.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3vgvGv6Sd2z9s7K for ; Sun, 12 Mar 2017 19:26:30 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id EB0F6C21C7A; Sun, 12 Mar 2017 08:26:20 +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.0 required=5.0 tests=none 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 3E1E2C21C34; Sun, 12 Mar 2017 08:26:18 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id EA4B8C21C32; Sun, 12 Mar 2017 08:26:16 +0000 (UTC) Received: from lechuck.jsg.id.au (jsg.id.au [210.15.216.215]) by lists.denx.de (Postfix) with ESMTPS id 3AB17C21BE5 for ; Sun, 12 Mar 2017 08:26:14 +0000 (UTC) Received: from largo.jsg.id.au (largo.jsg.id.au [192.168.1.43]) by lechuck.jsg.id.au (OpenSMTPD) with ESMTP id f55aec3c; Sun, 12 Mar 2017 19:26:07 +1100 (AEDT) Received: from largo.jsg.id.au (localhost [127.0.0.1]) by largo.jsg.id.au (OpenSMTPD) with ESMTP id db522462; Sun, 12 Mar 2017 19:26:07 +1100 (AEDT) From: Jonathan Gray To: u-boot@lists.denx.de Date: Sun, 12 Mar 2017 19:26:06 +1100 Message-Id: <20170312082607.58540-1-jsg@jsg.id.au> X-Mailer: git-send-email 2.9.0 Subject: [U-Boot] [PATCH 1/2] efi_loader: run CreateEvent() notify function based on flags 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" The UEFI specification states that the tpl, function and context arguments are to be ignored if neither EVT_NOTIFY_WAIT or EVT_NOTIFY_SIGNAL are specified. This matches observed behaviour with an AMI EDK2 based UEFI implementation. Skip calling the notify function if neither flag is present. Signed-off-by: Jonathan Gray Acked-By: Heinrich Schuchardt --- include/efi_api.h | 3 +++ lib/efi_loader/efi_boottime.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/include/efi_api.h b/include/efi_api.h index 5c3836a51b..f071b36b53 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -28,6 +28,9 @@ enum efi_event_type { EFI_TIMER_RELATIVE = 2 }; +#define EVT_NOTIFY_WAIT 0x00000100 +#define EVT_NOTIFY_SIGNAL 0x00000200 + /* EFI Boot Services table */ struct efi_boot_services { struct efi_table_hdr hdr; diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index 51080cbeed..eb5946a959 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -210,7 +210,9 @@ void efi_timer_check(void) /* Triggering! */ if (efi_event.trigger_type == EFI_TIMER_PERIODIC) efi_event.trigger_next += efi_event.trigger_time / 10; - efi_event.notify_function(&efi_event, efi_event.notify_context); + if (efi_event.type & (EVT_NOTIFY_WAIT | EVT_NOTIFY_SIGNAL)) + efi_event.notify_function(&efi_event, + efi_event.notify_context); } WATCHDOG_RESET();