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=6299cb929a586fd8debcc316c1ede714d5b95979;hp=0000000000000000000000000000000000000000;hpb=e9e3ee43cb302909917b5919f6043347b73c6995;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); +} +