summaryrefslogtreecommitdiffstats
path: root/src/include/kernel/block.H
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/include/kernel/block.H
parent4de170997eee6244b2091bb8bf065ae2da1396d7 (diff)
downloadblackbird-hostboot-8c062af8b6bd50a59823c7ec430ec5fc019052d2.tar.gz
blackbird-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/include/kernel/block.H')
-rw-r--r--src/include/kernel/block.H63
1 files changed, 42 insertions, 21 deletions
diff --git a/src/include/kernel/block.H b/src/include/kernel/block.H
index 405791e94..01187617f 100644
--- a/src/include/kernel/block.H
+++ b/src/include/kernel/block.H
@@ -72,7 +72,7 @@ class Block
MessageQueue* i_msgQueue = NULL) :
iv_baseAddr(i_baseAddr), iv_size(i_size),
iv_parent(NULL), iv_nextBlock(NULL), iv_ptes(NULL),
- iv_msgHdlr(NULL)
+ iv_readMsgHdlr(NULL), iv_writeMsgHdlr(NULL)
{ init(i_msgQueue); };
/**
@@ -117,23 +117,6 @@ class Block
bool handlePageFault(task_t* i_task, uint64_t i_addr);
/**
- * @brief Sets the 'present' bit within the Shadow page table
- *
- * @param[in] i_vaddr - Virtual address within the Shadow page table
- */
- void setIsPresent(void* i_vaddr);
-
- /**
- * @brief Adds the page table entry for the given address
- *
- * @param[in] i_vaddr - Virtual address to add to the page table
- *
- * The permissions set within the Shadow page table are used for
- * this address
- */
- void addPTE(void* i_vaddr);
-
- /**
* @brief Locate the physical address of the given virtual address
*
* @param[in] i_vaddr virtual address
@@ -171,9 +154,22 @@ class Block
*/
bool evictPage(ShadowPTE* i_pte);
+ /**
+ * @brief Removes a range of pages within a block of virtual memory
+ * @param[in] i_op - Page removal operation to perform
+ * @param[in] i_vaddr - Virtual address associated to page(s)
+ * @param[in] i_size - Size of memory to perform page removal on
+ * @param[in] i_task - Task requesting page removal.
+ * @return int - 0 for successful page removal, non-zero otherwise
+ */
+ int removePages(VmmManager::PAGE_REMOVAL_OPS i_op, void* i_vaddr,
+ uint64_t i_size, task_t* i_task);
+
friend class Segment;
friend class BaseSegment;
friend class StackSegment;
+ friend class BlockReadMsgHdlr;
+ friend class BlockWriteMsgHdlr;
protected:
/**
@@ -248,6 +244,30 @@ class Block
*/
int mmSetPermission(uint64_t i_va, uint64_t i_size, uint64_t i_access_type);
+ /**
+ * @brief Adds the page table entry for the given address
+ *
+ * @param[in] i_vaddr - Virtual address to add to the page table
+ *
+ * The permissions set within the Shadow page table are used for
+ * this address
+ */
+ void addPTE(void* i_vaddr);
+
+ /**
+ * @brief Sets the 'present' bit within the Shadow page table
+ *
+ * @param[in] i_vaddr - Virtual address within the Shadow page table
+ */
+ void setIsPresent(void* i_vaddr);
+
+ /**
+ * @brief Effectively removes the given page table entry from the
+ * shadow page table
+ * @param[in] i_pte - Shadow page table entry to release
+ */
+ void releasePTE(ShadowPTE* i_pte);
+
private:
/** Base address of the block */
const uint64_t iv_baseAddr;
@@ -261,8 +281,10 @@ class Block
/** Pointer to the Shadow PTE entries. */
ShadowPTE* iv_ptes;
- /** Pointer to the message handler */
- BlockMsgHdlr* iv_msgHdlr;
+ /** Pointer to message handler(read) */
+ BlockReadMsgHdlr* iv_readMsgHdlr;
+ /** Pointer to message handler(write) */
+ BlockWriteMsgHdlr* iv_writeMsgHdlr;
/**
* @brief Finish initialization of block.
@@ -286,7 +308,6 @@ class Block
*/
ShadowPTE* getPTE(uint64_t i_addr) const;
-
Block(const Block&); // prohibit copy.
Block& operator=(const Block&); // prohibit assignment.
OpenPOWER on IntegriCloud