diff options
Diffstat (limited to 'src/kernel')
-rw-r--r-- | src/kernel/basesegment.C | 5 | ||||
-rw-r--r-- | src/kernel/devicesegment.C | 2 | ||||
-rw-r--r-- | src/kernel/heapmgr.C | 2 | ||||
-rw-r--r-- | src/kernel/segmentmgr.C | 3 | ||||
-rw-r--r-- | src/kernel/stacksegment.C | 11 |
5 files changed, 9 insertions, 14 deletions
diff --git a/src/kernel/basesegment.C b/src/kernel/basesegment.C index 2c5b73c19..fc053f856 100644 --- a/src/kernel/basesegment.C +++ b/src/kernel/basesegment.C @@ -31,7 +31,6 @@ #include <kernel/vmmmgr.H> #include <kernel/cpuid.H> -#define SLBE_s 40 BaseSegment::~BaseSegment() { @@ -54,12 +53,12 @@ void BaseSegment::_init() case CORE_POWER7: case CORE_POWER7_PLUS: case CORE_POWER8_VENICE: - iv_physMemSize = VmmManager::EIGHT_MEG; + iv_physMemSize = (8*MEGABYTE); break; case CORE_POWER8_SALERNO: default: - iv_physMemSize = VmmManager::FOUR_MEG; + iv_physMemSize = (4*MEGABYTE); break; } // Base block is L3 cache physical memory size diff --git a/src/kernel/devicesegment.C b/src/kernel/devicesegment.C index f158ab3ec..4af3a75bb 100644 --- a/src/kernel/devicesegment.C +++ b/src/kernel/devicesegment.C @@ -28,8 +28,6 @@ #include <kernel/devicesegment.H> #include <kernel/segmentmgr.H> -#define SLBE_s 40 - #include <kernel/console.H> /** diff --git a/src/kernel/heapmgr.C b/src/kernel/heapmgr.C index 5eddccc3d..7d3757b9f 100644 --- a/src/kernel/heapmgr.C +++ b/src/kernel/heapmgr.C @@ -102,7 +102,7 @@ void HeapManager::newPage() { void* page = PageManager::allocatePage(); chunk_t * c = (chunk_t*)page; - for (int i = 0; i < (PAGESIZE / (1 << (BUCKETS + 3))); i++) + for (uint64_t i = 0; i < (PAGESIZE / (1 << (BUCKETS + 3))); i++) { c->len = BUCKETS-1; push_bucket(c, BUCKETS-1); diff --git a/src/kernel/segmentmgr.C b/src/kernel/segmentmgr.C index c52b4de04..890bd1812 100644 --- a/src/kernel/segmentmgr.C +++ b/src/kernel/segmentmgr.C @@ -121,9 +121,6 @@ uint64_t SegmentManager::_findPhysicalAddress(uint64_t i_vaddr) const void SegmentManager::_updateRefCount( uint64_t i_vaddr, PageTableManager::UsageStats_t i_stats ) { - // This constant should come from page manager. Segment size. - const size_t SLBE_s = 40; - // Get segment ID from effective address. size_t segId = i_vaddr >> SLBE_s; diff --git a/src/kernel/stacksegment.C b/src/kernel/stacksegment.C index 91b16e6a9..592d4dec7 100644 --- a/src/kernel/stacksegment.C +++ b/src/kernel/stacksegment.C @@ -28,6 +28,7 @@ #include <kernel/segmentmgr.H> #include <kernel/block.H> #include <errno.h> +#include <usr/vmmconst.h> void StackSegment::init() { @@ -62,7 +63,7 @@ StackSegment::~StackSegment() bool StackSegment::handlePageFault(task_t* i_task, uint64_t i_addr) { - uint64_t l_addr_8mb = i_addr & ~((EIGHT_MEGABYTE) - 1); + uint64_t l_addr_8mb = i_addr & ~((8*MEGABYTE) - 1); StackBlockNode* l_node = iv_blockList.find(l_addr_8mb); @@ -73,7 +74,7 @@ bool StackSegment::handlePageFault(task_t* i_task, uint64_t i_addr) uint64_t StackSegment::findPhysicalAddress(uint64_t i_vaddr) const { - uint64_t l_addr_8mb = i_vaddr & ~((EIGHT_MEGABYTE) - 1); + uint64_t l_addr_8mb = i_vaddr & ~((8*MEGABYTE) - 1); StackBlockNode* l_node = iv_blockList.find(l_addr_8mb); @@ -91,7 +92,7 @@ void StackSegment::_init() void* StackSegment::_createStack(tid_t i_task) { /* The segment is broken out into 8MB blocks so we need to place the - * stack somewhere within an 8MB range. The constrants are ensuring + * stack somewhere within an 8MB range. The constraints are ensuring * we have adequate protection and that the hashed page table does not * have a large number of collisions. If we were to place all of the * stacks at (8MB - 64k) there would be a large amount of contention on @@ -117,7 +118,7 @@ void* StackSegment::_createStack(tid_t i_task) * space). */ - uint64_t l_addr_8mb = i_task * EIGHT_MEGABYTE + ONE_TERABYTE; + uint64_t l_addr_8mb = i_task * (8*MEGABYTE) + VMM_VADDR_STACK_SEGMENT; // Ensure block doesn't already exist. kassert(NULL == iv_blockList.find(l_addr_8mb)); @@ -149,7 +150,7 @@ void* StackSegment::_createStack(tid_t i_task) void StackSegment::_deleteStack(tid_t i_task) { - uint64_t l_addr_8mb = i_task * EIGHT_MEGABYTE + ONE_TERABYTE; + uint64_t l_addr_8mb = i_task * (8*MEGABYTE) + VMM_VADDR_STACK_SEGMENT; StackBlockNode* l_node = iv_blockList.find(l_addr_8mb); kassert(NULL != l_node); |