diff options
author | Patrick Williams <iawillia@us.ibm.com> | 2012-01-11 10:25:12 -0600 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-01-18 09:52:45 -0600 |
commit | b699fc329722088174afe6031351d3bddb559f6c (patch) | |
tree | 62e2ad43fb7becba393346fbb2aeca1ba140efdf /src/usr/testcore | |
parent | 811a7e18fb3630f4af77c545f057aa147b18334c (diff) | |
download | talos-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/usr/testcore')
-rw-r--r-- | src/usr/testcore/kernel/segmenttest.H | 29 |
1 files changed, 29 insertions, 0 deletions
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 <sys/mmio.h> #include <usr/vmmconst.h> +#include <list> + 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<void*> blocks; + + void* block = NULL; + while (reinterpret_cast<uint64_t>(block) + < (VMM_VADDR_DEVICE_SEGMENT_FIRST + TERABYTE)) + { + block = mmio_dev_map(reinterpret_cast<void*>(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 |