diff options
author | Matthew Barth <msbarth@us.ibm.com> | 2011-08-12 10:54:52 -0500 |
---|---|---|
committer | MATTHEW S. BARTH <msbarth@us.ibm.com> | 2011-08-15 16:14:21 -0500 |
commit | 5b4ea4d127be9898ae1aada5df6b06e67ec47086 (patch) | |
tree | 2df7dd4825b8208492a536174f6f6bb4dc86d997 /src/include/kernel/block.H | |
parent | fa0113e4599fcca0c2d4c938c88d445d288a952a (diff) | |
download | talos-hostboot-5b4ea4d127be9898ae1aada5df6b06e67ec47086.tar.gz talos-hostboot-5b4ea4d127be9898ae1aada5df6b06e67ec47086.zip |
Support msgq and paging data for blocks in base segment
Change-Id: I4f1775b6a843140be97f3c328155aa1654086723
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/254
Tested-by: Jenkins Server
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/kernel/block.H')
-rw-r--r-- | src/include/kernel/block.H | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/src/include/kernel/block.H b/src/include/kernel/block.H index 1de1c1280..45b506a80 100644 --- a/src/include/kernel/block.H +++ b/src/include/kernel/block.H @@ -7,9 +7,11 @@ #include <stdint.h> #include <kernel/task.H> #include <kernel/vmmmgr.H> +#include <kernel/msghandler.H> class ShadowPTE; class Segment; +class MessageQueue; /** @class Block * @brief Provides management of the memory pages associated with a block of @@ -36,13 +38,17 @@ class Block * * @param[in] i_baseAddr - Base virtual Address of the block. * @param[in] i_size - Size of the block (in bytes). + * @param[in] i_msgQueue - Message queue passed along to the handler + * Default: NULL * * Will allocate enough shadow PTEs to track pages in the block. */ - Block(uint64_t i_baseAddr, uint64_t i_size) : + Block(uint64_t i_baseAddr, uint64_t i_size, + MessageQueue* i_msgQueue = NULL) : iv_baseAddr(i_baseAddr), iv_size(i_size), - iv_parent(NULL), iv_nextBlock(NULL), iv_ptes(NULL) - { init(); }; + iv_parent(NULL), iv_nextBlock(NULL), iv_ptes(NULL), + iv_msgHdlr(NULL) + { init(i_msgQueue); }; /** * @brief Destructor. @@ -118,6 +124,18 @@ class Block void setPhysicalPage(uint64_t i_vAddr, uint64_t i_pAddr, VmmManager::ACCESS_TYPES i_access); + /** + * @brief Adds up the total size of all blocks within the segment + * + * @param[in/out] io_totalSize - total size allocated within segment + */ + void totalBlocksAlloc(uint64_t &io_totalSize) + { + io_totalSize=io_totalSize+this->iv_size; + if (iv_nextBlock == NULL) return; + else iv_nextBlock->totalBlocksAlloc(io_totalSize); + } + private: /** Base address of the block */ const uint64_t iv_baseAddr; @@ -131,10 +149,14 @@ class Block /** Pointer to the Shadow PTE entries. */ ShadowPTE* iv_ptes; + /** Pointer to the message handler */ + MessageHandler* iv_msgHdlr; /** * @brief Finish initialization of block. * + * @param[in] i_msgQ - The message queue associated with this block + * * Construct ShadowPTE entries. * * This is defined as a separate function to reduce the code @@ -142,7 +164,7 @@ class Block * "not-in-charge" version of each constructor, so put as much * common code into an init function. */ - void init(); + void init(MessageQueue* i_msgQ); /** * @brief Find the Shadow PTE for a virtual address. |