diff --git a/headers/private/kernel/boot/platform/efi/arch_start.h b/headers/private/kernel/boot/platform/efi/arch_start.h index 1c45176055..eebebdf177 100644 --- a/headers/private/kernel/boot/platform/efi/arch_start.h +++ b/headers/private/kernel/boot/platform/efi/arch_start.h @@ -1,11 +1,12 @@ /* - * Copyright 2019-2020, Haiku, Inc. All rights reserved. + * Copyright 2019-2021, Haiku, Inc. All rights reserved. * Released under the terms of the MIT License. */ #ifndef __ARCH_START_H #define __ARCH_START_H +void arch_convert_kernel_args(void); void arch_start_kernel(addr_t kernelEntry); diff --git a/src/system/boot/platform/efi/arch/arm/arch_start.cpp b/src/system/boot/platform/efi/arch/arm/arch_start.cpp index 58bdbf1ba4..761edcbb1f 100644 --- a/src/system/boot/platform/efi/arch/arm/arch_start.cpp +++ b/src/system/boot/platform/efi/arch/arm/arch_start.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Haiku, Inc. All rights reserved. + * Copyright 2019-2021 Haiku, Inc. All rights reserved. * Released under the terms of the MIT License. */ @@ -10,6 +10,7 @@ #include #include "efi_platform.h" +#include "mmu.h" #define ALIGN_MEMORY_MAP 4 @@ -28,6 +29,13 @@ extern uint32_t arch_mmu_generate_post_efi_page_tables(size_t memory_map_size, uint32_t descriptor_version); +void +arch_convert_kernel_args(void) +{ + fix_address(gKernelArgs.arch_args.fdt); +} + + static const char* memory_region_type_str(int type) { diff --git a/src/system/boot/platform/efi/arch/riscv64/arch_start.cpp b/src/system/boot/platform/efi/arch/riscv64/arch_start.cpp index 27d4585621..c93bebf225 100644 --- a/src/system/boot/platform/efi/arch/riscv64/arch_start.cpp +++ b/src/system/boot/platform/efi/arch/riscv64/arch_start.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2019-2020 Haiku, Inc. All rights reserved. + * Copyright 2019-2021 Haiku, Inc. All rights reserved. * Released under the terms of the MIT License. */ @@ -34,6 +34,13 @@ extern uint64_t arch_mmu_generate_post_efi_page_tables(size_t memory_map_size, #include +void +arch_convert_kernel_args(void) +{ + // empty +} + + void arch_start_kernel(addr_t kernelEntry) { diff --git a/src/system/boot/platform/efi/arch/x86_64/arch_start.cpp b/src/system/boot/platform/efi/arch/x86_64/arch_start.cpp index d67f735633..2cae36ee91 100644 --- a/src/system/boot/platform/efi/arch/x86_64/arch_start.cpp +++ b/src/system/boot/platform/efi/arch/x86_64/arch_start.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2014-2020 Haiku, Inc. All rights reserved. + * Copyright 2014-2021 Haiku, Inc. All rights reserved. * Copyright 2013-2014, Fredrik Holmqvist, fredrik.holmqvist@gmail.com. * Copyright 2014, Henry Harrington, henry.harrington@gmail.com. * All rights reserved. @@ -34,6 +34,15 @@ extern uint64_t arch_mmu_generate_post_efi_page_tables(size_t memory_map_size, uint32_t descriptor_version); +void +arch_convert_kernel_args(void) +{ + fix_address(gKernelArgs.ucode_data); + fix_address(gKernelArgs.arch_args.apic); + fix_address(gKernelArgs.arch_args.hpet); +} + + void arch_start_kernel(addr_t kernelEntry) { diff --git a/src/system/boot/platform/efi/start.cpp b/src/system/boot/platform/efi/start.cpp index 3b773e42d0..c6b45d715d 100644 --- a/src/system/boot/platform/efi/start.cpp +++ b/src/system/boot/platform/efi/start.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 Haiku, Inc. All rights reserved. + * Copyright 2014-2021 Haiku, Inc. All rights reserved. * Copyright 2013-2014, Fredrik Holmqvist, fredrik.holmqvist@gmail.com. * Copyright 2014, Henry Harrington, henry.harrington@gmail.com. * All rights reserved. @@ -97,11 +97,8 @@ convert_kernel_args() fix_address(gKernelArgs.edid_info); fix_address(gKernelArgs.debug_output); fix_address(gKernelArgs.boot_splash); - #if defined(__x86_64__) || defined(__i386__) - fix_address(gKernelArgs.ucode_data); - fix_address(gKernelArgs.arch_args.apic); - fix_address(gKernelArgs.arch_args.hpet); - #endif + + arch_convert_kernel_args(); convert_preloaded_image(static_cast( gKernelArgs.kernel_image.Pointer()));