1 // SPDX-License-Identifier: GPL-2.0+
3 * EFI application runtime services
5 * Copyright (c) 2016 Alexander Graf
12 #include <efi_loader.h>
15 /* For manual relocation support */
16 DECLARE_GLOBAL_DATA_PTR
;
18 struct efi_runtime_mmio_list
{
19 struct list_head link
;
25 /* This list contains all runtime available mmio regions */
26 LIST_HEAD(efi_runtime_mmio
);
28 static efi_status_t __efi_runtime EFIAPI
efi_unimplemented(void);
31 * TODO(sjg@chromium.org): These defines and structures should come from the ELF
32 * header for each architecture (or a generic header) rather than being repeated
35 #if defined(__aarch64__)
36 #define R_RELATIVE R_AARCH64_RELATIVE
37 #define R_MASK 0xffffffffULL
39 #elif defined(__arm__)
40 #define R_RELATIVE R_ARM_RELATIVE
41 #define R_MASK 0xffULL
42 #elif defined(__i386__)
43 #define R_RELATIVE R_386_RELATIVE
44 #define R_MASK 0xffULL
45 #elif defined(__x86_64__)
46 #define R_RELATIVE R_X86_64_RELATIVE
47 #define R_MASK 0xffffffffULL
49 #elif defined(__riscv)
50 #define R_RELATIVE R_RISCV_RELATIVE
51 #define R_MASK 0xffULL
60 #if (__riscv_xlen == 32)
61 #define R_ABSOLUTE R_RISCV_32
63 #elif (__riscv_xlen == 64)
64 #define R_ABSOLUTE R_RISCV_64
67 #error unknown riscv target
70 #error Need to add relocation awareness
84 static __efi_runtime_data
struct efi_mem_desc
*efi_virtmap
;
85 static __efi_runtime_data efi_uintn_t efi_descriptor_count
;
86 static __efi_runtime_data efi_uintn_t efi_descriptor_size
;
89 * EFI runtime code lives in two stages. In the first stage, U-Boot and an EFI
90 * payload are running concurrently at the same time. In this mode, we can
91 * handle a good number of runtime callbacks
94 efi_status_t
efi_init_runtime_supported(void)
96 u16 efi_runtime_services_supported
=
97 EFI_RT_SUPPORTED_SET_VIRTUAL_ADDRESS_MAP
|
98 EFI_RT_SUPPORTED_CONVERT_POINTER
;
101 * This value must be synced with efi_runtime_detach_list
102 * as well as efi_runtime_services.
104 #ifdef CONFIG_EFI_HAVE_RUNTIME_RESET
105 efi_runtime_services_supported
|= EFI_RT_SUPPORTED_RESET_SYSTEM
;
108 return EFI_CALL(efi_set_variable(L
"RuntimeServicesSupported",
109 &efi_global_variable_guid
,
110 EFI_VARIABLE_BOOTSERVICE_ACCESS
|
111 EFI_VARIABLE_RUNTIME_ACCESS
,
112 sizeof(efi_runtime_services_supported
),
113 &efi_runtime_services_supported
));
117 * efi_update_table_header_crc32() - Update crc32 in table header
121 void __efi_runtime
efi_update_table_header_crc32(struct efi_table_hdr
*table
)
124 table
->crc32
= crc32(0, (const unsigned char *)table
,
129 * efi_reset_system_boottime() - reset system at boot time
131 * This function implements the ResetSystem() runtime service before
132 * SetVirtualAddressMap() is called.
134 * See the Unified Extensible Firmware Interface (UEFI) specification for
137 * @reset_type: type of reset to perform
138 * @reset_status: status code for the reset
139 * @data_size: size of reset_data
140 * @reset_data: information about the reset
142 static void EFIAPI
efi_reset_system_boottime(
143 enum efi_reset_type reset_type
,
144 efi_status_t reset_status
,
145 unsigned long data_size
, void *reset_data
)
147 struct efi_event
*evt
;
149 EFI_ENTRY("%d %lx %lx %p", reset_type
, reset_status
, data_size
,
153 list_for_each_entry(evt
, &efi_events
, link
) {
156 &efi_guid_event_group_reset_system
)) {
157 efi_signal_event(evt
);
161 switch (reset_type
) {
164 case EFI_RESET_PLATFORM_SPECIFIC
:
165 do_reset(NULL
, 0, 0, NULL
);
167 case EFI_RESET_SHUTDOWN
:
168 #ifdef CONFIG_CMD_POWEROFF
169 do_poweroff(NULL
, 0, 0, NULL
);
178 * efi_get_time_boottime() - get current time at boot time
180 * This function implements the GetTime runtime service before
181 * SetVirtualAddressMap() is called.
183 * See the Unified Extensible Firmware Interface (UEFI) specification
186 * @time: pointer to structure to receive current time
187 * @capabilities: pointer to structure to receive RTC properties
188 * Returns: status code
190 static efi_status_t EFIAPI
efi_get_time_boottime(
191 struct efi_time
*time
,
192 struct efi_time_cap
*capabilities
)
194 #ifdef CONFIG_EFI_GET_TIME
195 efi_status_t ret
= EFI_SUCCESS
;
199 EFI_ENTRY("%p %p", time
, capabilities
);
202 ret
= EFI_INVALID_PARAMETER
;
205 if (uclass_get_device(UCLASS_RTC
, 0, &dev
) ||
206 dm_rtc_get(dev
, &tm
)) {
207 ret
= EFI_UNSUPPORTED
;
210 if (dm_rtc_get(dev
, &tm
)) {
211 ret
= EFI_DEVICE_ERROR
;
215 memset(time
, 0, sizeof(*time
));
216 time
->year
= tm
.tm_year
;
217 time
->month
= tm
.tm_mon
;
218 time
->day
= tm
.tm_mday
;
219 time
->hour
= tm
.tm_hour
;
220 time
->minute
= tm
.tm_min
;
221 time
->second
= tm
.tm_sec
;
224 EFI_TIME_ADJUST_DAYLIGHT
| EFI_TIME_IN_DAYLIGHT
;
225 time
->timezone
= EFI_UNSPECIFIED_TIMEZONE
;
228 /* Set reasonable dummy values */
229 capabilities
->resolution
= 1; /* 1 Hz */
230 capabilities
->accuracy
= 100000000; /* 100 ppm */
231 capabilities
->sets_to_zero
= false;
234 return EFI_EXIT(ret
);
236 EFI_ENTRY("%p %p", time
, capabilities
);
237 return EFI_EXIT(EFI_UNSUPPORTED
);
241 #ifdef CONFIG_EFI_SET_TIME
244 * efi_validate_time() - checks if timestamp is valid
246 * @time: timestamp to validate
247 * Returns: 0 if timestamp is valid, 1 otherwise
249 static int efi_validate_time(struct efi_time
*time
)
252 time
->year
< 1900 || time
->year
> 9999 ||
253 !time
->month
|| time
->month
> 12 || !time
->day
||
254 time
->day
> rtc_month_days(time
->month
- 1, time
->year
) ||
255 time
->hour
> 23 || time
->minute
> 59 || time
->second
> 59 ||
256 time
->nanosecond
> 999999999 ||
258 ~(EFI_TIME_IN_DAYLIGHT
| EFI_TIME_ADJUST_DAYLIGHT
) ||
259 ((time
->timezone
< -1440 || time
->timezone
> 1440) &&
260 time
->timezone
!= EFI_UNSPECIFIED_TIMEZONE
));
266 * efi_set_time_boottime() - set current time
268 * This function implements the SetTime() runtime service before
269 * SetVirtualAddressMap() is called.
271 * See the Unified Extensible Firmware Interface (UEFI) specification
274 * @time: pointer to structure to with current time
275 * Returns: status code
277 static efi_status_t EFIAPI
efi_set_time_boottime(struct efi_time
*time
)
279 #ifdef CONFIG_EFI_SET_TIME
280 efi_status_t ret
= EFI_SUCCESS
;
284 EFI_ENTRY("%p", time
);
286 if (efi_validate_time(time
)) {
287 ret
= EFI_INVALID_PARAMETER
;
291 if (uclass_get_device(UCLASS_RTC
, 0, &dev
)) {
292 ret
= EFI_UNSUPPORTED
;
296 memset(&tm
, 0, sizeof(tm
));
297 tm
.tm_year
= time
->year
;
298 tm
.tm_mon
= time
->month
;
299 tm
.tm_mday
= time
->day
;
300 tm
.tm_hour
= time
->hour
;
301 tm
.tm_min
= time
->minute
;
302 tm
.tm_sec
= time
->second
;
303 tm
.tm_isdst
= time
->daylight
==
304 (EFI_TIME_ADJUST_DAYLIGHT
| EFI_TIME_IN_DAYLIGHT
);
305 /* Calculate day of week */
306 rtc_calc_weekday(&tm
);
308 if (dm_rtc_set(dev
, &tm
))
309 ret
= EFI_DEVICE_ERROR
;
311 return EFI_EXIT(ret
);
313 EFI_ENTRY("%p", time
);
314 return EFI_EXIT(EFI_UNSUPPORTED
);
318 * efi_reset_system() - reset system
320 * This function implements the ResetSystem() runtime service after
321 * SetVirtualAddressMap() is called. It only executes an endless loop.
322 * Boards may override the helpers below to implement reset functionality.
324 * See the Unified Extensible Firmware Interface (UEFI) specification for
327 * @reset_type: type of reset to perform
328 * @reset_status: status code for the reset
329 * @data_size: size of reset_data
330 * @reset_data: information about the reset
332 void __weak __efi_runtime EFIAPI
efi_reset_system(
333 enum efi_reset_type reset_type
,
334 efi_status_t reset_status
,
335 unsigned long data_size
, void *reset_data
)
337 /* Nothing we can do */
342 * efi_reset_system_init() - initialize the reset driver
344 * Boards may override this function to initialize the reset driver.
346 efi_status_t __weak
efi_reset_system_init(void)
352 * efi_get_time() - get current time
354 * This function implements the GetTime runtime service after
355 * SetVirtualAddressMap() is called. As the U-Boot driver are not available
356 * anymore only an error code is returned.
358 * See the Unified Extensible Firmware Interface (UEFI) specification
361 * @time: pointer to structure to receive current time
362 * @capabilities: pointer to structure to receive RTC properties
363 * Returns: status code
365 efi_status_t __weak __efi_runtime EFIAPI
efi_get_time(
366 struct efi_time
*time
,
367 struct efi_time_cap
*capabilities
)
369 return EFI_UNSUPPORTED
;
373 * efi_set_time() - set current time
375 * This function implements the SetTime runtime service after
376 * SetVirtualAddressMap() is called. As the U-Boot driver are not available
377 * anymore only an error code is returned.
379 * See the Unified Extensible Firmware Interface (UEFI) specification
382 * @time: pointer to structure to with current time
383 * Returns: status code
385 efi_status_t __weak __efi_runtime EFIAPI
efi_set_time(struct efi_time
*time
)
387 return EFI_UNSUPPORTED
;
391 * efi_is_runtime_service_pointer() - check if pointer points to runtime table
393 * @p: pointer to check
394 * Return: true if the pointer points to a service function pointer in the
397 static bool efi_is_runtime_service_pointer(void *p
)
399 return (p
>= (void *)&efi_runtime_services
.get_time
&&
400 p
<= (void *)&efi_runtime_services
.query_variable_info
) ||
401 p
== (void *)&efi_events
.prev
||
402 p
== (void *)&efi_events
.next
;
406 * efi_runtime_detach() - detach unimplemented runtime functions
408 void efi_runtime_detach(void)
410 efi_runtime_services
.reset_system
= efi_reset_system
;
411 efi_runtime_services
.get_time
= efi_get_time
;
412 efi_runtime_services
.set_time
= efi_set_time
;
415 efi_update_table_header_crc32(&efi_runtime_services
.hdr
);
419 * efi_set_virtual_address_map_runtime() - change from physical to virtual
422 * This function implements the SetVirtualAddressMap() runtime service after
423 * it is first called.
425 * See the Unified Extensible Firmware Interface (UEFI) specification for
428 * @memory_map_size: size of the virtual map
429 * @descriptor_size: size of an entry in the map
430 * @descriptor_version: version of the map entries
431 * @virtmap: virtual address mapping information
432 * Return: status code EFI_UNSUPPORTED
434 static __efi_runtime efi_status_t EFIAPI
efi_set_virtual_address_map_runtime(
435 efi_uintn_t memory_map_size
,
436 efi_uintn_t descriptor_size
,
437 uint32_t descriptor_version
,
438 struct efi_mem_desc
*virtmap
)
440 return EFI_UNSUPPORTED
;
444 * efi_convert_pointer_runtime() - convert from physical to virtual pointer
446 * This function implements the ConvertPointer() runtime service after
447 * the first call to SetVirtualAddressMap().
449 * See the Unified Extensible Firmware Interface (UEFI) specification for
452 * @debug_disposition: indicates if pointer may be converted to NULL
453 * @address: pointer to be converted
454 * Return: status code EFI_UNSUPPORTED
456 static __efi_runtime efi_status_t EFIAPI
efi_convert_pointer_runtime(
457 efi_uintn_t debug_disposition
, void **address
)
459 return EFI_UNSUPPORTED
;
463 * efi_convert_pointer_runtime() - convert from physical to virtual pointer
465 * This function implements the ConvertPointer() runtime service until
466 * the first call to SetVirtualAddressMap().
468 * See the Unified Extensible Firmware Interface (UEFI) specification for
471 * @debug_disposition: indicates if pointer may be converted to NULL
472 * @address: pointer to be converted
473 * Return: status code EFI_UNSUPPORTED
475 static __efi_runtime efi_status_t EFIAPI
efi_convert_pointer(
476 efi_uintn_t debug_disposition
, void **address
)
478 efi_physical_addr_t addr
= (uintptr_t)*address
;
480 efi_status_t ret
= EFI_NOT_FOUND
;
482 EFI_ENTRY("%zu %p", debug_disposition
, address
);
485 ret
= EFI_UNSUPPORTED
;
490 ret
= EFI_INVALID_PARAMETER
;
494 for (i
= 0; i
< efi_descriptor_count
; i
++) {
495 struct efi_mem_desc
*map
= (void *)efi_virtmap
+
496 (efi_descriptor_size
* i
);
498 if (addr
>= map
->physical_start
&&
499 (addr
< map
->physical_start
500 + (map
->num_pages
<< EFI_PAGE_SHIFT
))) {
501 *address
= (void *)(uintptr_t)
502 (addr
+ map
->virtual_start
-
503 map
->physical_start
);
511 return EFI_EXIT(ret
);
514 static __efi_runtime
void efi_relocate_runtime_table(ulong offset
)
519 /* Relocate the runtime services pointers */
520 patchoff
= offset
- gd
->relocaddr
;
521 for (pos
= (void **)&efi_runtime_services
.get_time
;
522 pos
<= (void **)&efi_runtime_services
.query_variable_info
; ++pos
) {
528 * The entry for SetVirtualAddress() must point to a physical address.
529 * After the first execution the service must return EFI_UNSUPPORTED.
531 efi_runtime_services
.set_virtual_address_map
=
532 &efi_set_virtual_address_map_runtime
;
535 * The entry for ConvertPointer() must point to a physical address.
536 * The service is not usable after SetVirtualAddress().
538 efi_runtime_services
.convert_pointer
= &efi_convert_pointer_runtime
;
541 * TODO: Update UEFI variable RuntimeServicesSupported removing flags
542 * EFI_RT_SUPPORTED_SET_VIRTUAL_ADDRESS_MAP and
543 * EFI_RT_SUPPORTED_CONVERT_POINTER as required by the UEFI spec 2.8.
547 efi_update_table_header_crc32(&efi_runtime_services
.hdr
);
550 /* Relocate EFI runtime to uboot_reloc_base = offset */
551 void efi_runtime_relocate(ulong offset
, struct efi_mem_desc
*map
)
554 struct elf_rela
*rel
= (void*)&__efi_runtime_rel_start
;
556 struct elf_rel
*rel
= (void*)&__efi_runtime_rel_start
;
557 static ulong lastoff
= CONFIG_SYS_TEXT_BASE
;
560 debug("%s: Relocating to offset=%lx\n", __func__
, offset
);
561 for (; (ulong
)rel
< (ulong
)&__efi_runtime_rel_stop
; rel
++) {
562 ulong base
= CONFIG_SYS_TEXT_BASE
;
566 p
= (void*)((ulong
)rel
->offset
- base
) + gd
->relocaddr
;
568 /* The runtime services are updated in efi_runtime_detach() */
569 if (map
&& efi_is_runtime_service_pointer(p
))
572 debug("%s: rel->info=%#lx *p=%#lx rel->offset=%p\n", __func__
,
573 rel
->info
, *p
, rel
->offset
);
575 switch (rel
->info
& R_MASK
) {
578 newaddr
= rel
->addend
+ offset
- CONFIG_SYS_TEXT_BASE
;
580 newaddr
= *p
- lastoff
+ offset
;
585 ulong symidx
= rel
->info
>> SYM_INDEX
;
586 extern struct dyn_sym __dyn_sym_start
[];
587 newaddr
= __dyn_sym_start
[symidx
].addr
+ offset
;
589 newaddr
-= CONFIG_SYS_TEXT_BASE
;
595 printf("%s: Unknown relocation type %llx\n",
596 __func__
, rel
->info
& R_MASK
);
600 /* Check if the relocation is inside bounds */
601 if (map
&& ((newaddr
< map
->virtual_start
) ||
602 newaddr
> (map
->virtual_start
+
603 (map
->num_pages
<< EFI_PAGE_SHIFT
)))) {
604 printf("%s: Relocation at %p is out of range (%lx)\n",
605 __func__
, p
, newaddr
);
609 debug("%s: Setting %p to %lx\n", __func__
, p
, newaddr
);
611 flush_dcache_range((ulong
)p
& ~(EFI_CACHELINE_SIZE
- 1),
612 ALIGN((ulong
)&p
[1], EFI_CACHELINE_SIZE
));
619 invalidate_icache_all();
623 * efi_set_virtual_address_map() - change from physical to virtual mapping
625 * This function implements the SetVirtualAddressMap() runtime service.
627 * See the Unified Extensible Firmware Interface (UEFI) specification for
630 * @memory_map_size: size of the virtual map
631 * @descriptor_size: size of an entry in the map
632 * @descriptor_version: version of the map entries
633 * @virtmap: virtual address mapping information
634 * Return: status code
636 static efi_status_t EFIAPI
efi_set_virtual_address_map(
637 efi_uintn_t memory_map_size
,
638 efi_uintn_t descriptor_size
,
639 uint32_t descriptor_version
,
640 struct efi_mem_desc
*virtmap
)
642 efi_uintn_t n
= memory_map_size
/ descriptor_size
;
644 int rt_code_sections
= 0;
645 struct efi_event
*event
;
647 EFI_ENTRY("%zx %zx %x %p", memory_map_size
, descriptor_size
,
648 descriptor_version
, virtmap
);
650 efi_virtmap
= virtmap
;
651 efi_descriptor_size
= descriptor_size
;
652 efi_descriptor_count
= n
;
656 * Further down we are cheating. While really we should implement
657 * SetVirtualAddressMap() events and ConvertPointer() to allow
658 * dynamically loaded drivers to expose runtime services, we don't
661 * So let's ensure we see exactly one single runtime section, as
662 * that is the built-in one. If we see more (or less), someone must
663 * have tried adding or removing to that which we don't support yet.
664 * In that case, let's better fail rather than expose broken runtime
667 for (i
= 0; i
< n
; i
++) {
668 struct efi_mem_desc
*map
= (void*)virtmap
+
669 (descriptor_size
* i
);
671 if (map
->type
== EFI_RUNTIME_SERVICES_CODE
)
675 if (rt_code_sections
!= 1) {
677 * We expose exactly one single runtime code section, so
678 * something is definitely going wrong.
680 return EFI_EXIT(EFI_INVALID_PARAMETER
);
683 /* Notify EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE */
684 list_for_each_entry(event
, &efi_events
, link
) {
685 if (event
->notify_function
)
686 EFI_CALL_VOID(event
->notify_function(
687 event
, event
->notify_context
));
690 /* Rebind mmio pointers */
691 for (i
= 0; i
< n
; i
++) {
692 struct efi_mem_desc
*map
= (void*)virtmap
+
693 (descriptor_size
* i
);
694 struct list_head
*lhandle
;
695 efi_physical_addr_t map_start
= map
->physical_start
;
696 efi_physical_addr_t map_len
= map
->num_pages
<< EFI_PAGE_SHIFT
;
697 efi_physical_addr_t map_end
= map_start
+ map_len
;
698 u64 off
= map
->virtual_start
- map_start
;
700 /* Adjust all mmio pointers in this region */
701 list_for_each(lhandle
, &efi_runtime_mmio
) {
702 struct efi_runtime_mmio_list
*lmmio
;
704 lmmio
= list_entry(lhandle
,
705 struct efi_runtime_mmio_list
,
707 if ((map_start
<= lmmio
->paddr
) &&
708 (map_end
>= lmmio
->paddr
)) {
709 uintptr_t new_addr
= lmmio
->paddr
+ off
;
710 *lmmio
->ptr
= (void *)new_addr
;
713 if ((map_start
<= (uintptr_t)systab
.tables
) &&
714 (map_end
>= (uintptr_t)systab
.tables
)) {
715 char *ptr
= (char *)systab
.tables
;
718 systab
.tables
= (struct efi_configuration_table
*)ptr
;
723 * Some runtime services are implemented in a way that we can only offer
724 * them at boottime. Replace those function pointers.
726 * TODO: move this call to ExitBootServices().
728 efi_runtime_detach();
730 /* Relocate the runtime. See TODO above */
731 for (i
= 0; i
< n
; i
++) {
732 struct efi_mem_desc
*map
;
734 map
= (void*)virtmap
+ (descriptor_size
* i
);
735 if (map
->type
== EFI_RUNTIME_SERVICES_CODE
) {
736 ulong new_offset
= map
->virtual_start
-
737 map
->physical_start
+ gd
->relocaddr
;
739 efi_relocate_runtime_table(new_offset
);
740 efi_runtime_relocate(new_offset
, map
);
741 return EFI_EXIT(EFI_SUCCESS
);
745 return EFI_EXIT(EFI_INVALID_PARAMETER
);
749 * efi_add_runtime_mmio() - add memory-mapped IO region
751 * This function adds a memory-mapped IO region to the memory map to make it
752 * available at runtime.
754 * @mmio_ptr: pointer to a pointer to the start of the memory-mapped
756 * @len: size of the memory-mapped IO region
757 * Returns: status code
759 efi_status_t
efi_add_runtime_mmio(void *mmio_ptr
, u64 len
)
761 struct efi_runtime_mmio_list
*newmmio
;
762 u64 pages
= (len
+ EFI_PAGE_MASK
) >> EFI_PAGE_SHIFT
;
763 uint64_t addr
= *(uintptr_t *)mmio_ptr
;
766 ret
= efi_add_memory_map(addr
, pages
, EFI_MMAP_IO
, false);
767 if (ret
!= EFI_SUCCESS
)
768 return EFI_OUT_OF_RESOURCES
;
770 newmmio
= calloc(1, sizeof(*newmmio
));
772 return EFI_OUT_OF_RESOURCES
;
773 newmmio
->ptr
= mmio_ptr
;
774 newmmio
->paddr
= *(uintptr_t *)mmio_ptr
;
776 list_add_tail(&newmmio
->link
, &efi_runtime_mmio
);
782 * In the second stage, U-Boot has disappeared. To isolate our runtime code
783 * that at this point still exists from the rest, we put it into a special
788 * This means that we can not rely on any code outside of this file in any
789 * function or variable below this line.
791 * Please keep everything fully self-contained and annotated with
792 * __efi_runtime and __efi_runtime_data markers.
796 * Relocate the EFI runtime stub to a different place. We need to call this
797 * the first time we expose the runtime interface to a user and on set virtual
802 * efi_unimplemented() - replacement function, returns EFI_UNSUPPORTED
804 * This function is used after SetVirtualAddressMap() is called as replacement
805 * for services that are not available anymore due to constraints of the U-Boot
808 * Return: EFI_UNSUPPORTED
810 static efi_status_t __efi_runtime EFIAPI
efi_unimplemented(void)
812 return EFI_UNSUPPORTED
;
816 * efi_update_capsule() - process information from operating system
818 * This function implements the UpdateCapsule() runtime service.
820 * See the Unified Extensible Firmware Interface (UEFI) specification for
823 * @capsule_header_array: pointer to array of virtual pointers
824 * @capsule_count: number of pointers in capsule_header_array
825 * @scatter_gather_list: pointer to arry of physical pointers
826 * Returns: status code
828 efi_status_t __efi_runtime EFIAPI
efi_update_capsule(
829 struct efi_capsule_header
**capsule_header_array
,
830 efi_uintn_t capsule_count
,
831 u64 scatter_gather_list
)
833 return EFI_UNSUPPORTED
;
837 * efi_query_capsule_caps() - check if capsule is supported
839 * This function implements the QueryCapsuleCapabilities() runtime service.
841 * See the Unified Extensible Firmware Interface (UEFI) specification for
844 * @capsule_header_array: pointer to array of virtual pointers
845 * @capsule_count: number of pointers in capsule_header_array
846 * @maximum_capsule_size: maximum capsule size
847 * @reset_type: type of reset needed for capsule update
848 * Returns: status code
850 efi_status_t __efi_runtime EFIAPI
efi_query_capsule_caps(
851 struct efi_capsule_header
**capsule_header_array
,
852 efi_uintn_t capsule_count
,
853 u64
*maximum_capsule_size
,
856 return EFI_UNSUPPORTED
;
859 struct efi_runtime_services __efi_runtime_data efi_runtime_services
= {
861 .signature
= EFI_RUNTIME_SERVICES_SIGNATURE
,
862 .revision
= EFI_SPECIFICATION_VERSION
,
863 .headersize
= sizeof(struct efi_runtime_services
),
865 .get_time
= &efi_get_time_boottime
,
866 .set_time
= &efi_set_time_boottime
,
867 .get_wakeup_time
= (void *)&efi_unimplemented
,
868 .set_wakeup_time
= (void *)&efi_unimplemented
,
869 .set_virtual_address_map
= &efi_set_virtual_address_map
,
870 .convert_pointer
= efi_convert_pointer
,
871 .get_variable
= efi_get_variable
,
872 .get_next_variable_name
= efi_get_next_variable_name
,
873 .set_variable
= efi_set_variable
,
874 .get_next_high_mono_count
= (void *)&efi_unimplemented
,
875 .reset_system
= &efi_reset_system_boottime
,
876 .update_capsule
= efi_update_capsule
,
877 .query_capsule_caps
= efi_query_capsule_caps
,
878 .query_variable_info
= efi_query_variable_info
,