1 #ifndef _CPU_TOPOLOGY_H_
2 #define _CPU_TOPOLOGY_H_
6 /* CPU TOPOLOGY DATA AND FUNCTIONS */
8 struct cpu_node * parent_node;
9 struct cpu_node * child_node;
14 typedef struct cpu_node cpu_node_t;
16 extern int cpu_topology_levels_number;
18 cpumask_t get_cpumask_from_level(int cpuid,
22 get_cpu_node_by_cpuid(int cpuid);
26 /* Level type for CPU siblings */
27 #define PACKAGE_LEVEL 1
30 #define THREAD_LEVEL 4
32 #define CPU_ISSET(n, p) ((CPUMASK(n) & p) != 0)
34 #define CPUSET_FOREACH(cpu, mask) \
35 for ((cpu) = 0; (cpu) < ncpus; (cpu)++) \
36 if (CPU_ISSET(cpu, mask))
40 #endif /* _CPU_TOPOLOGY_H_ */