Commit 2074f70064b5860db0d273ad3d050e87764c08e5

Authored by Heinrich Schuchardt
Committed by Alexander Graf
1 parent fb83350952

efi_loader: consistently use efi_handle_t for handles

We should consistently use the efi_handle_t typedef when
referring to handles.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Alexander Graf <agraf@suse.de>

Showing 5 changed files with 53 additions and 46 deletions Side-by-side Diff

... ... @@ -122,8 +122,8 @@
122 122 }
123 123  
124 124 static efi_status_t efi_do_enter(
125   - void *image_handle, struct efi_system_table *st,
126   - asmlinkage ulong (*entry)(void *image_handle,
  125 + efi_handle_t image_handle, struct efi_system_table *st,
  126 + asmlinkage ulong (*entry)(efi_handle_t image_handle,
127 127 struct efi_system_table *st))
128 128 {
129 129 efi_status_t ret = EFI_LOAD_ERROR;
... ... @@ -136,8 +136,8 @@
136 136  
137 137 #ifdef CONFIG_ARM64
138 138 static efi_status_t efi_run_in_el2(asmlinkage ulong (*entry)(
139   - void *image_handle, struct efi_system_table *st),
140   - void *image_handle, struct efi_system_table *st)
  139 + efi_handle_t image_handle, struct efi_system_table *st),
  140 + efi_handle_t image_handle, struct efi_system_table *st)
141 141 {
142 142 /* Enable caches again */
143 143 dcache_enable();
... ... @@ -159,7 +159,7 @@
159 159 struct efi_device_path *memdp = NULL;
160 160 ulong ret;
161 161  
162   - ulong (*entry)(void *image_handle, struct efi_system_table *st)
  162 + ulong (*entry)(efi_handle_t image_handle, struct efi_system_table *st)
163 163 asmlinkage;
164 164 ulong fdt_pages, fdt_size, fdt_start, fdt_end;
165 165 const efi_guid_t fdt_guid = EFI_FDT_GUID;
... ... @@ -84,11 +84,12 @@
84 84 efi_status_t (EFIAPI *reinstall_protocol_interface)(
85 85 void *handle, const efi_guid_t *protocol,
86 86 void *old_interface, void *new_interface);
87   - efi_status_t (EFIAPI *uninstall_protocol_interface)(void *handle,
88   - const efi_guid_t *protocol, void *protocol_interface);
89   - efi_status_t (EFIAPI *handle_protocol)(efi_handle_t,
90   - const efi_guid_t *protocol,
91   - void **protocol_interface);
  87 + efi_status_t (EFIAPI *uninstall_protocol_interface)(
  88 + efi_handle_t handle, const efi_guid_t *protocol,
  89 + void *protocol_interface);
  90 + efi_status_t (EFIAPI *handle_protocol)(
  91 + efi_handle_t handle, const efi_guid_t *protocol,
  92 + void **protocol_interface);
92 93 void *reserved;
93 94 efi_status_t (EFIAPI *register_protocol_notify)(
94 95 const efi_guid_t *protocol, struct efi_event *event,
... ... @@ -113,7 +114,7 @@
113 114 efi_status_t (EFIAPI *exit)(efi_handle_t handle,
114 115 efi_status_t exit_status,
115 116 unsigned long exitdata_size, s16 *exitdata);
116   - efi_status_t (EFIAPI *unload_image)(void *image_handle);
  117 + efi_status_t (EFIAPI *unload_image)(efi_handle_t image_handle);
117 118 efi_status_t (EFIAPI *exit_boot_services)(efi_handle_t, unsigned long);
118 119  
119 120 efi_status_t (EFIAPI *get_next_monotonic_count)(u64 *count);
... ... @@ -139,9 +140,10 @@
139 140 const efi_guid_t *protocol, void **interface,
140 141 efi_handle_t agent_handle,
141 142 efi_handle_t controller_handle, u32 attributes);
142   - efi_status_t (EFIAPI *close_protocol)(void *handle,
143   - const efi_guid_t *protocol, void *agent_handle,
144   - void *controller_handle);
  143 + efi_status_t (EFIAPI *close_protocol)(
  144 + efi_handle_t handle, const efi_guid_t *protocol,
  145 + efi_handle_t agent_handle,
  146 + efi_handle_t controller_handle);
145 147 efi_status_t(EFIAPI *open_protocol_information)(efi_handle_t handle,
146 148 const efi_guid_t *protocol,
147 149 struct efi_open_protocol_info_entry **entry_buffer,
include/efi_loader.h
... ... @@ -205,23 +205,25 @@
205 205 /* Add a new object to the object list. */
206 206 void efi_add_handle(struct efi_object *obj);
207 207 /* Create handle */
208   -efi_status_t efi_create_handle(void **handle);
  208 +efi_status_t efi_create_handle(efi_handle_t *handle);
209 209 /* Delete handle */
210 210 void efi_delete_handle(struct efi_object *obj);
211 211 /* Call this to validate a handle and find the EFI object for it */
212   -struct efi_object *efi_search_obj(const void *handle);
  212 +struct efi_object *efi_search_obj(const efi_handle_t handle);
213 213 /* Find a protocol on a handle */
214   -efi_status_t efi_search_protocol(const void *handle,
  214 +efi_status_t efi_search_protocol(const efi_handle_t handle,
215 215 const efi_guid_t *protocol_guid,
216 216 struct efi_handler **handler);
217 217 /* Install new protocol on a handle */
218   -efi_status_t efi_add_protocol(const void *handle, const efi_guid_t *protocol,
  218 +efi_status_t efi_add_protocol(const efi_handle_t handle,
  219 + const efi_guid_t *protocol,
219 220 void *protocol_interface);
220 221 /* Delete protocol from a handle */
221   -efi_status_t efi_remove_protocol(const void *handle, const efi_guid_t *protocol,
  222 +efi_status_t efi_remove_protocol(const efi_handle_t handle,
  223 + const efi_guid_t *protocol,
222 224 void *protocol_interface);
223 225 /* Delete all protocols from a handle */
224   -efi_status_t efi_remove_all_protocols(const void *handle);
  226 +efi_status_t efi_remove_all_protocols(const efi_handle_t handle);
225 227 /* Call this to create an event */
226 228 efi_status_t efi_create_event(uint32_t type, efi_uintn_t notify_tpl,
227 229 void (EFIAPI *notify_function) (
lib/efi_loader/efi_boottime.c
... ... @@ -60,9 +60,10 @@
60 60 const efi_guid_t efi_guid_driver_binding_protocol =
61 61 EFI_DRIVER_BINDING_PROTOCOL_GUID;
62 62  
63   -static efi_status_t EFIAPI efi_disconnect_controller(void *controller_handle,
64   - void *driver_image_handle,
65   - void *child_handle);
  63 +static efi_status_t EFIAPI efi_disconnect_controller(
  64 + efi_handle_t controller_handle,
  65 + efi_handle_t driver_image_handle,
  66 + efi_handle_t child_handle);
66 67  
67 68 /* Called on every callback entry */
68 69 int __efi_entry_check(void)
... ... @@ -351,7 +352,7 @@
351 352 * @handle new handle
352 353 * @return status code
353 354 */
354   -efi_status_t efi_create_handle(void **handle)
  355 +efi_status_t efi_create_handle(efi_handle_t *handle)
355 356 {
356 357 struct efi_object *obj;
357 358 efi_status_t r;
... ... @@ -374,7 +375,7 @@
374 375 * @handler reference to the protocol
375 376 * @return status code
376 377 */
377   -efi_status_t efi_search_protocol(const void *handle,
  378 +efi_status_t efi_search_protocol(const efi_handle_t handle,
378 379 const efi_guid_t *protocol_guid,
379 380 struct efi_handler **handler)
380 381 {
... ... @@ -407,7 +408,8 @@
407 408 * @protocol_interface interface of the protocol implementation
408 409 * @return status code
409 410 */
410   -efi_status_t efi_remove_protocol(const void *handle, const efi_guid_t *protocol,
  411 +efi_status_t efi_remove_protocol(const efi_handle_t handle,
  412 + const efi_guid_t *protocol,
411 413 void *protocol_interface)
412 414 {
413 415 struct efi_handler *handler;
... ... @@ -429,7 +431,7 @@
429 431 * @handle handle from which the protocols shall be deleted
430 432 * @return status code
431 433 */
432   -efi_status_t efi_remove_all_protocols(const void *handle)
  434 +efi_status_t efi_remove_all_protocols(const efi_handle_t handle)
433 435 {
434 436 struct efi_object *efiobj;
435 437 struct efi_handler *protocol;
... ... @@ -809,7 +811,7 @@
809 811 * @handle handle to find
810 812 * @return EFI object
811 813 */
812   -struct efi_object *efi_search_obj(const void *handle)
  814 +struct efi_object *efi_search_obj(const efi_handle_t handle)
813 815 {
814 816 struct efi_object *efiobj;
815 817  
... ... @@ -863,7 +865,8 @@
863 865 * @protocol_interface interface of the protocol implementation
864 866 * @return status code
865 867 */
866   -efi_status_t efi_add_protocol(const void *handle, const efi_guid_t *protocol,
  868 +efi_status_t efi_add_protocol(const efi_handle_t handle,
  869 + const efi_guid_t *protocol,
867 870 void *protocol_interface)
868 871 {
869 872 struct efi_object *efiobj;
... ... @@ -948,9 +951,9 @@
948 951 * @new_interface interface to be installed
949 952 * @return status code
950 953 */
951   -static efi_status_t EFIAPI efi_reinstall_protocol_interface(void *handle,
952   - const efi_guid_t *protocol, void *old_interface,
953   - void *new_interface)
  954 +static efi_status_t EFIAPI efi_reinstall_protocol_interface(
  955 + efi_handle_t handle, const efi_guid_t *protocol,
  956 + void *old_interface, void *new_interface)
954 957 {
955 958 EFI_ENTRY("%p, %pUl, %p, %p", handle, protocol, old_interface,
956 959 new_interface);
... ... @@ -1073,7 +1076,7 @@
1073 1076 * @return status code
1074 1077 */
1075 1078 static efi_status_t EFIAPI efi_uninstall_protocol_interface(
1076   - void *handle, const efi_guid_t *protocol,
  1079 + efi_handle_t handle, const efi_guid_t *protocol,
1077 1080 void *protocol_interface)
1078 1081 {
1079 1082 struct efi_object *efiobj;
... ... @@ -1530,7 +1533,7 @@
1530 1533 unsigned long *exit_data_size,
1531 1534 s16 **exit_data)
1532 1535 {
1533   - ulong (*entry)(void *image_handle, struct efi_system_table *st);
  1536 + ulong (*entry)(efi_handle_t image_handle, struct efi_system_table *st);
1534 1537 struct efi_loaded_image *info = image_handle;
1535 1538 efi_status_t ret;
1536 1539  
... ... @@ -1632,7 +1635,7 @@
1632 1635 * @image_handle handle of the image to be unloaded
1633 1636 * @return status code
1634 1637 */
1635   -static efi_status_t EFIAPI efi_unload_image(void *image_handle)
  1638 +static efi_status_t EFIAPI efi_unload_image(efi_handle_t image_handle)
1636 1639 {
1637 1640 struct efi_object *efiobj;
1638 1641  
... ... @@ -1670,7 +1673,7 @@
1670 1673 * @map_key key of the memory map
1671 1674 * @return status code
1672 1675 */
1673   -static efi_status_t EFIAPI efi_exit_boot_services(void *image_handle,
  1676 +static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle,
1674 1677 unsigned long map_key)
1675 1678 {
1676 1679 int i;
1677 1680  
... ... @@ -1774,10 +1777,10 @@
1774 1777 * @controller_handle handle of the controller
1775 1778 * @return status code
1776 1779 */
1777   -static efi_status_t EFIAPI efi_close_protocol(void *handle,
  1780 +static efi_status_t EFIAPI efi_close_protocol(efi_handle_t handle,
1778 1781 const efi_guid_t *protocol,
1779   - void *agent_handle,
1780   - void *controller_handle)
  1782 + efi_handle_t agent_handle,
  1783 + efi_handle_t controller_handle)
1781 1784 {
1782 1785 struct efi_handler *handler;
1783 1786 struct efi_open_protocol_info_item *item;
... ... @@ -1883,8 +1886,8 @@
1883 1886 * @protocol_buffer_count number of entries in the buffer
1884 1887 * @return status code
1885 1888 */
1886   -static efi_status_t EFIAPI efi_protocols_per_handle(void *handle,
1887   - efi_guid_t ***protocol_buffer,
  1889 +static efi_status_t EFIAPI efi_protocols_per_handle(
  1890 + efi_handle_t handle, efi_guid_t ***protocol_buffer,
1888 1891 efi_uintn_t *protocol_buffer_count)
1889 1892 {
1890 1893 unsigned long buffer_size;
... ... @@ -1974,7 +1977,7 @@
1974 1977 r = efi_locate_handle(search_type, protocol, search_key, &buffer_size,
1975 1978 *buffer);
1976 1979 if (r == EFI_SUCCESS)
1977   - *no_handles = buffer_size / sizeof(void *);
  1980 + *no_handles = buffer_size / sizeof(efi_handle_t);
1978 1981 out:
1979 1982 return EFI_EXIT(r);
1980 1983 }
... ... @@ -2442,7 +2445,7 @@
2442 2445 * @protocol_interface interface implementing the protocol
2443 2446 * @return status code
2444 2447 */
2445   -static efi_status_t EFIAPI efi_handle_protocol(void *handle,
  2448 +static efi_status_t EFIAPI efi_handle_protocol(efi_handle_t handle,
2446 2449 const efi_guid_t *protocol,
2447 2450 void **protocol_interface)
2448 2451 {
lib/efi_loader/efi_console.c
... ... @@ -503,21 +503,21 @@
503 503 struct efi_object *efi_console_input_obj;
504 504  
505 505 /* Create handles */
506   - r = efi_create_handle((void **)&efi_console_control_obj);
  506 + r = efi_create_handle((efi_handle_t *)&efi_console_control_obj);
507 507 if (r != EFI_SUCCESS)
508 508 goto out_of_memory;
509 509 r = efi_add_protocol(efi_console_control_obj->handle,
510 510 &efi_guid_console_control, &efi_console_control);
511 511 if (r != EFI_SUCCESS)
512 512 goto out_of_memory;
513   - r = efi_create_handle((void **)&efi_console_output_obj);
  513 + r = efi_create_handle((efi_handle_t *)&efi_console_output_obj);
514 514 if (r != EFI_SUCCESS)
515 515 goto out_of_memory;
516 516 r = efi_add_protocol(efi_console_output_obj->handle,
517 517 &efi_guid_text_output_protocol, &efi_con_out);
518 518 if (r != EFI_SUCCESS)
519 519 goto out_of_memory;
520   - r = efi_create_handle((void **)&efi_console_input_obj);
  520 + r = efi_create_handle((efi_handle_t *)&efi_console_input_obj);
521 521 if (r != EFI_SUCCESS)
522 522 goto out_of_memory;
523 523 r = efi_add_protocol(efi_console_input_obj->handle,