From ebeb14c813ca3a6f60818a181ef0a37ac9f3477b Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Fri, 1 Sep 2017 13:24:43 +0200 Subject: [PATCH] sel4: propagate ACPI RSDP via extra bootinfo Issue #2242 --- repos/base-sel4/patches/acpi_bootinfo.patch | 146 -------- repos/base-sel4/patches/uefi_mbi2.patch | 381 +++++++++++++------- 2 files changed, 249 insertions(+), 278 deletions(-) delete mode 100644 repos/base-sel4/patches/acpi_bootinfo.patch diff --git a/repos/base-sel4/patches/acpi_bootinfo.patch b/repos/base-sel4/patches/acpi_bootinfo.patch deleted file mode 100644 index 8a2dba64010..00000000000 --- a/repos/base-sel4/patches/acpi_bootinfo.patch +++ /dev/null @@ -1,146 +0,0 @@ ---- src/kernel/sel4/libsel4/include/sel4/bootinfo_types.h -+++ src/kernel/sel4/libsel4/include/sel4/bootinfo_types.h -@@ -65,7 +65,12 @@ - seL4_SlotRegion extraBIPages; /* caps for any pages used to back the additional bootinfo information */ - seL4_Uint8 initThreadCNodeSizeBits; /* initial thread's root CNode size (2^n slots) */ - seL4_Domain initThreadDomain; /* Initial thread's domain ID */ -- seL4_Word archInfo; /* tsc freq on x86, unused on arm */ -+ struct { -+ seL4_Word tsc; /* tsc freq on x86, unused on arm */ -+ seL4_Word revision; -+ seL4_Word rsdt; -+ unsigned long long xsdt; -+ } archInfo; - seL4_SlotRegion untyped; /* untyped-object caps (untyped caps) */ - seL4_UntypedDesc untypedList[CONFIG_MAX_NUM_BOOTINFO_UNTYPED_CAPS]; /* information about each untyped */ - /* the untypedList should be the last entry in this struct, in order ---- src/kernel/sel4/include/arch/x86/arch/kernel/boot.h -+++ src/kernel/sel4/include/arch/x86/arch/kernel/boot.h -@@ -41,7 +41,8 @@ - paddr_t* drhu_list, - acpi_rmrr_list_t *rmrr_list, - seL4_X86_BootInfo_VBE *vbe, -- seL4_X86_BootInfo_mmap_t *mb_mmap -+ seL4_X86_BootInfo_mmap_t *mb_mmap, -+ acpi_info_t* acpi_info - ); - - bool_t init_cpu( ---- src/kernel/sel4/src/plat/pc99/machine/acpi.c -+++ src/kernel/sel4/src/plat/pc99/machine/acpi.c -@@ -30,10 +30,10 @@ - uint8_t revision; - uint32_t rsdt_address; - uint32_t length; -- uint32_t xsdt_address[2]; -+ uint64_t xsdt_address; - uint8_t extended_checksum; - char reserved[3]; --} acpi_rsdp_t; -+} PACKED acpi_rsdp_t; - compile_assert(acpi_rsdp_packed, sizeof(acpi_rsdp_t) == 36) - - /* DMA Remapping Reporting Table */ -@@ -245,7 +245,7 @@ - } - - BOOT_CODE acpi_rsdt_t* --acpi_init(void) -+acpi_init(acpi_info_t *acpi_info) - { - acpi_rsdp_t* acpi_rsdp = acpi_get_rsdp(); - acpi_rsdt_t* acpi_rsdt; -@@ -259,6 +259,12 @@ - acpi_rsdp = acpi_table_init(acpi_rsdp, ACPI_RSDP); - printf("ACPI: RSDP vaddr=%p\n", acpi_rsdp); - -+ if (acpi_info) { -+ acpi_info->revision = acpi_rsdp->revision; -+ acpi_info->phys_rsdt = acpi_rsdp->rsdt_address; -+ acpi_info->phys_xsdt = acpi_rsdp->xsdt_address; -+ } -+ - acpi_rsdt = (acpi_rsdt_t*)(word_t)acpi_rsdp->rsdt_address; - printf("ACPI: RSDT paddr=%p\n", acpi_rsdt); - acpi_rsdt_mapped = (acpi_rsdt_t*)acpi_table_init(acpi_rsdt, ACPI_RSDT); ---- src/kernel/sel4/include/plat/pc99/plat/machine/acpi.h -+++ src/kernel/sel4/include/plat/pc99/plat/machine/acpi.h -@@ -34,7 +34,13 @@ - uint32_t entry[1]; - } PACKED acpi_rsdt_t; - --acpi_rsdt_t* acpi_init(void); -+typedef struct acpi_info_t { -+ uint32_t revision; -+ uint32_t phys_rsdt; -+ uint64_t phys_xsdt; -+} acpi_info_t; -+ -+acpi_rsdt_t * acpi_init(acpi_info_t *); - - uint32_t acpi_madt_scan( - acpi_rsdt_t* acpi_rsdt, ---- src/kernel/sel4/src/arch/x86/kernel/boot_sys.c -+++ src/kernel/sel4/src/arch/x86/kernel/boot_sys.c -@@ -187,7 +187,7 @@ - } - - static BOOT_CODE bool_t --try_boot_sys_node(cpu_id_t cpu_id) -+try_boot_sys_node(cpu_id_t cpu_id, acpi_info_t* acpi_info) - { - p_region_t boot_mem_reuse_p_reg; - -@@ -224,7 +224,8 @@ - boot_state.drhu_list, - &boot_state.rmrr_list, - &boot_state.vbe_info, -- &boot_state.mb_mmap_info -+ &boot_state.mb_mmap_info, -+ acpi_info - )) { - return false; - } -@@ -487,7 +488,8 @@ - } - - /* get ACPI root table */ -- acpi_rsdt = acpi_init(); -+ acpi_info_t acpi_info = { 0, 0, 0 }; -+ acpi_rsdt = acpi_init(&acpi_info); - if (!acpi_rsdt) { - return false; - } -@@ -597,7 +599,7 @@ - ksNumCPUs = boot_state.num_cpus; - - printf("Starting node #0 with APIC ID %lu\n", boot_state.cpus[0]); -- if (!try_boot_sys_node(boot_state.cpus[0])) { -+ if (!try_boot_sys_node(boot_state.cpus[0], &acpi_info)) { - return false; - } - ---- src/kernel/sel4/src/arch/x86/kernel/boot.c -+++ src/kernel/sel4/src/arch/x86/kernel/boot.c -@@ -250,7 +250,8 @@ - paddr_t* drhu_list, - acpi_rmrr_list_t *rmrr_list, - seL4_X86_BootInfo_VBE *vbe, -- seL4_X86_BootInfo_mmap_t *mb_mmap -+ seL4_X86_BootInfo_mmap_t *mb_mmap, -+ acpi_info_t* acpi_info - ) - { - cap_t root_cnode_cap; -@@ -405,7 +406,10 @@ - } - write_it_asid_pool(it_ap_cap, it_vspace_cap); - -- ndks_boot.bi_frame->archInfo = tsc_init(); -+ ndks_boot.bi_frame->archInfo.tsc = tsc_init(); -+ ndks_boot.bi_frame->archInfo.revision = acpi_info->revision; -+ ndks_boot.bi_frame->archInfo.rsdt = acpi_info->phys_rsdt; -+ ndks_boot.bi_frame->archInfo.xsdt = acpi_info->phys_xsdt; - - /* create the idle thread */ - if (!create_idle_thread()) { diff --git a/repos/base-sel4/patches/uefi_mbi2.patch b/repos/base-sel4/patches/uefi_mbi2.patch index 0a07c649546..a2b63fbdba7 100644 --- a/repos/base-sel4/patches/uefi_mbi2.patch +++ b/repos/base-sel4/patches/uefi_mbi2.patch @@ -1,6 +1,180 @@ +--- src/kernel/sel4/src/arch/x86/multiboot.S ++++ src/kernel/sel4/src/arch/x86/multiboot.S +@@ -62,3 +62,15 @@ + .long CONFIG_MULTIBOOT_GRAPHICS_MODE_WIDTH /*width*/ + .long CONFIG_MULTIBOOT_GRAPHICS_MODE_HEIGHT /*height*/ + .long CONFIG_MULTIBOOT_GRAPHICS_MODE_DEPTH /*depth*/ ++ .align 8 ++ __mbi2_start: ++ /* magic multi-boot 2 header */ ++ .long 0xe85250d6 ++ .long 0x0 ++ .long (__mbi2_end - __mbi2_start) ++ .long -(0xe85250d6 + (__mbi2_end - __mbi2_start)) ++ /* end tag - type, flags, size */ ++ .word 0x0 ++ .word 0x0 ++ .long 0x8 ++ __mbi2_end: +--- src/kernel/sel4/include/arch/x86/arch/kernel/multiboot2.h ++++ src/kernel/sel4/include/arch/x86/arch/kernel/multiboot2.h +@@ -0,0 +1,52 @@ ++/* ++ * Copyright 2017, Genode Labs GmbH ++ * ++ * This software may be distributed and modified according to the terms of ++ * the GNU General Public License version 2. Note that NO WARRANTY is provided. ++ * See "LICENSE_GPLv2.txt" for details. ++ * ++ */ ++ ++#ifndef __ARCH_KERNEL_MULTIBOOT2_H ++#define __ARCH_KERNEL_MULTIBOOT2_H ++ ++#define MULTIBOOT2_MAGIC 0x36d76289 ++ ++#include ++ ++typedef struct multiboot2_header ++{ ++ uint32_t total_size; ++ uint32_t unknown; ++} PACKED multiboot2_header_t; ++ ++typedef struct multiboot2_tag ++{ ++ uint32_t type; ++ uint32_t size; ++} PACKED multiboot2_tag_t; ++ ++typedef struct multiboot2_memory ++{ ++ uint64_t addr; ++ uint64_t size; ++ uint32_t type; ++ uint32_t reserved; ++} PACKED multiboot2_memory_t; ++ ++typedef struct multiboot2_module ++{ ++ uint32_t start; ++ uint32_t end; ++ char string [0]; ++} PACKED multiboot2_module_t; ++ ++enum multiboot2_tags { ++ MULTIBOOT2_TAG_END = 0, ++ MULTIBOOT2_TAG_CMDLINE = 1, ++ MULTIBOOT2_TAG_MODULE = 3, ++ MULTIBOOT2_TAG_MEMORY = 6, ++ MULTIBOOT2_TAG_ACPI = 15, ++}; ++ ++#endif +--- src/kernel/sel4/include/arch/x86/arch/kernel/boot.h ++++ src/kernel/sel4/include/arch/x86/arch/kernel/boot.h +@@ -40,6 +40,7 @@ + uint32_t num_drhu, + paddr_t* drhu_list, + acpi_rmrr_list_t *rmrr_list, ++ acpi_rsdp_t *acpi_rsdp, + seL4_X86_BootInfo_VBE *vbe, + seL4_X86_BootInfo_mmap_t *mb_mmap + ); +--- src/kernel/sel4/include/arch/x86/arch/kernel/boot_sys.h ++++ src/kernel/sel4/include/arch/x86/arch/kernel/boot_sys.h +@@ -12,10 +12,11 @@ + #define __ARCH_KERNEL_BOOT_SYS_H + + #include ++#include + + void boot_sys( + unsigned long multiboot_magic, +- multiboot_info_t* mbi ++ void * multiboot + ); + + #endif +--- src/kernel/sel4/include/plat/pc99/plat/machine/acpi.h ++++ src/kernel/sel4/include/plat/pc99/plat/machine/acpi.h +@@ -28,13 +28,27 @@ + uint32_t creater_revision; + } PACKED acpi_header_t; + ++/* Root System Descriptor Pointer */ ++typedef struct acpi_rsdp { ++ char signature[8]; ++ uint8_t checksum; ++ char oem_id[6]; ++ uint8_t revision; ++ uint32_t rsdt_address; ++ uint32_t length; ++ uint64_t xsdt_address; ++ uint8_t extended_checksum; ++ char reserved[3]; ++} PACKED acpi_rsdp_t; ++compile_assert(acpi_rsdp_packed, sizeof(acpi_rsdp_t) == 36) ++ + /* Root System Descriptor Table */ + typedef struct acpi_rsdt { + acpi_header_t header; + uint32_t entry[1]; + } PACKED acpi_rsdt_t; + +-acpi_rsdt_t* acpi_init(void); ++acpi_rsdt_t* acpi_init(acpi_rsdp_t const * rsdp_ptr); + + uint32_t acpi_madt_scan( + acpi_rsdt_t* acpi_rsdt, +--- src/kernel/sel4/libsel4/include/sel4/bootinfo_types.h ++++ src/kernel/sel4/libsel4/include/sel4/bootinfo_types.h +@@ -87,5 +87,6 @@ + #define SEL4_BOOTINFO_HEADER_PADDING 0 + #define SEL4_BOOTINFO_HEADER_X86_VBE 1 + #define SEL4_BOOTINFO_HEADER_X86_MBMMAP 2 ++#define SEL4_BOOTINFO_HEADER_X86_ACPI_RSDP 3 + + #endif // __LIBSEL4_BOOTINFO_TYPES_H +--- src/kernel/sel4/src/arch/x86/kernel/boot.c ++++ src/kernel/sel4/src/arch/x86/kernel/boot.c +@@ -249,6 +249,7 @@ + uint32_t num_drhu, + paddr_t* drhu_list, + acpi_rmrr_list_t *rmrr_list, ++ acpi_rsdp_t *acpi_rsdp, + seL4_X86_BootInfo_VBE *vbe, + seL4_X86_BootInfo_mmap_t *mb_mmap + ) +@@ -337,6 +338,17 @@ + extra_bi_offset += sizeof(seL4_X86_BootInfo_VBE); + } + ++ /* populate acpi rsdp block */ ++ if (acpi_rsdp) { ++ seL4_BootInfoHeader header; ++ header.id = SEL4_BOOTINFO_HEADER_X86_ACPI_RSDP; ++ header.len = sizeof(header) + sizeof(*acpi_rsdp); ++ memcpy((void*)(extra_bi_region.start + extra_bi_offset), &header, sizeof(header)); ++ extra_bi_offset += sizeof(header); ++ memcpy((void*)(extra_bi_region.start + extra_bi_offset), acpi_rsdp, sizeof(*acpi_rsdp)); ++ extra_bi_offset += sizeof(*acpi_rsdp); ++ } ++ + /* populate multiboot mmap block */ + mb_mmap->header.id = SEL4_BOOTINFO_HEADER_X86_MBMMAP; + mb_mmap->header.len = mb_mmap_size; --- src/kernel/sel4/src/arch/x86/kernel/boot_sys.c +++ src/kernel/sel4/src/arch/x86/kernel/boot_sys.c -@@ -113,11 +113,11 @@ +@@ -62,6 +62,7 @@ + uint32_t num_drhu; /* number of IOMMUs */ + paddr_t drhu_list[MAX_NUM_DRHU]; /* list of physical addresses of the IOMMUs */ + acpi_rmrr_list_t rmrr_list; ++ acpi_rsdp_t acpi_rsdp; + uint32_t num_cpus; /* number of detected cpus */ + cpu_id_t cpus[CONFIG_MAX_NUM_NODES]; + mem_p_regs_t mem_p_regs; /* physical memory regions */ +@@ -113,11 +114,11 @@ } BOOT_CODE static paddr_t @@ -14,7 +188,15 @@ if (!elf_checkFile(elf_file)) { printf("Boot module does not contain a valid ELF image\n"); -@@ -378,8 +378,13 @@ +@@ -223,6 +224,7 @@ + boot_state.num_drhu, + boot_state.drhu_list, + &boot_state.rmrr_list, ++ &boot_state.acpi_rsdp, + &boot_state.vbe_info, + &boot_state.mb_mmap_info + )) { +@@ -377,8 +379,12 @@ } static BOOT_CODE bool_t @@ -22,15 +204,14 @@ - unsigned long multiboot_magic, +try_load_boot_module( + paddr_t mods_end_paddr, /* physical address where boot modules end */ -+ paddr_t boot_module_start, /* physical address of first boot module */ -+ acpi_info_t *acpi_info); ++ paddr_t boot_module_start); /* physical address of first boot module */ + +static BOOT_CODE bool_t +try_boot_sys_mbi1( multiboot_info_t* mbi ) { -@@ -387,15 +392,9 @@ +@@ -386,15 +392,9 @@ acpi_rsdt_t* acpi_rsdt; /* physical address of ACPI root */ paddr_t mods_end_paddr; /* physical address where boot modules end */ @@ -46,28 +227,29 @@ cmdline_parse((const char *)(word_t)mbi->part1.cmdline, &cmdline_opt); if ((mbi->part1.flags & MULTIBOOT_INFO_MEM_FLAG) == 0) { -@@ -489,7 +488,7 @@ +@@ -486,8 +486,8 @@ + pic_disable(); + } - /* get ACPI root table */ - acpi_info_t acpi_info = { 0, 0, 0 }; -- acpi_rsdt = acpi_init(&acpi_info); -+ acpi_rsdt = acpi_init(&acpi_info, 0); +- /* get ACPI root table */ +- acpi_rsdt = acpi_init(); ++ /* get ACPI root table - we have no ACPI RSDP pointer */ ++ acpi_rsdt = acpi_init(0); if (!acpi_rsdt) { return false; } -@@ -561,13 +560,27 @@ +@@ -559,13 +559,26 @@ mods_end_paddr = modules[i].end; } } + -+ return try_load_boot_module(mods_end_paddr, modules->start, &acpi_info); ++ return try_load_boot_module(mods_end_paddr, modules->start); +} + +static BOOT_CODE bool_t +try_load_boot_module( + paddr_t mods_end_paddr, /* physical address where boot modules end */ -+ paddr_t boot_module_start, /* physical address of first boot module */ -+ acpi_info_t *acpi_info ++ paddr_t boot_module_start /* physical address of first boot module */ +) +{ + p_region_t ui_p_regs; @@ -84,16 +266,7 @@ if (!load_paddr) { return false; } -@@ -599,7 +612,7 @@ - ksNumCPUs = boot_state.num_cpus; - - printf("Starting node #0 with APIC ID %lu\n", boot_state.cpus[0]); -- if (!try_boot_sys_node(boot_state.cpus[0], &acpi_info)) { -+ if (!try_boot_sys_node(boot_state.cpus[0], acpi_info)) { - return false; - } - -@@ -619,13 +632,208 @@ +@@ -617,13 +630,210 @@ return true; } @@ -112,7 +285,6 @@ + uint32_t mem_lower = 0; + acpi_rsdt_t* acpi_rsdt = 0; /* physical address of ACPI root */ + paddr_t mods_end_paddr = 0; /* physical address where boot modules end */ -+ char * acpi_rsdp = 0; + int mod_count = 0; + word_t boot_module_start = 0; + word_t boot_module_size = 0; @@ -136,7 +308,11 @@ + cmdline_parse(cmdline, &cmdline_opt); + } else + if (tag->type == MULTIBOOT2_TAG_ACPI) { -+ acpi_rsdp = (char *)behind_tag; ++ if (sizeof(boot_state.acpi_rsdp) != tag->size - sizeof(*tag)) { ++ printf("sizeof ACPI RSDP unexpected %ld!=%lu\n", sizeof(boot_state.acpi_rsdp), tag->size - sizeof(*tag)); ++ return false; ++ } ++ memcpy(&boot_state.acpi_rsdp, (void *)behind_tag, sizeof(boot_state.acpi_rsdp)); + } else + if (tag->type == MULTIBOOT2_TAG_MODULE) { + multiboot2_module_t const * module = (multiboot2_module_t const *)behind_tag; @@ -224,8 +400,7 @@ + pic_disable(); + } + -+ acpi_info_t acpi_info = { 0, 0, 0 }; -+ acpi_rsdt = acpi_init(&acpi_info, acpi_rsdp); ++ acpi_rsdt = acpi_init(&boot_state.acpi_rsdp); //&boot_state.acpi_rsdp); + if (!acpi_rsdt) { + return false; + } @@ -279,7 +454,7 @@ + mods_end_paddr = ROUND_UP(mods_end_paddr, PAGE_BITS); + } + -+ return try_load_boot_module(mods_end_paddr, boot_module_start, &acpi_info); ++ return try_load_boot_module(mods_end_paddr, boot_module_start); +} + BOOT_CODE VISIBLE void @@ -305,131 +480,73 @@ if (!result) { fail("boot_sys failed for some reason :(\n"); ---- src/kernel/sel4/include/arch/x86/arch/kernel/boot_sys.h -+++ src/kernel/sel4/include/arch/x86/arch/kernel/boot_sys.h -@@ -12,10 +12,11 @@ - #define __ARCH_KERNEL_BOOT_SYS_H +--- src/kernel/sel4/src/plat/pc99/machine/acpi.c ++++ src/kernel/sel4/src/plat/pc99/machine/acpi.c +@@ -22,20 +22,6 @@ + ACPI_RSDT + }; - #include -+#include +-/* Root System Descriptor Pointer */ +-typedef struct acpi_rsdp { +- char signature[8]; +- uint8_t checksum; +- char oem_id[6]; +- uint8_t revision; +- uint32_t rsdt_address; +- uint32_t length; +- uint32_t xsdt_address[2]; +- uint8_t extended_checksum; +- char reserved[3]; +-} acpi_rsdp_t; +-compile_assert(acpi_rsdp_packed, sizeof(acpi_rsdp_t) == 36) +- + /* DMA Remapping Reporting Table */ + typedef struct acpi_dmar { + acpi_header_t header; +@@ -177,7 +163,7 @@ + const char acpi_str_dmar[] = {'D', 'M', 'A', 'R', 0}; - void boot_sys( - unsigned long multiboot_magic, -- multiboot_info_t* mbi -+ void * multiboot - ); + BOOT_CODE static uint8_t +-acpi_calc_checksum(char* start, uint32_t length) ++acpi_calc_checksum(char const* start, uint32_t length) + { + uint8_t checksum = 0; - #endif ---- src/kernel/sel4/src/plat/pc99/machine/acpi.c -+++ src/kernel/sel4/src/plat/pc99/machine/acpi.c -@@ -190,8 +190,13 @@ +@@ -190,8 +176,13 @@ } BOOT_CODE static acpi_rsdp_t* -acpi_get_rsdp(void) -+acpi_get_rsdp(char *rsdp_by_bootloader) ++acpi_get_rsdp(acpi_rsdp_t const *rsdp_by_bootloader) { + if (rsdp_by_bootloader) { -+ if (acpi_calc_checksum(rsdp_by_bootloader, 20) == 0) ++ if (acpi_calc_checksum((char const *)rsdp_by_bootloader, 20) == 0) + return (acpi_rsdp_t*)rsdp_by_bootloader; + } + char* addr; for (addr = (char*)BIOS_PADDR_START; addr < (char*)BIOS_PADDR_END; addr += 16) { -@@ -245,9 +250,9 @@ +@@ -245,9 +236,9 @@ } BOOT_CODE acpi_rsdt_t* --acpi_init(acpi_info_t *acpi_info) -+acpi_init(acpi_info_t *acpi_info, char * rsdp_ptr) +-acpi_init(void) ++acpi_init(acpi_rsdp_t const * rsdp_ptr) { - acpi_rsdp_t* acpi_rsdp = acpi_get_rsdp(); + acpi_rsdp_t* acpi_rsdp = acpi_get_rsdp(rsdp_ptr); acpi_rsdt_t* acpi_rsdt; acpi_rsdt_t* acpi_rsdt_mapped; ---- src/kernel/sel4/include/plat/pc99/plat/machine/acpi.h -+++ src/kernel/sel4/include/plat/pc99/plat/machine/acpi.h -@@ -40,7 +40,7 @@ - uint64_t phys_xsdt; - } acpi_info_t; - --acpi_rsdt_t * acpi_init(acpi_info_t *); -+acpi_rsdt_t * acpi_init(acpi_info_t *, char * rsdp_ptr); +@@ -256,7 +247,9 @@ + return NULL; + } + printf("ACPI: RSDP paddr=%p\n", acpi_rsdp); +- acpi_rsdp = acpi_table_init(acpi_rsdp, ACPI_RSDP); ++ /* if acpi rsdp_ptr is set, it points to a copy already accessible by kernel */ ++ if (!rsdp_ptr) ++ acpi_rsdp = acpi_table_init(acpi_rsdp, ACPI_RSDP); + printf("ACPI: RSDP vaddr=%p\n", acpi_rsdp); - uint32_t acpi_madt_scan( - acpi_rsdt_t* acpi_rsdt, ---- src/kernel/sel4/src/arch/x86/multiboot.S -+++ src/kernel/sel4/src/arch/x86/multiboot.S -@@ -62,3 +62,15 @@ - .long CONFIG_MULTIBOOT_GRAPHICS_MODE_WIDTH /*width*/ - .long CONFIG_MULTIBOOT_GRAPHICS_MODE_HEIGHT /*height*/ - .long CONFIG_MULTIBOOT_GRAPHICS_MODE_DEPTH /*depth*/ -+ .align 8 -+ __mbi2_start: -+ /* magic multi-boot 2 header */ -+ .long 0xe85250d6 -+ .long 0x0 -+ .long (__mbi2_end - __mbi2_start) -+ .long -(0xe85250d6 + (__mbi2_end - __mbi2_start)) -+ /* end tag - type, flags, size */ -+ .word 0x0 -+ .word 0x0 -+ .long 0x8 -+ __mbi2_end: ---- src/kernel/sel4/include/arch/x86/arch/kernel/multiboot2.h -+++ src/kernel/sel4/include/arch/x86/arch/kernel/multiboot2.h -@@ -0,0 +1,52 @@ -+/* -+ * Copyright 2017, Genode Labs GmbH -+ * -+ * This software may be distributed and modified according to the terms of -+ * the GNU General Public License version 2. Note that NO WARRANTY is provided. -+ * See "LICENSE_GPLv2.txt" for details. -+ * -+ */ -+ -+#ifndef __ARCH_KERNEL_MULTIBOOT2_H -+#define __ARCH_KERNEL_MULTIBOOT2_H -+ -+#define MULTIBOOT2_MAGIC 0x36d76289 -+ -+#include -+ -+typedef struct multiboot2_header -+{ -+ uint32_t total_size; -+ uint32_t unknown; -+} PACKED multiboot2_header_t; -+ -+typedef struct multiboot2_tag -+{ -+ uint32_t type; -+ uint32_t size; -+} PACKED multiboot2_tag_t; -+ -+typedef struct multiboot2_memory -+{ -+ uint64_t addr; -+ uint64_t size; -+ uint32_t type; -+ uint32_t reserved; -+} PACKED multiboot2_memory_t; -+ -+typedef struct multiboot2_module -+{ -+ uint32_t start; -+ uint32_t end; -+ char string [0]; -+} PACKED multiboot2_module_t; -+ -+enum multiboot2_tags { -+ MULTIBOOT2_TAG_END = 0, -+ MULTIBOOT2_TAG_CMDLINE = 1, -+ MULTIBOOT2_TAG_MODULE = 3, -+ MULTIBOOT2_TAG_MEMORY = 6, -+ MULTIBOOT2_TAG_ACPI = 15, -+}; -+ -+#endif + acpi_rsdt = (acpi_rsdt_t*)(word_t)acpi_rsdp->rsdt_address;