summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMatthew Barth <msbarth@us.ibm.com>2011-08-19 11:31:43 -0500
committerMATTHEW S. BARTH <msbarth@us.ibm.com>2011-08-23 16:34:04 -0500
commitb755e532a742a9143946c7b5bd17c6a244d2316a (patch)
treefdbc0030154ad8a0f08d1c9e4a50f425c05a0b20 /src/include
parent213b45cd7d8b0367f85ee68b79941f6d548c1e9c (diff)
downloadtalos-hostboot-b755e532a742a9143946c7b5bd17c6a244d2316a.tar.gz
talos-hostboot-b755e532a742a9143946c7b5bd17c6a244d2316a.zip
Handle response from messages registered to a block within the base segment
Change-Id: I65be2258e5e6bd707797415a5376fd94c3bab68a Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/265 Tested-by: Jenkins Server Reviewed-by: MATTHEW S. BARTH <msbarth@us.ibm.com>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/kernel/block.H21
-rw-r--r--src/include/kernel/blockmsghdlr.H65
2 files changed, 84 insertions, 2 deletions
diff --git a/src/include/kernel/block.H b/src/include/kernel/block.H
index 45b506a80..4e23d9710 100644
--- a/src/include/kernel/block.H
+++ b/src/include/kernel/block.H
@@ -7,7 +7,7 @@
#include <stdint.h>
#include <kernel/task.H>
#include <kernel/vmmmgr.H>
-#include <kernel/msghandler.H>
+#include <kernel/blockmsghdlr.H>
class ShadowPTE;
class Segment;
@@ -91,6 +91,23 @@ 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);
+
friend class Segment;
friend class BaseSegment;
friend class StackSegment;
@@ -150,7 +167,7 @@ class Block
/** Pointer to the Shadow PTE entries. */
ShadowPTE* iv_ptes;
/** Pointer to the message handler */
- MessageHandler* iv_msgHdlr;
+ BlockMsgHdlr* iv_msgHdlr;
/**
* @brief Finish initialization of block.
diff --git a/src/include/kernel/blockmsghdlr.H b/src/include/kernel/blockmsghdlr.H
new file mode 100644
index 000000000..e67c1911d
--- /dev/null
+++ b/src/include/kernel/blockmsghdlr.H
@@ -0,0 +1,65 @@
+/** @file blockmsghdlr.H
+ * @brief Defines the implementation for a block's handling of messages.
+ */
+#ifndef __KERNEL_BLOCKMSGHDLR_H
+#define __KERNEL_BLOCKMSGHDLR_H
+
+#include <stdint.h>
+#include <kernel/types.h>
+#include <kernel/msghandler.H>
+
+//Forward declaration.
+class Spinlock;
+class MessageQueue;
+class Block;
+
+/**
+ * @class BlockMsgHdlr
+ * @brief Class to handle message data for blocks
+ *
+ * This class extends from the base MessageHandler so the base send/receive
+ * message functions can be utilized. It overrides how to handle the message
+ * responses for blocks within the base virtual memory segment.
+ */
+class BlockMsgHdlr : public MessageHandler
+{
+ public:
+
+ /**
+ * @brief Constructor
+ *
+ * @param[in] i_lock - Subsystem lock for this message handler, passed
+ * directly onto the MessageHandler
+ * @param[in] i_msgq - Queue used to send messages into userspace,
+ * passed directly onto the MessageHandler
+ * @param[in] i_block - Block to associate this message handler to
+ */
+ BlockMsgHdlr(Spinlock* i_lock, MessageQueue* i_msgq, Block* i_block) :
+ MessageHandler(i_lock,i_msgq), iv_block(i_block) {};
+
+ /**
+ * @brief Destructor
+ */
+ ~BlockMsgHdlr() {};
+
+ /**
+ * @brief Handle response to 'send message' associated with this block
+ *
+ * @param[in] i_type - The message type previously sent.
+ * @param[in] i_key - The key value for the received message.
+ * @param[in] i_task - The deferred task.
+ * @param[in] i_rc - The response rc from userspace.
+ *
+ * @return HandleResult - The desired behavior on the 'recv message'
+ * interface for this <key, task> pair.
+ */
+ virtual HandleResult handleResponse(msg_sys_types_t i_type,void* i_key,
+ task_t* i_task,int i_rc);
+
+ private:
+
+ /* Associated block for this message handler */
+ Block* const iv_block;
+};
+
+#endif
OpenPOWER on IntegriCloud