diff options
author | Dean Sanner <dsanner@us.ibm.com> | 2013-06-19 12:15:05 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2013-07-02 10:52:52 -0500 |
commit | 102dafda92c9a4ae71d461e54ab7d76c74f371ce (patch) | |
tree | 935dcaa56009901d3c71ce8c667830f4dfc33e4b /src/usr/dump/test | |
parent | 872b09dc527e6e75e4d08e819e74e28157b1283a (diff) | |
download | talos-hostboot-102dafda92c9a4ae71d461e54ab7d76c74f371ce.tar.gz talos-hostboot-102dafda92c9a4ae71d461e54ab7d76c74f371ce.zip |
Update hdat services to use mm_block_map
Change-Id: I14a307a5ff54685e2ade2e58a45f5134f6782942
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/5088
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/dump/test')
-rw-r--r-- | src/usr/dump/test/dumptest.H | 197 |
1 files changed, 82 insertions, 115 deletions
diff --git a/src/usr/dump/test/dumptest.H b/src/usr/dump/test/dumptest.H index b38f45b0d..58568b8a2 100644 --- a/src/usr/dump/test/dumptest.H +++ b/src/usr/dump/test/dumptest.H @@ -41,6 +41,7 @@ #include <sys/mm.h> #include <dump/dumpif.H> #include <vfs/vfs.H> +#include "../dumpCollect.H" extern trace_desc_t* g_trac_dump; @@ -91,28 +92,33 @@ class DumpTest: public CxxTest::TestSuite errlHndl_t l_err = NULL; - uint64_t srcTableAddr = 0; uint64_t srcTableSize = 0; - - uint64_t dstTableAddr = 0; uint64_t dstTableSize = 0; - - uint64_t resultsTableAddr = 0; uint64_t resultsTableSize = 0; - DUMP::dumpEntry *srcTableEntry = NULL; - DUMP::dumpEntry *destTableEntry = NULL; - DUMP::resultsEntry *resultsTableEntry = NULL; + DUMP::dumpEntry *srcTable = NULL; + DUMP::dumpEntry *destTable = NULL; + DUMP::resultsEntry *resultsTable = NULL; // For testing I am using my own data pointers and setting it up // to look like PHYP would have to test the copy function. - srcTableAddr = DUMP_TEST_SRC_MEM_ADDR; - srcTableSize = DUMP_TEST_SRC_MEM_SIZE; - dstTableAddr = DUMP_TEST_DST_MEM_ADDR; - dstTableSize = DUMP_TEST_DST_MEM_SIZE; - resultsTableAddr = DUMP_TEST_RESULTS_MEM_ADDR; - resultsTableSize = DUMP_TEST_RESULTS_MEM_SIZE; + l_err = DUMP::getHostDataPtrs(srcTable, srcTableSize, + destTable, dstTableSize, + resultsTable, resultsTableSize); + if(l_err) + { + TRACFCOMP(g_trac_dump, "DumpTest:test_DumpCollect> error getting getHostDataPtrs: RC=%X" + ,l_err->reasonCode() ); + TS_FAIL( "DumpTest::CollectDump ERROR : Failed getHostDataPtrs" ); + errlCommit(l_err,DUMP_COMP_ID); + return; + } + // Point to the location of the src Data pointer. + // Point to the location of the dest Data pointer. + uint64_t *srcTablePtr = reinterpret_cast<uint64_t *>(srcTable); + uint64_t *dstTablePtr = reinterpret_cast<uint64_t *>(destTable); + uint64_t *resultTablePtr = reinterpret_cast<uint64_t *>(resultsTable); uint64_t src_data[8] = {DUMP_TEST_SRC_DATA_AREA, 64, // 450000 DUMP_TEST_SRC_DATA_AREA + 64, 64, @@ -126,14 +132,6 @@ class DumpTest: public CxxTest::TestSuite DUMP_TEST_DST_DATA_AREA + 192, 64}; - // Point to the location of the src Data pointer. - uint64_t *srcTablePtr = reinterpret_cast<uint64_t *>(srcTableAddr); - - // Point to the location of the dest Data pointer. - uint64_t *dstTablePtr = reinterpret_cast<uint64_t *>(dstTableAddr); - - uint64_t *resultTablePtr = reinterpret_cast<uint64_t *>(resultsTableAddr); - // Put the src addresses defined above into the MDST memcpy(srcTablePtr, src_data, sizeof(src_data)); @@ -210,15 +208,7 @@ class DumpTest: public CxxTest::TestSuite index+=2; } - - srcTableEntry = reinterpret_cast<DUMP::dumpEntry *>(srcTableAddr); - destTableEntry = reinterpret_cast<DUMP::dumpEntry *>(dstTableAddr); - resultsTableEntry = reinterpret_cast<DUMP::resultsEntry *>(resultsTableAddr); - - - l_err = DUMP::copySrcToDest(srcTableEntry,srcTableSize, - destTableEntry,dstTableSize, - resultsTableEntry,resultsTableSize); + l_err = DUMP::doDumpCollect(); if( l_err ) { @@ -309,25 +299,31 @@ class DumpTest: public CxxTest::TestSuite TRACFCOMP( g_trac_dump, "DumpTest::DumpCollectUnevenDest START" ); errlHndl_t l_err = NULL; - uint64_t srcTableAddr = 0; uint64_t srcTableSize = 0; - uint64_t dstTableAddr = 0; uint64_t dstTableSize = 0; - uint64_t resultsTableAddr = 0; uint64_t resultsTableSize = 0; - DUMP::dumpEntry *srcTableEntry = NULL; - DUMP::dumpEntry *destTableEntry = NULL; - DUMP::resultsEntry *resultsTableEntry = NULL; + DUMP::dumpEntry *srcTable = NULL; + DUMP::dumpEntry *destTable = NULL; + DUMP::resultsEntry *resultsTable = NULL; - // Setting up TESt version of the MDST, MDDT and MDRT. - srcTableAddr = DUMP_TEST_SRC_MEM_ADDR; - srcTableSize = DUMP_TEST_SRC_MEM_SIZE; - dstTableAddr = DUMP_TEST_DST_MEM_ADDR; - dstTableSize = DUMP_TEST_DST_MEM_SIZE; - resultsTableAddr = DUMP_TEST_RESULTS_MEM_ADDR; - resultsTableSize = DUMP_TEST_RESULTS_MEM_SIZE; + // For testing I am using my own data pointers and setting it up + // to look like PHYP would have to test the copy function. + l_err = DUMP::getHostDataPtrs(srcTable, srcTableSize, + destTable, dstTableSize, + resultsTable, resultsTableSize); + if(l_err) + { + TRACFCOMP(g_trac_dump, "DumpTest:test_DumpCollect> error getting getHostDataPtrs: RC=%X" + ,l_err->reasonCode() ); + TS_FAIL( "DumpTest::CollectDump ERROR : Failed getHostDataPtrs" ); + errlCommit(l_err,DUMP_COMP_ID); + return; + } + uint64_t *srcTablePtr = reinterpret_cast<uint64_t *>(srcTable); + uint64_t *dstTablePtr = reinterpret_cast<uint64_t *>(destTable); + uint64_t *resultTablePtr = reinterpret_cast<uint64_t *>(resultsTable); uint64_t src_data[8] = {DUMP_TEST_SRC_DATA_AREA+256, 64, // 4500100 DUMP_TEST_SRC_DATA_AREA+256 + 64,64, // 4500140 @@ -339,10 +335,6 @@ class DumpTest: public CxxTest::TestSuite DUMP_TEST_DST_DATA_AREA+1024 + 96, 32, // 4600480 DUMP_TEST_DST_DATA_AREA+1024+ 128, 128}; // 46004C0 - uint64_t *srcTablePtr = reinterpret_cast<uint64_t *>(srcTableAddr); - uint64_t *dstTablePtr = reinterpret_cast<uint64_t *>(dstTableAddr); - uint64_t *resultTablePtr = reinterpret_cast<uint64_t *>(resultsTableAddr); - memcpy(srcTablePtr, src_data, sizeof(src_data)); memcpy(dstTablePtr, dst_data, sizeof(dst_data)); @@ -417,15 +409,7 @@ class DumpTest: public CxxTest::TestSuite index+=2; } - srcTableEntry = reinterpret_cast<DUMP::dumpEntry *>(srcTableAddr); - destTableEntry = reinterpret_cast<DUMP::dumpEntry *>(dstTableAddr); - resultsTableEntry = reinterpret_cast<DUMP::resultsEntry *>(resultsTableAddr); - - - l_err = DUMP::copySrcToDest(srcTableEntry,srcTableSize, - destTableEntry,dstTableSize, - resultsTableEntry,resultsTableSize); - + l_err = DUMP::doDumpCollect(); if( l_err ) { @@ -612,28 +596,32 @@ class DumpTest: public CxxTest::TestSuite errlHndl_t l_err = NULL; - uint64_t srcTableAddr = 0; uint64_t srcTableSize = 0; - - uint64_t dstTableAddr = 0; uint64_t dstTableSize = 0; - - uint64_t resultsTableAddr = 0; uint64_t resultsTableSize = 0; - uint64_t offset = 0; - DUMP::dumpEntry *srcTableEntry = NULL; - DUMP::dumpEntry *destTableEntry = NULL; - DUMP::resultsEntry *resultsTableEntry = NULL; + DUMP::dumpEntry *srcTable = NULL; + DUMP::dumpEntry *destTable = NULL; + DUMP::resultsEntry *resultsTable = NULL; + + // For testing I am using my own data pointers and setting it up + // to look like PHYP would have to test the copy function. + l_err = DUMP::getHostDataPtrs(srcTable, srcTableSize, + destTable, dstTableSize, + resultsTable, resultsTableSize); + if(l_err) + { + TRACFCOMP(g_trac_dump, "DumpTest:test_DumpCollect> error getting getHostDataPtrs: RC=%X" + ,l_err->reasonCode() ); + TS_FAIL( "DumpTest::CollectDump ERROR : Failed getHostDataPtrs" ); + errlCommit(l_err,DUMP_COMP_ID); + return; + } - // Setting up TESt version of the MDST, MDDT and MDRT. - srcTableAddr = DUMP_TEST_SRC_MEM_ADDR; - srcTableSize = DUMP_TEST_SRC_MEM_SIZE; - dstTableAddr = DUMP_TEST_DST_MEM_ADDR; - dstTableSize = DUMP_TEST_DST_MEM_SIZE; - resultsTableAddr = DUMP_TEST_RESULTS_MEM_ADDR; - resultsTableSize = DUMP_TEST_RESULTS_MEM_SIZE; + uint64_t *srcTablePtr = reinterpret_cast<uint64_t *>(srcTable); + uint64_t *dstTablePtr = reinterpret_cast<uint64_t *>(destTable); + uint64_t *resultTablePtr = reinterpret_cast<uint64_t *>(resultsTable); uint64_t src_data[8] = {DUMP_TEST_SRC_DATA_AREA+1024, 16, // 4500400 DUMP_TEST_SRC_DATA_AREA+2048, 48, // 4500800 @@ -646,11 +634,6 @@ class DumpTest: public CxxTest::TestSuite DUMP_TEST_DST_DATA_AREA+3072, 32, // 4600C00 DUMP_TEST_DST_DATA_AREA+3072+64, 128}; // 4600C40 - - uint64_t *srcTablePtr = reinterpret_cast<uint64_t *>(srcTableAddr); - uint64_t *dstTablePtr = reinterpret_cast<uint64_t *>(dstTableAddr); - uint64_t *resultTablePtr = reinterpret_cast<uint64_t *>(resultsTableAddr); - memcpy(srcTablePtr, src_data, sizeof(src_data)); memcpy(dstTablePtr, dst_data, sizeof(dst_data)); @@ -797,15 +780,7 @@ class DumpTest: public CxxTest::TestSuite } }while(0); - - srcTableEntry = reinterpret_cast<DUMP::dumpEntry *>(srcTableAddr); - destTableEntry = reinterpret_cast<DUMP::dumpEntry *>(dstTableAddr); - resultsTableEntry = reinterpret_cast<DUMP::resultsEntry *>(resultsTableAddr); - - - l_err = DUMP::copySrcToDest(srcTableEntry,srcTableSize, - destTableEntry,dstTableSize, - resultsTableEntry,resultsTableSize); + l_err = DUMP::doDumpCollect(); if( l_err ) { @@ -1106,26 +1081,30 @@ class DumpTest: public CxxTest::TestSuite errlHndl_t l_err = NULL; - uint64_t srcTableAddr = 0; uint64_t srcTableSize = 0; - - uint64_t dstTableAddr = 0; uint64_t dstTableSize = 0; - - uint64_t resultsTableAddr = 0; uint64_t resultsTableSize = 0; - DUMP::dumpEntry *srcTableEntry = NULL; - DUMP::dumpEntry *destTableEntry = NULL; - DUMP::resultsEntry *resultsTableEntry = NULL; + DUMP::dumpEntry *srcTable = NULL; + DUMP::dumpEntry *destTable = NULL; + DUMP::resultsEntry *resultsTable = NULL; + + // For testing I am using my own data pointers and setting it up + // to look like PHYP would have to test the copy function. + l_err = DUMP::getHostDataPtrs(srcTable, srcTableSize, + destTable, dstTableSize, + resultsTable, resultsTableSize); + if(l_err) + { + TRACFCOMP(g_trac_dump, "DumpTest:test_DumpCollect> error getting getHostDataPtrs: RC=%X" + ,l_err->reasonCode() ); + TS_FAIL( "DumpTest::CollectDump ERROR : Failed getHostDataPtrs" ); + errlCommit(l_err,DUMP_COMP_ID); + return; + } - // Test locations of the MDST, MDDT, MDRT - srcTableAddr = DUMP_TEST_SRC_MEM_ADDR; - srcTableSize = DUMP_TEST_SRC_MEM_SIZE; - dstTableAddr = DUMP_TEST_DST_MEM_ADDR; - dstTableSize = DUMP_TEST_DST_MEM_SIZE; - resultsTableAddr = DUMP_TEST_RESULTS_MEM_ADDR; - resultsTableSize = DUMP_TEST_RESULTS_MEM_SIZE; + uint64_t *srcTablePtr = reinterpret_cast<uint64_t *>(srcTable); + uint64_t *dstTablePtr = reinterpret_cast<uint64_t *>(destTable); uint64_t src_data[8] = {DUMP_TEST_SRC_DATA_AREA, 64, // 450000 DUMP_TEST_SRC_DATA_AREA + 64, 64, @@ -1139,12 +1118,6 @@ class DumpTest: public CxxTest::TestSuite DUMP_TEST_DST_DATA_AREA + 4096 + 192, 32}; // NOTE>> TOO SMALL of a space.. - // Point to the location of the src Data pointer. - uint64_t *srcTablePtr = reinterpret_cast<uint64_t *>(srcTableAddr); - - // Point to the location of the dest Data pointer. - uint64_t *dstTablePtr = reinterpret_cast<uint64_t *>(dstTableAddr); - // Put the src addresses defined above into the MDST memcpy(srcTablePtr, src_data, sizeof(src_data)); @@ -1224,13 +1197,7 @@ class DumpTest: public CxxTest::TestSuite errlCommit(l_err,DUMP_COMP_ID); } - srcTableEntry = reinterpret_cast<DUMP::dumpEntry *>(srcTableAddr); - destTableEntry = reinterpret_cast<DUMP::dumpEntry *>(dstTableAddr); - resultsTableEntry = reinterpret_cast<DUMP::resultsEntry *>(resultsTableAddr); - - l_err = DUMP::copySrcToDest(srcTableEntry,srcTableSize, - destTableEntry,dstTableSize, - resultsTableEntry,resultsTableSize); + l_err = DUMP::doDumpCollect(); // this testcase expects an error returned. if( l_err ) |