summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMatthew Barth <msbarth@us.ibm.com>2011-09-09 16:46:39 -0500
committerMATTHEW S. BARTH <msbarth@us.ibm.com>2011-09-14 11:25:18 -0500
commitb06c8727c809ec10aafe8fad0b929626f9d50987 (patch)
treea23543920d2826749bb125ebe6cfa22ad9b36446 /src/include
parent4b2a8bf042e96d8181929e92d9b241f65280a93c (diff)
downloadblackbird-hostboot-b06c8727c809ec10aafe8fad0b929626f9d50987.tar.gz
blackbird-hostboot-b06c8727c809ec10aafe8fad0b929626f9d50987.zip
Remove page by given TYPE system call
Change-Id: Iffdd97a75944abbd52dbc72d3aa1394b771fd371 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/333 Tested-by: Jenkins Server Reviewed-by: MATTHEW S. BARTH <msbarth@us.ibm.com>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/kernel/syscalls.H2
-rw-r--r--src/include/kernel/vmmmgr.H14
-rw-r--r--src/include/sys/mm.h20
3 files changed, 36 insertions, 0 deletions
diff --git a/src/include/kernel/syscalls.H b/src/include/kernel/syscalls.H
index 332273a07..bdffea120 100644
--- a/src/include/kernel/syscalls.H
+++ b/src/include/kernel/syscalls.H
@@ -94,6 +94,8 @@ namespace Systemcalls
/** mm_alloc_block() */
MM_ALLOC_BLOCK,
+ /** mm_remove_pages() */
+ MM_REMOVE_PAGES,
SYSCALL_MAX
};
diff --git a/src/include/kernel/vmmmgr.H b/src/include/kernel/vmmmgr.H
index 06533e34e..ff8702f53 100644
--- a/src/include/kernel/vmmmgr.H
+++ b/src/include/kernel/vmmmgr.H
@@ -25,6 +25,7 @@
#include <limits.h>
#include <sys/mmio.h>
+#include <sys/mm.h>
#include <kernel/types.h>
#include <kernel/spinlock.H>
@@ -108,6 +109,19 @@ class VmmManager
*/
static uint64_t findPhysicalAddress(uint64_t i_vaddr);
+ /**
+ * @brief Remove pages by a specified operation of the given size
+ * @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
+ * @return int - 0 for successful page removal, non-zero otherwise
+ *
+ * The given virtual address will be 'rounded' down to the nearest page
+ * boundary, along with the given size will be 'rounded' up to the
+ * nearest divisible page size.
+ */
+ static int mmRemovePages(PAGE_REMOVAL_OPS i_op, void* i_vaddr,
+ uint64_t i_size);
protected:
VmmManager();
diff --git a/src/include/sys/mm.h b/src/include/sys/mm.h
index ba9fe9e19..a14e4f83d 100644
--- a/src/include/sys/mm.h
+++ b/src/include/sys/mm.h
@@ -32,6 +32,15 @@ extern "C"
{
#endif
+/**
+ * Page removal operations
+ */
+enum PAGE_REMOVAL_OPS
+{
+ RELEASE,
+ FLUSH,
+};
+
/** @fn mm_alloc_block()
* @brief System call to allocate virtual memory block in the base segment
*
@@ -43,6 +52,17 @@ extern "C"
*/
int mm_alloc_block(msg_q_t mq,void* va,uint64_t size);
+/** @fn mm_remove_pages()
+ * @brief System call to remove pages by a specified operation
+ *
+ * @param[in] i_op - Page removal operation to perform
+ * @param[in] i_vaddr - Virtual address associated to page(s)
+ * @param[in] size - Size of memory to perform page removal on
+ *
+ * @return int - 0 for successful page removal, non-zero otherwise
+ */
+int mm_remove_pages(PAGE_REMOVAL_OPS i_op, void* i_vaddr, uint64_t i_size);
+
#ifdef __cplusplus
}
#endif
OpenPOWER on IntegriCloud