blob: 427eb3540e5f9d55e6611221e416ef8e6429f3a8 [file] [log] [blame]
Huang, Ying5b836832008-01-30 13:31:19 +01001/*
2 * x86_64 specific EFI support functions
3 * Based on Extensible Firmware Interface Specification version 1.0
4 *
5 * Copyright (C) 2005-2008 Intel Co.
6 * Fenghua Yu <fenghua.yu@intel.com>
7 * Bibo Mao <bibo.mao@intel.com>
8 * Chandramouli Narayanan <mouli@linux.intel.com>
9 * Huang Ying <ying.huang@intel.com>
10 *
11 * Code to convert EFI to E820 map has been implemented in elilo bootloader
12 * based on a EFI patch by Edgar Hucek. Based on the E820 map, the page table
13 * is setup appropriately for EFI runtime code.
14 * - mouli 06/14/2007.
15 *
16 */
17
18#include <linux/kernel.h>
19#include <linux/init.h>
20#include <linux/mm.h>
21#include <linux/types.h>
22#include <linux/spinlock.h>
23#include <linux/bootmem.h>
24#include <linux/ioport.h>
25#include <linux/module.h>
26#include <linux/efi.h>
27#include <linux/uaccess.h>
28#include <linux/io.h>
29#include <linux/reboot.h>
David Howells0d01ff22013-04-11 23:51:01 +010030#include <linux/slab.h>
Huang, Ying5b836832008-01-30 13:31:19 +010031
32#include <asm/setup.h>
33#include <asm/page.h>
34#include <asm/e820.h>
35#include <asm/pgtable.h>
36#include <asm/tlbflush.h>
Huang, Ying5b836832008-01-30 13:31:19 +010037#include <asm/proto.h>
38#include <asm/efi.h>
Huang, Ying4de0d4a2008-02-13 17:22:41 +080039#include <asm/cacheflush.h>
Brian Gerst3819cd42009-01-23 11:03:29 +090040#include <asm/fixmap.h>
Borislav Petkovd2f7cbe2013-10-31 17:25:08 +010041#include <asm/realmode.h>
Matt Fleming4f9dbcf2014-01-10 18:48:30 +000042#include <asm/time.h>
Huang, Ying5b836832008-01-30 13:31:19 +010043
Nathan Zimmerb8f2c212013-01-08 09:02:43 -060044static pgd_t *save_pgd __initdata;
Huang, Ying5b836832008-01-30 13:31:19 +010045
Borislav Petkovd2f7cbe2013-10-31 17:25:08 +010046/*
47 * We allocate runtime services regions bottom-up, starting from -4G, i.e.
48 * 0xffff_ffff_0000_0000 and limit EFI VA mapping space to 64G.
49 */
Mathias Krause8266e312014-09-21 17:26:54 +020050static u64 efi_va = EFI_VA_START;
Borislav Petkovd2f7cbe2013-10-31 17:25:08 +010051
52/*
53 * Scratch space used for switching the pagetable in the EFI stub
54 */
55struct efi_scratch {
56 u64 r15;
57 u64 prev_cr3;
58 pgd_t *efi_pgt;
59 bool use_pgd;
Matt Fleming4f9dbcf2014-01-10 18:48:30 +000060 u64 phys_stack;
61} __packed;
Borislav Petkovd2f7cbe2013-10-31 17:25:08 +010062
Matthew Garrett9cd2b072011-05-05 15:19:43 -040063static void __init early_code_mapping_set_exec(int executable)
Huang, Ying5b836832008-01-30 13:31:19 +010064{
65 efi_memory_desc_t *md;
66 void *p;
67
Huang, Yinga2172e22008-01-30 13:33:55 +010068 if (!(__supported_pte_mask & _PAGE_NX))
69 return;
70
Matthew Garrett916f6762011-05-25 09:53:13 -040071 /* Make EFI service code area executable */
Huang, Ying5b836832008-01-30 13:31:19 +010072 for (p = memmap.map; p < memmap.map_end; p += memmap.desc_size) {
73 md = p;
Matthew Garrett916f6762011-05-25 09:53:13 -040074 if (md->type == EFI_RUNTIME_SERVICES_CODE ||
75 md->type == EFI_BOOT_SERVICES_CODE)
Matthew Garrett9cd2b072011-05-05 15:19:43 -040076 efi_set_executable(md, executable);
Huang, Ying5b836832008-01-30 13:31:19 +010077 }
78}
79
Mathias Krause4e78eb052014-09-07 19:42:17 +020080void __init efi_call_phys_prolog(void)
Huang, Ying5b836832008-01-30 13:31:19 +010081{
82 unsigned long vaddress;
Nathan Zimmerb8f2c212013-01-08 09:02:43 -060083 int pgd;
84 int n_pgds;
Huang, Ying5b836832008-01-30 13:31:19 +010085
Borislav Petkovd2f7cbe2013-10-31 17:25:08 +010086 if (!efi_enabled(EFI_OLD_MEMMAP))
87 return;
88
Matthew Garrett9cd2b072011-05-05 15:19:43 -040089 early_code_mapping_set_exec(1);
Nathan Zimmerb8f2c212013-01-08 09:02:43 -060090
91 n_pgds = DIV_ROUND_UP((max_pfn << PAGE_SHIFT), PGDIR_SIZE);
92 save_pgd = kmalloc(n_pgds * sizeof(pgd_t), GFP_KERNEL);
93
94 for (pgd = 0; pgd < n_pgds; pgd++) {
95 save_pgd[pgd] = *pgd_offset_k(pgd * PGDIR_SIZE);
96 vaddress = (unsigned long)__va(pgd * PGDIR_SIZE);
97 set_pgd(pgd_offset_k(pgd * PGDIR_SIZE), *pgd_offset_k(vaddress));
98 }
Huang, Ying5b836832008-01-30 13:31:19 +010099 __flush_tlb_all();
100}
101
102void __init efi_call_phys_epilog(void)
103{
104 /*
105 * After the lock is released, the original page table is restored.
106 */
Nathan Zimmerb8f2c212013-01-08 09:02:43 -0600107 int pgd;
108 int n_pgds = DIV_ROUND_UP((max_pfn << PAGE_SHIFT) , PGDIR_SIZE);
Borislav Petkovd2f7cbe2013-10-31 17:25:08 +0100109
110 if (!efi_enabled(EFI_OLD_MEMMAP))
111 return;
112
Nathan Zimmerb8f2c212013-01-08 09:02:43 -0600113 for (pgd = 0; pgd < n_pgds; pgd++)
114 set_pgd(pgd_offset_k(pgd * PGDIR_SIZE), save_pgd[pgd]);
115 kfree(save_pgd);
Huang, Ying5b836832008-01-30 13:31:19 +0100116 __flush_tlb_all();
Matthew Garrett9cd2b072011-05-05 15:19:43 -0400117 early_code_mapping_set_exec(0);
Huang, Ying5b836832008-01-30 13:31:19 +0100118}
Keith Packarde1ad7832011-12-11 16:12:42 -0800119
Borislav Petkovd2f7cbe2013-10-31 17:25:08 +0100120/*
121 * Add low kernel mappings for passing arguments to EFI functions.
122 */
123void efi_sync_low_kernel_mappings(void)
124{
125 unsigned num_pgds;
126 pgd_t *pgd = (pgd_t *)__va(real_mode_header->trampoline_pgd);
127
128 if (efi_enabled(EFI_OLD_MEMMAP))
129 return;
130
131 num_pgds = pgd_index(MODULES_END - 1) - pgd_index(PAGE_OFFSET);
132
133 memcpy(pgd + pgd_index(PAGE_OFFSET),
134 init_mm.pgd + pgd_index(PAGE_OFFSET),
135 sizeof(pgd_t) * num_pgds);
136}
137
Mathias Krause4e78eb052014-09-07 19:42:17 +0200138int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages)
Borislav Petkovd2f7cbe2013-10-31 17:25:08 +0100139{
Matt Fleming4f9dbcf2014-01-10 18:48:30 +0000140 unsigned long text;
Matt Fleming4f9dbcf2014-01-10 18:48:30 +0000141 struct page *page;
Matt Fleming994448f2014-03-05 18:15:37 +0000142 unsigned npages;
Borislav Petkovb7b898a2014-01-18 12:48:17 +0100143 pgd_t *pgd;
Borislav Petkovd2f7cbe2013-10-31 17:25:08 +0100144
Borislav Petkovb7b898a2014-01-18 12:48:17 +0100145 if (efi_enabled(EFI_OLD_MEMMAP))
146 return 0;
147
148 efi_scratch.efi_pgt = (pgd_t *)(unsigned long)real_mode_header->trampoline_pgd;
149 pgd = __va(efi_scratch.efi_pgt);
150
151 /*
152 * It can happen that the physical address of new_memmap lands in memory
153 * which is not mapped in the EFI page table. Therefore we need to go
154 * and ident-map those pages containing the map before calling
155 * phys_efi_set_virtual_address_map().
156 */
157 if (kernel_map_pages_in_pgd(pgd, pa_memmap, pa_memmap, num_pages, _PAGE_NX)) {
158 pr_err("Error ident-mapping new memmap (0x%lx)!\n", pa_memmap);
159 return 1;
160 }
161
162 efi_scratch.use_pgd = true;
163
Matt Fleming4f9dbcf2014-01-10 18:48:30 +0000164 /*
165 * When making calls to the firmware everything needs to be 1:1
166 * mapped and addressable with 32-bit pointers. Map the kernel
167 * text and allocate a new stack because we can't rely on the
168 * stack pointer being < 4GB.
169 */
170 if (!IS_ENABLED(CONFIG_EFI_MIXED))
Matt Fleming994448f2014-03-05 18:15:37 +0000171 return 0;
Matt Fleming4f9dbcf2014-01-10 18:48:30 +0000172
173 page = alloc_page(GFP_KERNEL|__GFP_DMA32);
174 if (!page)
175 panic("Unable to allocate EFI runtime stack < 4GB\n");
176
177 efi_scratch.phys_stack = virt_to_phys(page_address(page));
178 efi_scratch.phys_stack += PAGE_SIZE; /* stack grows down */
179
180 npages = (_end - _text) >> PAGE_SHIFT;
181 text = __pa(_text);
182
Matt Fleming994448f2014-03-05 18:15:37 +0000183 if (kernel_map_pages_in_pgd(pgd, text >> PAGE_SHIFT, text, npages, 0)) {
Matt Fleming4f9dbcf2014-01-10 18:48:30 +0000184 pr_err("Failed to map kernel text 1:1\n");
Matt Fleming994448f2014-03-05 18:15:37 +0000185 return 1;
Matt Fleming4f9dbcf2014-01-10 18:48:30 +0000186 }
Borislav Petkovb7b898a2014-01-18 12:48:17 +0100187
188 return 0;
189}
190
Mathias Krause4e78eb052014-09-07 19:42:17 +0200191void __init efi_cleanup_page_tables(unsigned long pa_memmap, unsigned num_pages)
Borislav Petkovb7b898a2014-01-18 12:48:17 +0100192{
193 pgd_t *pgd = (pgd_t *)__va(real_mode_header->trampoline_pgd);
194
195 kernel_unmap_pages_in_pgd(pgd, pa_memmap, num_pages);
Borislav Petkovd2f7cbe2013-10-31 17:25:08 +0100196}
197
198static void __init __map_region(efi_memory_desc_t *md, u64 va)
199{
200 pgd_t *pgd = (pgd_t *)__va(real_mode_header->trampoline_pgd);
Dave Young2da6e572013-12-20 18:02:13 +0800201 unsigned long pf = 0;
Borislav Petkovd2f7cbe2013-10-31 17:25:08 +0100202
203 if (!(md->attribute & EFI_MEMORY_WB))
204 pf |= _PAGE_PCD;
205
Borislav Petkovd2f7cbe2013-10-31 17:25:08 +0100206 if (kernel_map_pages_in_pgd(pgd, md->phys_addr, va, md->num_pages, pf))
207 pr_warn("Error mapping PA 0x%llx -> VA 0x%llx!\n",
208 md->phys_addr, va);
209}
210
211void __init efi_map_region(efi_memory_desc_t *md)
212{
213 unsigned long size = md->num_pages << PAGE_SHIFT;
214 u64 pa = md->phys_addr;
215
216 if (efi_enabled(EFI_OLD_MEMMAP))
217 return old_map_region(md);
218
219 /*
220 * Make sure the 1:1 mappings are present as a catch-all for b0rked
221 * firmware which doesn't update all internal pointers after switching
222 * to virtual mode and would otherwise crap on us.
223 */
224 __map_region(md, md->phys_addr);
225
Matt Fleming4f9dbcf2014-01-10 18:48:30 +0000226 /*
227 * Enforce the 1:1 mapping as the default virtual address when
228 * booting in EFI mixed mode, because even though we may be
229 * running a 64-bit kernel, the firmware may only be 32-bit.
230 */
231 if (!efi_is_native () && IS_ENABLED(CONFIG_EFI_MIXED)) {
232 md->virt_addr = md->phys_addr;
233 return;
234 }
235
Borislav Petkovd2f7cbe2013-10-31 17:25:08 +0100236 efi_va -= size;
237
238 /* Is PA 2M-aligned? */
239 if (!(pa & (PMD_SIZE - 1))) {
240 efi_va &= PMD_MASK;
241 } else {
242 u64 pa_offset = pa & (PMD_SIZE - 1);
243 u64 prev_va = efi_va;
244
245 /* get us the same offset within this 2M page */
246 efi_va = (efi_va & PMD_MASK) + pa_offset;
247
248 if (efi_va > prev_va)
249 efi_va -= PMD_SIZE;
250 }
251
252 if (efi_va < EFI_VA_END) {
253 pr_warn(FW_WARN "VA address range overflow!\n");
254 return;
255 }
256
257 /* Do the VA map */
258 __map_region(md, efi_va);
259 md->virt_addr = efi_va;
260}
261
Dave Young3b266492013-12-20 18:02:14 +0800262/*
263 * kexec kernel will use efi_map_region_fixed to map efi runtime memory ranges.
264 * md->virt_addr is the original virtual address which had been mapped in kexec
265 * 1st kernel.
266 */
267void __init efi_map_region_fixed(efi_memory_desc_t *md)
268{
269 __map_region(md, md->virt_addr);
270}
271
Keith Packarde1ad7832011-12-11 16:12:42 -0800272void __iomem *__init efi_ioremap(unsigned long phys_addr, unsigned long size,
Matt Fleming3e8fa262012-10-19 13:25:46 +0100273 u32 type, u64 attribute)
Keith Packarde1ad7832011-12-11 16:12:42 -0800274{
275 unsigned long last_map_pfn;
276
277 if (type == EFI_MEMORY_MAPPED_IO)
278 return ioremap(phys_addr, size);
279
280 last_map_pfn = init_memory_mapping(phys_addr, phys_addr + size);
281 if ((last_map_pfn << PAGE_SHIFT) < phys_addr + size) {
282 unsigned long top = last_map_pfn << PAGE_SHIFT;
Matt Fleming3e8fa262012-10-19 13:25:46 +0100283 efi_ioremap(top, size - (top - phys_addr), type, attribute);
Keith Packarde1ad7832011-12-11 16:12:42 -0800284 }
285
Matt Fleming3e8fa262012-10-19 13:25:46 +0100286 if (!(attribute & EFI_MEMORY_WB))
287 efi_memory_uc((u64)(unsigned long)__va(phys_addr), size);
288
Keith Packarde1ad7832011-12-11 16:12:42 -0800289 return (void __iomem *)__va(phys_addr);
290}
Dave Young1fec0532013-12-20 18:02:19 +0800291
292void __init parse_efi_setup(u64 phys_addr, u32 data_len)
293{
294 efi_setup = phys_addr + sizeof(struct setup_data);
Dave Young1fec0532013-12-20 18:02:19 +0800295}
Borislav Petkovc55d0162014-02-14 08:24:24 +0100296
297void __init efi_runtime_mkexec(void)
298{
299 if (!efi_enabled(EFI_OLD_MEMMAP))
300 return;
301
302 if (__supported_pte_mask & _PAGE_NX)
303 runtime_code_page_mkexec();
304}
Borislav Petkov11cc8512014-01-18 12:48:15 +0100305
306void __init efi_dump_pagetable(void)
307{
308#ifdef CONFIG_EFI_PGT_DUMP
309 pgd_t *pgd = (pgd_t *)__va(real_mode_header->trampoline_pgd);
310
311 ptdump_walk_pgd_level(NULL, pgd);
312#endif
313}
Matt Fleming994448f2014-03-05 18:15:37 +0000314
Matt Fleming4f9dbcf2014-01-10 18:48:30 +0000315#ifdef CONFIG_EFI_MIXED
316extern efi_status_t efi64_thunk(u32, ...);
317
318#define runtime_service32(func) \
319({ \
320 u32 table = (u32)(unsigned long)efi.systab; \
321 u32 *rt, *___f; \
322 \
323 rt = (u32 *)(table + offsetof(efi_system_table_32_t, runtime)); \
324 ___f = (u32 *)(*rt + offsetof(efi_runtime_services_32_t, func)); \
325 *___f; \
326})
327
328/*
329 * Switch to the EFI page tables early so that we can access the 1:1
330 * runtime services mappings which are not mapped in any other page
331 * tables. This function must be called before runtime_service32().
332 *
333 * Also, disable interrupts because the IDT points to 64-bit handlers,
334 * which aren't going to function correctly when we switch to 32-bit.
335 */
336#define efi_thunk(f, ...) \
337({ \
338 efi_status_t __s; \
339 unsigned long flags; \
340 u32 func; \
341 \
342 efi_sync_low_kernel_mappings(); \
343 local_irq_save(flags); \
344 \
345 efi_scratch.prev_cr3 = read_cr3(); \
346 write_cr3((unsigned long)efi_scratch.efi_pgt); \
347 __flush_tlb_all(); \
348 \
349 func = runtime_service32(f); \
350 __s = efi64_thunk(func, __VA_ARGS__); \
351 \
352 write_cr3(efi_scratch.prev_cr3); \
353 __flush_tlb_all(); \
354 local_irq_restore(flags); \
355 \
356 __s; \
357})
358
359efi_status_t efi_thunk_set_virtual_address_map(
360 void *phys_set_virtual_address_map,
361 unsigned long memory_map_size,
362 unsigned long descriptor_size,
363 u32 descriptor_version,
364 efi_memory_desc_t *virtual_map)
365{
366 efi_status_t status;
367 unsigned long flags;
368 u32 func;
369
370 efi_sync_low_kernel_mappings();
371 local_irq_save(flags);
372
373 efi_scratch.prev_cr3 = read_cr3();
374 write_cr3((unsigned long)efi_scratch.efi_pgt);
375 __flush_tlb_all();
376
377 func = (u32)(unsigned long)phys_set_virtual_address_map;
378 status = efi64_thunk(func, memory_map_size, descriptor_size,
379 descriptor_version, virtual_map);
380
381 write_cr3(efi_scratch.prev_cr3);
382 __flush_tlb_all();
383 local_irq_restore(flags);
384
385 return status;
386}
387
388static efi_status_t efi_thunk_get_time(efi_time_t *tm, efi_time_cap_t *tc)
389{
390 efi_status_t status;
391 u32 phys_tm, phys_tc;
392
393 spin_lock(&rtc_lock);
394
395 phys_tm = virt_to_phys(tm);
396 phys_tc = virt_to_phys(tc);
397
398 status = efi_thunk(get_time, phys_tm, phys_tc);
399
400 spin_unlock(&rtc_lock);
401
402 return status;
403}
404
405static efi_status_t efi_thunk_set_time(efi_time_t *tm)
406{
407 efi_status_t status;
408 u32 phys_tm;
409
410 spin_lock(&rtc_lock);
411
412 phys_tm = virt_to_phys(tm);
413
414 status = efi_thunk(set_time, phys_tm);
415
416 spin_unlock(&rtc_lock);
417
418 return status;
419}
420
421static efi_status_t
422efi_thunk_get_wakeup_time(efi_bool_t *enabled, efi_bool_t *pending,
423 efi_time_t *tm)
424{
425 efi_status_t status;
426 u32 phys_enabled, phys_pending, phys_tm;
427
428 spin_lock(&rtc_lock);
429
430 phys_enabled = virt_to_phys(enabled);
431 phys_pending = virt_to_phys(pending);
432 phys_tm = virt_to_phys(tm);
433
434 status = efi_thunk(get_wakeup_time, phys_enabled,
435 phys_pending, phys_tm);
436
437 spin_unlock(&rtc_lock);
438
439 return status;
440}
441
442static efi_status_t
443efi_thunk_set_wakeup_time(efi_bool_t enabled, efi_time_t *tm)
444{
445 efi_status_t status;
446 u32 phys_tm;
447
448 spin_lock(&rtc_lock);
449
450 phys_tm = virt_to_phys(tm);
451
452 status = efi_thunk(set_wakeup_time, enabled, phys_tm);
453
454 spin_unlock(&rtc_lock);
455
456 return status;
457}
458
459
460static efi_status_t
461efi_thunk_get_variable(efi_char16_t *name, efi_guid_t *vendor,
462 u32 *attr, unsigned long *data_size, void *data)
463{
464 efi_status_t status;
465 u32 phys_name, phys_vendor, phys_attr;
466 u32 phys_data_size, phys_data;
467
468 phys_data_size = virt_to_phys(data_size);
469 phys_vendor = virt_to_phys(vendor);
470 phys_name = virt_to_phys(name);
471 phys_attr = virt_to_phys(attr);
472 phys_data = virt_to_phys(data);
473
474 status = efi_thunk(get_variable, phys_name, phys_vendor,
475 phys_attr, phys_data_size, phys_data);
476
477 return status;
478}
479
480static efi_status_t
481efi_thunk_set_variable(efi_char16_t *name, efi_guid_t *vendor,
482 u32 attr, unsigned long data_size, void *data)
483{
484 u32 phys_name, phys_vendor, phys_data;
485 efi_status_t status;
486
487 phys_name = virt_to_phys(name);
488 phys_vendor = virt_to_phys(vendor);
489 phys_data = virt_to_phys(data);
490
491 /* If data_size is > sizeof(u32) we've got problems */
492 status = efi_thunk(set_variable, phys_name, phys_vendor,
493 attr, data_size, phys_data);
494
495 return status;
496}
497
498static efi_status_t
499efi_thunk_get_next_variable(unsigned long *name_size,
500 efi_char16_t *name,
501 efi_guid_t *vendor)
502{
503 efi_status_t status;
504 u32 phys_name_size, phys_name, phys_vendor;
505
506 phys_name_size = virt_to_phys(name_size);
507 phys_vendor = virt_to_phys(vendor);
508 phys_name = virt_to_phys(name);
509
510 status = efi_thunk(get_next_variable, phys_name_size,
511 phys_name, phys_vendor);
512
513 return status;
514}
515
516static efi_status_t
517efi_thunk_get_next_high_mono_count(u32 *count)
518{
519 efi_status_t status;
520 u32 phys_count;
521
522 phys_count = virt_to_phys(count);
523 status = efi_thunk(get_next_high_mono_count, phys_count);
524
525 return status;
526}
527
528static void
529efi_thunk_reset_system(int reset_type, efi_status_t status,
530 unsigned long data_size, efi_char16_t *data)
531{
532 u32 phys_data;
533
534 phys_data = virt_to_phys(data);
535
536 efi_thunk(reset_system, reset_type, status, data_size, phys_data);
537}
538
539static efi_status_t
540efi_thunk_update_capsule(efi_capsule_header_t **capsules,
541 unsigned long count, unsigned long sg_list)
542{
543 /*
544 * To properly support this function we would need to repackage
545 * 'capsules' because the firmware doesn't understand 64-bit
546 * pointers.
547 */
548 return EFI_UNSUPPORTED;
549}
550
551static efi_status_t
552efi_thunk_query_variable_info(u32 attr, u64 *storage_space,
553 u64 *remaining_space,
554 u64 *max_variable_size)
555{
556 efi_status_t status;
557 u32 phys_storage, phys_remaining, phys_max;
558
559 if (efi.runtime_version < EFI_2_00_SYSTEM_TABLE_REVISION)
560 return EFI_UNSUPPORTED;
561
562 phys_storage = virt_to_phys(storage_space);
563 phys_remaining = virt_to_phys(remaining_space);
564 phys_max = virt_to_phys(max_variable_size);
565
Matt Fleming9a110402014-03-16 17:46:46 +0000566 status = efi_thunk(query_variable_info, attr, phys_storage,
Matt Fleming4f9dbcf2014-01-10 18:48:30 +0000567 phys_remaining, phys_max);
568
569 return status;
570}
571
572static efi_status_t
573efi_thunk_query_capsule_caps(efi_capsule_header_t **capsules,
574 unsigned long count, u64 *max_size,
575 int *reset_type)
576{
577 /*
578 * To properly support this function we would need to repackage
579 * 'capsules' because the firmware doesn't understand 64-bit
580 * pointers.
581 */
582 return EFI_UNSUPPORTED;
583}
584
585void efi_thunk_runtime_setup(void)
586{
587 efi.get_time = efi_thunk_get_time;
588 efi.set_time = efi_thunk_set_time;
589 efi.get_wakeup_time = efi_thunk_get_wakeup_time;
590 efi.set_wakeup_time = efi_thunk_set_wakeup_time;
591 efi.get_variable = efi_thunk_get_variable;
592 efi.get_next_variable = efi_thunk_get_next_variable;
593 efi.set_variable = efi_thunk_set_variable;
594 efi.get_next_high_mono_count = efi_thunk_get_next_high_mono_count;
595 efi.reset_system = efi_thunk_reset_system;
596 efi.query_variable_info = efi_thunk_query_variable_info;
597 efi.update_capsule = efi_thunk_update_capsule;
598 efi.query_capsule_caps = efi_thunk_query_capsule_caps;
599}
600#endif /* CONFIG_EFI_MIXED */