| @@ -15,10 +15,12 @@ · 14 unmodified lines |
| 15 | 15 | */ |
| 16 | 16 | |
| 17 | 17 | #include <linux/linkage.h> |
| 18 | +#include <asm/asm-offsets.h> |
| 18 | 19 | #include <asm/msr.h> |
| 19 | 20 | #include <asm/page_types.h> |
| 20 | 21 | #include <asm/processor-flags.h> |
| 21 | 22 | #include <asm/segment.h> |
| 23 | +#include <asm/setup.h> |
| 22 | 24 | |
| 23 | 25 | .code64 |
| 24 | 26 | .text |
| @@ -149,6 +151,7 @@ SYM_FUNC_END(__efi64_thunk) · 124 unmodified lines |
| 149 | 151 | SYM_FUNC_START(efi32_stub_entry) |
| 150 | 152 | call 1f |
| 151 | 153 | 1: popl %ecx |
| 154 | + leal (efi32_boot_args - 1b)(%ecx), %ebx |
| 152 | 155 | |
| 153 | 156 | /* Clear BSS */ |
| 154 | 157 | xorl %eax, %eax |
| @@ -163,6 +166,7 @@ SYM_FUNC_START(efi32_stub_entry) · 8 unmodified lines |
| 163 | 166 | popl %ecx |
| 164 | 167 | popl %edx |
| 165 | 168 | popl %esi |
| 169 | + movl %esi, 8(%ebx) |
| 166 | 170 | jmp efi32_entry |
| 167 | 171 | SYM_FUNC_END(efi32_stub_entry) |
| 168 | 172 | #endif |
| @@ -239,8 +243,6 @@ SYM_FUNC_END(efi_enter32) · 70 unmodified lines |
| 239 | 243 | * |
| 240 | 244 | * Arguments: %ecx image handle |
| 241 | 245 | * %edx EFI system table pointer |
| 242 | | − * %esi struct bootparams pointer (or NULL when not using |
| 243 | | − * the EFI handover protocol) |
| 244 | 246 | * |
| 245 | 247 | * Since this is the point of no return for ordinary execution, no registers |
| 246 | 248 | * are considered live except for the function parameters. [Note that the EFI |
| @@ -266,9 +268,18 @@ SYM_FUNC_START_LOCAL(efi32_entry) · 19 unmodified lines |
| 266 | 268 | leal (efi32_boot_args - 1b)(%ebx), %ebx |
| 267 | 269 | movl %ecx, 0(%ebx) |
| 268 | 270 | movl %edx, 4(%ebx) |
| 269 | | − movl %esi, 8(%ebx) |
| 270 | 271 | movb $0x0, 12(%ebx) // efi_is64 |
| 271 | 272 | |
| 273 | + /* |
| 274 | + * Allocate some memory for a temporary struct boot_params, which only |
| 275 | + * needs the minimal pieces that startup_32() relies on. |
| 276 | + */ |
| 277 | + subl $PARAM_SIZE, %esp |
| 278 | + movl %esp, %esi |
| 279 | + movl $PAGE_SIZE, BP_kernel_alignment(%esi) |
| 280 | + movl $_end - 1b, BP_init_size(%esi) |
| 281 | + subl $startup_32 - 1b, BP_init_size(%esi) |
| 282 | + |
| 272 | 283 | /* Disable paging */ |
| 273 | 284 | movl %cr0, %eax |
| 274 | 285 | btrl $X86_CR0_PG_BIT, %eax |
| @@ -294,8 +305,7 @@ SYM_FUNC_START(efi32_pe_entry) · 19 unmodified lines |
| 294 | 305 | |
| 295 | 306 | movl 8(%ebp), %ecx // image_handle |
| 296 | 307 | movl 12(%ebp), %edx // sys_table |
| 297 | | − xorl %esi, %esi |
| 298 | | − jmp efi32_entry // pass %ecx, %edx, %esi |
| 308 | + jmp efi32_entry // pass %ecx, %edx |
| 299 | 309 | // no other registers remain live |
| 300 | 310 | |
| 301 | 311 | 2: popl %edi // restore callee-save registers |