efi_runtime.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671
  1. // SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * EFI application runtime services
  4. *
  5. * Copyright (c) 2016 Alexander Graf
  6. */
  7. #include <common.h>
  8. #include <command.h>
  9. #include <dm.h>
  10. #include <elf.h>
  11. #include <efi_loader.h>
  12. #include <rtc.h>
  13. /* For manual relocation support */
  14. DECLARE_GLOBAL_DATA_PTR;
  15. struct efi_runtime_mmio_list {
  16. struct list_head link;
  17. void **ptr;
  18. u64 paddr;
  19. u64 len;
  20. };
  21. /* This list contains all runtime available mmio regions */
  22. LIST_HEAD(efi_runtime_mmio);
  23. static efi_status_t __efi_runtime EFIAPI efi_unimplemented(void);
  24. static efi_status_t __efi_runtime EFIAPI efi_device_error(void);
  25. static efi_status_t __efi_runtime EFIAPI efi_invalid_parameter(void);
  26. /*
  27. * TODO(sjg@chromium.org): These defines and structures should come from the ELF
  28. * header for each architecture (or a generic header) rather than being repeated
  29. * here.
  30. */
  31. #if defined(__aarch64__)
  32. #define R_RELATIVE R_AARCH64_RELATIVE
  33. #define R_MASK 0xffffffffULL
  34. #define IS_RELA 1
  35. #elif defined(__arm__)
  36. #define R_RELATIVE R_ARM_RELATIVE
  37. #define R_MASK 0xffULL
  38. #elif defined(__x86_64__) || defined(__i386__)
  39. #define R_RELATIVE R_386_RELATIVE
  40. #define R_MASK 0xffULL
  41. #elif defined(__riscv)
  42. #define R_RELATIVE R_RISCV_RELATIVE
  43. #define R_MASK 0xffULL
  44. #define IS_RELA 1
  45. struct dyn_sym {
  46. ulong foo1;
  47. ulong addr;
  48. u32 foo2;
  49. u32 foo3;
  50. };
  51. #if (__riscv_xlen == 32)
  52. #define R_ABSOLUTE R_RISCV_32
  53. #define SYM_INDEX 8
  54. #elif (__riscv_xlen == 64)
  55. #define R_ABSOLUTE R_RISCV_64
  56. #define SYM_INDEX 32
  57. #else
  58. #error unknown riscv target
  59. #endif
  60. #else
  61. #error Need to add relocation awareness
  62. #endif
  63. struct elf_rel {
  64. ulong *offset;
  65. ulong info;
  66. };
  67. struct elf_rela {
  68. ulong *offset;
  69. ulong info;
  70. long addend;
  71. };
  72. /*
  73. * EFI runtime code lives in two stages. In the first stage, U-Boot and an EFI
  74. * payload are running concurrently at the same time. In this mode, we can
  75. * handle a good number of runtime callbacks
  76. */
  77. /**
  78. * efi_update_table_header_crc32() - Update crc32 in table header
  79. *
  80. * @table: EFI table
  81. */
  82. void __efi_runtime efi_update_table_header_crc32(struct efi_table_hdr *table)
  83. {
  84. table->crc32 = 0;
  85. table->crc32 = crc32(0, (const unsigned char *)table,
  86. table->headersize);
  87. }
  88. /**
  89. * efi_reset_system_boottime() - reset system at boot time
  90. *
  91. * This function implements the ResetSystem() runtime service before
  92. * SetVirtualAddressMap() is called.
  93. *
  94. * See the Unified Extensible Firmware Interface (UEFI) specification for
  95. * details.
  96. *
  97. * @reset_type: type of reset to perform
  98. * @reset_status: status code for the reset
  99. * @data_size: size of reset_data
  100. * @reset_data: information about the reset
  101. */
  102. static void EFIAPI efi_reset_system_boottime(
  103. enum efi_reset_type reset_type,
  104. efi_status_t reset_status,
  105. unsigned long data_size, void *reset_data)
  106. {
  107. struct efi_event *evt;
  108. EFI_ENTRY("%d %lx %lx %p", reset_type, reset_status, data_size,
  109. reset_data);
  110. /* Notify reset */
  111. list_for_each_entry(evt, &efi_events, link) {
  112. if (evt->group &&
  113. !guidcmp(evt->group,
  114. &efi_guid_event_group_reset_system)) {
  115. efi_signal_event(evt, false);
  116. break;
  117. }
  118. }
  119. switch (reset_type) {
  120. case EFI_RESET_COLD:
  121. case EFI_RESET_WARM:
  122. case EFI_RESET_PLATFORM_SPECIFIC:
  123. do_reset(NULL, 0, 0, NULL);
  124. break;
  125. case EFI_RESET_SHUTDOWN:
  126. /* We don't have anything to map this to */
  127. break;
  128. }
  129. while (1) { }
  130. }
  131. /**
  132. * efi_get_time_boottime() - get current time at boot time
  133. *
  134. * This function implements the GetTime runtime service before
  135. * SetVirtualAddressMap() is called.
  136. *
  137. * See the Unified Extensible Firmware Interface (UEFI) specification
  138. * for details.
  139. *
  140. * @time: pointer to structure to receive current time
  141. * @capabilities: pointer to structure to receive RTC properties
  142. * Returns: status code
  143. */
  144. static efi_status_t EFIAPI efi_get_time_boottime(
  145. struct efi_time *time,
  146. struct efi_time_cap *capabilities)
  147. {
  148. #ifdef CONFIG_DM_RTC
  149. efi_status_t ret = EFI_SUCCESS;
  150. int r;
  151. struct rtc_time tm;
  152. struct udevice *dev;
  153. EFI_ENTRY("%p %p", time, capabilities);
  154. if (!time) {
  155. ret = EFI_INVALID_PARAMETER;
  156. goto out;
  157. }
  158. r = uclass_get_device(UCLASS_RTC, 0, &dev);
  159. if (!r)
  160. r = dm_rtc_get(dev, &tm);
  161. if (r) {
  162. ret = EFI_DEVICE_ERROR;
  163. goto out;
  164. }
  165. memset(time, 0, sizeof(*time));
  166. time->year = tm.tm_year;
  167. time->month = tm.tm_mon;
  168. time->day = tm.tm_mday;
  169. time->hour = tm.tm_hour;
  170. time->minute = tm.tm_min;
  171. time->second = tm.tm_sec;
  172. time->daylight = EFI_TIME_ADJUST_DAYLIGHT;
  173. if (tm.tm_isdst > 0)
  174. time->daylight |= EFI_TIME_IN_DAYLIGHT;
  175. time->timezone = EFI_UNSPECIFIED_TIMEZONE;
  176. if (capabilities) {
  177. /* Set reasonable dummy values */
  178. capabilities->resolution = 1; /* 1 Hz */
  179. capabilities->accuracy = 100000000; /* 100 ppm */
  180. capabilities->sets_to_zero = false;
  181. }
  182. out:
  183. return EFI_EXIT(ret);
  184. #else
  185. EFI_ENTRY("%p %p", time, capabilities);
  186. return EFI_EXIT(EFI_DEVICE_ERROR);
  187. #endif
  188. }
  189. /**
  190. * efi_reset_system() - reset system
  191. *
  192. * This function implements the ResetSystem() runtime service after
  193. * SetVirtualAddressMap() is called. It only executes an endless loop.
  194. * Boards may override the helpers below to implement reset functionality.
  195. *
  196. * See the Unified Extensible Firmware Interface (UEFI) specification for
  197. * details.
  198. *
  199. * @reset_type: type of reset to perform
  200. * @reset_status: status code for the reset
  201. * @data_size: size of reset_data
  202. * @reset_data: information about the reset
  203. */
  204. void __weak __efi_runtime EFIAPI efi_reset_system(
  205. enum efi_reset_type reset_type,
  206. efi_status_t reset_status,
  207. unsigned long data_size, void *reset_data)
  208. {
  209. /* Nothing we can do */
  210. while (1) { }
  211. }
  212. /**
  213. * efi_reset_system_init() - initialize the reset driver
  214. *
  215. * Boards may override this function to initialize the reset driver.
  216. */
  217. efi_status_t __weak efi_reset_system_init(void)
  218. {
  219. return EFI_SUCCESS;
  220. }
  221. /**
  222. * efi_get_time() - get current time
  223. *
  224. * This function implements the GetTime runtime service after
  225. * SetVirtualAddressMap() is called. As the U-Boot driver are not available
  226. * anymore only an error code is returned.
  227. *
  228. * See the Unified Extensible Firmware Interface (UEFI) specification
  229. * for details.
  230. *
  231. * @time: pointer to structure to receive current time
  232. * @capabilities: pointer to structure to receive RTC properties
  233. * Returns: status code
  234. */
  235. efi_status_t __weak __efi_runtime EFIAPI efi_get_time(
  236. struct efi_time *time,
  237. struct efi_time_cap *capabilities)
  238. {
  239. /* Nothing we can do */
  240. return EFI_DEVICE_ERROR;
  241. }
  242. struct efi_runtime_detach_list_struct {
  243. void *ptr;
  244. void *patchto;
  245. };
  246. static const struct efi_runtime_detach_list_struct efi_runtime_detach_list[] = {
  247. {
  248. /* do_reset is gone */
  249. .ptr = &efi_runtime_services.reset_system,
  250. .patchto = efi_reset_system,
  251. }, {
  252. /* invalidate_*cache_all are gone */
  253. .ptr = &efi_runtime_services.set_virtual_address_map,
  254. .patchto = &efi_invalid_parameter,
  255. }, {
  256. /* RTC accessors are gone */
  257. .ptr = &efi_runtime_services.get_time,
  258. .patchto = &efi_get_time,
  259. }, {
  260. /* Clean up system table */
  261. .ptr = &systab.con_in,
  262. .patchto = NULL,
  263. }, {
  264. /* Clean up system table */
  265. .ptr = &systab.con_out,
  266. .patchto = NULL,
  267. }, {
  268. /* Clean up system table */
  269. .ptr = &systab.std_err,
  270. .patchto = NULL,
  271. }, {
  272. /* Clean up system table */
  273. .ptr = &systab.boottime,
  274. .patchto = NULL,
  275. }, {
  276. .ptr = &efi_runtime_services.get_variable,
  277. .patchto = &efi_device_error,
  278. }, {
  279. .ptr = &efi_runtime_services.get_next_variable_name,
  280. .patchto = &efi_device_error,
  281. }, {
  282. .ptr = &efi_runtime_services.set_variable,
  283. .patchto = &efi_device_error,
  284. }
  285. };
  286. static bool efi_runtime_tobedetached(void *p)
  287. {
  288. int i;
  289. for (i = 0; i < ARRAY_SIZE(efi_runtime_detach_list); i++)
  290. if (efi_runtime_detach_list[i].ptr == p)
  291. return true;
  292. return false;
  293. }
  294. static void efi_runtime_detach(ulong offset)
  295. {
  296. int i;
  297. ulong patchoff = offset - (ulong)gd->relocaddr;
  298. for (i = 0; i < ARRAY_SIZE(efi_runtime_detach_list); i++) {
  299. ulong patchto = (ulong)efi_runtime_detach_list[i].patchto;
  300. ulong *p = efi_runtime_detach_list[i].ptr;
  301. ulong newaddr = patchto ? (patchto + patchoff) : 0;
  302. debug("%s: Setting %p to %lx\n", __func__, p, newaddr);
  303. *p = newaddr;
  304. }
  305. /* Update CRC32 */
  306. efi_update_table_header_crc32(&efi_runtime_services.hdr);
  307. }
  308. /* Relocate EFI runtime to uboot_reloc_base = offset */
  309. void efi_runtime_relocate(ulong offset, struct efi_mem_desc *map)
  310. {
  311. #ifdef IS_RELA
  312. struct elf_rela *rel = (void*)&__efi_runtime_rel_start;
  313. #else
  314. struct elf_rel *rel = (void*)&__efi_runtime_rel_start;
  315. static ulong lastoff = CONFIG_SYS_TEXT_BASE;
  316. #endif
  317. debug("%s: Relocating to offset=%lx\n", __func__, offset);
  318. for (; (ulong)rel < (ulong)&__efi_runtime_rel_stop; rel++) {
  319. ulong base = CONFIG_SYS_TEXT_BASE;
  320. ulong *p;
  321. ulong newaddr;
  322. p = (void*)((ulong)rel->offset - base) + gd->relocaddr;
  323. debug("%s: rel->info=%#lx *p=%#lx rel->offset=%p\n", __func__, rel->info, *p, rel->offset);
  324. switch (rel->info & R_MASK) {
  325. case R_RELATIVE:
  326. #ifdef IS_RELA
  327. newaddr = rel->addend + offset - CONFIG_SYS_TEXT_BASE;
  328. #else
  329. newaddr = *p - lastoff + offset;
  330. #endif
  331. break;
  332. #ifdef R_ABSOLUTE
  333. case R_ABSOLUTE: {
  334. ulong symidx = rel->info >> SYM_INDEX;
  335. extern struct dyn_sym __dyn_sym_start[];
  336. newaddr = __dyn_sym_start[symidx].addr + offset;
  337. break;
  338. }
  339. #endif
  340. default:
  341. continue;
  342. }
  343. /* Check if the relocation is inside bounds */
  344. if (map && ((newaddr < map->virtual_start) ||
  345. newaddr > (map->virtual_start +
  346. (map->num_pages << EFI_PAGE_SHIFT)))) {
  347. if (!efi_runtime_tobedetached(p))
  348. printf("U-Boot EFI: Relocation at %p is out of "
  349. "range (%lx)\n", p, newaddr);
  350. continue;
  351. }
  352. debug("%s: Setting %p to %lx\n", __func__, p, newaddr);
  353. *p = newaddr;
  354. flush_dcache_range((ulong)p & ~(EFI_CACHELINE_SIZE - 1),
  355. ALIGN((ulong)&p[1], EFI_CACHELINE_SIZE));
  356. }
  357. #ifndef IS_RELA
  358. lastoff = offset;
  359. #endif
  360. invalidate_icache_all();
  361. }
  362. /**
  363. * efi_set_virtual_address_map() - change from physical to virtual mapping
  364. *
  365. * This function implements the SetVirtualAddressMap() runtime service.
  366. *
  367. * See the Unified Extensible Firmware Interface (UEFI) specification for
  368. * details.
  369. *
  370. * @memory_map_size: size of the virtual map
  371. * @descriptor_size: size of an entry in the map
  372. * @descriptor_version: version of the map entries
  373. * @virtmap: virtual address mapping information
  374. * Return: status code
  375. */
  376. static efi_status_t EFIAPI efi_set_virtual_address_map(
  377. unsigned long memory_map_size,
  378. unsigned long descriptor_size,
  379. uint32_t descriptor_version,
  380. struct efi_mem_desc *virtmap)
  381. {
  382. ulong runtime_start = (ulong)&__efi_runtime_start &
  383. ~(ulong)EFI_PAGE_MASK;
  384. int n = memory_map_size / descriptor_size;
  385. int i;
  386. EFI_ENTRY("%lx %lx %x %p", memory_map_size, descriptor_size,
  387. descriptor_version, virtmap);
  388. /* Rebind mmio pointers */
  389. for (i = 0; i < n; i++) {
  390. struct efi_mem_desc *map = (void*)virtmap +
  391. (descriptor_size * i);
  392. struct list_head *lhandle;
  393. efi_physical_addr_t map_start = map->physical_start;
  394. efi_physical_addr_t map_len = map->num_pages << EFI_PAGE_SHIFT;
  395. efi_physical_addr_t map_end = map_start + map_len;
  396. u64 off = map->virtual_start - map_start;
  397. /* Adjust all mmio pointers in this region */
  398. list_for_each(lhandle, &efi_runtime_mmio) {
  399. struct efi_runtime_mmio_list *lmmio;
  400. lmmio = list_entry(lhandle,
  401. struct efi_runtime_mmio_list,
  402. link);
  403. if ((map_start <= lmmio->paddr) &&
  404. (map_end >= lmmio->paddr)) {
  405. uintptr_t new_addr = lmmio->paddr + off;
  406. *lmmio->ptr = (void *)new_addr;
  407. }
  408. }
  409. if ((map_start <= (uintptr_t)systab.tables) &&
  410. (map_end >= (uintptr_t)systab.tables)) {
  411. char *ptr = (char *)systab.tables;
  412. ptr += off;
  413. systab.tables = (struct efi_configuration_table *)ptr;
  414. }
  415. }
  416. /* Move the actual runtime code over */
  417. for (i = 0; i < n; i++) {
  418. struct efi_mem_desc *map;
  419. map = (void*)virtmap + (descriptor_size * i);
  420. if (map->type == EFI_RUNTIME_SERVICES_CODE) {
  421. ulong new_offset = map->virtual_start -
  422. (runtime_start - gd->relocaddr);
  423. efi_runtime_relocate(new_offset, map);
  424. /* Once we're virtual, we can no longer handle
  425. complex callbacks */
  426. efi_runtime_detach(new_offset);
  427. return EFI_EXIT(EFI_SUCCESS);
  428. }
  429. }
  430. return EFI_EXIT(EFI_INVALID_PARAMETER);
  431. }
  432. /**
  433. * efi_add_runtime_mmio() - add memory-mapped IO region
  434. *
  435. * This function adds a memory-mapped IO region to the memory map to make it
  436. * available at runtime.
  437. *
  438. * @mmio_ptr: address of the memory-mapped IO region
  439. * @len: size of the memory-mapped IO region
  440. * Returns: status code
  441. */
  442. efi_status_t efi_add_runtime_mmio(void *mmio_ptr, u64 len)
  443. {
  444. struct efi_runtime_mmio_list *newmmio;
  445. u64 pages = (len + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT;
  446. uint64_t addr = *(uintptr_t *)mmio_ptr;
  447. uint64_t retaddr;
  448. retaddr = efi_add_memory_map(addr, pages, EFI_MMAP_IO, false);
  449. if (retaddr != addr)
  450. return EFI_OUT_OF_RESOURCES;
  451. newmmio = calloc(1, sizeof(*newmmio));
  452. if (!newmmio)
  453. return EFI_OUT_OF_RESOURCES;
  454. newmmio->ptr = mmio_ptr;
  455. newmmio->paddr = *(uintptr_t *)mmio_ptr;
  456. newmmio->len = len;
  457. list_add_tail(&newmmio->link, &efi_runtime_mmio);
  458. return EFI_SUCCESS;
  459. }
  460. /*
  461. * In the second stage, U-Boot has disappeared. To isolate our runtime code
  462. * that at this point still exists from the rest, we put it into a special
  463. * section.
  464. *
  465. * !!WARNING!!
  466. *
  467. * This means that we can not rely on any code outside of this file in any
  468. * function or variable below this line.
  469. *
  470. * Please keep everything fully self-contained and annotated with
  471. * __efi_runtime and __efi_runtime_data markers.
  472. */
  473. /*
  474. * Relocate the EFI runtime stub to a different place. We need to call this
  475. * the first time we expose the runtime interface to a user and on set virtual
  476. * address map calls.
  477. */
  478. /**
  479. * efi_unimplemented() - replacement function, returns EFI_UNSUPPORTED
  480. *
  481. * This function is used after SetVirtualAddressMap() is called as replacement
  482. * for services that are not available anymore due to constraints of the U-Boot
  483. * implementation.
  484. *
  485. * Return: EFI_UNSUPPORTED
  486. */
  487. static efi_status_t __efi_runtime EFIAPI efi_unimplemented(void)
  488. {
  489. return EFI_UNSUPPORTED;
  490. }
  491. /**
  492. * efi_device_error() - replacement function, returns EFI_DEVICE_ERROR
  493. *
  494. * This function is used after SetVirtualAddressMap() is called as replacement
  495. * for services that are not available anymore due to constraints of the U-Boot
  496. * implementation.
  497. *
  498. * Return: EFI_DEVICE_ERROR
  499. */
  500. static efi_status_t __efi_runtime EFIAPI efi_device_error(void)
  501. {
  502. return EFI_DEVICE_ERROR;
  503. }
  504. /**
  505. * efi_invalid_parameter() - replacement function, returns EFI_INVALID_PARAMETER
  506. *
  507. * This function is used after SetVirtualAddressMap() is called as replacement
  508. * for services that are not available anymore due to constraints of the U-Boot
  509. * implementation.
  510. *
  511. * Return: EFI_INVALID_PARAMETER
  512. */
  513. static efi_status_t __efi_runtime EFIAPI efi_invalid_parameter(void)
  514. {
  515. return EFI_INVALID_PARAMETER;
  516. }
  517. /**
  518. * efi_update_capsule() - process information from operating system
  519. *
  520. * This function implements the UpdateCapsule() runtime service.
  521. *
  522. * See the Unified Extensible Firmware Interface (UEFI) specification for
  523. * details.
  524. *
  525. * @capsule_header_array: pointer to array of virtual pointers
  526. * @capsule_count: number of pointers in capsule_header_array
  527. * @scatter_gather_list: pointer to arry of physical pointers
  528. * Returns: status code
  529. */
  530. efi_status_t __efi_runtime EFIAPI efi_update_capsule(
  531. struct efi_capsule_header **capsule_header_array,
  532. efi_uintn_t capsule_count,
  533. u64 scatter_gather_list)
  534. {
  535. return EFI_UNSUPPORTED;
  536. }
  537. /**
  538. * efi_query_capsule_caps() - check if capsule is supported
  539. *
  540. * This function implements the QueryCapsuleCapabilities() runtime service.
  541. *
  542. * See the Unified Extensible Firmware Interface (UEFI) specification for
  543. * details.
  544. *
  545. * @capsule_header_array: pointer to array of virtual pointers
  546. * @capsule_count: number of pointers in capsule_header_array
  547. * @capsule_size: maximum capsule size
  548. * @reset_type: type of reset needed for capsule update
  549. * Returns: status code
  550. */
  551. efi_status_t __efi_runtime EFIAPI efi_query_capsule_caps(
  552. struct efi_capsule_header **capsule_header_array,
  553. efi_uintn_t capsule_count,
  554. u64 maximum_capsule_size,
  555. u32 reset_type)
  556. {
  557. return EFI_UNSUPPORTED;
  558. }
  559. /**
  560. * efi_query_variable_info() - get information about EFI variables
  561. *
  562. * This function implements the QueryVariableInfo() runtime service.
  563. *
  564. * See the Unified Extensible Firmware Interface (UEFI) specification for
  565. * details.
  566. *
  567. * @attributes: bitmask to select variables to be
  568. * queried
  569. * @maximum_variable_storage_size: maximum size of storage area for the
  570. * selected variable types
  571. * @remaining_variable_storage_size: remaining size of storage are for the
  572. * selected variable types
  573. * @maximum_variable_size: maximum size of a variable of the
  574. * selected type
  575. * Returns: status code
  576. */
  577. efi_status_t __efi_runtime EFIAPI efi_query_variable_info(
  578. u32 attributes,
  579. u64 *maximum_variable_storage_size,
  580. u64 *remaining_variable_storage_size,
  581. u64 *maximum_variable_size)
  582. {
  583. return EFI_UNSUPPORTED;
  584. }
  585. struct efi_runtime_services __efi_runtime_data efi_runtime_services = {
  586. .hdr = {
  587. .signature = EFI_RUNTIME_SERVICES_SIGNATURE,
  588. .revision = EFI_SPECIFICATION_VERSION,
  589. .headersize = sizeof(struct efi_runtime_services),
  590. },
  591. .get_time = &efi_get_time_boottime,
  592. .set_time = (void *)&efi_device_error,
  593. .get_wakeup_time = (void *)&efi_unimplemented,
  594. .set_wakeup_time = (void *)&efi_unimplemented,
  595. .set_virtual_address_map = &efi_set_virtual_address_map,
  596. .convert_pointer = (void *)&efi_invalid_parameter,
  597. .get_variable = efi_get_variable,
  598. .get_next_variable_name = efi_get_next_variable_name,
  599. .set_variable = efi_set_variable,
  600. .get_next_high_mono_count = (void *)&efi_device_error,
  601. .reset_system = &efi_reset_system_boottime,
  602. .update_capsule = efi_update_capsule,
  603. .query_capsule_caps = efi_query_capsule_caps,
  604. .query_variable_info = efi_query_variable_info,
  605. };