From patchwork Wed Jul 19 17:22:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 791173 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 3xCP5F2p70z9s7g for ; Thu, 20 Jul 2017 03:23:45 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 03DB1C21DC3; Wed, 19 Jul 2017 17:23:39 +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_H3, RCVD_IN_MSPIKE_WL 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 DF41CC21C26; Wed, 19 Jul 2017 17:23:36 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 3503DC21C26; Wed, 19 Jul 2017 17:23:35 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by lists.denx.de (Postfix) with ESMTPS id CCA56C21BE5 for ; Wed, 19 Jul 2017 17:23:34 +0000 (UTC) Received: from localhost.localdomain ([84.118.154.110]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MGSgq-1dTUxp06wC-00DF5d; Wed, 19 Jul 2017 19:22:53 +0200 From: Heinrich Schuchardt To: Alexander Graf Date: Wed, 19 Jul 2017 19:22:34 +0200 Message-Id: <20170719172234.1403-1-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.13.2 In-Reply-To: References: X-Provags-ID: V03:K0:xMgkRFSWjqSxY9iDxDuYDbn/jfHGx9qV3T6dObvRmrR58xk6o9o pfxGjGnugX3eFRUTTLyyQcfVVldwU4/9ZuI7EnLTvIm+uhFHmO65IaHAhcEutomuqO/VLQm MJL6diNq0kQaAgyZB9Ck42LxwYItVYhfhGJpraqnj7GJBGKs+mPNG3ounN3m/8fQ0AnGYkw uoX4Ndv6VNDtGUNbkE3MQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:wB+WOjvogzw=:fmqT+aWgMUsW7N+227mYp4 zOMKZpS4Sh839OmaHpEsudbyM4HSyfbLVcdn+ZG77UWI5Wl+cbKjMiVed+WDoVgP9PbwcOHOA 502VEa6fF5S6BLnbsSXZRFcpq2Oi+MG5PS+hj+xbPEGlRl+Egc1X+kg27aDKuUYCz8NZzPkSB mDexR4IOiNIdPzHtayu8EpIrXDUbWZ6405/HjG4LSMJKVFtyIY327pcB30fMZ8aEQ8K68u+/5 96YKR8+lzz8iRrY52VbKfaXczSSwm5vz7h7xoHl8yodmNB42/39pgwDSV+kqpMYtKo3y3azTm dlVvMpPBVoyl+Yg9L1lCMQjXTRvnwbffv00EiiwVFi/RBv/44TAXZVVrGmfsrTV3W9r+nvLoN Q/728GycplL3WZ3EtvtnTpG7TMtnX69Psawta6b5D2tmFW/bPkeG+De8oJirBle/4JVHCrxLC pbi7vJaU6seAFv2aqbYqQANlAl91eWBWvHeFvMwqFDhVVU6XUtBAviejcuWyU96qYZLSBUao2 A9GiqW/iECsBJMPdd4JCzWy+8QMpSXM/4GiG5oI1WIxCLFEwF3c5HeuAtLWt1HV7cDuj/hSuj FB7nsA7Zggz3xU/bvxmV0Hj+ItVdVmMI7Yt07PZlToo/2oir+cgnT0pbAr7j9itqu+JGMPlWg k2FgPIGJ2zUn/LYhecxEZIVh9SpTzhzk326l2wy97mfimo0xXYLpLUkds3h0s3YB3FJtwAR4F GUdPvDxQQ1GZa/j5B81+/tpr/JpvDClkoypEU2oX6gs9HL0Dd1irH+ZD46ge1QlBqvSXGP7UI j6mZI9EMPYlMLclzHhonVRXaO/Raw== Cc: u-boot@lists.denx.de, Heinrich Schuchardt Subject: [U-Boot] [PATCH 1/1] efi_loader: parameter types for CreateEvent, SetTimer 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 first argument 'type' of CreateEvent is an 32bit unsigned integer bitmap and not an enum. The second argument 'type' of SetTimer take values of an enum which is called EFI_TIMER_DELAY in the UEFI standard. To avoid confusion rename efi_event_type to efi_timer_delay. Reported-by: Alexander Graf Signed-off-by: Heinrich Schuchardt --- include/efi_api.h | 9 +++++---- include/efi_loader.h | 8 ++++---- lib/efi_loader/efi_boottime.c | 11 ++++++----- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/include/efi_api.h b/include/efi_api.h index d52eea4086..8f881d2903 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -22,7 +22,7 @@ #endif /* Types and defines for EFI CreateEvent */ -enum efi_event_type { +enum efi_timer_delay { EFI_TIMER_STOP = 0, EFI_TIMER_PERIODIC = 1, EFI_TIMER_RELATIVE = 2 @@ -59,14 +59,15 @@ struct efi_boot_services { efi_status_t (EFIAPI *allocate_pool)(int, unsigned long, void **); efi_status_t (EFIAPI *free_pool)(void *); - efi_status_t (EFIAPI *create_event)(enum efi_event_type type, + efi_status_t (EFIAPI *create_event)(uint32_t type, UINTN notify_tpl, void (EFIAPI *notify_function) ( struct efi_event *event, void *context), void *notify_context, struct efi_event **event); - efi_status_t (EFIAPI *set_timer)(struct efi_event *event, int type, - uint64_t trigger_time); + efi_status_t (EFIAPI *set_timer)(struct efi_event *event, + enum efi_timer_delay type, + uint64_t trigger_time); efi_status_t (EFIAPI *wait_for_event)(unsigned long number_of_events, struct efi_event **event, unsigned long *index); efi_status_t (EFIAPI *signal_event)(struct efi_event *event); diff --git a/include/efi_loader.h b/include/efi_loader.h index 2abb6b87e1..70dc73bbbc 100644 --- a/include/efi_loader.h +++ b/include/efi_loader.h @@ -76,13 +76,13 @@ struct efi_object { * @signaled: The notify function was already called */ struct efi_event { - u32 type; + uint32_t type; UINTN notify_tpl; void (EFIAPI *notify_function)(struct efi_event *event, void *context); void *notify_context; u64 trigger_next; u64 trigger_time; - enum efi_event_type trigger_type; + enum efi_timer_delay trigger_type; int signaled; }; @@ -119,13 +119,13 @@ void efi_runtime_relocate(ulong offset, struct efi_mem_desc *map); /* Call this to set the current device name */ void efi_set_bootdev(const char *dev, const char *devnr, const char *path); /* Call this to create an event */ -efi_status_t efi_create_event(enum efi_event_type type, UINTN notify_tpl, +efi_status_t efi_create_event(uint32_t type, UINTN notify_tpl, void (EFIAPI *notify_function) ( struct efi_event *event, void *context), void *notify_context, struct efi_event **event); /* Call this to set a timer */ -efi_status_t efi_set_timer(struct efi_event *event, int type, +efi_status_t efi_set_timer(struct efi_event *event, enum efi_timer_delay type, uint64_t trigger_time); /* Call this to signal an event */ void efi_signal_event(struct efi_event *event); diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index ecd8c8fc71..468d14fda3 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -213,7 +213,7 @@ static efi_status_t EFIAPI efi_free_pool_ext(void *buffer) */ static struct efi_event efi_events[16]; -efi_status_t efi_create_event(enum efi_event_type type, UINTN notify_tpl, +efi_status_t efi_create_event(uint32_t type, UINTN notify_tpl, void (EFIAPI *notify_function) ( struct efi_event *event, void *context), @@ -248,7 +248,7 @@ efi_status_t efi_create_event(enum efi_event_type type, UINTN notify_tpl, } static efi_status_t EFIAPI efi_create_event_ext( - enum efi_event_type type, UINTN notify_tpl, + uint32_t type, UINTN notify_tpl, void (EFIAPI *notify_function) ( struct efi_event *event, void *context), @@ -286,7 +286,7 @@ void efi_timer_check(void) WATCHDOG_RESET(); } -efi_status_t efi_set_timer(struct efi_event *event, int type, +efi_status_t efi_set_timer(struct efi_event *event, enum efi_timer_delay type, uint64_t trigger_time) { int i; @@ -322,8 +322,9 @@ efi_status_t efi_set_timer(struct efi_event *event, int type, return EFI_INVALID_PARAMETER; } -static efi_status_t EFIAPI efi_set_timer_ext(struct efi_event *event, int type, - uint64_t trigger_time) +static efi_status_t EFIAPI efi_set_timer_ext(struct efi_event *event, + enum efi_timer_delay type, + uint64_t trigger_time) { EFI_ENTRY("%p, %d, %"PRIx64, event, type, trigger_time); return EFI_EXIT(efi_set_timer(event, type, trigger_time));