i386/relocator: Add grub_relocator64_efi relocator
Add grub_relocator64_efi relocator. It will be used on EFI 64-bit platforms when multiboot2 compatible image requests MULTIBOOT_TAG_TYPE_EFI_BS. Relocator will set lower parts of %rax and %rbx accordingly to multiboot2 specification. On the other hand processor mode, just before jumping into loaded image, will be set accordingly to Unified Extensible Firmware Interface Specification, Version 2.4 Errata B, section 2.3.4, x64 Platforms, boot services. This way loaded image will be able to use EFI boot services without any issues. Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
This commit is contained in:
parent
e563928ba4
commit
9862b24121
8 changed files with 186 additions and 9 deletions
|
@ -73,6 +73,14 @@ VARIABLE(grub_relocator64_rsp)
|
|||
|
||||
movq %rax, %rsp
|
||||
|
||||
/*
|
||||
* Here is grub_relocator64_efi_start() entry point.
|
||||
* Following code is shared between grub_relocator64_efi_start()
|
||||
* and grub_relocator64_start().
|
||||
*
|
||||
* Think twice before changing anything below!!!
|
||||
*/
|
||||
VARIABLE(grub_relocator64_efi_start)
|
||||
/* mov imm64, %rax */
|
||||
.byte 0x48
|
||||
.byte 0xb8
|
||||
|
@ -120,6 +128,9 @@ LOCAL(jump_addr):
|
|||
VARIABLE(grub_relocator64_rip)
|
||||
.quad 0
|
||||
|
||||
/* Here grub_relocator64_efi_start() ends. Ufff... */
|
||||
VARIABLE(grub_relocator64_efi_end)
|
||||
|
||||
#ifndef __x86_64__
|
||||
.p2align 4
|
||||
LOCAL(gdt):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue