efi: Refactor CPU code to be arch-specific

* Migrate some platform agnostic architecture code into
  boot/arch from efi/arch. This helps to avoid conflicts
  between kernel and boot sources as well.
* Conflicts between arch_cpu in efi and kernel code means
  bootcode really should *never* directly use kernel arch
  headers. (other platforms don't, which is why they don't
  have this same issue)
* We carefully thread any needed kernel headers (namely
  assembly helper macros) into the bootloader headers without
  mixing in the whole conflicting kernel/arch headers.
* ARM now properly get its cpu init code called, and we
  progress further into the EFI bootloader.

Change-Id: If67ec9758b5ce68563ebd9eb45d5196401911c67
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2975
Reviewed-by: waddlesplash <[email protected]>
This commit is contained in:
Alexander von Gluck IV
2020-07-04 21:04:20 +00:00
committed by waddlesplash
parent 1f2666fd48
commit 89fd39f42a
12 changed files with 192 additions and 173 deletions
@@ -0,0 +1,25 @@
/*
* Copyright 2013-2020 Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef EFI_BOOT_PLATFORM_EFI_ARCH_CPU_H
#define EFI_BOOT_PLATFORM_EFI_ARCH_CPU_H
#include <SupportDefs.h>
#include <boot/vfs.h>
#ifdef __cplusplus
extern "C" {
#endif
status_t boot_arch_cpu_init(void);
void arch_ucode_load(BootVolume& volume);
#ifdef __cplusplus
}
#endif
#endif /* EFI_BOOT_PLATFORM_EFI_ARCH_CPU_H */
@@ -7,6 +7,9 @@
#include <SupportDefs.h>
#include <boot/vfs.h>
#include "../../../arch/x86/arch_cpuasm.h"
#ifdef __cplusplus
@@ -15,15 +18,13 @@ extern "C" {
void calculate_cpu_conversion_factor(uint8 channel);
status_t boot_arch_cpu_init(void);
void arch_ucode_load(BootVolume& volume);
#ifdef __cplusplus
}
#endif
#include <boot/vfs.h>
void ucode_load(BootVolume& volume);
#endif /* BOOT_ARCH_CPU_H */