aboutsummaryrefslogtreecommitdiff
path: root/stand/efi/loader/arch/amd64/amd64_tramp.S
diff options
context:
space:
mode:
authorRoger Pau Monné <royger@FreeBSD.org>2021-01-27 11:23:32 +0000
committerRoger Pau Monné <royger@FreeBSD.org>2021-02-16 14:26:11 +0000
commitadda2797eb2a29487fe26640a9c990fea7e6585d (patch)
treee3268ac02c268d67c305e8a053c62446863f0bf1 /stand/efi/loader/arch/amd64/amd64_tramp.S
parent7d3259775cb69f250df3e7fe51d6fff2283c6f20 (diff)
downloadsrc-adda2797eb2a29487fe26640a9c990fea7e6585d.tar.gz
src-adda2797eb2a29487fe26640a9c990fea7e6585d.zip
stand/multiboot2: add support for booting a Xen dom0 in UEFI mode
Add some basic multiboot2 infrastructure to the EFI loader in order to be capable of booting a FreeBSD/Xen dom0 when booted from UEFI. Only a very limited subset of the multiboot2 protocol is implemented in order to support enough to boot into Xen, the implementation doesn't intend to be a full multiboot2 capable implementation. Such multiboot2 functionality is hooked up into the amd64 EFI loader, which is the only architecture that supports Xen dom0 on FreeBSD. The options to boot a FreeBSD/Xen dom0 system are exactly the same as on BIOS, and requires setting the xen_kernel and xen_cmdline options in loader.conf. Sponsored by: Citrix Systems R&D Reviewed by: tsoome, imp Differential revision: https://reviews.freebsd.org/D28497
Diffstat (limited to 'stand/efi/loader/arch/amd64/amd64_tramp.S')
-rw-r--r--stand/efi/loader/arch/amd64/amd64_tramp.S12
1 files changed, 12 insertions, 0 deletions
diff --git a/stand/efi/loader/arch/amd64/amd64_tramp.S b/stand/efi/loader/arch/amd64/amd64_tramp.S
index c102d9243589..877705407f92 100644
--- a/stand/efi/loader/arch/amd64/amd64_tramp.S
+++ b/stand/efi/loader/arch/amd64/amd64_tramp.S
@@ -30,6 +30,9 @@
#include <machine/asmacros.h>
+#define ASM_FILE
+#include "multiboot2.h"
+
.text
.globl amd64_tramp
@@ -58,6 +61,15 @@ amd64_tramp:
ALIGN_TEXT
amd64_tramp_end:
+/* void multiboot2_exec(uint64_t entry, uint64_t multiboot_info, uint64_t stack) */
+ .globl multiboot2_exec
+multiboot2_exec:
+ movq %rdx,%rsp
+ pushq %rdi
+ movq %rsi,%rbx
+ movq $MULTIBOOT2_BOOTLOADER_MAGIC,%rax
+ ret
+
.data
.globl amd64_tramp_size
amd64_tramp_size: