1 /* 2 * Copyright 2021, Haiku, Inc. 3 * Distributed under the terms of the MIT License. 4 */ 5 6 7 #include "smp.h" 8 9 #include <boot/stage2.h> 10 11 12 static CpuInfo sCpus[SMP_MAX_CPUS]; 13 uint32 sCpuCount = 0; 14 15 16 CpuInfo* 17 smp_find_cpu(uint32 phandle) 18 { 19 return &sCpus[0]; 20 } 21 22 23 void 24 smp_init_other_cpus(void) 25 { 26 gKernelArgs.num_cpus = 1; 27 for (uint32 i = 0; i < gKernelArgs.num_cpus; i++) { 28 gKernelArgs.arch_args.hartIds[i] = sCpus[i].hartId; 29 gKernelArgs.arch_args.plicContexts[i] = sCpus[i].plicContext; 30 } 31 } 32 33 34 void 35 smp_boot_other_cpus(uint64 pageTable, uint64 kernel_entry) 36 { 37 } 38 39 40 void 41 smp_init() 42 { 43 sCpus[0].hartId = 0; 44 } 45