X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=kitten%2Fkernel%2Fcpuinfo.c;fp=kitten%2Fkernel%2Fcpuinfo.c;h=fe775a1486a92408a54829db326956c7ff714bf5;hb=66a1a4c7a9edcd7d8bc207aca093d694a6e6b5b2;hp=0000000000000000000000000000000000000000;hpb=f7cf9c19ecb0a589dd45ae0d2c91814bd3c2acc2;p=palacios-OLD.git diff --git a/kitten/kernel/cpuinfo.c b/kitten/kernel/cpuinfo.c new file mode 100644 index 0000000..fe775a1 --- /dev/null +++ b/kitten/kernel/cpuinfo.c @@ -0,0 +1,31 @@ +#include +#include + +/** + * Info structure for each CPU in the system. + * Array is indexed by logical CPU ID. + */ +struct cpuinfo cpu_info[NR_CPUS]; + +/** + * Map of all available CPUs. + * This map represents logical CPU IDs. + */ +cpumask_t cpu_present_map; + +/** + * Map of all booted CPUs. + * This map represents logical CPU IDs. + * It will be a subset of cpu_present_map (usually identical after boot). + */ +cpumask_t cpu_online_map; + +/** + * Prints the input cpuinfo structure to the console. + */ +void print_cpuinfo(struct cpuinfo *c) +{ + printk("logical cpu id\t: %u\n", c->logical_id); + print_arch_cpuinfo(c); +} +