From 023977fc4bbe5478fefa132d5453fbdf2aafdb0c Mon Sep 17 00:00:00 2001 From: Alexander Boettcher Date: Thu, 5 Oct 2017 13:43:06 +1100 Subject: [PATCH] x86: Provide copy of RSDP in bootinfo This gives a rootserver a way to find the ACPI tables in cases where there is no BIOS region to scan for an RSDP. --- include/arch/x86/arch/kernel/boot.h | 1 + libsel4/include/sel4/bootinfo_types.h | 1 + src/arch/x86/kernel/boot.c | 12 ++++++++++++ src/arch/x86/kernel/boot_sys.c | 1 + 4 files changed, 15 insertions(+) diff --git a/include/arch/x86/arch/kernel/boot.h b/include/arch/x86/arch/kernel/boot.h index 5b73c802a..825f256cb 100644 --- a/include/arch/x86/arch/kernel/boot.h +++ b/include/arch/x86/arch/kernel/boot.h @@ -40,6 +40,7 @@ bool_t init_sys_state( 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 ); diff --git a/libsel4/include/sel4/bootinfo_types.h b/libsel4/include/sel4/bootinfo_types.h index 6d97b800e..35edf8d5c 100644 --- a/libsel4/include/sel4/bootinfo_types.h +++ b/libsel4/include/sel4/bootinfo_types.h @@ -87,5 +87,6 @@ typedef struct { #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 diff --git a/src/arch/x86/kernel/boot.c b/src/arch/x86/kernel/boot.c index 3ed494a20..82cdaec33 100644 --- a/src/arch/x86/kernel/boot.c +++ b/src/arch/x86/kernel/boot.c @@ -251,6 +251,7 @@ init_sys_state( 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 ) @@ -341,6 +342,17 @@ init_sys_state( 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; diff --git a/src/arch/x86/kernel/boot_sys.c b/src/arch/x86/kernel/boot_sys.c index d255a9571..8f7a40405 100644 --- a/src/arch/x86/kernel/boot_sys.c +++ b/src/arch/x86/kernel/boot_sys.c @@ -224,6 +224,7 @@ try_boot_sys_node(cpu_id_t cpu_id) 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 )) {