summaryrefslogtreecommitdiffstats
path: root/src/include/kernel
diff options
context:
space:
mode:
authorMike Jones <mjjones@us.ibm.com>2011-07-18 13:01:59 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2011-07-19 13:43:56 -0500
commit103f2e58b35ac7218d9960ceb6568ff7ceb332d2 (patch)
treeef4c3bf1e3b8fe380e03d2fc256bdd46d10214fc /src/include/kernel
parentbe301c4ea87c944bd1c51ca2c73ac719cec6b495 (diff)
downloadtalos-hostboot-103f2e58b35ac7218d9960ceb6568ff7ceb332d2.tar.gz
talos-hostboot-103f2e58b35ac7218d9960ceb6568ff7ceb332d2.zip
Shutdown and post status on HostBoot completion
Change-Id: If2ab46af85065b29695a1186ed331fd835944eb4 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/204 Tested-by: Jenkins Server Reviewed-by: Mark W. Wenning <wenning@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/kernel')
-rw-r--r--src/include/kernel/cpu.H24
-rw-r--r--src/include/kernel/cpumgr.H25
-rw-r--r--src/include/kernel/syscalls.H3
3 files changed, 41 insertions, 11 deletions
diff --git a/src/include/kernel/cpu.H b/src/include/kernel/cpu.H
index 8f6fedb69..2e2a4b8e4 100644
--- a/src/include/kernel/cpu.H
+++ b/src/include/kernel/cpu.H
@@ -21,21 +21,27 @@ class Scheduler;
*/
struct cpu_t
{
- /** Stack to use while in kernel mode. */
+ /** Stack to use while in kernel mode. */
void* kernel_stack;
- /** ID of the CPU (PIR value) */
+
+ /** ID of the CPU (PIR value) */
cpuid_t cpu;
-
- /** Pointer to the scheduler for this CPU (may not be unique) */
+
+ /** If the CPU is the master */
+ bool master;
+
+ /** 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.
- */
+
+ /** 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 */
+
+ /** Pointer to the idle task for this CPU */
task_t* idle_task;
- /** XSCOM mutex to serialize access per CPU */
+ /** XSCOM mutex to serialize access per CPU */
mutex_t xscom_mutex;
};
diff --git a/src/include/kernel/cpumgr.H b/src/include/kernel/cpumgr.H
index 6ba4bfee1..4416e5815 100644
--- a/src/include/kernel/cpumgr.H
+++ b/src/include/kernel/cpumgr.H
@@ -14,14 +14,29 @@ class CpuManager
* task structure in SPRG3.
*/
static cpu_t* getCurrentCPU();
- static cpu_t* getCpu(size_t i) { return cv_cpus[i]; };
+ static cpu_t* getCpu(size_t i) { return cv_cpus[i]; }
static void init();
static void init_slave_smp(cpu_t*);
+ /** @fn requestShutdown
+ * Requests that all CPUs shutdown
+ */
+ static void requestShutdown(uint64_t i_status);
+
+ /** @fn isShutdownRequested
+ * Returns if a shutdown of all CPUs was requested
+ */
+ static bool isShutdownRequested() { return cv_shutdown_requested; }
+
+ /** @fn getShutdownStatus
+ * Returns the status code that needs to be posted during shutdown
+ */
+ static uint32_t getShutdownStatus() { return cv_shutdown_status; }
+
protected:
CpuManager();
- ~CpuManager() {};
+ ~CpuManager() {}
/** @fn startCPU
* Starts the requested CPU. Default of -1 implies current CPU.
@@ -33,6 +48,12 @@ class CpuManager
static cpu_t* cv_cpus[MAXCPUS]; // Need to be able to access this
// from start.S to get initial stacks
// of secondary cpus / threads.
+
+ // If a shutdown of all CPUs is requested
+ static bool cv_shutdown_requested;
+
+ // The status code that needs to be posted during shutdown
+ static uint64_t cv_shutdown_status;
};
#endif
diff --git a/src/include/kernel/syscalls.H b/src/include/kernel/syscalls.H
index 26e2bdf75..6473f12b6 100644
--- a/src/include/kernel/syscalls.H
+++ b/src/include/kernel/syscalls.H
@@ -56,6 +56,9 @@ namespace Systemcalls
/** futex_wake() */
FUTEX_WAKE,
+ /** shutdown() */
+ MISC_SHUTDOWN,
+
SYSCALL_MAX
};
OpenPOWER on IntegriCloud