summaryrefslogtreecommitdiffstats
path: root/src/kernel/basesegment.C
diff options
context:
space:
mode:
authorMatthew Barth <msbarth@us.ibm.com>2011-09-29 15:42:30 -0500
committerMATTHEW S. BARTH <msbarth@us.ibm.com>2011-10-10 15:51:19 -0500
commit8c062af8b6bd50a59823c7ec430ec5fc019052d2 (patch)
treedbe0625a3024a3737ddfa5d32634ce8225fda991 /src/kernel/basesegment.C
parent4de170997eee6244b2091bb8bf065ae2da1396d7 (diff)
downloadtalos-hostboot-8c062af8b6bd50a59823c7ec430ec5fc019052d2.tar.gz
talos-hostboot-8c062af8b6bd50a59823c7ec430ec5fc019052d2.zip
Flush/Release/Evict pages functionality
Change-Id: Ic0bb4122164e11f6d13e6850abf8ae9bd32caea2 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/393 Tested-by: Jenkins Server Reviewed-by: MATTHEW S. BARTH <msbarth@us.ibm.com>
Diffstat (limited to 'src/kernel/basesegment.C')
-rw-r--r--src/kernel/basesegment.C25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/kernel/basesegment.C b/src/kernel/basesegment.C
index 8eb7e5484..4cb2c39cb 100644
--- a/src/kernel/basesegment.C
+++ b/src/kernel/basesegment.C
@@ -118,7 +118,8 @@ int BaseSegment::_mmAllocBlock(MessageQueue* i_mq,void* i_va,uint64_t i_size)
//Verify input address and size falls within this segment's address range
if (l_vaddr < this->getBaseAddress() ||
l_vaddr >= (this->getBaseAddress() + (1ull << SLBE_s)) ||
- (l_blockSizeTotal + ALIGN_PAGE(i_size)) >= (1ull << SLBE_s))
+ (l_blockSizeTotal + ALIGN_PAGE(i_size)) >= (1ull << SLBE_s) ||
+ (l_vaddr != ALIGN_PAGE_DOWN(l_vaddr)))
{
return -EINVAL;
}
@@ -198,3 +199,25 @@ void BaseSegment::castOutPages(uint64_t i_type)
// Could try again with a more agressive constraint if cast_out == 0 ????
if(cast_out) printkd("Cast out %ld pages,Type=%ld\n",cast_out,i_type);
}
+/**
+ * STATIC
+ * Remove pages by a specified operation of the given size
+ */
+int BaseSegment::mmRemovePages(VmmManager::PAGE_REMOVAL_OPS i_op,
+ void* i_vaddr, uint64_t i_size, task_t* i_task)
+{
+ return Singleton<BaseSegment>::instance()._mmRemovePages(i_op,i_vaddr,
+ i_size,i_task);
+}
+
+/**
+ * Remove pages by a specified operation of the given size
+ */
+int BaseSegment::_mmRemovePages(VmmManager::PAGE_REMOVAL_OPS i_op,
+ void* i_vaddr, uint64_t i_size, task_t* i_task)
+{
+ //Don't allow removal of pages for base block
+ return (iv_block->iv_nextBlock ?
+ iv_block->iv_nextBlock->removePages(i_op,i_vaddr,i_size,i_task):
+ -EINVAL);
+}
OpenPOWER on IntegriCloud