|
26 | 26 | * When booting in 64-bit mode on 32-bit EFI firmware, startup_64_mixed_mode() |
27 | 27 | * is the first thing that runs after switching to long mode. Depending on |
28 | 28 | * whether the EFI handover protocol or the compat entry point was used to |
29 | | - * enter the kernel, it will either branch to the 64-bit EFI handover |
30 | | - * entrypoint at offset 0x390 in the image, or to the 64-bit EFI PE/COFF |
| 29 | + * enter the kernel, it will either branch to the common 64-bit EFI stub |
| 30 | + * entrypoint efi_stub_entry() directly, or via the 64-bit EFI PE/COFF |
31 | 31 | * entrypoint efi_pe_entry(). In the former case, the bootloader must provide a |
32 | 32 | * struct bootparams pointer as the third argument, so the presence of such a |
33 | 33 | * pointer is used to disambiguate. |
|
37 | 37 | * | efi32_pe_entry |---->| | | +-----------+--+ |
38 | 38 | * +------------------+ | | +------+----------------+ | |
39 | 39 | * | startup_32 |---->| startup_64_mixed_mode | | |
40 | | - * +------------------+ | | +------+----------------+ V |
41 | | - * | efi32_stub_entry |---->| | | +------------------+ |
42 | | - * +------------------+ +------------+ +---->| efi64_stub_entry | |
43 | | - * +-------------+----+ |
44 | | - * +------------+ +----------+ | |
45 | | - * | startup_64 |<----| efi_main |<--------------+ |
46 | | - * +------------+ +----------+ |
| 40 | + * +------------------+ | | +------+----------------+ | |
| 41 | + * | efi32_stub_entry |---->| | | | |
| 42 | + * +------------------+ +------------+ | | |
| 43 | + * V | |
| 44 | + * +------------+ +----------------+ | |
| 45 | + * | startup_64 |<----| efi_stub_entry |<--------+ |
| 46 | + * +------------+ +----------------+ |
47 | 47 | */ |
48 | 48 | SYM_FUNC_START(startup_64_mixed_mode) |
49 | 49 | lea efi32_boot_args(%rip), %rdx |
50 | 50 | mov 0(%rdx), %edi |
51 | 51 | mov 4(%rdx), %esi |
| 52 | +#ifdef CONFIG_EFI_HANDOVER_PROTOCOL |
52 | 53 | mov 8(%rdx), %edx // saved bootparams pointer |
53 | 54 | test %edx, %edx |
54 | | - jnz efi64_stub_entry |
| 55 | + jnz efi_stub_entry |
| 56 | +#endif |
55 | 57 | /* |
56 | 58 | * efi_pe_entry uses MS calling convention, which requires 32 bytes of |
57 | 59 | * shadow space on the stack even if all arguments are passed in |
|
0 commit comments