From patchwork Sun Sep 24 19:57:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 817975 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 3y0dRF1S8tz9t30 for ; Mon, 25 Sep 2017 06:02:17 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id DD025C22127; Sun, 24 Sep 2017 19:59: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_H2 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 27830C22124; Sun, 24 Sep 2017 19:58:34 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id DF0BCC220E5; Sun, 24 Sep 2017 19:58:19 +0000 (UTC) Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by lists.denx.de (Postfix) with ESMTPS id 586D6C2209B for ; Sun, 24 Sep 2017 19:58:16 +0000 (UTC) Received: from workstation4.fritz.box ([84.118.154.110]) by mail.gmx.com (mrgmx102 [212.227.17.174]) with ESMTPSA (Nemesis) id 0MGoU1-1e9jgW3z9d-00DaFD; Sun, 24 Sep 2017 21:57:30 +0200 From: Heinrich Schuchardt To: Alexander Graf Date: Sun, 24 Sep 2017 21:57:02 +0200 Message-Id: <20170924195716.3433-4-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170924195716.3433-1-xypron.glpk@gmx.de> References: <20170924195716.3433-1-xypron.glpk@gmx.de> X-Provags-ID: V03:K0:39eFKdQFjuIWVfL3QY0qLxCMFbeNcRzt8ATW8pe+0qE2Rmn/O8w YekC0yG5Mdl1YMNWdlSKNjtKJ5DdUyMuxM4IN5afxM4mMPSniiw1XeI5iqKq7TsRUnkgxiW 5WBkd5nK7mqClkRYqlEXXFBdK+e6NRH546K7OwVsJex53qboj9dSCiwihub6ALwHlatZFAT 9xrIb5Wg3o0PLkFc1O3GA== X-UI-Out-Filterresults: notjunk:1; V01:K0:uAQnt2PdK68=:ay4sxS/djvtxdC6w5+vkZ3 AdrLaNYVGzjZZo5x+e3Bilzj9jPUSmWDig5N8+RVNA7T4M3YjX7OHKN9lyDMqsFHw+OskMT3A o2uejaF+PWX1/dam2JKz9P6BSHyeOpDqURLtFkV+uezeHqVFj7Dmsra2s2PCu+hgAokbaLGir JTjG1KpkkKQZsL/VO8i6WqoR5TupzFqzd7kGf6J585PS6CfBEdIb0lNGvkFd9pYjwhSM/mPTL GJKDcDjKj83KY9vKBFak5pMiVT0GlgYD38ABucP8SnUAJXWDdDjbCU6et+TLvoeFhO27K+VX5 ZlngA2mjinnrSHoLLmkjdf+Dkkl24LPsbXk6/+1RgcWDkjtQnQ9vGjAD0mu69OhA5YgW1yI8R FyLnj3dQsc/xICyKW6UnhurED1Y+oD8RNCtHxUIapJPNCVhQ6MSa3zeGphJGI+eh/ow2rIq/M NhgZehqzr6LbSbzeqi6bfcjl4SPyKhTgnv4WW3sgDqxDMjOND2bABk5obmcUzEBacKoXr8QOW 7n+YEV4ylcrXDBIZ5KSdIFvTrt37deu5FE0k3TKI1YXu+VPFiJO77JTfojG/18XXnKrFnaTk5 3X0AojCwd3O0VrZEc2TkE/dZrggJA3k8ZZUvFZTz2qwox1DiBdYQzj5sZvbB5/CWPMvimddib wjGbvapE3AeKHKFtr2VAf0I7mpLI3Nh+zTAtuREvT6BE2QDDxvKL/nL+nHL8IjzJ8UqIXVcUU tQrnAaLAWKfkxD/RadT/6WtPz3Fzz15TdiA0XBp4vrpJgDvKxRBoWOedMEN3afxZKQH0jn3l8 jd0P0xv4T/3qfdmW3hB4HolNY0BrA== Cc: Heinrich Schuchardt , u-boot@lists.denx.de Subject: [U-Boot] [PATCH 03/17] efi_loader: pass GUIDs as const efi_guid_t * 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" We need to call some boottime services internally. Our GUIDs are stored as const efi_guid_t *. The boottime services never change GUIDs. So we can define the parameters as const efi_guid_t *. Signed-off-by: Heinrich Schuchardt --- include/efi_api.h | 27 ++++++++++++++------------- lib/efi_loader/efi_boottime.c | 40 +++++++++++++++++++++------------------- 2 files changed, 35 insertions(+), 32 deletions(-) diff --git a/include/efi_api.h b/include/efi_api.h index 0b1a383e61..aa4306aac9 100644 --- a/include/efi_api.h +++ b/include/efi_api.h @@ -77,24 +77,25 @@ struct efi_boot_services { 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, + void **handle, const efi_guid_t *protocol, int protocol_interface_type, void *protocol_interface); efi_status_t (EFIAPI *reinstall_protocol_interface)( - void *handle, efi_guid_t *protocol, + void *handle, const efi_guid_t *protocol, void *old_interface, void *new_interface); efi_status_t (EFIAPI *uninstall_protocol_interface)(void *handle, - efi_guid_t *protocol, void *protocol_interface); - efi_status_t (EFIAPI *handle_protocol)(efi_handle_t, efi_guid_t *, - void **); + const efi_guid_t *protocol, void *protocol_interface); + efi_status_t (EFIAPI *handle_protocol)(efi_handle_t, + const efi_guid_t *protocol, + void **protocol_interface); void *reserved; efi_status_t (EFIAPI *register_protocol_notify)( - efi_guid_t *protocol, struct efi_event *event, + const efi_guid_t *protocol, struct efi_event *event, void **registration); efi_status_t (EFIAPI *locate_handle)( enum efi_locate_search_type search_type, - efi_guid_t *protocol, void *search_key, + const efi_guid_t *protocol, void *search_key, unsigned long *buffer_size, efi_handle_t *buffer); - efi_status_t (EFIAPI *locate_device_path)(efi_guid_t *protocol, + efi_status_t (EFIAPI *locate_device_path)(const efi_guid_t *protocol, struct efi_device_path **device_path, efi_handle_t *device); efi_status_t (EFIAPI *install_configuration_table)( @@ -131,14 +132,14 @@ struct efi_boot_services { #define EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010 #define EFI_OPEN_PROTOCOL_EXCLUSIVE 0x00000020 efi_status_t (EFIAPI *open_protocol)(efi_handle_t handle, - efi_guid_t *protocol, void **interface, + const efi_guid_t *protocol, void **interface, efi_handle_t agent_handle, efi_handle_t controller_handle, u32 attributes); efi_status_t (EFIAPI *close_protocol)(void *handle, - efi_guid_t *protocol, void *agent_handle, + const efi_guid_t *protocol, void *agent_handle, void *controller_handle); efi_status_t(EFIAPI *open_protocol_information)(efi_handle_t handle, - efi_guid_t *protocol, + const efi_guid_t *protocol, struct efi_open_protocol_info_entry **entry_buffer, unsigned long *entry_count); efi_status_t (EFIAPI *protocols_per_handle)(efi_handle_t handle, @@ -146,9 +147,9 @@ struct efi_boot_services { unsigned long *protocols_buffer_count); efi_status_t (EFIAPI *locate_handle_buffer) ( enum efi_locate_search_type search_type, - efi_guid_t *protocol, void *search_key, + const efi_guid_t *protocol, void *search_key, unsigned long *no_handles, efi_handle_t **buffer); - efi_status_t (EFIAPI *locate_protocol)(efi_guid_t *protocol, + efi_status_t (EFIAPI *locate_protocol)(const efi_guid_t *protocol, void *registration, void **protocol_interface); efi_status_t (EFIAPI *install_multiple_protocol_interfaces)( void **handle, ...); diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index 22e6e6c569..b053b47262 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -719,7 +719,7 @@ static efi_status_t EFIAPI efi_check_event(struct efi_event *event) * @return status code */ static efi_status_t EFIAPI efi_install_protocol_interface(void **handle, - efi_guid_t *protocol, int protocol_interface_type, + const efi_guid_t *protocol, int protocol_interface_type, void *protocol_interface) { struct list_head *lhandle; @@ -790,7 +790,7 @@ out: * @return status code */ static efi_status_t EFIAPI efi_install_protocol_interface_ext(void **handle, - efi_guid_t *protocol, int protocol_interface_type, + const efi_guid_t *protocol, int protocol_interface_type, void *protocol_interface) { EFI_ENTRY("%p, %pUl, %d, %p", handle, protocol, protocol_interface_type, @@ -816,7 +816,7 @@ static efi_status_t EFIAPI efi_install_protocol_interface_ext(void **handle, * @return status code */ static efi_status_t EFIAPI efi_reinstall_protocol_interface(void *handle, - efi_guid_t *protocol, void *old_interface, + const efi_guid_t *protocol, void *old_interface, void *new_interface) { EFI_ENTRY("%p, %pUl, %p, %p", handle, protocol, old_interface, @@ -837,7 +837,7 @@ static efi_status_t EFIAPI efi_reinstall_protocol_interface(void *handle, * @return status code */ static efi_status_t EFIAPI efi_uninstall_protocol_interface(void *handle, - efi_guid_t *protocol, void *protocol_interface) + const efi_guid_t *protocol, void *protocol_interface) { struct list_head *lhandle; int i; @@ -890,7 +890,7 @@ out: * @return status code */ static efi_status_t EFIAPI efi_uninstall_protocol_interface_ext(void *handle, - efi_guid_t *protocol, void *protocol_interface) + const efi_guid_t *protocol, void *protocol_interface) { EFI_ENTRY("%p, %pUl, %p", handle, protocol, protocol_interface); @@ -911,9 +911,10 @@ static efi_status_t EFIAPI efi_uninstall_protocol_interface_ext(void *handle, * @registration key for retrieving the registration information * @return status code */ -static efi_status_t EFIAPI efi_register_protocol_notify(efi_guid_t *protocol, - struct efi_event *event, - void **registration) +static efi_status_t EFIAPI efi_register_protocol_notify( + const efi_guid_t *protocol, + struct efi_event *event, + void **registration) { EFI_ENTRY("%pUl, %p, %p", protocol, event, registration); return EFI_EXIT(EFI_OUT_OF_RESOURCES); @@ -931,7 +932,7 @@ static efi_status_t EFIAPI efi_register_protocol_notify(efi_guid_t *protocol, * @return 0 if the handle implements the protocol */ static int efi_search(enum efi_locate_search_type search_type, - efi_guid_t *protocol, void *search_key, + const efi_guid_t *protocol, void *search_key, struct efi_object *efiobj) { int i; @@ -968,7 +969,7 @@ static int efi_search(enum efi_locate_search_type search_type, */ static efi_status_t efi_locate_handle( enum efi_locate_search_type search_type, - efi_guid_t *protocol, void *search_key, + const efi_guid_t *protocol, void *search_key, unsigned long *buffer_size, efi_handle_t *buffer) { struct list_head *lhandle; @@ -1020,7 +1021,7 @@ static efi_status_t efi_locate_handle( */ static efi_status_t EFIAPI efi_locate_handle_ext( enum efi_locate_search_type search_type, - efi_guid_t *protocol, void *search_key, + const efi_guid_t *protocol, void *search_key, unsigned long *buffer_size, efi_handle_t *buffer) { EFI_ENTRY("%d, %pUl, %p, %p, %p", search_type, protocol, search_key, @@ -1042,7 +1043,8 @@ static efi_status_t EFIAPI efi_locate_handle_ext( * @device handle of the device * @return status code */ -static efi_status_t EFIAPI efi_locate_device_path(efi_guid_t *protocol, +static efi_status_t EFIAPI efi_locate_device_path( + const efi_guid_t *protocol, struct efi_device_path **device_path, efi_handle_t *device) { @@ -1581,7 +1583,7 @@ static efi_status_t EFIAPI efi_disconnect_controller(void *controller_handle, * @return status code */ static efi_status_t EFIAPI efi_close_protocol(void *handle, - efi_guid_t *protocol, + const efi_guid_t *protocol, void *agent_handle, void *controller_handle) { @@ -1604,7 +1606,7 @@ static efi_status_t EFIAPI efi_close_protocol(void *handle, * @return status code */ static efi_status_t EFIAPI efi_open_protocol_information(efi_handle_t handle, - efi_guid_t *protocol, + const efi_guid_t *protocol, struct efi_open_protocol_info_entry **entry_buffer, unsigned long *entry_count) { @@ -1693,7 +1695,7 @@ static efi_status_t EFIAPI efi_protocols_per_handle(void *handle, */ static efi_status_t EFIAPI efi_locate_handle_buffer( enum efi_locate_search_type search_type, - efi_guid_t *protocol, void *search_key, + const efi_guid_t *protocol, void *search_key, unsigned long *no_handles, efi_handle_t **buffer) { efi_status_t r; @@ -1735,7 +1737,7 @@ out: * @registration registration key passed to the notification function * @protocol_interface interface implementing the protocol */ -static efi_status_t EFIAPI efi_locate_protocol(efi_guid_t *protocol, +static efi_status_t EFIAPI efi_locate_protocol(const efi_guid_t *protocol, void *registration, void **protocol_interface) { @@ -1788,7 +1790,7 @@ static efi_status_t EFIAPI efi_install_multiple_protocol_interfaces( EFI_ENTRY("%p", handle); va_list argptr; - efi_guid_t *protocol; + const efi_guid_t *protocol; void *protocol_interface; efi_status_t r = EFI_SUCCESS; int i = 0; @@ -1919,7 +1921,7 @@ static void EFIAPI efi_set_mem(void *buffer, size_t size, uint8_t value) * @return status code */ static efi_status_t EFIAPI efi_open_protocol( - void *handle, efi_guid_t *protocol, + void *handle, const efi_guid_t *protocol, void **protocol_interface, void *agent_handle, void *controller_handle, uint32_t attributes) { @@ -2003,7 +2005,7 @@ out: * @return status code */ static efi_status_t EFIAPI efi_handle_protocol(void *handle, - efi_guid_t *protocol, + const efi_guid_t *protocol, void **protocol_interface) { return efi_open_protocol(handle, protocol, protocol_interface, NULL,