x86[_64]: Add CPU topology detection for Intel processors

This commit is contained in:
Pawel Dziepak
2013-10-02 01:19:17 +02:00
parent 4110b730db
commit 8ec897323e
2 changed files with 207 additions and 0 deletions
+12
View File
@@ -31,6 +31,15 @@ namespace BKernel {
using BKernel::Thread;
typedef enum cpu_topology_level {
CPU_TOPOLOGY_SMT,
CPU_TOPOLOGY_CORE,
CPU_TOPOLOGY_PACKAGE,
//
CPU_TOPOLOGY_LEVELS
} cpu_topology_level;
/* CPU local data structure */
typedef struct cpu_ent {
@@ -56,6 +65,9 @@ typedef struct cpu_ent {
bool invoke_scheduler_if_idle;
bool disabled;
// CPU topology information
int topology_id[CPU_TOPOLOGY_LEVELS];
// arch-specific stuff
arch_cpu_info arch;
} cpu_ent __attribute__((aligned(64)));