summaryrefslogtreecommitdiffstats
path: root/src/include/kernel/segmentmgr.H
diff options
context:
space:
mode:
authorPatrick Williams <iawillia@us.ibm.com>2012-01-11 10:25:12 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2012-01-18 09:52:45 -0600
commitb699fc329722088174afe6031351d3bddb559f6c (patch)
tree62e2ad43fb7becba393346fbb2aeca1ba140efdf /src/include/kernel/segmentmgr.H
parent811a7e18fb3630f4af77c545f057aa147b18334c (diff)
downloadtalos-hostboot-b699fc329722088174afe6031351d3bddb559f6c.tar.gz
talos-hostboot-b699fc329722088174afe6031351d3bddb559f6c.zip
Support additional device segments and MMIO blocks
Change-Id: Icd2e9ed7de2c0227b25979622d0f37a77595570a Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/609 Tested-by: Jenkins Server Reviewed-by: MATTHEW S. BARTH <msbarth@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com> Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/include/kernel/segmentmgr.H')
-rw-r--r--src/include/kernel/segmentmgr.H36
1 files changed, 30 insertions, 6 deletions
diff --git a/src/include/kernel/segmentmgr.H b/src/include/kernel/segmentmgr.H
index d2e4be2df..85ecf3269 100644
--- a/src/include/kernel/segmentmgr.H
+++ b/src/include/kernel/segmentmgr.H
@@ -51,17 +51,18 @@ class SegmentManager
BASE_SEGMENT_ID = 0,
/** Task Stack Segment (1-2TB). */
STACK_SEGMENT_ID = 1,
- /** MMIO Space Segment (2-3TB). */
- MMIO_SEGMENT_ID = 2,
+ /** MMIO Space Segments (2-11TB). */
+ MMIO_FIRST_SEGMENT_ID = 2,
+ MMIO_LAST_SEGMENT_ID = MMIO_FIRST_SEGMENT_ID + 8,
- MAX_SEGMENTS = 4
+ MAX_SEGMENTS = 16
};
enum
{
CI_ACCESS = 0xFFFFFFFF
// Set to all F's to identify this type
- };
+ };
/**
* Constructor. Initializes instance variables.
@@ -130,12 +131,30 @@ class SegmentManager
*/
static void castOutPages(uint64_t i_type);
+ /**
+ * @brief Map a device into the device segment
+ * @param ra[in] - Void pointer to real address to be mapped in
+ * @param i_devDataSize[in] - Size of device segment block
+ * @return void* - Pointer to beginning virtual address, NULL otherwise
+ */
+ static void* devMap(void* ra, uint64_t i_devDataSize);
+
+ /**
+ * @brief Unmap a device from the device segment
+ * @param ea[in] - Void pointer to effective address
+ * @return int - 0 for successful unmap, non-zero otherwise
+ */
+ static int devUnmap(void* ea);
+
+
private:
/** See handlePageFault. */
bool _handlePageFault(task_t* i_task, uint64_t i_addr);
/** See addSegment. */
void _addSegment(Segment* i_segment, size_t i_segId);
+ /** See getSegment. */
+ Segment* _getSegment(size_t i_segId);
/** See initSLB. */
void _initSLB();
/** See updateRefCount. */
@@ -143,14 +162,19 @@ class SegmentManager
PageTableManager::UsageStats_t i_stats );
/** See castOutPages */
void _castOutPages(uint64_t i_type);
+ /** See devMap */
+ void* _devMap(void* ra, uint64_t i_devDataSize);
+ /** See devUnmap */
+ int _devUnmap(void* ea);
+
/** See findPhysicalAddress */
uint64_t _findPhysicalAddress(uint64_t i_vaddr) const;
ALWAYS_INLINE
- size_t getSegmentIdFromAddress(uint64_t i_addr) const
+ static size_t getSegmentIdFromAddress(uint64_t i_addr)
{
- return i_addr >> SLBE_s;
+ return i_addr >> SLBE_s;
}
/** Array of segment objects to associated segment IDs. */
OpenPOWER on IntegriCloud