xref: /haiku/src/system/boot/platform/efi/arch/arm64/arch_smp.cpp (revision 1deede7388b04dbeec5af85cae7164735ea9e70d)
1 /*
2  * Copyright 2019-2020, Haiku, Inc. All rights reserved.
3  * Released under the terms of the MIT License.
4 */
5 
6 
7 #include "arch_smp.h"
8 
9 #include <string.h>
10 
11 #include <KernelExport.h>
12 
13 #include <kernel.h>
14 #include <safemode.h>
15 #include <boot/platform.h>
16 #include <boot/stage2.h>
17 #include <boot/menu.h>
18 
19 
20 //#define TRACE_SMP
21 #ifdef TRACE_SMP
22 #	define TRACE(x) dprintf x
23 #else
24 #	define TRACE(x) ;
25 #endif
26 
27 
28 int
29 arch_smp_get_current_cpu(void)
30 {
31 	// One cpu for now.
32 	return 0;
33 }
34 
35 
36 void
37 arch_smp_init_other_cpus(void)
38 {
39 	// One cpu for now.
40 	gKernelArgs.num_cpus = 1;
41 	return;
42 }
43 
44 
45 void
46 arch_smp_boot_other_cpus(uint32 pml4, uint64 kernel_entry)
47 {
48 	// One cpu for now.
49 }
50 
51 
52 void
53 arch_smp_add_safemode_menus(Menu *menu)
54 {
55 	MenuItem *item;
56 
57 	if (gKernelArgs.num_cpus < 2)
58 		return;
59 
60 	item = new(nothrow) MenuItem("Disable SMP");
61 	menu->AddItem(item);
62 	item->SetData(B_SAFEMODE_DISABLE_SMP);
63 	item->SetType(MENU_ITEM_MARKABLE);
64 	item->SetHelpText("Disables all but one CPU core.");
65 }
66 
67 
68 void
69 arch_smp_init(void)
70 {
71 	// One cpu for now.
72 }
73