diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2011-07-25 16:41:57 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2011-07-29 15:12:07 -0500 |
commit | a4ad138162e1c2b0e7ae008d38d91a0094393bd7 (patch) | |
tree | 7c3068ebd522d36a3f3e9083303e3cf66ac281a3 /src/include | |
parent | 786c6a4a3aa85bb9f240a86735eb8f6ac277c109 (diff) | |
download | talos-hostboot-a4ad138162e1c2b0e7ae008d38d91a0094393bd7.tar.gz talos-hostboot-a4ad138162e1c2b0e7ae008d38d91a0094393bd7.zip |
Reduce memory footprint to 3MB.
Change-Id: I309bc63bdb27baa21f65de05e12324b9c4ce3407
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/212
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/kernel/cpuid.H | 93 | ||||
-rw-r--r-- | src/include/kernel/taskmgr.H | 6 | ||||
-rw-r--r-- | src/include/kernel/vmmmgr.H | 13 |
3 files changed, 39 insertions, 73 deletions
diff --git a/src/include/kernel/cpuid.H b/src/include/kernel/cpuid.H index fa9b0649b..75287a66e 100644 --- a/src/include/kernel/cpuid.H +++ b/src/include/kernel/cpuid.H @@ -1,74 +1,45 @@ #ifndef __KERNEL_CPUID_H #define __KERNEL_CPUID_H +#include <stdint.h> #include <arch/ppc.H> -/** @enum ProcessorCoreType - * @brief Enumeration of the different supported processor cores. - */ -enum ProcessorCoreType +namespace CpuID { + /** @enum ProcessorCoreType + * @brief Enumeration of the different supported processor cores. + */ + enum ProcessorCoreType + { /** Base Power7 */ - POWER7, + POWER7, /** Power7+ */ - POWER7_PLUS, + POWER7_PLUS, /** Power8 "Salerno" (low-end) core */ - POWER8_SALERNO, + POWER8_SALERNO, /** Power8 "Venice" (high-end) core */ - POWER8_VENICE, - - UNKNOWN, + POWER8_VENICE, + + UNKNOWN, + }; + + /** @fn getCpuType() + * @brief Decode the processor type from the PVR register. + * + * These values come from the pervasive spec for each processor. + * + * @return ProcessorCoreType - Value from enumeration for this core. + */ + ProcessorCoreType getCpuType(); + + /** @fn getCpuDD + * @brief Decode the processor DD level from the PVR register. + * + * These offsets come from the pervasive spec for each processor. + * + * @return 1 byte DD level as <major nibble, minor nibble>. + */ + uint8_t getCpuDD(); }; - -/** @fn getCpuType() - * @brief Decode the processor type from the PVR register. - * - * These values come from the pervasive spec for each processor. - * - * @return ProcessorCoreType - Value from enumeration for this core. - */ -ALWAYS_INLINE -ProcessorCoreType getCpuType() -{ - uint64_t l_pvr = getPVR(); - - // Layout of the PVR is (32-bit): - // 2 nibbles reserved. - // 2 nibbles chip type. - // 1 nibble technology. - // 1 nibble major DD. - // 1 nibble reserved. - // 1 nibble minor DD. - - switch(l_pvr & 0xFFFF0000) - { - case 0x003F0000: - return POWER7; - - case 0x004A0000: - return POWER7_PLUS; - - case 0x004B0000: - return POWER8_VENICE; - - default: - return UNKNOWN; - } -} - -/** @fn getCpuDD - * @brief Decode the processor DD level from the PVR register. - * - * These offsets come from the pervasive spec for each processor. - * - * @return 1 byte DD level as <major nibble, minor nibble>. - */ -ALWAYS_INLINE -uint8_t getCpuDD() -{ - uint64_t l_pvr = getPVR(); - return ((l_pvr & 0x0F00) >> 4) | (l_pvr & 0x000F); -} - #endif diff --git a/src/include/kernel/taskmgr.H b/src/include/kernel/taskmgr.H index b34a1d3b1..82aab7da1 100644 --- a/src/include/kernel/taskmgr.H +++ b/src/include/kernel/taskmgr.H @@ -10,7 +10,7 @@ class TaskManager public: static task_t* getCurrentTask(); static void setCurrentTask(task_t* t); - + typedef void(*task_fn_t)(void*); static task_t* createTask(task_fn_t, void*); @@ -22,8 +22,8 @@ class TaskManager static task_t* createIdleTask(); private: - tid_t getNextTid() - { return iv_nextTid.next() + VmmManager::FirstPid; }; + tid_t getNextTid() + { return iv_nextTid.next(); }; Util::Lockfree::Counter<tid_t> iv_nextTid; static void idleTaskLoop(void*); diff --git a/src/include/kernel/vmmmgr.H b/src/include/kernel/vmmmgr.H index 49101feed..f57f01677 100644 --- a/src/include/kernel/vmmmgr.H +++ b/src/include/kernel/vmmmgr.H @@ -10,9 +10,11 @@ class VmmManager public: enum VMM_CONSTS { - EIGHT_MEG = 8 * 1024 * 1024, + ONE_MEG = 1 * 1024 * 1024, + THREE_MEG = 3 * ONE_MEG, + EIGHT_MEG = 8 * ONE_MEG, - FULL_MEM_SIZE = 1 * EIGHT_MEG, + FULL_MEM_SIZE = THREE_MEG, // put the Page Table at the end of our memory space PTSIZE = (1 << 18), @@ -28,13 +30,6 @@ class VmmManager RO_EXE_ACCESS, }; - enum PID_ALLOCATIONS - { - LinearSpace = (FULL_MEM_SIZE / EIGHT_MEG) - 1, - MMIOSpace = LinearSpace + 1, - FirstPid, - }; - static void init(); static void init_slb(); |