xref: /haiku/headers/private/kernel/boot/platform/efi/arch_smp.h (revision 52f7c9389475e19fc21487b38064b4390eeb6fea)
1 /*
2  * Copyright 2013-2022 Haiku, Inc. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef KERNEL_BOOT_PLATFORM_EFI_ARCH_SMP_H
6 #define KERNEL_BOOT_PLATFORM_EFI_ARCH_SMP_H
7 
8 
9 #include <boot/menu.h>
10 
11 
12 #if defined(__riscv) || defined(__ARM__) || defined(__aarch64__)
13 // These platforms take inventory of cpu cores from fdt
14 
15 struct platform_cpu_info {
16 	uint32 id; // hart id on riscv
17 #if defined(__riscv)
18 	uint32 phandle;
19 	uint32 plicContext;
20 #endif
21 };
22 
23 #if defined(__riscv)
24 extern uint32 gBootHart;
25 #endif
26 
27 void arch_smp_register_cpu(platform_cpu_info** cpu);
28 #endif
29 
30 
31 int arch_smp_get_current_cpu(void);
32 void arch_smp_init_other_cpus(void);
33 #ifdef __riscv
34 platform_cpu_info* arch_smp_find_cpu(uint32 phandle);
35 void arch_smp_boot_other_cpus(uint64 satp, uint64 kernelEntry, addr_t virtKernelArgs);
36 #else
37 void arch_smp_boot_other_cpus(uint32 pml4, uint64 kernelEntry, addr_t virtKernelArgs);
38 #endif
39 void arch_smp_add_safemode_menus(Menu *menu);
40 void arch_smp_init(void);
41 
42 
43 #endif /* KERNEL_BOOT_PLATFORM_EFI_ARCH_SMP_H */
44