Lines Matching +full:arm +full:- +full:efi
2 * EFI application boot time services
6 * SPDX-License-Identifier: GPL-2.0+
14 #include <u-boot/crc.h>
21 /* This list contains all the EFI objects our payload has access to */
25 * If we're running on nasty systems (32bit ARM booting into non-EFI Linux)
26 * we need to do trickery with caches. Since we don't want to break the EFI
28 * direct Linux EFI booting along the way - oh well).
33 * EFI can pass arbitrary additional "tables" containing vendor specific
44 * The "gd" pointer lives in a register on ARM and AArch64 that we declare
45 * fixed when compiling U-Boot. However, the payload does not know about that
47 * EFI callback entry/exit.
70 int ret = --entry_count == 0; in __efi_exit_check()
87 * to u-boot world so we can dump out an abort msg, without any care
93 /* Only restore if we're already in EFI context */ in efi_restore_gd()
102 * enough for anyone ;-)
109 return &indent[max - level]; in indent_string()
119 return indent_string(--nesting_level); in __efi_nesting_dec()
157 if (event->signaled) in efi_signal_event()
159 event->signaled = 1; in efi_signal_event()
160 if (event->type & EVT_NOTIFY_SIGNAL) { in efi_signal_event()
161 EFI_CALL(event->notify_function(event, event->notify_context)); in efi_signal_event()
167 debug("EFI: App called into unimplemented function %s\n", funcname); in efi_unsupported()
272 efi_events[i].trigger_next = -1ULL; in efi_create_event()
334 if (!(event->type & EVT_TIMER)) in efi_set_timer()
338 event->trigger_next = -1ULL; in efi_set_timer()
342 event->trigger_next = in efi_set_timer()
348 event->trigger_type = type; in efi_set_timer()
349 event->trigger_time = trigger_time; in efi_set_timer()
381 if (!event[i]->type || event[i]->type & EVT_NOTIFY_SIGNAL) in efi_wait_for_event()
388 if (event[i]->signaled) in efi_wait_for_event()
400 event[i]->signaled = 0; in efi_wait_for_event()
428 event->type = 0; in efi_close_event()
429 event->trigger_next = -1ULL; in efi_close_event()
430 event->signaled = 0; in efi_close_event()
446 if (!event->type || event->type & EVT_NOTIFY_SIGNAL) in efi_check_event()
448 if (event->signaled) in efi_check_event()
479 if (efiobj->handle != *handle) in efi_install_protocol_interface()
482 for (i = 0; i < ARRAY_SIZE(efiobj->protocols); i++) { in efi_install_protocol_interface()
483 struct efi_handler *handler = &efiobj->protocols[i]; in efi_install_protocol_interface()
485 if (!handler->guid) in efi_install_protocol_interface()
487 if (!guidcmp(handler->guid, protocol)) { in efi_install_protocol_interface()
493 for (i = 0; i < ARRAY_SIZE(efiobj->protocols); i++) { in efi_install_protocol_interface()
494 struct efi_handler *handler = &efiobj->protocols[i]; in efi_install_protocol_interface()
496 if (handler->guid) in efi_install_protocol_interface()
499 handler->guid = protocol; in efi_install_protocol_interface()
500 handler->protocol_interface = protocol_interface; in efi_install_protocol_interface()
549 if (efiobj->handle != handle) in efi_uninstall_protocol_interface()
552 for (i = 0; i < ARRAY_SIZE(efiobj->protocols); i++) { in efi_uninstall_protocol_interface()
553 struct efi_handler *handler = &efiobj->protocols[i]; in efi_uninstall_protocol_interface()
554 const efi_guid_t *hprotocol = handler->guid; in efi_uninstall_protocol_interface()
559 if (handler->protocol_interface) { in efi_uninstall_protocol_interface()
562 handler->guid = 0; in efi_uninstall_protocol_interface()
601 return -1; in efi_search()
603 for (i = 0; i < ARRAY_SIZE(efiobj->protocols); i++) { in efi_search()
604 const efi_guid_t *guid = efiobj->protocols[i].guid; in efi_search()
608 return -1; in efi_search()
611 return -1; in efi_search()
645 *(buffer++) = efiobj->handle; in efi_locate_handle()
676 *device = efiobj->handle; in efi_locate_device_path()
688 memmove(this, next, (ulong)end - (ulong)next); in efi_remove_configuration_table()
689 systab.nr_tables--; in efi_remove_configuration_table()
730 * protocols, boot-device, etc.
736 obj->handle = info; in efi_setup_loaded_image()
742 obj->protocols[0].guid = &efi_guid_device_path; in efi_setup_loaded_image()
743 obj->protocols[0].protocol_interface = device_path; in efi_setup_loaded_image()
749 obj->protocols[1].guid = &efi_guid_loaded_image; in efi_setup_loaded_image()
750 obj->protocols[1].protocol_interface = info; in efi_setup_loaded_image()
752 obj->protocols[2].guid = &efi_guid_console_control; in efi_setup_loaded_image()
753 obj->protocols[2].protocol_interface = (void *)&efi_console_control; in efi_setup_loaded_image()
755 obj->protocols[3].guid = &efi_guid_device_path_to_text_protocol; in efi_setup_loaded_image()
756 obj->protocols[3].protocol_interface = in efi_setup_loaded_image()
759 info->file_path = file_path; in efi_setup_loaded_image()
760 info->device_handle = efi_dp_find_obj(device_path, NULL); in efi_setup_loaded_image()
762 list_add_tail(&obj->link, &efi_obj_list); in efi_setup_loaded_image()
789 obj->handle = info; in efi_load_image()
790 info->file_path = file_path; in efi_load_image()
791 info->reserved = efi_load_pe(source_buffer, info); in efi_load_image()
792 if (!info->reserved) { in efi_load_image()
799 list_add_tail(&obj->link, &efi_obj_list); in efi_load_image()
812 entry = info->reserved; in efi_start_image()
817 if (setjmp(&info->exit_jmp)) { in efi_start_image()
819 return EFI_EXIT(info->exit_status); in efi_start_image()
841 loaded_image_info->exit_status = exit_status; in efi_exit()
842 longjmp(&loaded_image_info->exit_jmp, 1); in efi_exit()
844 panic("EFI application exited"); in efi_exit()
854 if (efiobj->handle == handle) in efi_search_obj()
868 list_del(&efiobj->link); in efi_unload_image()
877 * Grub on 32bit ARM needs to have caches disabled before jumping into in efi_exit_caches()
892 /* Fix up caches for EFI payloads if necessary */ in efi_exit_boot_services()
990 if (efiobj->handle != handle) in efi_protocols_per_handle()
994 for (i = 0; i < ARRAY_SIZE(efiobj->protocols); i++) { in efi_protocols_per_handle()
995 if (efiobj->protocols[i].guid) in efi_protocols_per_handle()
1008 for (i = 0; i < ARRAY_SIZE(efiobj->protocols); ++i) { in efi_protocols_per_handle()
1009 if (efiobj->protocols[i].guid) { in efi_protocols_per_handle()
1011 efiobj->protocols[i].guid; in efi_protocols_per_handle()
1071 for (i = 0; i < ARRAY_SIZE(efiobj->protocols); i++) { in efi_locate_protocol()
1072 struct efi_handler *handler = &efiobj->protocols[i]; in efi_locate_protocol()
1074 if (!handler->guid) in efi_locate_protocol()
1076 if (!guidcmp(handler->guid, protocol)) { in efi_locate_protocol()
1078 handler->protocol_interface; in efi_locate_protocol()
1121 for (; i; --i) { in efi_install_multiple_protocol_interfaces()
1204 if (efiobj->handle != handle) in efi_open_protocol()
1207 for (i = 0; i < ARRAY_SIZE(efiobj->protocols); i++) { in efi_open_protocol()
1208 struct efi_handler *handler = &efiobj->protocols[i]; in efi_open_protocol()
1209 const efi_guid_t *hprotocol = handler->guid; in efi_open_protocol()
1216 handler->protocol_interface; in efi_open_protocol()
1290 { 'D','a','s',' ','U','-','b','o','o','t',0 };