diff options
Diffstat (limited to 'src/include/kernel/cpu.H')
-rw-r--r-- | src/include/kernel/cpu.H | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/include/kernel/cpu.H b/src/include/kernel/cpu.H index 2e5a489d9..81b43a57c 100644 --- a/src/include/kernel/cpu.H +++ b/src/include/kernel/cpu.H @@ -2,6 +2,10 @@ #define __KERNEL_CPU_H #include <kernel/types.h> +#include <kernel/ppcarch.H> + +// Thread ID support only, Power7 (4 threads). +#define KERNEL_MAX_SUPPORTED_CPUS 4 class Scheduler; @@ -11,6 +15,13 @@ struct cpu_t cpuid_t cpu; Scheduler* scheduler; + task_t* idle_task; }; +__attribute__((always_inline)) +inline uint64_t getCpuId() +{ + return ppc_getPIR() & (KERNEL_MAX_SUPPORTED_CPUS - 1); +} + #endif |