5 #include <lwk/cpumask.h>
7 #include <lwk/aspace.h>
8 #include <arch/cpuinfo.h>
12 * Each CPU in the system is described by one of these structures.
16 uint16_t logical_id; // CPU's kernel assigned ID
17 uint16_t physical_id; // CPU's hardware ID
19 /* Topology information */
20 uint16_t numa_node_id; // NUMA node ID this CPU is in
21 cpumask_t numa_node_map; // CPUs in this CPU's NUMA node
22 cpumask_t llc_share_map; // CPUs sharing last level cache
24 /* Physical packaging */
25 uint16_t phys_socket_id; // Physical socket/package
26 uint16_t phys_core_id; // Core ID in the socket/package
27 uint16_t phys_hwthread_id; // Hardware thread ID in core
29 /* Memory management info */
30 vmpagesize_t pagesz_mask; // Page sizes supported by the CPU
32 /* Architecture specific */
33 struct arch_cpuinfo arch;
34 } ____cacheline_aligned;
36 extern struct cpuinfo cpu_info[NR_CPUS];
37 extern cpumask_t cpu_present_map;
38 extern cpumask_t cpu_online_map;
41 * Returns the number of CPUs in the system.
43 #define num_cpus() cpus_weight(cpu_present_map)
45 extern void print_cpuinfo(struct cpuinfo *);