@@ -83,17 +83,10 @@ SYM_FUNC_START(__efi64_thunk)
push %rbp
push %rbx
- movl %ds, %eax
- push %rax
- movl %es, %eax
- push %rax
- movl %ss, %eax
- push %rax
-
/* Copy args passed on stack */
- movq 0x30(%rsp), %rbp
- movq 0x38(%rsp), %rbx
- movq 0x40(%rsp), %rax
+ movq 0x18(%rsp), %rbp
+ movq 0x20(%rsp), %rbx
+ movq 0x28(%rsp), %rax
/*
* Convert x86-64 ABI params to i386 ABI
@@ -135,14 +128,11 @@ SYM_FUNC_START(__efi64_thunk)
1: addq $64, %rsp
movq %rdi, %rax
- pop %rbx
- movl %ebx, %ss
- pop %rbx
- movl %ebx, %es
- pop %rbx
- movl %ebx, %ds
- /* Clear out 32-bit selector from FS and GS */
+ /* Clear out 32-bit segment selectors */
xorl %ebx, %ebx
+ movl %ebx, %ds
+ movl %ebx, %es
+ movl %ebx, %ss
movl %ebx, %fs
movl %ebx, %gs