Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Merge branch 'devel'
[palacios.git] / kitten / include / lwk / cpuinfo.h
1 #ifndef _LWK_CPUINFO_H
2 #define _LWK_CPUINFO_H
3
4 #include <lwk/types.h>
5 #include <lwk/cpumask.h>
6 #include <lwk/cache.h>
7 #include <lwk/aspace.h>
8 #include <arch/cpuinfo.h>
9
10 /**
11  * CPU information.
12  * Each CPU in the system is described by one of these structures.
13  */
14 struct cpuinfo {
15         /* Identification */
16         uint16_t        logical_id;        // CPU's kernel assigned ID
17         uint16_t        physical_id;       // CPU's hardware ID
18
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
23
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
28
29         /* Memory management info */
30         vmpagesize_t    pagesz_mask;       // Page sizes supported by the CPU
31
32         /* Architecture specific */
33         struct arch_cpuinfo arch;
34 } ____cacheline_aligned;
35
36 extern struct cpuinfo   cpu_info[NR_CPUS];
37 extern cpumask_t        cpu_present_map;
38 extern cpumask_t        cpu_online_map;
39
40 /**
41  * Returns the number of CPUs in the system.
42  */
43 #define num_cpus()      cpus_weight(cpu_present_map)
44
45 extern void print_cpuinfo(struct cpuinfo *);
46
47 #endif