The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/sys/cpu_topology.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 #ifndef _CPU_TOPOLOGY_H_
    2 #define _CPU_TOPOLOGY_H_
    3 
    4 #ifdef _KERNEL
    5 
    6 /* CPU TOPOLOGY DATA AND FUNCTIONS */
    7 struct cpu_node {
    8         struct cpu_node * parent_node;
    9         struct cpu_node * child_node;
   10         uint32_t child_no;
   11         cpumask_t members;
   12         uint8_t type;
   13 };
   14 typedef struct cpu_node cpu_node_t;
   15 
   16 extern int cpu_topology_levels_number;
   17 extern cpu_node_t *root_cpu_node;
   18 
   19 cpumask_t get_cpumask_from_level(int cpuid, uint8_t level_type);
   20 cpu_node_t *get_cpu_node_by_cpuid(int cpuid);
   21 
   22 #define LEVEL_NO 4
   23 
   24 /* Level type for CPU siblings */
   25 #define PACKAGE_LEVEL   1
   26 #define CHIP_LEVEL      2
   27 #define CORE_LEVEL      3
   28 #define THREAD_LEVEL    4
   29 
   30 #define CPU_ISSET(n, p) ((CPUMASK(n) & p) != 0)
   31 
   32 #define CPUSET_FOREACH(cpu, mask)                       \
   33         for ((cpu) = 0; (cpu) < ncpus; (cpu)++)         \
   34                 if (CPU_ISSET(cpu, mask))
   35 
   36 
   37 #endif /* _KERNEL */
   38 #endif /* _CPU_TOPOLOGY_H_ */

Cache object: 0f32fc26b8f14ca73553ce7100fe0bdb


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.