summaryrefslogtreecommitdiffstats
path: root/src/kernel/cpumgr.C
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2011-08-23 15:16:35 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2011-08-31 13:39:51 -0500
commitf7b7b56dea28dd69a44a877f7b7073c4496ced9e (patch)
tree640fdb38b13df41c5f0835374033d53b21d163ca /src/kernel/cpumgr.C
parente6b1dcfdee1467cf7f43b64c8dddb87f13bf2f10 (diff)
downloadtalos-hostboot-f7b7b56dea28dd69a44a877f7b7073c4496ced9e.tar.gz
talos-hostboot-f7b7b56dea28dd69a44a877f7b7073c4496ced9e.zip
Ensure scratch operations happen on master core.
Change-Id: I970d645108de041d410599847edce877cb794015 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/275 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/kernel/cpumgr.C')
-rw-r--r--src/kernel/cpumgr.C25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/kernel/cpumgr.C b/src/kernel/cpumgr.C
index 3e7a83a38..d8a9960f6 100644
--- a/src/kernel/cpumgr.C
+++ b/src/kernel/cpumgr.C
@@ -49,6 +49,15 @@ cpu_t* CpuManager::getCurrentCPU()
return cv_cpus[getPIR()];
}
+cpu_t* CpuManager::getMasterCPU()
+{
+ for (int i = 0; i < MAXCPUS; i++)
+ if (cv_cpus[i] != NULL)
+ if (cv_cpus[i]->master)
+ return cv_cpus[i];
+ return NULL;
+}
+
void CpuManager::init()
{
// For the initial boot we only want to set up CPU objects for the threads
@@ -115,14 +124,14 @@ void CpuManager::startCPU(ssize_t i)
// Initialize CPU.
cpu->cpu = i;
- if (currentCPU)
- {
- cpu->master = true;
- }
- else
- {
- cpu->master = false;
- }
+ if (currentCPU)
+ {
+ cpu->master = true;
+ }
+ else
+ {
+ cpu->master = false;
+ }
cpu->scheduler = &Singleton<Scheduler>::instance();
cpu->scheduler_extra = NULL;
cpu->kernel_stack =
OpenPOWER on IntegriCloud