From b699fc329722088174afe6031351d3bddb559f6c Mon Sep 17 00:00:00 2001 From: Patrick Williams Date: Wed, 11 Jan 2012 10:25:12 -0600 Subject: 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 Reviewed-by: Daniel M. Crowell Reviewed-by: A. Patrick Williams III --- src/usr/testcore/kernel/segmenttest.H | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/usr/testcore/kernel') diff --git a/src/usr/testcore/kernel/segmenttest.H b/src/usr/testcore/kernel/segmenttest.H index effa34e2e..e5b9ff64a 100644 --- a/src/usr/testcore/kernel/segmenttest.H +++ b/src/usr/testcore/kernel/segmenttest.H @@ -34,6 +34,8 @@ #include #include +#include + class segmenttest: public CxxTest::TestSuite { public: @@ -82,6 +84,33 @@ class segmenttest: public CxxTest::TestSuite } } + // Verify we can allocate a block from the second device segment. + void testManyDeviceBlocks() + { + std::list blocks; + + void* block = NULL; + while (reinterpret_cast(block) + < (VMM_VADDR_DEVICE_SEGMENT_FIRST + TERABYTE)) + { + block = mmio_dev_map(reinterpret_cast(10 * TERABYTE), + THIRTYTWO_GB); + + if (block == NULL) + { + TS_FAIL("Unable to allocate device block."); + break; + } + blocks.push_back(block); + } + + while(!blocks.empty()) + { + mmio_dev_unmap(blocks.front()); + blocks.pop_front(); + } + } + }; #endif -- cgit v1.2.3