summaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/compressed/efi_stub_64.S
blob: 7ff3632806b18ec9a48bd0ae88bdc7a9e9dbe091 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <asm/segment.h>
#include <asm/msr.h>
#include <asm/processor-flags.h>

#include "../../platform/efi/efi_stub_64.S"

#ifdef CONFIG_EFI_MIXED
	.code64
	.text
ENTRY(efi64_thunk)
	push	%rbp
	push	%rbx

	subq	$16, %rsp
	leaq	efi_exit32(%rip), %rax
	movl	%eax, 8(%rsp)
	leaq	efi_gdt64(%rip), %rax
	movl	%eax, 4(%rsp)
	movl	%eax, 2(%rax)		/* Fixup the gdt base address */
	leaq	efi32_boot_gdt(%rip), %rax
	movl	%eax, (%rsp)

	call	__efi64_thunk

	addq	$16, %rsp
	pop	%rbx
	pop	%rbp
	ret
ENDPROC(efi64_thunk)
#endif /* CONFIG_EFI_MIXED */