diff options
author | Missy Connell <missyc@us.ibm.com> | 2011-09-07 14:34:48 -0500 |
---|---|---|
committer | Melissa J. Connell <missyc@us.ibm.com> | 2011-09-15 23:19:29 -0500 |
commit | a740789978e866ce8e9c278ecb05b0060751f090 (patch) | |
tree | b3e6babc2767801f22ace9745dc56457e8eff218 /src/include/kernel | |
parent | a5f6b8ec8b637628dd843ec8f187e01acb678b67 (diff) | |
download | blackbird-hostboot-a740789978e866ce8e9c278ecb05b0060751f090.tar.gz blackbird-hostboot-a740789978e866ce8e9c278ecb05b0060751f090.zip |
Adding new interface to update page permissions.. Interface only.
Added changes from review comments
Updated new enum for system call
Change-Id: I8a55b5e2f67427e59263eae31913e438ca782006
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/331
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Reviewed-by: Douglas R. Gilbert <dgilbert@us.ibm.com>
Reviewed-by: Melissa J. Connell <missyc@us.ibm.com>
Diffstat (limited to 'src/include/kernel')
-rw-r--r-- | src/include/kernel/basesegment.H | 28 | ||||
-rw-r--r-- | src/include/kernel/syscalls.H | 5 | ||||
-rw-r--r-- | src/include/kernel/vmmmgr.H | 16 |
3 files changed, 48 insertions, 1 deletions
diff --git a/src/include/kernel/basesegment.H b/src/include/kernel/basesegment.H index 72869d535..da262c2a0 100644 --- a/src/include/kernel/basesegment.H +++ b/src/include/kernel/basesegment.H @@ -27,6 +27,7 @@ #define __KERNEL_BASESEGMENT_H #include <kernel/segment.H> +//#include <kernel/vmmmgr.H> // Forward declaration. class MessageQueue; @@ -93,6 +94,19 @@ class BaseSegment : public Segment */ virtual uint64_t findPhysicalAddress(uint64_t i_vaddr) const; + /** + * @brief Sets the page permissions for a given virtual address and size. + * @param i_va[in] - virtual address of the page(s) to set permissions + * @param i_size[in] - range of memory that needs permissions updated... + * if i_size equals 0 then we only need to update an + * individual page. + * @param i_access_type[in] - type of permission to set + * @return int - 0 for successful block allocation, non-zero otherwise + */ + static int mmSetPermission(void* i_va, + uint64_t i_size, + PAGE_PERMISSIONS i_access_type); + private: /** * @brief Internal implementation of init function. @@ -114,6 +128,20 @@ class BaseSegment : public Segment */ int _mmAllocBlock(MessageQueue* i_mq,void* i_va,uint64_t i_size); + /** + * @brief Sets the page permissions for a given virtual address and size. + * @param i_va[in] - virtual address of the page(s) to set permissions + * @param i_size[in] - range of memory that needs permissions updated... + * if i_size equals 0 then we only need to update an individual + * page. + * @param i_access_type[in] - type of permission to set + * @return int - 0 for successful block allocation, non-zero otherwise + */ + int _mmSetPermission(void* i_va, + uint64_t i_size, + PAGE_PERMISSIONS i_access_type); + + }; #endif diff --git a/src/include/kernel/syscalls.H b/src/include/kernel/syscalls.H index bdffea120..70dd436be 100644 --- a/src/include/kernel/syscalls.H +++ b/src/include/kernel/syscalls.H @@ -97,7 +97,10 @@ namespace Systemcalls /** mm_remove_pages() */ MM_REMOVE_PAGES, - SYSCALL_MAX + /** mm_set_permission() */ + MM_SET_PERMISSION, + + SYSCALL_MAX }; /** @enum SysCalls_FastPath diff --git a/src/include/kernel/vmmmgr.H b/src/include/kernel/vmmmgr.H index 2d0d0297d..ef8e6c362 100644 --- a/src/include/kernel/vmmmgr.H +++ b/src/include/kernel/vmmmgr.H @@ -118,6 +118,19 @@ class VmmManager */ static int mmRemovePages(PAGE_REMOVAL_OPS i_op, void* i_vaddr, uint64_t i_size); + /** + * @brief Sets the permissions for a given page or range of pages + * @param i_va[in] - Virtual address of the page to update permission + * @param i_size[in] - range of memory that needs permissions updated... + * if i_size equals 0 then we only need to update an + * individual page. + * @return int - 0 for successful permission update, 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 mmSetPermission(void* i_va,uint64_t i_size, PAGE_PERMISSIONS i_access_type); protected: VmmManager(); @@ -141,6 +154,9 @@ class VmmManager /** See findPhysicalAddress */ uint64_t _findPhysicalAddress(uint64_t i_vaddr); + /* See mmSetPermission */ + int _mmSetPermission(void* i_va,uint64_t i_size, PAGE_PERMISSIONS i_access_type); + public: friend class Block; |