diff options
author | Missy Connell <missyc@us.ibm.com> | 2012-09-10 16:05:01 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-10-09 17:10:32 -0500 |
commit | 1bf8c6b8376efacd03e3ec62d5ded5b2be4bff39 (patch) | |
tree | c266815232142e67f15a61ffcbdf09407737f259 /src/usr/testcore | |
parent | fb1836fd7b1b8839815595db08ae740ec7b86347 (diff) | |
download | talos-hostboot-1bf8c6b8376efacd03e3ec62d5ded5b2be4bff39.tar.gz talos-hostboot-1bf8c6b8376efacd03e3ec62d5ded5b2be4bff39.zip |
Extend VMM to 32M
Add mmLinearMap to create block at a specified phys addr.
Added iv_MaptoPhy in the block to indicate we are physically mapped
block and to not apply the HRMOR.
Change-Id: I75ddb19b82ae9a2035ff873edff8a34a33c74639
RTC:43401
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/1846
Tested-by: Jenkins Server
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 | 90 |
1 files changed, 67 insertions, 23 deletions
diff --git a/src/usr/testcore/kernel/segmenttest.H b/src/usr/testcore/kernel/segmenttest.H index 72ae8f23a..478f63657 100644 --- a/src/usr/testcore/kernel/segmenttest.H +++ b/src/usr/testcore/kernel/segmenttest.H @@ -1,26 +1,25 @@ -/* IBM_PROLOG_BEGIN_TAG - * This is an automatically generated prolog. - * - * $Source: src/usr/testcore/kernel/segmenttest.H $ - * - * IBM CONFIDENTIAL - * - * COPYRIGHT International Business Machines Corp. 2011-2012 - * - * p1 - * - * Object Code Only (OCO) source materials - * Licensed Internal Code Source Materials - * IBM HostBoot Licensed Internal Code - * - * The source code for this program is not published or other- - * wise divested of its trade secrets, irrespective of what has - * been deposited with the U.S. Copyright Office. - * - * Origin: 30 - * - * IBM_PROLOG_END_TAG - */ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/testcore/kernel/segmenttest.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2011,2012 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ #ifndef __SEGMENTTEST_H #define __SEGMENTTEST_H /** @@ -112,6 +111,51 @@ class segmenttest: public CxxTest::TestSuite } } + // Create 2 blocks at different specified address's and sizes and direct + // map this. + void testSegLinearBlock() + { + int rc = -1; + uint64_t phys = 0; + uint64_t addr = 0x8000000 - 0x5000; //128M- 16K + uint64_t size = 0x1000; //4K + + rc = mm_linear_map(reinterpret_cast<void*>(addr),size); + if (rc != 0) + { + TS_FAIL("Failed to create BaseSegment block\n"); + } + + phys = mm_virt_to_phys( reinterpret_cast<void*>(addr) ); + + if( phys != addr ) + { + TS_TRACE( "Block> virt=%lX, phys=%lX", &addr, phys ); + TS_FAIL("Unexpected Physical Address for block."); + } + + + uint64_t addr2 = 0x8000000 - 0x3000; //128M- 12k + uint64_t size2 = 0x3000; //12K + + rc = mm_linear_map(reinterpret_cast<void*>(addr2),size2); + + if (rc != 0) + { + TS_FAIL("Failed to create BaseSegment block\n"); + } + + phys = mm_virt_to_phys( reinterpret_cast<void*>(addr2) ); + + if( phys != addr2 ) + { + TS_TRACE( "Block> virt=%lX, phys=%lX", &addr2, phys ); + TS_FAIL("Unexpected Physical Address for block."); + + } + + } + }; #endif |