diff options
author | Doug Gilbert <dgilbert@us.ibm.com> | 2011-08-22 17:14:23 -0500 |
---|---|---|
committer | Douglas R. Gilbert <dgilbert@us.ibm.com> | 2011-08-25 13:52:09 -0500 |
commit | bf46e7954689c41cccc897b8b00bcc5db5245374 (patch) | |
tree | c7807ff84dd5f8519fb0b065e03ba4939255d485 /src/include/kernel/segmentmgr.H | |
parent | 968add63523933786a85ab271b277d79dc5851e6 (diff) | |
download | talos-hostboot-bf46e7954689c41cccc897b8b00bcc5db5245374.tar.gz talos-hostboot-bf46e7954689c41cccc897b8b00bcc5db5245374.zip |
map virtual address to physical address in kernel
Change-Id: Id18e604facd517598a18968af3dff927026ad894
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/272
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/include/kernel/segmentmgr.H')
-rw-r--r-- | src/include/kernel/segmentmgr.H | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/include/kernel/segmentmgr.H b/src/include/kernel/segmentmgr.H index cf1a02b1a..0d8caec33 100644 --- a/src/include/kernel/segmentmgr.H +++ b/src/include/kernel/segmentmgr.H @@ -28,6 +28,7 @@ #define __KERNEL_SEGMENTMGR_H #include <kernel/task.H> +#include <builtins.h> // Forward declaration. class Segment; @@ -99,6 +100,14 @@ class SegmentManager */ static void initSLB(); + /** + * @brief Find the phyiscal address bound to the given address + * @param[in] i_vaddr The address + * @return the physical address or -EFAULT @see errno.h + */ + static uint64_t findPhysicalAddress(uint64_t i_vaddr); + + private: /** See handlePageFault. */ bool _handlePageFault(task_t* i_task, uint64_t i_addr); @@ -107,6 +116,15 @@ class SegmentManager /** See initSLB. */ void _initSLB(); + /** See findPhysicalAddress */ + uint64_t _findPhysicalAddress(uint64_t i_vaddr) const; + + ALWAYS_INLINE inline + size_t getSegmentIdFromAddress(uint64_t i_addr) const + { + return i_addr >> 40; // SLBE_s = 40 Should come from page manager? + } + /** Array of segment objects to associated segment IDs. */ Segment* iv_segments[MAX_SEGMENTS]; }; |