diff options
| author | Patrick Williams <iawillia@us.ibm.com> | 2011-05-24 22:01:46 -0500 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2011-05-26 10:40:30 -0500 |
| commit | 97399f8e048f3fe76bc9fe179546990b8ba54562 (patch) | |
| tree | 6491efcd31e67ef6f4670659965cbc75a04ccd9b /src/include/kernel/cpu.H | |
| parent | 90d4e5df06e6108f846013a48b996e936adeffec (diff) | |
| download | talos-hostboot-97399f8e048f3fe76bc9fe179546990b8ba54562.tar.gz talos-hostboot-97399f8e048f3fe76bc9fe179546990b8ba54562.zip | |
Kernel support for processor affinity.
Change-Id: Ie84a805bad58032085208a98b1b31393def681cb
Reviewed-on: http://gfwr801.rchland.ibm.com:8080/gerrit/100
Tested-by: Jenkins Server
Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com>
Reviewed-by: Andrew J. Geissler <andrewg@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Diffstat (limited to 'src/include/kernel/cpu.H')
| -rw-r--r-- | src/include/kernel/cpu.H | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/src/include/kernel/cpu.H b/src/include/kernel/cpu.H index 4d5134114..0fb794989 100644 --- a/src/include/kernel/cpu.H +++ b/src/include/kernel/cpu.H @@ -1,3 +1,8 @@ +/** @file cpu.H + * @brief Defines kernel information and functions about CPUs. + * + * In this kernel the term CPU refers to a hardware thread (SMT), not core. + */ #ifndef __KERNEL_CPU_H #define __KERNEL_CPU_H @@ -10,17 +15,31 @@ class Scheduler; +/** @struct cpu_t + * @brief Stores per-CPU kernel information. + */ struct cpu_t { + /** Stack to use while in kernel mode. */ void* kernel_stack; + /** ID of the CPU (PIR value) */ cpuid_t cpu; - + + /** Pointer to the scheduler for this CPU (may not be unique) */ Scheduler* scheduler; + /** Location for scheduler to store per-CPU data, currently used + * for the local run-queue for processor affinity. + */ + void* scheduler_extra; + /** Pointer to the idle task for this CPU */ task_t* idle_task; }; +/** @fn getCpuId + * @brief Read the PIR value to determine the cpuid_t of this CPU. + */ ALWAYS_INLINE -inline uint64_t getCpuId() +inline cpuid_t getCpuId() { return getPIR() & (KERNEL_MAX_SUPPORTED_CPUS - 1); } |

