summaryrefslogtreecommitdiffstats
path: root/src/include/kernel
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2012-05-16 12:51:22 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-07-16 19:05:48 -0500
commit3bba9a3ff18b6991bba4247898f4c26fa944a676 (patch)
treeda3462c53eaf0670670b37f094c17444f1ce5c4c /src/include/kernel
parent2aa5e0afac73384aaabe1fe1529898601be1155f (diff)
downloadtalos-hostboot-3bba9a3ff18b6991bba4247898f4c26fa944a676.tar.gz
talos-hostboot-3bba9a3ff18b6991bba4247898f4c26fa944a676.zip
Support for core_activate via IPI.
RTC: 37009 Change-Id: I56669805c86d9659a20ad7c26e5e9860c7a248c7 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1087 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/kernel')
-rw-r--r--src/include/kernel/cpu.H3
-rw-r--r--src/include/kernel/cpumgr.H15
-rw-r--r--src/include/kernel/syscalls.H2
-rw-r--r--src/include/kernel/timemgr.H56
4 files changed, 49 insertions, 27 deletions
diff --git a/src/include/kernel/cpu.H b/src/include/kernel/cpu.H
index b6fe66ef2..e395b2920 100644
--- a/src/include/kernel/cpu.H
+++ b/src/include/kernel/cpu.H
@@ -75,6 +75,9 @@ struct cpu_t
*/
void* scheduler_extra;
+ /** Location for task delay-list, managed by TimeManager. */
+ void* delay_list;
+
/** Pointer to the idle task for this CPU */
task_t* idle_task;
diff --git a/src/include/kernel/cpumgr.H b/src/include/kernel/cpumgr.H
index e4d2b8b0b..d7bc2da78 100644
--- a/src/include/kernel/cpumgr.H
+++ b/src/include/kernel/cpumgr.H
@@ -36,7 +36,7 @@ class CpuManager
{
MAXCPUS = KERNEL_MAX_SUPPORTED_CPUS,
CPU_PERIODIC_CHECK_MEMORY = 128, // Is this even needed anymore?
- CPU_PERIODIC_FLUSH_PAGETABLE = 256,
+ CPU_PERIODIC_FLUSH_PAGETABLE = 256,
CPU_PERIODIC_DEFRAG = 949, // TODO Any bigger not currently hit
};
@@ -44,7 +44,7 @@ class CpuManager
* Returns a pointer to the current CPU structure by using the
* task structure in SPRG3.
*/
- static cpu_t* getCurrentCPU();
+ static cpu_t* getCurrentCPU() { return cv_cpus[getPIR()]; }
static cpu_t* getCpu(size_t i) { return cv_cpus[i]; }
/** @brief Return pointer to master CPU object.
@@ -87,6 +87,13 @@ class CpuManager
*/
static size_t getCpuCount() { return cv_cpuCount; }
+ /** @fn startCore
+ * Create structures to support a core activating and start the core.
+ *
+ * @param[in] pir - PIR value of first thread in core.
+ */
+ static int startCore(uint64_t pir);
+
/** @fn forceMemoryPeriodic()
* Force the memory free / coalesce operations to be performed on the
@@ -105,8 +112,10 @@ class CpuManager
void startCPU(ssize_t i = -1);
void startSlaveCPU(cpu_t*);
+ static size_t getThreadCount();
+
private:
- static cpu_t* cv_cpus[MAXCPUS]; // Need to be able to access this
+ static cpu_t** cv_cpus; // Need to be able to access this
// from start.S to get initial stacks
// of secondary cpus / threads.
diff --git a/src/include/kernel/syscalls.H b/src/include/kernel/syscalls.H
index a46fde703..0a0d5dba5 100644
--- a/src/include/kernel/syscalls.H
+++ b/src/include/kernel/syscalls.H
@@ -88,6 +88,8 @@ namespace Systemcalls
MISC_CPUCORETYPE,
/** cpu_dd_level() */
MISC_CPUDDLEVEL,
+ /** cpu_start_core() */
+ MISC_CPUSTARTCORE,
/** mm_alloc_block() */
MM_ALLOC_BLOCK,
diff --git a/src/include/kernel/timemgr.H b/src/include/kernel/timemgr.H
index 0590dedff..96950b928 100644
--- a/src/include/kernel/timemgr.H
+++ b/src/include/kernel/timemgr.H
@@ -47,28 +47,32 @@ struct _TimeManager_Delay_t
class TimeManager
{
public:
- enum
- {
+ enum
+ {
/** Number of time-slices to allow per second.
*
* Context length becomes (1/TIMESLICE_PER_SECOND) sec.
*/
- TIMESLICE_PER_SEC = 1000,
- };
+ TIMESLICE_PER_SEC = 1000,
+ };
/** Initialize the time subsystem. */
- static void init();
+ static void init();
+
+ /** Initialize the task-delay structures for a CPU. */
+ static void init_cpu(cpu_t* cpu);
+
/** Return the number of ticks per time-slice. */
- static uint64_t getTimeSliceCount()
- {
- return iv_timebaseFreq / TIMESLICE_PER_SEC;
- };
+ static uint64_t getTimeSliceCount()
+ {
+ return iv_timebaseFreq / TIMESLICE_PER_SEC;
+ };
/** Returns the value of the processor timebase register. */
- static uint64_t getCurrentTimeBase()
- {
- return getTB();
- };
+ static uint64_t getCurrentTimeBase()
+ {
+ return getTB();
+ };
/** Converts seconds/nsecs to timebase ticks.
*
@@ -80,7 +84,7 @@ class TimeManager
*
* @return Number of timebase ticks.
*/
- static uint64_t convertSecToTicks(uint64_t i_sec, uint64_t i_nsec);
+ static uint64_t convertSecToTicks(uint64_t i_sec, uint64_t i_nsec);
/** Converts timebase ticks to seconds/nsecs.
*
* @param[in] i_ticks - Number of ticks.
@@ -96,23 +100,27 @@ class TimeManager
* @param[in] i_sec - Seconds.
* @param[in] i_nsec - Nsecs.
*/
- static void delayTask(task_t* t, uint64_t i_sec, uint64_t i_nsec);
+ static void delayTask(task_t* t, uint64_t i_sec, uint64_t i_nsec);
/** Checks the sleep queue to determine if any tasks should be woken. */
- static void checkReleaseTasks(Scheduler* s);
+ static void checkReleaseTasks(Scheduler* s);
protected:
- TimeManager() {};
- ~TimeManager() {};
+ TimeManager() {};
+ ~TimeManager() {};
private:
- void _init();
- void _delayTask(task_t* t, uint64_t i_sec, uint64_t i_nsec);
- void _checkReleaseTasks(Scheduler* s);
- Util::Locked::PQueue<_TimeManager_Delay_t, uint64_t>
- iv_taskList[KERNEL_MAX_SUPPORTED_CPUS];
+ typedef Util::Locked::PQueue<_TimeManager_Delay_t, uint64_t>
+ delaylist_t;
+
+ void _init();
+ void _init_cpu(cpu_t* cpu);
+ void _delayTask(task_t* t, uint64_t i_sec, uint64_t i_nsec);
+ void _checkReleaseTasks(Scheduler* s);
+ inline delaylist_t* _get_delaylist();
+
/** Frequency of the timebase register in Hz. (ticks per second) */
- static uint64_t iv_timebaseFreq;
+ static uint64_t iv_timebaseFreq;
};
#endif
OpenPOWER on IntegriCloud