summaryrefslogtreecommitdiffstats
path: root/src/kernel/ptmgr.C
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2012-07-13 21:28:37 -0500
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-07-16 14:00:44 -0500
commit1535c27d4a7a970f3e14ace7cb980ae06820e9ec (patch)
tree5cc9f264592f90f56c40bc12a50d1c6a6261b89a /src/kernel/ptmgr.C
parent7f482f9ad23bd7689fdee5982ad91f8506b2dfb8 (diff)
downloadblackbird-hostboot-1535c27d4a7a970f3e14ace7cb980ae06820e9ec.tar.gz
blackbird-hostboot-1535c27d4a7a970f3e14ace7cb980ae06820e9ec.zip
Improve user-space page allocator.
* Allow page allocation system call to force coalesce if a contiguous block is unavailable. [long-term enhancement] * Workaround lack of large contiguous memory for PageTable test-cases, which require 256K, by allocating a VMM block. This should be removed when story 43401 is implemented. [short-term workaround] Change-Id: Idddb30eaa3aeac52d56b82a70355095f31d4a0cd Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1369 Tested-by: Jenkins Server Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/kernel/ptmgr.C')
-rw-r--r--src/kernel/ptmgr.C65
1 files changed, 40 insertions, 25 deletions
diff --git a/src/kernel/ptmgr.C b/src/kernel/ptmgr.C
index 3d7f28578..bf8937b78 100644
--- a/src/kernel/ptmgr.C
+++ b/src/kernel/ptmgr.C
@@ -1,25 +1,26 @@
-// IBM_PROLOG_BEGIN_TAG
-// This is an automatically generated prolog.
-//
-// $Source: src/kernel/ptmgr.C $
-//
-// IBM CONFIDENTIAL
-//
-// COPYRIGHT International Business Machines Corp. 2011
-//
-// p1
-//
-// Object Code Only (OCO) source materials
-// Licensed Internal Code Source Materials
-// IBM HostBoot Licensed Internal Code
-//
-// The source code for this program is not published or other-
-// wise divested of its trade secrets, irrespective of what has
-// been deposited with the U.S. Copyright Office.
-//
-// Origin: 30
-//
-// IBM_PROLOG_END
+/* IBM_PROLOG_BEGIN_TAG
+ * This is an automatically generated prolog.
+ *
+ * $Source: src/kernel/ptmgr.C $
+ *
+ * IBM CONFIDENTIAL
+ *
+ * COPYRIGHT International Business Machines Corp. 2011-2012
+ *
+ * p1
+ *
+ * Object Code Only (OCO) source materials
+ * Licensed Internal Code Source Materials
+ * IBM HostBoot Licensed Internal Code
+ *
+ * The source code for this program is not published or other-
+ * wise divested of its trade secrets, irrespective of what has
+ * been deposited with the U.S. Copyright Office.
+ *
+ * Origin: 30
+ *
+ * IBM_PROLOG_END_TAG
+ */
#include <kernel/ptmgr.H>
#include <kernel/vmmmgr.H>
#include <util/singleton.H>
@@ -295,7 +296,8 @@ void PageTableManager::flush( void )
/********************
Private/Protected Methods
********************/
-
+#include <sys/mm.h> //@TODO: Remove with 43401
+#include <usr/vmmconst.h> //@TODO: Remove with 43401.
/**
* @brief Constructor
*/
@@ -304,7 +306,16 @@ PageTableManager::PageTableManager( bool i_userSpace )
{
if( i_userSpace )
{
- ivTABLE = new char[getSize()];
+ //@TODO: Remove with 43401.
+ // Don't have enough contiguous memory to do this allocation, so
+ // allocate a VMM block instead.
+ ivTABLE = reinterpret_cast<char*>(VMM_VADDR_RMVPAGE_TEST - getSize());
+ mm_alloc_block(NULL, ivTABLE, getSize());
+ mm_set_permission(ivTABLE, getSize(), WRITABLE | ALLOCATE_FROM_ZERO);
+
+ //@TODO: Add back after 43401.
+ //ivTABLE = new char[getSize()];
+
//printk( "** PageTableManager running in USER_SPACE : ivTABLE = %p**\n", ivTABLE );
}
else
@@ -335,7 +346,11 @@ void PageTableManager::invalidatePT( void )
PageTableManager::~PageTableManager()
{
if( ivTABLE ) {
- delete[] ivTABLE;
+ //@TODO: Remove after 43401.
+ mm_remove_pages(RELEASE, ivTABLE, getSize());
+
+ //@TODO: Add back after 43401.
+ //delete[] ivTABLE;
}
}
OpenPOWER on IntegriCloud