summaryrefslogtreecommitdiffstats
path: root/src/kernel/block.C
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/kernel/block.C
parent213b45cd7d8b0367f85ee68b79941f6d548c1e9c (diff)
downloadblackbird-hostboot-b755e532a742a9143946c7b5bd17c6a244d2316a.tar.gz
blackbird-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/kernel/block.C')
-rw-r--r--src/kernel/block.C27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/kernel/block.C b/src/kernel/block.C
index 5d9b8d1e3..17d6a1d5c 100644
--- a/src/kernel/block.C
+++ b/src/kernel/block.C
@@ -8,6 +8,7 @@
#include <kernel/vmmmgr.H>
#include <kernel/ptmgr.H>
#include <kernel/pagemgr.H>
+//#include <kernel/console.H>
Block::~Block()
{
@@ -29,7 +30,7 @@ void Block::init(MessageQueue* i_msgQ)
if (i_msgQ != NULL)
{
//Create message handler attribute for this block with this msgq
- this->iv_msgHdlr = new MessageHandler(VmmManager::getLock(),i_msgQ);
+ this->iv_msgHdlr = new BlockMsgHdlr(VmmManager::getLock(),i_msgQ,this);
}
}
@@ -61,8 +62,8 @@ bool Block::handlePageFault(task_t* i_task, uint64_t i_addr)
//Add to ShadowPTE
pte->setPageAddr(reinterpret_cast<uint64_t>(l_page));
//TODO - Update to correct permissions requested
- pte->setExecutable(true);
- pte->setWritable(false);
+ pte->setExecutable(false);
+ pte->setWritable(true);
}
//Send message to handler to read page
this->iv_msgHdlr->sendMessage(MSG_MM_RP_READ,
@@ -132,3 +133,23 @@ void Block::setPhysicalPage(uint64_t i_vAddr, uint64_t i_pAddr,
break;
}
}
+
+void Block::setIsPresent(void* i_vaddr)
+{
+ uint64_t l_vaddr = reinterpret_cast<uint64_t>(i_vaddr);
+ ShadowPTE* l_pte = getPTE(l_vaddr);
+ //Set present bit
+ l_pte->setPresent(true);
+}
+
+void Block::addPTE(void* i_vaddr)
+{
+ uint64_t l_vaddr = reinterpret_cast<uint64_t>(i_vaddr);
+ ShadowPTE* l_pte = getPTE(l_vaddr);
+ //Add page table entry
+ PageTableManager::addEntry((l_vaddr / PAGESIZE) * PAGESIZE,
+ l_pte->getPage(),
+ (l_pte->isExecutable() ? VmmManager::RO_EXE_ACCESS :
+ (l_pte->isWritable() ? VmmManager::NORMAL_ACCESS :
+ VmmManager::READ_O_ACCESS)));
+}
OpenPOWER on IntegriCloud