From patchwork Tue Jul 18 18:17:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 790459 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 3xBpNC1Lmvz9t1G for ; Wed, 19 Jul 2017 04:19:39 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id B65C2C21E2B; Tue, 18 Jul 2017 18:18: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_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 ECC19C21DF1; Tue, 18 Jul 2017 18:18:20 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 87466C21D5C; Tue, 18 Jul 2017 18:18:17 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by lists.denx.de (Postfix) with ESMTPS id 38C85C21C38 for ; Tue, 18 Jul 2017 18:18:17 +0000 (UTC) Received: from localhost.localdomain ([84.118.154.110]) by mail.gmx.com (mrgmx001 [212.227.17.190]) with ESMTPSA (Nemesis) id 0MIe0O-1dVLCW45P6-002Hc7; Tue, 18 Jul 2017 20:17:33 +0200 From: Heinrich Schuchardt To: Alexander Graf Date: Tue, 18 Jul 2017 20:17:17 +0200 Message-Id: <20170718181723.1780-2-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170718181723.1780-1-xypron.glpk@gmx.de> References: <20170718181723.1780-1-xypron.glpk@gmx.de> X-Provags-ID: V03:K0:wBAlfIPIjlZqf3WFw8uYYy6c/hmrVkliWx3jSqk0g2aaapTXyNR Fb/3OK/83cOsmnzJGEcn5Wwzq0Qip5ywZ5S037jGDietY7e3gQc86kuc/KmZs5cvUsMXzkc l/4iwj+6cR5I3L/BKlkC5kJOrL1/nP86u8MSJ7m9klupFHrX88Wqpb26Trji5rtLK1GiZ4L ckOYq4/+fVAZvs8xm0FnA== X-UI-Out-Filterresults: notjunk:1; V01:K0:ZXbgZQPaZCw=:GbKwj0StclqG1DA7t26ta/ RNxOAU1cddG5/i13qKGSK4svo3knaWyDxOmt6AGRNSokVWMeNSoANTAqNWrSDusUcZaZecjpD M6pPZIiJ2Ex1q0cZMtr+D8vLRDU7pwNMSHqs1ytSDHy9EDKdYkn4g8bqt00zU/OLPDxWQWixA VQSI+jSmiBJTP/9b0EJ5nzcWJznStM/EAKX93mzc2ibgcZ678UpBF4neRNhhcSHfTAplil8B3 i7w6O50fVTZjLNQDupRrshOHEOo0vJ3iasIGrBGaQo8RCbtNUPAvPi2/pqP4qPSdf7w29l1G8 rPUQI98xiejbQUXSfpuPoFLHpcv39ZdURY7s6meSM2+HzHvQyykbFaQuvIS13uJLqE+SccOK5 pAIogjNEhS86E9qBkLaD3DTBEyxka1A1ajNUv2IL1EyYA8XHK6gNu7VT9J2/PDFz6cNQpw9+V lW8HXtss/Xbq1XxLx7iSR3EjPjSkTBX41viJHSPsdnqAQzOPqFOY5DqzSzbA9fEms8w1tNpnR Hcg2mfRPnoA92Smm7zL9eLOA26/q14/5DuOppAWzYbfMFjmI+gvyckohtKabJxE9GnWyBpd5l PYphxhkHr0pr4pjewecXgmbAwqtDl3mOz6fnnjK2x4G6rUXpqqZugVbU6CzGNFGu18dsCIK08 MZgGJNI95NpV4v0H5iVXzodlMxDF4GGS4bfjuyl8uUTyNjYwoA0r3upHVvz4eXXWd4GC4zgYX bne1j5mAC2t/gBWsVN20+7WdE9k21BVRPsy+joZzzo5PAwAKrpZBLeGt1FoBi7nXj5fIIhw2d Tooana7FzfYrqRZYN55xXSuRgXZrA== Cc: Heinrich Schuchardt , u-boot@lists.denx.de Subject: [U-Boot] [PATCH v2 1/7] efi_loader: use struct efi_event * instead of void * 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" In our implementation the internal structure of events is known. So use the known type instead of void. Signed-off-by: Heinrich Schuchardt --- v2 new patch --- include/efi_api.h | 23 +++++++++++++---------- lib/efi_loader/efi_boottime.c | 25 ++++++++++++++----------- 2 files changed, 27 insertions(+), 21 deletions(-) diff --git a/include/efi_api.h b/include/efi_api.h index ea63e80b47..a1f8221111 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -31,6 +31,8 @@ enum efi_event_type { #define EVT_NOTIFY_WAIT 0x00000100 #define EVT_NOTIFY_SIGNAL 0x00000200 +struct efi_event; + /* EFI Boot Services table */ struct efi_boot_services { struct efi_table_hdr hdr; @@ -48,16 +50,17 @@ struct efi_boot_services { efi_status_t (EFIAPI *create_event)(enum efi_event_type type, unsigned long notify_tpl, - void (EFIAPI *notify_function) (void *event, - void *context), - void *notify_context, void **event); - efi_status_t (EFIAPI *set_timer)(void *event, int type, + 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 *wait_for_event)(unsigned long number_of_events, - void *event, unsigned long *index); - efi_status_t (EFIAPI *signal_event)(void *event); - efi_status_t (EFIAPI *close_event)(void *event); - efi_status_t (EFIAPI *check_event)(void *event); + struct efi_event **event, unsigned long *index); + efi_status_t (EFIAPI *signal_event)(struct efi_event *event); + efi_status_t (EFIAPI *close_event)(struct efi_event *event); + efi_status_t (EFIAPI *check_event)(struct efi_event *event); #define EFI_NATIVE_INTERFACE 0x00000000 efi_status_t (EFIAPI *install_protocol_interface)( void **handle, efi_guid_t *protocol, @@ -71,7 +74,7 @@ struct efi_boot_services { void **); void *reserved; efi_status_t (EFIAPI *register_protocol_notify)( - efi_guid_t *protocol, void *event, + efi_guid_t *protocol, struct efi_event *event, void **registration); efi_status_t (EFIAPI *locate_handle)( enum efi_locate_search_type search_type, @@ -374,7 +377,7 @@ struct efi_simple_input_interface { efi_status_t(EFIAPI *read_key_stroke)( struct efi_simple_input_interface *this, struct efi_input_key *key); - void *wait_for_key; + struct efi_event *wait_for_key; }; #define CONSOLE_CONTROL_GUID \ diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index fa264f3f3d..0eda465359 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -166,13 +166,14 @@ static efi_status_t EFIAPI efi_free_pool_ext(void *buffer) * Our event capabilities are very limited. Only support a single * event to exist, so we don't need to maintain lists. */ -static struct { +static struct efi_event { enum efi_event_type type; u32 trigger_type; u32 trigger_time; u64 trigger_next; unsigned long notify_tpl; - void (EFIAPI *notify_function) (void *event, void *context); + void (EFIAPI *notify_function) (struct efi_event *event, + void *context); void *notify_context; } efi_event = { /* Disable timers on bootup */ @@ -181,9 +182,10 @@ static struct { static efi_status_t EFIAPI efi_create_event( enum efi_event_type type, ulong notify_tpl, - void (EFIAPI *notify_function) (void *event, - void *context), - void *notify_context, void **event) + void (EFIAPI *notify_function) ( + struct efi_event *event, + void *context), + void *notify_context, struct efi_event **event) { EFI_ENTRY("%d, 0x%lx, %p, %p", type, notify_tpl, notify_function, notify_context); @@ -231,7 +233,7 @@ void efi_timer_check(void) WATCHDOG_RESET(); } -static efi_status_t EFIAPI efi_set_timer(void *event, int type, +static efi_status_t EFIAPI efi_set_timer(struct efi_event *event, int type, uint64_t trigger_time) { /* We don't have 64bit division available everywhere, so limit timer @@ -268,7 +270,8 @@ static efi_status_t EFIAPI efi_set_timer(void *event, int type, } static efi_status_t EFIAPI efi_wait_for_event(unsigned long num_events, - void *event, unsigned long *index) + struct efi_event **event, + unsigned long *index) { u64 now; @@ -281,20 +284,20 @@ static efi_status_t EFIAPI efi_wait_for_event(unsigned long num_events, return EFI_EXIT(EFI_SUCCESS); } -static efi_status_t EFIAPI efi_signal_event(void *event) +static efi_status_t EFIAPI efi_signal_event(struct efi_event *event) { EFI_ENTRY("%p", event); return EFI_EXIT(EFI_SUCCESS); } -static efi_status_t EFIAPI efi_close_event(void *event) +static efi_status_t EFIAPI efi_close_event(struct efi_event *event) { EFI_ENTRY("%p", event); efi_event.trigger_next = -1ULL; return EFI_EXIT(EFI_SUCCESS); } -static efi_status_t EFIAPI efi_check_event(void *event) +static efi_status_t EFIAPI efi_check_event(struct efi_event *event) { EFI_ENTRY("%p", event); return EFI_EXIT(EFI_NOT_READY); @@ -429,7 +432,7 @@ static efi_status_t EFIAPI efi_uninstall_protocol_interface_ext(void *handle, } static efi_status_t EFIAPI efi_register_protocol_notify(efi_guid_t *protocol, - void *event, + struct efi_event *event, void **registration) { EFI_ENTRY("%p, %p, %p", protocol, event, registration);