summaryrefslogtreecommitdiffstats
path: root/src/kernel
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2012-07-16 21:37:56 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-07-18 14:06:41 -0500
commit6f6561babb56d891e88dbcd07646c23af2563ddd (patch)
tree2a1d669781a0a02870cb2bbbb91b3b81d4aea16b /src/kernel
parentdd8219097772fe68a6eb66ff20ef4f6ffb4e469f (diff)
downloadtalos-hostboot-6f6561babb56d891e88dbcd07646c23af2563ddd.tar.gz
talos-hostboot-6f6561babb56d891e88dbcd07646c23af2563ddd.zip
cpu_spr_value syscall for SLW image build.
Task 44887 Change-Id: If87b6e80b974bb4cbff13844d8a3f055a17282d2 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1378 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com> Reviewed-by: Mark W. Wenning <wenning@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/kernel')
-rw-r--r--src/kernel/cpumgr.C6
-rw-r--r--src/kernel/start.S57
-rw-r--r--src/kernel/syscall.C27
3 files changed, 68 insertions, 22 deletions
diff --git a/src/kernel/cpumgr.C b/src/kernel/cpumgr.C
index 48bf4a5e8..943ef48fd 100644
--- a/src/kernel/cpumgr.C
+++ b/src/kernel/cpumgr.C
@@ -161,9 +161,15 @@ void CpuManager::startSlaveCPU(cpu_t* cpu)
void CpuManager::activateCPU(cpu_t * i_cpu)
{
+ // Set active.
i_cpu->active = true;
__sync_add_and_fetch(&cv_cpuCount, 1);
lwsync();
+
+ // Verify / set SPRs.
+ uint64_t msr = getMSR();
+ kassert(WAKEUP_MSR_VALUE == msr);
+ setLPCR(WAKEUP_LPCR_VALUE);
}
void CpuManager::executePeriodics(cpu_t * i_cpu)
diff --git a/src/kernel/start.S b/src/kernel/start.S
index a8166b980..2e4cd1784 100644
--- a/src/kernel/start.S
+++ b/src/kernel/start.S
@@ -1,25 +1,26 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/kernel/start.S $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2010 - 2011
-//
-// p1
-//
-// Object Code Only (OCO) source materials
-// Licensed Internal Code Source Materials
-// IBM HostBoot Licensed Internal Code
-//
-// The source code for this program is not published or other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/kernel/start.S $
+ *
+ * IBM CONFIDENTIAL
+ *
+ * COPYRIGHT International Business Machines Corp. 2010-2012
+ *
+ * p1
+ *
+ * Object Code Only (OCO) source materials
+ * Licensed Internal Code Source Materials
+ * IBM HostBoot Licensed Internal Code
+ *
+ * The source code for this program is not published or other-
+ * wise divested of its trade secrets, irrespective of what has
+ * been deposited with the U.S. Copyright Office.
+ *
+ * Origin: 30
+ *
+ * IBM_PROLOG_END_TAG
+ */
.include "kernel/ppcconsts.S"
.section .text.intvects
@@ -29,6 +30,18 @@ _start:
;// Set thread priority high.
or 3,3,3
+ ;// Clear MSR[TA] (bit 63).
+ mfmsr r2
+ rldicl r2,r2,1,1
+ rotldi r2,r2,63
+ ;// Set up SRR0 / SRR1 to enable new MSR.
+ mtsrr1 r2
+ li r2, _start_postmsr@l
+ mtsrr0 r2
+ rfid
+
+_start_postmsr:
+
;// Determine if this is the first thread.
li r4, 2
;// Read spinlock value.
diff --git a/src/kernel/syscall.C b/src/kernel/syscall.C
index 26a72cd35..061971f96 100644
--- a/src/kernel/syscall.C
+++ b/src/kernel/syscall.C
@@ -97,6 +97,7 @@ namespace Systemcalls
void CpuCoreType(task_t *t);
void CpuDDLevel(task_t *t);
void CpuStartCore(task_t *t);
+ void CpuSprValue(task_t *t);
void MmAllocBlock(task_t *t);
void MmRemovePages(task_t *t);
void MmSetPermission(task_t *t);
@@ -131,6 +132,7 @@ namespace Systemcalls
&CpuCoreType, // MISC_CPUCORETYPE
&CpuDDLevel, // MISC_CPUDDLEVEL
&CpuStartCore, // MISC_CPUSTARTCORE
+ &CpuSprValue, // MISC_CPUSPRVALUE
&MmAllocBlock, // MM_ALLOC_BLOCK
&MmRemovePages, // MM_REMOVE_PAGES
@@ -640,6 +642,31 @@ namespace Systemcalls
CpuManager::startCore(static_cast<uint64_t>(TASK_GETARG0(t))));
};
+ /** Read SPR values. */
+ void CpuSprValue(task_t *t)
+ {
+ uint64_t spr = TASK_GETARG0(t);
+
+ switch (spr)
+ {
+ case CPU_SPR_MSR:
+ TASK_SETRTN(t, CpuManager::WAKEUP_MSR_VALUE);
+ break;
+
+ case CPU_SPR_LPCR:
+ TASK_SETRTN(t, CpuManager::WAKEUP_LPCR_VALUE);
+ break;
+
+ case CPU_SPR_HRMOR:
+ TASK_SETRTN(t, getHRMOR());
+ break;
+
+ default:
+ TASK_SETRTN(t, -1);
+ break;
+ }
+ };
+
/**
* Allocate a block of virtual memory within the base segment
* @param[in] t: The task used to allocate a block in the base segment
OpenPOWER on IntegriCloud