diff options
| author | Patrick Williams <iawillia@us.ibm.com> | 2011-07-08 19:33:40 -0500 |
|---|---|---|
| committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2011-07-20 14:58:43 -0500 |
| commit | 471f09f1a9bcc46fc385fa8aca776cb682075c0b (patch) | |
| tree | e0a4969825799dcc4c28a71975cb68439f507390 /src/include/kernel/segment.H | |
| parent | 3ecf7085ccc55eb4f815a62f47ea09f55bb6688e (diff) | |
| download | blackbird-hostboot-471f09f1a9bcc46fc385fa8aca776cb682075c0b.tar.gz blackbird-hostboot-471f09f1a9bcc46fc385fa8aca776cb682075c0b.zip | |
VMM Improvements.
- Segment Manager
- Base / Device Segments
- Block for Base image.
Change-Id: Ic0c058e5c5b210ec1c48d30f6ed9f9837d74a3c8
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/193
Tested-by: Jenkins Server
Reviewed-by: MATTHEW S. BARTH <msbarth@us.ibm.com>
Diffstat (limited to 'src/include/kernel/segment.H')
| -rw-r--r-- | src/include/kernel/segment.H | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/include/kernel/segment.H b/src/include/kernel/segment.H new file mode 100644 index 000000000..5a4e7d092 --- /dev/null +++ b/src/include/kernel/segment.H @@ -0,0 +1,52 @@ +/** @file segment.H + * @brief Contains the definition of the virtual Segment class. + */ +#ifndef __KERNEL_SEGMENT_H +#define __KERNEL_SEGMENT_H + +#include <kernel/task.H> + +/** @class Segment + * @brief Virtual segment class to handle virtual memory management within + * a 1TB segment. + */ +class Segment +{ + public: + /** + * @brief Constructor. + * @param[in] i_baseAddr - Base [virtual] address of this segment. + */ + explicit Segment(uint64_t i_baseAddr) : iv_baseAddress(i_baseAddr) {}; + /** + * @brief Destructor. + * No additional action necessary. + */ + virtual ~Segment() {}; + + /** + * @brief Responsible for handling page faults within the segment. + * + * @param[in] i_task - Task causing the page fault. + * @param[in] i_addr - Effective address accessed to cause fault. + * + * @return true - Page fault was successfully handled. + * + * If the page fault is not successfully handled the expectation is + * that the VMM will perform appropriate action, such as killing the + * task. + */ + virtual bool handlePageFault(task_t* i_task, uint64_t i_addr) = 0; + + /** + * @brief Get the base address of this segment. + * @return Base address (as uint64_t). + */ + uint64_t getBaseAddress() const { return iv_baseAddress; }; + + protected: + /** The base address of the segment. */ + const uint64_t iv_baseAddress; +}; + +#endif |

