Lines Matching +full:gop +full:- +full:port +full:- +full:id

1 // SPDX-License-Identifier: GPL-2.0+
3 * UEFI Shell-like command
22 * efi_get_device_handle_info() - get information of UEFI device
26 * Return: 0 on success, -1 on failure
35 ret = EFI_CALL(BS->open_protocol(handle, &efi_guid_device_path, in efi_get_device_handle_info()
42 return -1; in efi_get_device_handle_info()
52 * do_efi_show_devices() - show UEFI devices
60 * Implement efidebug "devices" sub-command.
71 ret = EFI_CALL(BS->locate_handle_buffer(ALL_HANDLES, NULL, NULL, in do_efi_show_devices()
79 printf("Device%.*s Device Path\n", EFI_HANDLE_WIDTH - 6, spc); in do_efi_show_devices()
88 EFI_CALL(BS->free_pool(handles)); in do_efi_show_devices()
94 * efi_get_driver_handle_info() - get information of UEFI driver
99 * Return: 0 on success, -1 on failure
102 * built-in..
124 image = handler->protocol_interface; in efi_get_driver_handle_info()
125 *image_path = efi_dp_str(image->file_path); in efi_get_driver_handle_info()
131 * do_efi_show_drivers() - show UEFI drivers
139 * Implement efidebug "drivers" sub-command.
150 ret = EFI_CALL(BS->locate_handle_buffer( in do_efi_show_drivers()
160 EFI_HANDLE_WIDTH - 6, spc); in do_efi_show_drivers()
167 printf("%p %-20ls %ls\n", handles[i], in do_efi_show_drivers()
170 printf("%p %-20ls <built-in>\n", in do_efi_show_drivers()
172 EFI_CALL(BS->free_pool(driver_name)); in do_efi_show_drivers()
173 EFI_CALL(BS->free_pool(image_path_text)); in do_efi_show_drivers()
177 EFI_CALL(BS->free_pool(handles)); in do_efi_show_drivers()
231 "GOP",
237 * get_guid_text - get string of protocol guid
258 * do_efi_show_handles() - show UEFI handles
266 * Implement efidebug "dh" sub-command.
279 ret = EFI_CALL(BS->locate_handle_buffer(ALL_HANDLES, NULL, NULL, in do_efi_show_handles()
287 printf("Handle%.*s Protocols\n", EFI_HANDLE_WIDTH - 6, spc); in do_efi_show_handles()
291 ret = EFI_CALL(BS->protocols_per_handle(handles[i], &guid, in do_efi_show_handles()
313 EFI_CALL(BS->free_pool(handles)); in do_efi_show_handles()
319 * do_efi_show_images() - show UEFI images
327 * Implement efidebug "images" sub-command.
351 [EFI_MMAP_IO_PORT] = "IO PORT",
375 * print_memory_attributes() - print memory map attributes
399 * do_efi_show_memmap() - show UEFI memory map
407 * Implement efidebug "memmap" sub-command.
419 ret = EFI_CALL(BS->get_memory_map(&map_size, memmap, NULL, NULL, NULL)); in do_efi_show_memmap()
422 ret = EFI_CALL(BS->allocate_pool(EFI_LOADER_DATA, in do_efi_show_memmap()
426 ret = EFI_CALL(BS->get_memory_map(&map_size, memmap, in do_efi_show_memmap()
430 EFI_CALL(BS->free_pool(memmap)); in do_efi_show_memmap()
435 EFI_PHYS_ADDR_WIDTH - 5, spc, EFI_PHYS_ADDR_WIDTH - 3, spc); in do_efi_show_memmap()
439 if (map->type < EFI_MAX_MEMORY_TYPE) in do_efi_show_memmap()
440 type = efi_mem_type_string[map->type]; in do_efi_show_memmap()
444 printf("%-16s %.*llx-%.*llx", type, in do_efi_show_memmap()
446 map->physical_start, in do_efi_show_memmap()
448 map->physical_start + map->num_pages * EFI_PAGE_SIZE); in do_efi_show_memmap()
450 print_memory_attributes(map->attribute); in do_efi_show_memmap()
454 EFI_CALL(BS->free_pool(memmap)); in do_efi_show_memmap()
460 * do_efi_boot_add() - set UEFI load option
469 * Implement efidebug "boot add" sub-command.
471 * - boot add <id> <label> <interface> <devnum>[:<part>] <file> <options>
476 int id; in do_efi_boot_add() local
492 id = (int)simple_strtoul(argv[1], &endp, 16); in do_efi_boot_add()
493 if (*endp != '\0' || id > 0xffff) in do_efi_boot_add()
496 sprintf(var_name, "Boot%04X", id); in do_efi_boot_add()
536 ret = EFI_CALL(RT->set_variable(var_name16, &guid, in do_efi_boot_add()
551 * do_efi_boot_rm() - delete UEFI load options
559 * Implement efidebug "boot rm" sub-command.
561 * - boot rm <id> ...
567 int id, i; in do_efi_boot_rm() local
578 id = (int)simple_strtoul(argv[1], &endp, 16); in do_efi_boot_rm()
579 if (*endp != '\0' || id > 0xffff) in do_efi_boot_rm()
582 sprintf(var_name, "Boot%04X", id); in do_efi_boot_rm()
585 ret = EFI_CALL(RT->set_variable(var_name16, &guid, 0, 0, NULL)); in do_efi_boot_rm()
587 printf("cannot remove Boot%04X", id); in do_efi_boot_rm()
596 * show_efi_boot_opt_data() - dump UEFI load option
598 * @id: Load option number
603 static void show_efi_boot_opt_data(int id, void *data) in show_efi_boot_opt_data() argument
620 printf("Boot%04X:\n", id); in show_efi_boot_opt_data()
623 lo.attributes & LOAD_OPTION_ACTIVE ? 'A' : '-', in show_efi_boot_opt_data()
625 lo.attributes & LOAD_OPTION_FORCE_RECONNECT ? 'R' : '-', in show_efi_boot_opt_data()
627 lo.attributes & LOAD_OPTION_HIDDEN ? 'H' : '-', in show_efi_boot_opt_data()
641 * show_efi_boot_opt() - dump UEFI load option
643 * @id: Load option number
647 static void show_efi_boot_opt(int id) in show_efi_boot_opt() argument
656 sprintf(var_name, "Boot%04X", id); in show_efi_boot_opt()
662 ret = EFI_CALL(RT->get_variable(var_name16, &guid, NULL, &size, NULL)); in show_efi_boot_opt()
665 ret = EFI_CALL(RT->get_variable(var_name16, &guid, NULL, &size, in show_efi_boot_opt()
669 show_efi_boot_opt_data(id, data); in show_efi_boot_opt()
671 printf("Boot%04X: not found\n", id); in show_efi_boot_opt()
677 * show_efi_boot_dump() - dump all UEFI load options
685 * Implement efidebug "boot dump" sub-command.
687 * - boot dump
696 int id; in do_efi_boot_dump() local
701 snprintf(regex, 256, "efi_.*-.*-.*-.*-.*_Boot[0-9A-F]+"); in do_efi_boot_dump()
716 id = (int)simple_strtoul(value, NULL, 16); in do_efi_boot_dump()
717 show_efi_boot_opt(id); in do_efi_boot_dump()
729 * show_efi_boot_order() - show order of UEFI load options
751 ret = EFI_CALL(RT->get_variable(L"BootOrder", &guid, NULL, &size, in show_efi_boot_order()
755 ret = EFI_CALL(RT->get_variable(L"BootOrder", &guid, NULL, in show_efi_boot_order()
774 ret = EFI_CALL(RT->get_variable(var_name16, &guid, NULL, &size, in show_efi_boot_order()
787 ret = EFI_CALL(RT->get_variable(var_name16, &guid, NULL, &size, in show_efi_boot_order()
819 * do_efi_boot_next() - manage UEFI BootNext variable
828 * Implement efidebug "boot next" sub-command.
830 * - boot next <id>
853 ret = EFI_CALL(RT->set_variable(L"BootNext", &guid, in do_efi_boot_next()
863 * do_efi_boot_order() - manage UEFI BootOrder variable
871 * Implement efidebug "boot order" sub-command.
873 * - boot order [<id> ...]
880 int id, i; in do_efi_boot_order() local
888 argc--; in do_efi_boot_order()
897 id = (int)simple_strtoul(argv[i], &endp, 16); in do_efi_boot_order()
898 if (*endp != '\0' || id > 0xffff) { in do_efi_boot_order()
904 bootorder[i] = (u16)id; in do_efi_boot_order()
908 ret = EFI_CALL(RT->set_variable(L"BootOrder", &guid, in do_efi_boot_order()
929 * do_efi_boot_opt() - manage UEFI load options
938 * Implement efidebug "boot" sub-command.
939 * See above for details of sub-commands.
949 argc--; argv++; in do_efi_boot_opt()
956 return cp->cmd(cmdtp, flag, argc, argv); in do_efi_boot_opt()
974 * do_efidebug() - display and configure UEFI environment
985 * See above for details of sub-commands.
996 argc--; argv++; in do_efidebug()
1001 printf("Error: Cannot initialize UEFI sub-system, r = %lu\n", in do_efidebug()
1011 return cp->cmd(cmdtp, flag, argc, argv); in do_efidebug()
1016 " - UEFI Shell-like interface to configure UEFI environment\n"
1019 " - set UEFI BootXXXX variable\n"
1022 " - delete UEFI BootXXXX variables\n"
1024 " - dump all UEFI BootXXXX variables\n"
1026 " - set UEFI BootNext variable\n"
1028 " - set/show UEFI boot order\n"
1031 " - show uefi devices\n"
1033 " - show uefi drivers\n"
1035 " - show uefi handles\n"
1037 " - show loaded images\n"
1039 " - show uefi memory map\n";