/root/src/xen/xen/arch/x86/efi/stub.c
Line | Count | Source (jump to first uncovered line) |
1 | | #include <xen/efi.h> |
2 | | #include <xen/errno.h> |
3 | | #include <xen/init.h> |
4 | | #include <xen/lib.h> |
5 | | #include <asm/page.h> |
6 | | #include <asm/efibind.h> |
7 | | #include <efi/efidef.h> |
8 | | #include <efi/eficapsule.h> |
9 | | #include <efi/eficon.h> |
10 | | #include <efi/efidevp.h> |
11 | | #include <efi/efiapi.h> |
12 | | |
13 | | /* |
14 | | * Here we are in EFI stub. EFI calls are not supported due to lack |
15 | | * of relevant functionality in compiler and/or linker. |
16 | | * |
17 | | * efi_multiboot2() is an exception. Please look below for more details. |
18 | | */ |
19 | | |
20 | | void __init noreturn efi_multiboot2(EFI_HANDLE ImageHandle, |
21 | | EFI_SYSTEM_TABLE *SystemTable) |
22 | 0 | { |
23 | 0 | static const CHAR16 __initconst err[] = |
24 | 0 | L"Xen does not have EFI code build in!\r\nSystem halted!\r\n"; |
25 | 0 | SIMPLE_TEXT_OUTPUT_INTERFACE *StdErr; |
26 | 0 |
|
27 | 0 | StdErr = SystemTable->StdErr ? SystemTable->StdErr : SystemTable->ConOut; |
28 | 0 |
|
29 | 0 | /* |
30 | 0 | * Print error message and halt the system. |
31 | 0 | * |
32 | 0 | * We have to open code MS x64 calling convention |
33 | 0 | * in assembly because here this convention may |
34 | 0 | * not be directly supported by C compiler. |
35 | 0 | */ |
36 | 0 | asm volatile( |
37 | 0 | " call *%3 \n" |
38 | 0 | "0: hlt \n" |
39 | 0 | " jmp 0b \n" |
40 | 0 | : "+c" (StdErr), "=d" (StdErr) : "1" (err), "rm" (StdErr->OutputString) |
41 | 0 | : "rax", "r8", "r9", "r10", "r11", "memory"); |
42 | 0 |
|
43 | 0 | unreachable(); |
44 | 0 | } |
45 | | |
46 | | bool efi_enabled(unsigned int feature) |
47 | 20 | { |
48 | 20 | return false; |
49 | 20 | } |
50 | | |
51 | 1 | void __init efi_init_memory(void) { } |
52 | | |
53 | 2 | void efi_update_l4_pgtable(unsigned int l4idx, l4_pgentry_t l4e) { } |
54 | | |
55 | | bool efi_rs_using_pgtables(void) |
56 | 43.7M | { |
57 | 43.7M | return false; |
58 | 43.7M | } |
59 | | |
60 | | unsigned long efi_get_time(void) |
61 | 0 | { |
62 | 0 | BUG(); |
63 | 0 | return 0; |
64 | 0 | } |
65 | | |
66 | 0 | void efi_halt_system(void) { } |
67 | 0 | void efi_reset_system(bool warm) { } |
68 | | |
69 | | int efi_get_info(uint32_t idx, union xenpf_efi_info *info) |
70 | 0 | { |
71 | 0 | return -ENOSYS; |
72 | 0 | } |
73 | | |
74 | | int efi_compat_get_info(uint32_t idx, union compat_pf_efi_info *) |
75 | | __attribute__((__alias__("efi_get_info"))); |
76 | | |
77 | | int efi_runtime_call(struct xenpf_efi_runtime_call *op) |
78 | 0 | { |
79 | 0 | return -ENOSYS; |
80 | 0 | } |
81 | | |
82 | | int efi_compat_runtime_call(struct compat_pf_efi_runtime_call *) |
83 | | __attribute__((__alias__("efi_runtime_call"))); |