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