boot/efi: introduce arch_convert_kernel_args

Change-Id: Iabb321564d6733c6cf481ec2548fa287e308ae89
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4796
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
David Karoly 2021-12-15 20:41:05 +01:00 committed by Adrien Destugues
parent e94ea7bc22
commit af90bfd3bb
5 changed files with 32 additions and 10 deletions

View File

@ -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);

View File

@ -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 <boot/stdio.h>
#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)
{

View File

@ -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 <arch/riscv64/arch_uart_sifive.h>
void
arch_convert_kernel_args(void)
{
// empty
}
void
arch_start_kernel(addr_t kernelEntry)
{

View File

@ -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)
{

View File

@ -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<preloaded_elf64_image*>(
gKernelArgs.kernel_image.Pointer()));