coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
cpu.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef __SOC_CAVIUM_CN81XX_CPU_H__
4 #define __SOC_CAVIUM_CN81XX_CPU_H__
5 
6 #include <stdint.h>
7 #include <symbols.h>
8 
9 /**
10  * Number of the Core on which the program is currently running.
11  *
12  * @return Number of cores
13  */
14 size_t cpu_self_get_core_id(void);
15 
16 /**
17  * Return a mask representing this core in a 64bit bitmask
18  *
19  * @return The mask of active core.
20  */
22 
23 /**
24  * Return the mask of available cores.
25  *
26  * @return Mask of available cores
27  */
29 
30 /**
31  * Return the number of cores available in the chip.
32  *
33  * @return The number of available cores.
34  */
35 size_t cpu_get_num_available_cores(void);
36 
37 /**
38  * Init secondary core and call the provided entry for given core.
39  * A stack of size CONFIG_STACK_SIZE is set up for each core in REGION
40  * stack_sec. The unique core id is passed to the entry point functions.
41  *
42  * @return zero on success
43  */
44 size_t start_cpu(size_t cpu, void (*entry_64)(size_t core_id));
45 
46 /**
47  * Secondary ASM CPU entry point.
48  * For internal use only.
49  */
50 void secondary_init(void);
51 
52 /**
53  * Secondary CPU C entry point.
54  * For internal use only.
55  */
56 void secondary_cpu_init(size_t core_id);
57 
58 /* Symbols in memlayout.ld */
59 
60 DECLARE_REGION(stack_sec)
61 
62 #endif /* __SOC_CAVIUM_CN81XX_CPU_H__ */
asmlinkage void secondary_cpu_init(unsigned int cpu_index)
#define DECLARE_REGION(name)
Definition: symbols.h:12
uint64_t cpu_get_available_core_mask(void)
Return the mask of available cores.
Definition: cpu.c:12
size_t start_cpu(size_t cpu, void(*entry_64)(size_t core_id))
Init secondary core and call the provided entry for given core.
Definition: cpu.c:54
size_t cpu_get_num_available_cores(void)
Return the number of cores available in the chip.
Definition: cpu.c:17
size_t cpu_self_get_core_id(void)
Number of the Core on which the program is currently running.
Definition: cpu.c:36
void secondary_init(void)
Secondary ASM CPU entry point.
uint64_t cpu_self_get_core_mask(void)
Return a mask representing this core in a 64bit bitmask.
Definition: cpu.c:49
unsigned long long uint64_t
Definition: stdint.h:17