blob: 45b7809decc12a3af43662cf56e86c64c1dbb85a [file] [log] [blame]
Tom Rini70df9d62018-05-07 17:02:21 -04001// SPDX-License-Identifier: GPL-2.0+
Alexander Graf0bd425a2016-03-04 01:10:01 +01002/*
3 * EFI application runtime services
4 *
5 * Copyright (c) 2016 Alexander Graf
Alexander Graf0bd425a2016-03-04 01:10:01 +01006 */
7
8#include <common.h>
9#include <command.h>
10#include <dm.h>
Alexander Graf46c15142018-06-18 17:23:11 +020011#include <elf.h>
Alexander Graf0bd425a2016-03-04 01:10:01 +010012#include <efi_loader.h>
13#include <rtc.h>
Alexander Graf0bd425a2016-03-04 01:10:01 +010014
15/* For manual relocation support */
16DECLARE_GLOBAL_DATA_PTR;
17
Alexander Graf77256092016-08-16 21:08:45 +020018struct efi_runtime_mmio_list {
19 struct list_head link;
20 void **ptr;
21 u64 paddr;
22 u64 len;
23};
24
25/* This list contains all runtime available mmio regions */
26LIST_HEAD(efi_runtime_mmio);
27
Alexander Graf393dd912016-10-14 13:45:30 +020028static efi_status_t __efi_runtime EFIAPI efi_unimplemented(void);
29static efi_status_t __efi_runtime EFIAPI efi_device_error(void);
30static efi_status_t __efi_runtime EFIAPI efi_invalid_parameter(void);
Alexander Graf0bd425a2016-03-04 01:10:01 +010031
Simon Glassfff89d42018-06-11 23:26:40 -060032/*
33 * TODO(sjg@chromium.org): These defines and structs should come from the elf
34 * header for each arch (or a generic header) rather than being repeated here.
35 */
Alexander Graf0fe51922018-06-18 17:23:08 +020036#if defined(__aarch64__)
Alexander Graf46c15142018-06-18 17:23:11 +020037#define R_RELATIVE R_AARCH64_RELATIVE
Alexander Graf0bd425a2016-03-04 01:10:01 +010038#define R_MASK 0xffffffffULL
39#define IS_RELA 1
Alexander Graf0fe51922018-06-18 17:23:08 +020040#elif defined(__arm__)
Alexander Graf46c15142018-06-18 17:23:11 +020041#define R_RELATIVE R_ARM_RELATIVE
Alexander Graf0bd425a2016-03-04 01:10:01 +010042#define R_MASK 0xffULL
Alexander Graf0fe51922018-06-18 17:23:08 +020043#elif defined(__x86_64__) || defined(__i386__)
Simon Glasscdfe6962016-09-25 15:27:35 -060044#define R_RELATIVE R_386_RELATIVE
45#define R_MASK 0xffULL
Alexander Graf0fe51922018-06-18 17:23:08 +020046#elif defined(__riscv)
Rick Chen9677a372018-05-28 19:06:37 +080047#define R_RELATIVE R_RISCV_RELATIVE
48#define R_MASK 0xffULL
49#define IS_RELA 1
50
51struct dyn_sym {
52 ulong foo1;
53 ulong addr;
54 u32 foo2;
55 u32 foo3;
56};
Alexander Graf0fe51922018-06-18 17:23:08 +020057#if (__riscv_xlen == 32)
Rick Chen9677a372018-05-28 19:06:37 +080058#define R_ABSOLUTE R_RISCV_32
59#define SYM_INDEX 8
Alexander Graf0fe51922018-06-18 17:23:08 +020060#elif (__riscv_xlen == 64)
Rick Chen9677a372018-05-28 19:06:37 +080061#define R_ABSOLUTE R_RISCV_64
62#define SYM_INDEX 32
Alexander Graf0fe51922018-06-18 17:23:08 +020063#else
64#error unknown riscv target
Rick Chen9677a372018-05-28 19:06:37 +080065#endif
Alexander Graf0bd425a2016-03-04 01:10:01 +010066#else
67#error Need to add relocation awareness
68#endif
69
70struct elf_rel {
71 ulong *offset;
72 ulong info;
73};
74
75struct elf_rela {
76 ulong *offset;
77 ulong info;
78 long addend;
79};
80
81/*
82 * EFI Runtime code lives in 2 stages. In the first stage, U-Boot and an EFI
83 * payload are running concurrently at the same time. In this mode, we can
84 * handle a good number of runtime callbacks
85 */
86
Alexander Graf77256092016-08-16 21:08:45 +020087static void EFIAPI efi_reset_system_boottime(
88 enum efi_reset_type reset_type,
89 efi_status_t reset_status,
90 unsigned long data_size, void *reset_data)
Alexander Graf0bd425a2016-03-04 01:10:01 +010091{
Heinrich Schuchardtbf7f1692018-02-18 15:17:52 +010092 struct efi_event *evt;
93
Alexander Graf0bd425a2016-03-04 01:10:01 +010094 EFI_ENTRY("%d %lx %lx %p", reset_type, reset_status, data_size,
95 reset_data);
96
Heinrich Schuchardtbf7f1692018-02-18 15:17:52 +010097 /* Notify reset */
98 list_for_each_entry(evt, &efi_events, link) {
99 if (evt->group &&
100 !guidcmp(evt->group,
101 &efi_guid_event_group_reset_system)) {
102 efi_signal_event(evt, false);
103 break;
104 }
105 }
Alexander Graf0bd425a2016-03-04 01:10:01 +0100106 switch (reset_type) {
107 case EFI_RESET_COLD:
108 case EFI_RESET_WARM:
Heinrich Schuchardt450d4c82018-02-06 22:00:22 +0100109 case EFI_RESET_PLATFORM_SPECIFIC:
Alexander Graf0bd425a2016-03-04 01:10:01 +0100110 do_reset(NULL, 0, 0, NULL);
111 break;
112 case EFI_RESET_SHUTDOWN:
113 /* We don't have anything to map this to */
114 break;
115 }
116
Alexander Graf77256092016-08-16 21:08:45 +0200117 while (1) { }
Alexander Graf0bd425a2016-03-04 01:10:01 +0100118}
119
Heinrich Schuchardt37035b12018-07-07 23:39:14 +0200120/**
121 * efi_get_time_boottime - get current time
122 *
123 * This function implements the GetTime runtime service.
124 * See the Unified Extensible Firmware Interface (UEFI) specification
125 * for details.
126 *
127 * @time: pointer to structure to receive current time
128 * @capabilities: pointer to structure to receive RTC properties
129 * Return Value: status code
130 */
Alexander Graf77256092016-08-16 21:08:45 +0200131static efi_status_t EFIAPI efi_get_time_boottime(
132 struct efi_time *time,
133 struct efi_time_cap *capabilities)
Alexander Graf0bd425a2016-03-04 01:10:01 +0100134{
Heinrich Schuchardt37035b12018-07-07 23:39:14 +0200135#ifdef CONFIG_DM_RTC
136 efi_status_t ret = EFI_SUCCESS;
Alexander Graf0bd425a2016-03-04 01:10:01 +0100137 int r;
Heinrich Schuchardt37035b12018-07-07 23:39:14 +0200138 struct rtc_time tm;
Alexander Graf0bd425a2016-03-04 01:10:01 +0100139 struct udevice *dev;
140
141 EFI_ENTRY("%p %p", time, capabilities);
142
Heinrich Schuchardt37035b12018-07-07 23:39:14 +0200143 if (!time) {
144 ret = EFI_INVALID_PARAMETER;
145 goto out;
146 }
Alexander Graf0bd425a2016-03-04 01:10:01 +0100147
Heinrich Schuchardt37035b12018-07-07 23:39:14 +0200148 r = uclass_get_device(UCLASS_RTC, 0, &dev);
149 if (!r)
150 r = dm_rtc_get(dev, &tm);
151 if (r) {
152 ret = EFI_DEVICE_ERROR;
153 goto out;
154 }
Alexander Graf0bd425a2016-03-04 01:10:01 +0100155
156 memset(time, 0, sizeof(*time));
157 time->year = tm.tm_year;
158 time->month = tm.tm_mon;
159 time->day = tm.tm_mday;
160 time->hour = tm.tm_hour;
161 time->minute = tm.tm_min;
Heinrich Schuchardt37035b12018-07-07 23:39:14 +0200162 time->second = tm.tm_sec;
163 time->daylight = EFI_TIME_ADJUST_DAYLIGHT;
164 if (tm.tm_isdst > 0)
165 time->daylight |= EFI_TIME_IN_DAYLIGHT;
166 time->timezone = EFI_UNSPECIFIED_TIMEZONE;
Alexander Graf0bd425a2016-03-04 01:10:01 +0100167
Heinrich Schuchardt37035b12018-07-07 23:39:14 +0200168 if (capabilities) {
169 /* Set reasonable dummy values */
170 capabilities->resolution = 1; /* 1 Hz */
171 capabilities->accuracy = 100000000; /* 100 ppm */
172 capabilities->sets_to_zero = false;
173 }
174out:
175 return EFI_EXIT(ret);
Alexander Graf0bd425a2016-03-04 01:10:01 +0100176#else
Heinrich Schuchardt37035b12018-07-07 23:39:14 +0200177 EFI_ENTRY("%p %p", time, capabilities);
178 return EFI_EXIT(EFI_DEVICE_ERROR);
Alexander Graf0bd425a2016-03-04 01:10:01 +0100179#endif
180}
181
Alexander Graf77256092016-08-16 21:08:45 +0200182/* Boards may override the helpers below to implement RTS functionality */
183
Alexander Graf393dd912016-10-14 13:45:30 +0200184void __weak __efi_runtime EFIAPI efi_reset_system(
Alexander Graf77256092016-08-16 21:08:45 +0200185 enum efi_reset_type reset_type,
186 efi_status_t reset_status,
187 unsigned long data_size, void *reset_data)
188{
189 /* Nothing we can do */
190 while (1) { }
191}
192
Heinrich Schuchardt099b3b72018-03-03 15:28:59 +0100193efi_status_t __weak efi_reset_system_init(void)
Alexander Graf77256092016-08-16 21:08:45 +0200194{
Heinrich Schuchardt099b3b72018-03-03 15:28:59 +0100195 return EFI_SUCCESS;
Alexander Graf77256092016-08-16 21:08:45 +0200196}
197
Alexander Graf393dd912016-10-14 13:45:30 +0200198efi_status_t __weak __efi_runtime EFIAPI efi_get_time(
Alexander Graf77256092016-08-16 21:08:45 +0200199 struct efi_time *time,
200 struct efi_time_cap *capabilities)
201{
202 /* Nothing we can do */
203 return EFI_DEVICE_ERROR;
204}
205
Alexander Graf0bd425a2016-03-04 01:10:01 +0100206struct efi_runtime_detach_list_struct {
207 void *ptr;
208 void *patchto;
209};
210
211static const struct efi_runtime_detach_list_struct efi_runtime_detach_list[] = {
212 {
213 /* do_reset is gone */
214 .ptr = &efi_runtime_services.reset_system,
Alexander Graf77256092016-08-16 21:08:45 +0200215 .patchto = efi_reset_system,
Alexander Graf0bd425a2016-03-04 01:10:01 +0100216 }, {
217 /* invalidate_*cache_all are gone */
218 .ptr = &efi_runtime_services.set_virtual_address_map,
219 .patchto = &efi_invalid_parameter,
220 }, {
221 /* RTC accessors are gone */
222 .ptr = &efi_runtime_services.get_time,
Alexander Graf77256092016-08-16 21:08:45 +0200223 .patchto = &efi_get_time,
Alexander Grafc59d3602016-05-18 00:54:47 +0200224 }, {
225 /* Clean up system table */
226 .ptr = &systab.con_in,
227 .patchto = NULL,
228 }, {
229 /* Clean up system table */
230 .ptr = &systab.con_out,
231 .patchto = NULL,
232 }, {
233 /* Clean up system table */
234 .ptr = &systab.std_err,
235 .patchto = NULL,
236 }, {
237 /* Clean up system table */
238 .ptr = &systab.boottime,
239 .patchto = NULL,
Rob Clark15f3d742017-09-13 18:05:37 -0400240 }, {
241 .ptr = &efi_runtime_services.get_variable,
242 .patchto = &efi_device_error,
243 }, {
Heinrich Schuchardtd6a6baa2018-05-17 07:57:05 +0200244 .ptr = &efi_runtime_services.get_next_variable_name,
Rob Clark15f3d742017-09-13 18:05:37 -0400245 .patchto = &efi_device_error,
246 }, {
247 .ptr = &efi_runtime_services.set_variable,
248 .patchto = &efi_device_error,
249 }
Alexander Graf0bd425a2016-03-04 01:10:01 +0100250};
251
252static bool efi_runtime_tobedetached(void *p)
253{
254 int i;
255
256 for (i = 0; i < ARRAY_SIZE(efi_runtime_detach_list); i++)
257 if (efi_runtime_detach_list[i].ptr == p)
258 return true;
259
260 return false;
261}
262
263static void efi_runtime_detach(ulong offset)
264{
265 int i;
266 ulong patchoff = offset - (ulong)gd->relocaddr;
267
268 for (i = 0; i < ARRAY_SIZE(efi_runtime_detach_list); i++) {
269 ulong patchto = (ulong)efi_runtime_detach_list[i].patchto;
270 ulong *p = efi_runtime_detach_list[i].ptr;
271 ulong newaddr = patchto ? (patchto + patchoff) : 0;
272
Alexander Graf62a67482016-06-02 11:38:27 +0200273 debug("%s: Setting %p to %lx\n", __func__, p, newaddr);
Alexander Graf0bd425a2016-03-04 01:10:01 +0100274 *p = newaddr;
275 }
276}
277
278/* Relocate EFI runtime to uboot_reloc_base = offset */
279void efi_runtime_relocate(ulong offset, struct efi_mem_desc *map)
280{
281#ifdef IS_RELA
282 struct elf_rela *rel = (void*)&__efi_runtime_rel_start;
283#else
284 struct elf_rel *rel = (void*)&__efi_runtime_rel_start;
285 static ulong lastoff = CONFIG_SYS_TEXT_BASE;
286#endif
287
Alexander Graf62a67482016-06-02 11:38:27 +0200288 debug("%s: Relocating to offset=%lx\n", __func__, offset);
Alexander Graf0bd425a2016-03-04 01:10:01 +0100289 for (; (ulong)rel < (ulong)&__efi_runtime_rel_stop; rel++) {
290 ulong base = CONFIG_SYS_TEXT_BASE;
291 ulong *p;
292 ulong newaddr;
293
294 p = (void*)((ulong)rel->offset - base) + gd->relocaddr;
295
Rick Chen9677a372018-05-28 19:06:37 +0800296 debug("%s: rel->info=%#lx *p=%#lx rel->offset=%p\n", __func__, rel->info, *p, rel->offset);
Alexander Graf0bd425a2016-03-04 01:10:01 +0100297
Rick Chen9677a372018-05-28 19:06:37 +0800298 switch (rel->info & R_MASK) {
299 case R_RELATIVE:
Alexander Graf0bd425a2016-03-04 01:10:01 +0100300#ifdef IS_RELA
301 newaddr = rel->addend + offset - CONFIG_SYS_TEXT_BASE;
302#else
303 newaddr = *p - lastoff + offset;
304#endif
Rick Chen9677a372018-05-28 19:06:37 +0800305 break;
306#ifdef R_ABSOLUTE
307 case R_ABSOLUTE: {
308 ulong symidx = rel->info >> SYM_INDEX;
309 extern struct dyn_sym __dyn_sym_start[];
310 newaddr = __dyn_sym_start[symidx].addr + offset;
311 break;
312 }
313#endif
314 default:
315 continue;
316 }
Alexander Graf0bd425a2016-03-04 01:10:01 +0100317
318 /* Check if the relocation is inside bounds */
319 if (map && ((newaddr < map->virtual_start) ||
Heinrich Schuchardt9ebc47f2017-09-18 22:11:34 +0200320 newaddr > (map->virtual_start +
321 (map->num_pages << EFI_PAGE_SHIFT)))) {
Alexander Graf0bd425a2016-03-04 01:10:01 +0100322 if (!efi_runtime_tobedetached(p))
323 printf("U-Boot EFI: Relocation at %p is out of "
324 "range (%lx)\n", p, newaddr);
325 continue;
326 }
327
Alexander Graf62a67482016-06-02 11:38:27 +0200328 debug("%s: Setting %p to %lx\n", __func__, p, newaddr);
Alexander Graf0bd425a2016-03-04 01:10:01 +0100329 *p = newaddr;
Alexander Grafe5702322016-04-11 23:20:39 +0200330 flush_dcache_range((ulong)p & ~(EFI_CACHELINE_SIZE - 1),
331 ALIGN((ulong)&p[1], EFI_CACHELINE_SIZE));
Alexander Graf0bd425a2016-03-04 01:10:01 +0100332 }
333
334#ifndef IS_RELA
335 lastoff = offset;
336#endif
337
338 invalidate_icache_all();
339}
340
341static efi_status_t EFIAPI efi_set_virtual_address_map(
342 unsigned long memory_map_size,
343 unsigned long descriptor_size,
344 uint32_t descriptor_version,
345 struct efi_mem_desc *virtmap)
346{
Heinrich Schuchardt9ebc47f2017-09-18 22:11:34 +0200347 ulong runtime_start = (ulong)&__efi_runtime_start &
348 ~(ulong)EFI_PAGE_MASK;
Alexander Graf0bd425a2016-03-04 01:10:01 +0100349 int n = memory_map_size / descriptor_size;
350 int i;
351
352 EFI_ENTRY("%lx %lx %x %p", memory_map_size, descriptor_size,
353 descriptor_version, virtmap);
354
Alexander Graf77256092016-08-16 21:08:45 +0200355 /* Rebind mmio pointers */
356 for (i = 0; i < n; i++) {
357 struct efi_mem_desc *map = (void*)virtmap +
358 (descriptor_size * i);
359 struct list_head *lhandle;
360 efi_physical_addr_t map_start = map->physical_start;
361 efi_physical_addr_t map_len = map->num_pages << EFI_PAGE_SHIFT;
362 efi_physical_addr_t map_end = map_start + map_len;
Heinrich Schuchardt39054562018-08-04 23:16:06 +0200363 u64 off = map->virtual_start - map_start;
Alexander Graf77256092016-08-16 21:08:45 +0200364
365 /* Adjust all mmio pointers in this region */
366 list_for_each(lhandle, &efi_runtime_mmio) {
367 struct efi_runtime_mmio_list *lmmio;
368
369 lmmio = list_entry(lhandle,
370 struct efi_runtime_mmio_list,
371 link);
372 if ((map_start <= lmmio->paddr) &&
373 (map_end >= lmmio->paddr)) {
Alexander Graf77256092016-08-16 21:08:45 +0200374 uintptr_t new_addr = lmmio->paddr + off;
375 *lmmio->ptr = (void *)new_addr;
376 }
377 }
Heinrich Schuchardt39054562018-08-04 23:16:06 +0200378 if ((map_start <= (uintptr_t)systab.tables) &&
379 (map_end >= (uintptr_t)systab.tables)) {
380 char *ptr = (char *)systab.tables;
381
382 ptr += off;
383 systab.tables = (struct efi_configuration_table *)ptr;
384 }
Alexander Graf77256092016-08-16 21:08:45 +0200385 }
386
387 /* Move the actual runtime code over */
Alexander Graf0bd425a2016-03-04 01:10:01 +0100388 for (i = 0; i < n; i++) {
389 struct efi_mem_desc *map;
390
391 map = (void*)virtmap + (descriptor_size * i);
392 if (map->type == EFI_RUNTIME_SERVICES_CODE) {
Alexander Graf77256092016-08-16 21:08:45 +0200393 ulong new_offset = map->virtual_start -
394 (runtime_start - gd->relocaddr);
Alexander Graf0bd425a2016-03-04 01:10:01 +0100395
396 efi_runtime_relocate(new_offset, map);
397 /* Once we're virtual, we can no longer handle
398 complex callbacks */
399 efi_runtime_detach(new_offset);
400 return EFI_EXIT(EFI_SUCCESS);
401 }
402 }
403
404 return EFI_EXIT(EFI_INVALID_PARAMETER);
405}
406
Heinrich Schuchardt099b3b72018-03-03 15:28:59 +0100407efi_status_t efi_add_runtime_mmio(void *mmio_ptr, u64 len)
Alexander Graf77256092016-08-16 21:08:45 +0200408{
409 struct efi_runtime_mmio_list *newmmio;
xypron.glpk@gmx.de93fcc7f2017-08-11 21:19:37 +0200410 u64 pages = (len + EFI_PAGE_MASK) >> EFI_PAGE_SHIFT;
Alexander Graf33a83a32018-03-15 15:08:16 +0100411 uint64_t addr = *(uintptr_t *)mmio_ptr;
412 uint64_t retaddr;
413
414 retaddr = efi_add_memory_map(addr, pages, EFI_MMAP_IO, false);
415 if (retaddr != addr)
416 return EFI_OUT_OF_RESOURCES;
Alexander Graf77256092016-08-16 21:08:45 +0200417
418 newmmio = calloc(1, sizeof(*newmmio));
Heinrich Schuchardt099b3b72018-03-03 15:28:59 +0100419 if (!newmmio)
420 return EFI_OUT_OF_RESOURCES;
Alexander Graf77256092016-08-16 21:08:45 +0200421 newmmio->ptr = mmio_ptr;
422 newmmio->paddr = *(uintptr_t *)mmio_ptr;
423 newmmio->len = len;
424 list_add_tail(&newmmio->link, &efi_runtime_mmio);
Heinrich Schuchardt099b3b72018-03-03 15:28:59 +0100425
Alexander Graf33a83a32018-03-15 15:08:16 +0100426 return EFI_SUCCESS;
Alexander Graf77256092016-08-16 21:08:45 +0200427}
428
Alexander Graf0bd425a2016-03-04 01:10:01 +0100429/*
430 * In the second stage, U-Boot has disappeared. To isolate our runtime code
431 * that at this point still exists from the rest, we put it into a special
432 * section.
433 *
434 * !!WARNING!!
435 *
436 * This means that we can not rely on any code outside of this file in any
437 * function or variable below this line.
438 *
439 * Please keep everything fully self-contained and annotated with
Alexander Graf393dd912016-10-14 13:45:30 +0200440 * __efi_runtime and __efi_runtime_data markers.
Alexander Graf0bd425a2016-03-04 01:10:01 +0100441 */
442
443/*
444 * Relocate the EFI runtime stub to a different place. We need to call this
445 * the first time we expose the runtime interface to a user and on set virtual
446 * address map calls.
447 */
448
Alexander Graf393dd912016-10-14 13:45:30 +0200449static efi_status_t __efi_runtime EFIAPI efi_unimplemented(void)
Alexander Graf0bd425a2016-03-04 01:10:01 +0100450{
451 return EFI_UNSUPPORTED;
452}
453
Alexander Graf393dd912016-10-14 13:45:30 +0200454static efi_status_t __efi_runtime EFIAPI efi_device_error(void)
Alexander Graf0bd425a2016-03-04 01:10:01 +0100455{
456 return EFI_DEVICE_ERROR;
457}
458
Alexander Graf393dd912016-10-14 13:45:30 +0200459static efi_status_t __efi_runtime EFIAPI efi_invalid_parameter(void)
Alexander Graf0bd425a2016-03-04 01:10:01 +0100460{
461 return EFI_INVALID_PARAMETER;
462}
463
Heinrich Schuchardt897c0722018-02-09 20:41:21 +0100464efi_status_t __efi_runtime EFIAPI efi_update_capsule(
465 struct efi_capsule_header **capsule_header_array,
466 efi_uintn_t capsule_count,
467 u64 scatter_gather_list)
468{
469 return EFI_UNSUPPORTED;
470}
471
472efi_status_t __efi_runtime EFIAPI efi_query_capsule_caps(
473 struct efi_capsule_header **capsule_header_array,
474 efi_uintn_t capsule_count,
475 u64 maximum_capsule_size,
476 u32 reset_type)
477{
478 return EFI_UNSUPPORTED;
479}
480
481efi_status_t __efi_runtime EFIAPI efi_query_variable_info(
482 u32 attributes,
Heinrich Schuchardtd6a6baa2018-05-17 07:57:05 +0200483 u64 *maximum_variable_storage_size,
484 u64 *remaining_variable_storage_size,
485 u64 *maximum_variable_size)
Heinrich Schuchardt897c0722018-02-09 20:41:21 +0100486{
487 return EFI_UNSUPPORTED;
488}
489
Alexander Graf393dd912016-10-14 13:45:30 +0200490struct efi_runtime_services __efi_runtime_data efi_runtime_services = {
Alexander Graf0bd425a2016-03-04 01:10:01 +0100491 .hdr = {
492 .signature = EFI_RUNTIME_SERVICES_SIGNATURE,
Heinrich Schuchardte75b3cb2018-06-28 12:45:27 +0200493 .revision = EFI_SPECIFICATION_VERSION,
Heinrich Schuchardt10204252018-06-28 12:45:29 +0200494 .headersize = sizeof(struct efi_runtime_services),
Alexander Graf0bd425a2016-03-04 01:10:01 +0100495 },
Alexander Graf77256092016-08-16 21:08:45 +0200496 .get_time = &efi_get_time_boottime,
Alexander Graf0bd425a2016-03-04 01:10:01 +0100497 .set_time = (void *)&efi_device_error,
498 .get_wakeup_time = (void *)&efi_unimplemented,
499 .set_wakeup_time = (void *)&efi_unimplemented,
500 .set_virtual_address_map = &efi_set_virtual_address_map,
501 .convert_pointer = (void *)&efi_invalid_parameter,
Rob Clark15f3d742017-09-13 18:05:37 -0400502 .get_variable = efi_get_variable,
Heinrich Schuchardtd6a6baa2018-05-17 07:57:05 +0200503 .get_next_variable_name = efi_get_next_variable_name,
Rob Clark15f3d742017-09-13 18:05:37 -0400504 .set_variable = efi_set_variable,
Alexander Graf0bd425a2016-03-04 01:10:01 +0100505 .get_next_high_mono_count = (void *)&efi_device_error,
Alexander Graf77256092016-08-16 21:08:45 +0200506 .reset_system = &efi_reset_system_boottime,
Heinrich Schuchardt897c0722018-02-09 20:41:21 +0100507 .update_capsule = efi_update_capsule,
508 .query_capsule_caps = efi_query_capsule_caps,
509 .query_variable_info = efi_query_variable_info,
Alexander Graf0bd425a2016-03-04 01:10:01 +0100510};