diff options
author | Stephan Broyles <sbroyles@us.ibm.com> | 2014-12-05 18:08:09 -0600 |
---|---|---|
committer | Stephan Broyles <sbroyles@us.ibm.com> | 2014-12-05 18:35:46 -0600 |
commit | 5a14e6819ce1f153a36cda9d493cff63bb11bb19 (patch) | |
tree | fc8d32498d55adda3418db2ccb62eafbb653266f /src/occApplet | |
parent | ba087b7bee9d69fe39dc401a68ebc1960528fbdf (diff) | |
download | talos-occ-5a14e6819ce1f153a36cda9d493cff63bb11bb19.tar.gz talos-occ-5a14e6819ce1f153a36cda9d493cff63bb11bb19.zip |
Applet test directory cleanup.
Change-Id: I9ce7fc00ca43068b541f7bf709469dd81908b55c
Reviewed-on: http://gfw160.aus.stglabs.ibm.com:8080/gerrit/14741
Reviewed-by: Stephan Broyles <sbroyles@us.ibm.com>
Tested-by: Stephan Broyles <sbroyles@us.ibm.com>
Diffstat (limited to 'src/occApplet')
-rwxr-xr-x | src/occApplet/testApplet/Makefile | 28 | ||||
-rwxr-xr-x | src/occApplet/testApplet/apsstest.c | 57 | ||||
-rwxr-xr-x | src/occApplet/testApplet/errlTest.c | 196 | ||||
-rwxr-xr-x | src/occApplet/testApplet/linkTestApplet.cmd | 56 | ||||
-rw-r--r-- | src/occApplet/testApplet/occLinkInputFile | 25 | ||||
-rwxr-xr-x | src/occApplet/testApplet/pstApplet.c | 81 | ||||
-rwxr-xr-x | src/occApplet/testApplet/sensorTest.c | 156 | ||||
-rwxr-xr-x | src/occApplet/testApplet/testApltId.h | 39 | ||||
-rwxr-xr-x | src/occApplet/testApplet/testappletfiles.mk | 44 | ||||
-rwxr-xr-x | src/occApplet/testApplet/traceTest.c | 109 |
10 files changed, 400 insertions, 391 deletions
diff --git a/src/occApplet/testApplet/Makefile b/src/occApplet/testApplet/Makefile index dba7068..3e78279 100755 --- a/src/occApplet/testApplet/Makefile +++ b/src/occApplet/testApplet/Makefile @@ -1,3 +1,28 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/occApplet/testApplet/Makefile $ +# +# OpenPOWER OnChipController Project +# +# Contributors Listed Below - COPYRIGHT 2011,2014 +# [+] Google Inc. +# [+] International Business Machines Corp. +# +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. See the License for the specific language governing +# permissions and limitations under the License. +# +# IBM_PROLOG_END_TAG ifndef ROOTPATH ROOTPATH = $(shell pwd)/../../ @@ -37,7 +62,6 @@ INCLUDES += -I$(OCC)/aplt/incl -I$(OCC)/cmdh DEFS += $(D) DEFS += -DOCC=1 -DUSE_SSX_APP_CFG_H=1 -# Do not use SDA sections for product applet GCC-CFLAGS = -c -g -Wall -fsigned-char -msoft-float -pipe \ -m32 -Wa,-m405 -mcpu=405 -mmultiple -mstring -meabi \ -ffreestanding -Os -mno-sdata @@ -54,9 +78,9 @@ all: $(TESTAPLT_OBJECTS) #******************************************************************************* .PHONY : combineImage combineImage: + #******************************************************************************* # Clean #******************************************************************************* clean: rm -f *.o *.out *.bin *.dis *.map *.hash linkscript - diff --git a/src/occApplet/testApplet/apsstest.c b/src/occApplet/testApplet/apsstest.c index 8ccd968..106afc8 100755 --- a/src/occApplet/testApplet/apsstest.c +++ b/src/occApplet/testApplet/apsstest.c @@ -1,25 +1,26 @@ -/****************************************************************************** -// @file apsstest.c -// @brief APSS test applet -*/ -/****************************************************************************** - * - * @page ChangeLogs Change Logs - * @section apsstest.c APSSTEST.c - * @verbatim - * - * Flag Def/Fea Userid Date Description - * ------- ---------- -------- ---------- ---------------------------------- - * cjcain 08/30/2011 created - * @02 abagepa 10/03/2011 updated task signature - * @dw000 dwoodham 12/12/2011 Update call to IMAGE_HEADER macro - * @rc001 rickylie 01/10/2012 Change DEBUG_PRINTF to APSS_DBG - * @rc003 rickylie 02/03/2012 Verify & Clean Up OCC Headers & Comments - * - * @endverbatim - * - *///*************************************************************************/ - +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/occApplet/testApplet/apsstest.c $ */ +/* */ +/* OpenPOWER OnChipController Project */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2011,2014 */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ + //************************************************************************* // Includes //************************************************************************* @@ -27,7 +28,7 @@ #include <errl.h> // For error handle #include "ssx_io.h" // For printfs #include <apss.h> // APSS Interfaces -#include <appletId.h> // For applet ID @dw000a +#include <appletId.h> // For applet ID #include <trac.h> // For traces //************************************************************************* @@ -64,15 +65,13 @@ extern PoreEntryPoint GPE_pore_nop; // Sleep for specified amount of time... // // Name: apssTestMain // -// Description: +// Description: // -// Flow: FN=None -// // End Function Specification errlHndl_t apssTestMain(void * i_arg) { APSS_DBG("Running apssTestMain\n"); - errlHndl_t l_err = NULL; + errlHndl_t l_err = NULL; task_apss_start_pwr_meas(NULL); // Schedule GPE program to delay to ensure the data is available... (BLOCKING) @@ -95,13 +94,13 @@ errlHndl_t apssTestMain(void * i_arg) task_apss_complete_pwr_meas(NULL); APSS_DBG("Done apssTestMain\n"); - + return l_err; } /*****************************************************************************/ // Image Header /*****************************************************************************/ -// @dw000 - call macro with Applet ID arg +// call macro with Applet ID arg IMAGE_HEADER (G_apssTestMain,apssTestMain,APSSTESTMAIN_ID,OCC_APLT_TEST); diff --git a/src/occApplet/testApplet/errlTest.c b/src/occApplet/testApplet/errlTest.c index c466c8f..11342aa 100755 --- a/src/occApplet/testApplet/errlTest.c +++ b/src/occApplet/testApplet/errlTest.c @@ -1,27 +1,25 @@ -/****************************************************************************** -// @file errlTest.c -// @brief OCC errl component test applet -*/ -/****************************************************************************** - * - * @page ChangeLogs Change Logs - * @section errlTest.c ERRLTEST.c - * @verbatim - * - * Flag Def/Fea Userid Date Description - * ------- ---------- -------- ---------- ---------------------------------- - * @at002 alvinwan 02/10/2012 Created - * @nh001 neilhsu 05/23/2012 Add missing error log tags - * @at012 868019 alvinwan 01/25/2014 TRAC_get_buffer_partial() can result in TLB Miss Exception - * @jh001 881996 joshych 05/07/2013 Support SRAM error log format - * @jh003 890574 joshych 15/07/2013 Fix errlTest Applet - * @rt001 901927 tapiar 10/02/2013 Update error log to use unique module id - * @fk006 914801 fmkassem 01/05/2013 Remove wrong reference to a reasoncode - * @sb100 916174 sbroyles 02/18/2014 Remove rand.h include for ssx release release20140214 - * - * @endverbatim - * - *///*************************************************************************/ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/occApplet/testApplet/errlTest.c $ */ +/* */ +/* OpenPOWER OnChipController Project */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2011,2014 */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ #define ERRL_DEBUG /*****************************************************************************/ @@ -32,7 +30,6 @@ #include "ssx_io.h" // For ERRL_DBGs #include <errl.h> #include <appletId.h> // For applet ID -// #include <rand.h> @sb100 #include <trac.h> // For traces #include <occ_service_codes.h> // Reason code #include <cmdh_fsp.h> // Needed for rc codes. @@ -60,7 +57,7 @@ #define ERRLTESTMAIN_ID "errl Test\0" #define TRAC_PATTERN 0x55 #define MAX_BUFFER_SIZE MAX_ERRL_CALL_HOME_SZ -#define TEST_MODULE_ID 0x1616 // @nh001a +#define TEST_MODULE_ID 0x1616 // sensor test module ID enumeration typedef enum @@ -82,7 +79,7 @@ typedef enum { SUCCESS_RC = 0x00000000, } errlTestRc; - + //************************************************************************* // Structures //************************************************************************* @@ -92,6 +89,7 @@ typedef enum //************************************************************************* // TRACE: Trace buffers initialized uint8_t G_data[ MAX_BUFFER_SIZE]; + //************************************************************************* // Function Prototypes //************************************************************************* @@ -118,8 +116,6 @@ void ppdumpslot(void); // // Description: Entry point function // -// Flow: FN=None -// // End Function Specification errlHndl_t errlTestMain(void * i_arg) { @@ -205,15 +201,6 @@ errlHndl_t errlTestMain(void * i_arg) break; } - // @jh003c - // comment out the test case since we no longer add the alignment in addUsrDtlsToErrl - //l_rc = errlTestWordAlign(); - //l_modId = TEST_ERRL_TEST_WORD_ALIGN ; - //if( l_rc != ERRL_RC_SUCCESS) - //{ - // TRAC_INFO("Failure on word alignment test"); - // break; - //} } while (0); if( l_rc != ERRL_RC_SUCCESS) @@ -231,7 +218,7 @@ errlHndl_t errlTestMain(void * i_arg) * @devdesc Failure executing test applet */ l_err = createErrl(TEST_APLT_MODID_ERRLTEST, - INTERNAL_FAILURE, // @nh001c + INTERNAL_FAILURE, OCC_NO_EXTENDED_RC, ERRL_SEV_INFORMATIONAL, NULL, @@ -258,8 +245,6 @@ errlHndl_t errlTestMain(void * i_arg) // // Description: errlTestErrorHandling // -// Flow: FN=None -// // End Function Specification uint32_t errlTestErrorHandling() { @@ -275,13 +260,13 @@ uint32_t errlTestErrorHandling() /****************************************************/ // Test createErrl with incorrect parameter // Set ERRL_SEVERITY to 0x04, out of range so log won't be created - l_errlHnd = createErrl(TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, 0x04, NULL, 0, 0x01, 0x02); // @nh001c + l_errlHnd = createErrl(TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, 0x04, NULL, 0, 0x01, 0x02); CHECK_CONDITION( l_errlHnd == INVALID_ERR_HNDL, l_rc); /****************************************************/ // Test addTraceToErrl with incorrect parameter // Create a log - l_errlHnd = createErrl(TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_PREDICTIVE, NULL, 0, 0x01, 0x02); // @nh001c + l_errlHnd = createErrl(TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_PREDICTIVE, NULL, 0, 0x01, 0x02); CHECK_CONDITION( l_errlHnd != INVALID_ERR_HNDL, l_rc); // i_trace = NULL, so entry size doesn't change @@ -316,17 +301,17 @@ uint32_t errlTestErrorHandling() // io_err = INVALID_ERR_HNDL // We are making sure that this function // handles a INVALID_ERR_HNDL being passed, and that we can't verify if - // an error occured by checking anything. (It will just cause + // an error occurred by checking anything. (It will just cause // a TLB exception) l_errlHnd = INVALID_ERR_HNDL; - addTraceToErrl(g_trac_inf, 32, l_errlHnd); // @at012c + addTraceToErrl(g_trac_inf, 32, l_errlHnd); /****************************************************/ - // Test commitErrl with incorrect parameter + // Test commitErrl with incorrect parameter // io_err = NULL // We are making sure that this function // handles a NULL being passed, and that we can't verify if - // an error occured by checking anything. (It will just cause + // an error occurred by checking anything. (It will just cause // a TLB exception) commitErrl( NULL); @@ -336,11 +321,11 @@ uint32_t errlTestErrorHandling() CHECK_CONDITION( l_errlHnd == NULL, l_rc); /****************************************************/ - // Test deleteErrl with incorrect parameter + // Test deleteErrl with incorrect parameter // io_err = NULL // We are making sure that this function // handles a NULL being passed, and that we can't verify if - // an error occured by checking anything. (It will just cause + // an error occurred by checking anything. (It will just cause // a TLB exception) deleteErrl( NULL); @@ -350,38 +335,38 @@ uint32_t errlTestErrorHandling() CHECK_CONDITION( l_errlHnd == NULL, l_rc); /****************************************************/ - // Test addCalloutToErrl with incorrect parameter + // Test addCalloutToErrl with incorrect parameter // Set io_err to NULL // We are making sure that this function // handles a NULL being passed, and that we can't verify if - // an error occured by checking anything. (It will just cause + // an error occurred by checking anything. (It will just cause // a TLB exception) - addCalloutToErrl(NULL, ERRL_CALLOUT_TYPE_HUID, 0, ERRL_CALLOUT_PRIORITY_LOW); // @jh001c + addCalloutToErrl(NULL, ERRL_CALLOUT_TYPE_HUID, 0, ERRL_CALLOUT_PRIORITY_LOW); // Set io_err to INVALID_ERR_HNDL // We are making sure that this function // handles a INVALID_ERR_HNDL being passed, and that we can't verify if - // an error occured by checking anything. (It will just cause + // an error occurred by checking anything. (It will just cause // a TLB exception) - addCalloutToErrl(INVALID_ERR_HNDL, ERRL_CALLOUT_TYPE_HUID, 0, ERRL_CALLOUT_PRIORITY_LOW); // @jh001c + addCalloutToErrl(INVALID_ERR_HNDL, ERRL_CALLOUT_TYPE_HUID, 0, ERRL_CALLOUT_PRIORITY_LOW); /****************************************************/ // Test addUsrDtlsToErrl with incorrect parameter // Create a log - l_errlHnd = createErrl(TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_PREDICTIVE, NULL, 0, 0x01, 0x02); // @nh001c + l_errlHnd = createErrl(TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_PREDICTIVE, NULL, 0, 0x01, 0x02); CHECK_CONDITION( l_errlHnd != INVALID_ERR_HNDL, l_rc); // io_err = NULL // We are making sure that this function // handles a NULL being passed, and that we can't verify if - // an error occured by checking anything. (It will just cause + // an error occurred by checking anything. (It will just cause // a TLB exception) addUsrDtlsToErrl(NULL, l_dataPtr, 10, ERRL_USR_DTL_STRUCT_VERSION_1, ERRL_USR_DTL_TRACE_DATA); // io_err = INVALID_ERR_HNDL // We are making sure that this function // handles a INVALID_ERR_HNDL being passed, and that we can't verify if - // an error occured by checking anything. (It will just cause + // an error occurred by checking anything. (It will just cause // a TLB exception) addUsrDtlsToErrl(INVALID_ERR_HNDL, l_dataPtr, 10, ERRL_USR_DTL_STRUCT_VERSION_1, ERRL_USR_DTL_TRACE_DATA); @@ -413,14 +398,14 @@ uint32_t errlTestErrorHandling() // Set io_err to NULL. // We are making sure that this function // handles a NULL being passed, and that we can't verify if - // an error occured by checking anything. (It will just cause + // an error occurred by checking anything. (It will just cause // a TLB exception) setErrlSevToInfo(NULL); // Set io_err to INVALID_ERR_HNDL // We are making sure that this function // handles a INVALID_ERR_HNDL being passed, and that we can't verify if - // an error occured by checking anything. (It will just cause + // an error occurred by checking anything. (It will just cause // a TLB exception) setErrlSevToInfo(INVALID_ERR_HNDL); }while(0); @@ -434,8 +419,6 @@ uint32_t errlTestErrorHandling() // // Description: errlTestCreateCommitDeleteLog // -// Flow: FN=None -// // End Function Specification uint32_t errlTestCreateCommitDeleteLog() { @@ -447,7 +430,7 @@ uint32_t errlTestCreateCommitDeleteLog() /****************************************************/ // Test create log errlHndl_t l_handle = NULL; - l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_CALLHOME_DATA, g_trac_inf, 512, 0x1, 0x2); // @nh001c @at012c + l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_CALLHOME_DATA, g_trac_inf, 512, 0x1, 0x2); CHECK_CONDITION( l_handle != INVALID_ERR_HNDL, l_rc); ERRL_DBG("Slots after Creating call home log" ); @@ -485,8 +468,6 @@ uint32_t errlTestCreateCommitDeleteLog() // // Description: errlTestAddUsrDtlsToErrl // -// Flow: FN=None -// // End Function Specification uint32_t errlTestAddUsrDtlsToErrl() { @@ -502,9 +483,9 @@ uint32_t errlTestAddUsrDtlsToErrl() errlHndl_t l_handle2 = NULL; errlHndl_t l_handle3 = NULL; - l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_UNRECOVERABLE, NULL, 512, 0x1, 0x2); // @nh001c - l_handle2 = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_CALLHOME_DATA, NULL, 512, 0x1, 0x2); // @nh001c - l_handle3 = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_INFORMATIONAL, NULL, 512, 0x1, 0x2); // @nh001c + l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_UNRECOVERABLE, NULL, 512, 0x1, 0x2); + l_handle2 = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_CALLHOME_DATA, NULL, 512, 0x1, 0x2); + l_handle3 = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_INFORMATIONAL, NULL, 512, 0x1, 0x2); // l_handle will set to NULL after calling the commitErrl, so we need to store it errlHndl_t l_handleX = l_handle; @@ -518,7 +499,7 @@ uint32_t errlTestAddUsrDtlsToErrl() (l_handle3 != INVALID_ERR_HNDL), l_rc); /****************************************************/ - // Test sizelimit for addUsrDtlsToErrl + // Test size limit for addUsrDtlsToErrl // Add "user details" data that exceeds the max size for l_handle l_entrySizeBefore = l_handle->iv_userDetails.iv_entrySize; memset( G_data, 0xCC, sizeof( G_data ) ); @@ -562,9 +543,9 @@ uint32_t errlTestAddUsrDtlsToErrl() ppdumpslot(); /****************************************************/ - // Test sizelimit for addUsrDtlsToErrl with continuous calls + // Test size limit for addUsrDtlsToErrl with continuous calls // Create log with 512 bytes trace - l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_PREDICTIVE, g_trac_inf, 512, 0x1, 0x2); // @nh001c @at012c + l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_PREDICTIVE, g_trac_inf, 512, 0x1, 0x2); CHECK_CONDITION( l_handle != INVALID_ERR_HNDL, l_rc); // l_handle will set to NULL after calling the commitErrl, so we need to store it @@ -617,8 +598,6 @@ uint32_t errlTestAddUsrDtlsToErrl() // // Description: errlTestAddTraceToErrl // -// Flow: FN=None -// // End Function Specification uint32_t errlTestAddTraceToErrl() { @@ -631,7 +610,7 @@ uint32_t errlTestAddTraceToErrl() { // Create one err log errlHndl_t l_handle = NULL; - l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_PREDICTIVE, NULL, 512, 0x1, 0x2); // @nh001c + l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_PREDICTIVE, NULL, 512, 0x1, 0x2); CHECK_CONDITION( l_handle != INVALID_ERR_HNDL, l_rc); // l_handle will set to NULL after calling the commitErrl, so we need to store it @@ -640,12 +619,12 @@ uint32_t errlTestAddTraceToErrl() ppdumpslot(); /****************************************************/ - // Test sizelimit for addTraceToErrl + // Test size limit for addTraceToErrl // Add "trace" data that exceeds the max size l_entrySizeBefore = l_handle->iv_userDetails.iv_entrySize; - addTraceToErrl(g_trac_inf, MAX_BUFFER_SIZE, l_handle); // @at012c + addTraceToErrl(g_trac_inf, MAX_BUFFER_SIZE, l_handle); l_entrySizeAfter = l_handle->iv_userDetails.iv_entrySize; - CHECK_CONDITION( l_entrySizeAfter <= MAX_ERRL_ENTRY_SZ, l_rc); // @at012c + CHECK_CONDITION( l_entrySizeAfter <= MAX_ERRL_ENTRY_SZ, l_rc); dumpLog( l_handle, l_handle->iv_userDetails.iv_entrySize ); commitErrl( &l_handle ); @@ -657,9 +636,9 @@ uint32_t errlTestAddTraceToErrl() ppdumpslot(); /****************************************************/ - // Test sizelimit for addTraceToErrl with continuous calls + // Test size limit for addTraceToErrl with continuous calls // Create log with 512 bytes trace - l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_PREDICTIVE, g_trac_inf, 512, 0x1, 0x2); // @nh001c @at012c + l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_PREDICTIVE, g_trac_inf, 512, 0x1, 0x2); CHECK_CONDITION( l_handle != INVALID_ERR_HNDL, l_rc); // l_handle will set to NULL after calling the commitErrl, so we need to store it @@ -673,7 +652,7 @@ uint32_t errlTestAddTraceToErrl() ERRL_DBG("Slots after create + 256 bytes" ); ppdumpslot(); // (header + 256) is the size that add to entry - CHECK_CONDITION( l_entrySizeAfter <= (l_entrySizeBefore+sizeof(ErrlUserDetailsEntry_t)+256), l_rc); // @at012c + CHECK_CONDITION( l_entrySizeAfter <= (l_entrySizeBefore+sizeof(ErrlUserDetailsEntry_t)+256), l_rc); // Add 512 bytes of trace (512+256+512) l_entrySizeBefore = l_handle->iv_userDetails.iv_entrySize; @@ -681,7 +660,7 @@ uint32_t errlTestAddTraceToErrl() l_entrySizeAfter = l_handle->iv_userDetails.iv_entrySize; ERRL_DBG("Slots after create + 256 + 512 bytes"); ppdumpslot(); - CHECK_CONDITION( l_entrySizeAfter <= (l_entrySizeBefore+sizeof(ErrlUserDetailsEntry_t)+512), l_rc); // @at012c + CHECK_CONDITION( l_entrySizeAfter <= (l_entrySizeBefore+sizeof(ErrlUserDetailsEntry_t)+512), l_rc); // Add 1024 bytes of trace (512+256+512+1024), the entry size is more than 2048 now l_entrySizeBefore = l_handle->iv_userDetails.iv_entrySize; @@ -689,7 +668,7 @@ uint32_t errlTestAddTraceToErrl() l_entrySizeAfter = l_handle->iv_userDetails.iv_entrySize; ERRL_DBG("Slots after create + 256 + 512 bytes"); ppdumpslot(); - CHECK_CONDITION( l_entrySizeAfter <= MAX_ERRL_ENTRY_SZ, l_rc); // @at012c + CHECK_CONDITION( l_entrySizeAfter <= MAX_ERRL_ENTRY_SZ, l_rc); commitErrl( &l_handle ); deleteErrl(&l_handleX); @@ -708,8 +687,6 @@ uint32_t errlTestAddTraceToErrl() // // Description: errlTestTime // -// Flow: FN=None -// // End Function Specification uint32_t errlTestTime() { @@ -727,7 +704,7 @@ uint32_t errlTestTime() // Check timeStamp // Create one log l_start = ssx_timebase_get(); - l_handle = createErrl( 0x1716, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_CALLHOME_DATA, g_trac_inf, 128, 0x1, 0x2); // @nh001c @at012c + l_handle = createErrl( 0x1716, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_CALLHOME_DATA, g_trac_inf, 128, 0x1, 0x2); CHECK_CONDITION( l_handle != INVALID_ERR_HNDL, l_rc); @@ -761,11 +738,11 @@ uint32_t errlTestCreate2InfoCallhomeLog() // Create first Info log errlHndl_t l_handle = NULL; errlHndl_t l_handle2= NULL; - l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_INFORMATIONAL,g_trac_inf, 32, 0x1, 0x2); // @nh001c @at012c + l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_INFORMATIONAL,g_trac_inf, 32, 0x1, 0x2); CHECK_CONDITION( l_handle != INVALID_ERR_HNDL, l_rc); // Create second Info log and it should fail - l_handle2 = createErrl( 0x2727, 0x19, OCC_NO_EXTENDED_RC, ERRL_SEV_INFORMATIONAL, g_trac_inf, 32, 0x2, 0x3); // @nh001c @at012c + l_handle2 = createErrl( 0x2727, 0x19, OCC_NO_EXTENDED_RC, ERRL_SEV_INFORMATIONAL, g_trac_inf, 32, 0x2, 0x3); CHECK_CONDITION( l_handle2 == INVALID_ERR_HNDL, l_rc); deleteErrl(&l_handle); @@ -775,11 +752,11 @@ uint32_t errlTestCreate2InfoCallhomeLog() // Create first Callhome log l_handle = NULL; l_handle2= NULL; - l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_CALLHOME_DATA,g_trac_inf, 32, 0x1, 0x2); // @nh001c @at012c + l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_CALLHOME_DATA,g_trac_inf, 32, 0x1, 0x2); CHECK_CONDITION( l_handle != INVALID_ERR_HNDL, l_rc); // Create second Callhome log and it should fail - l_handle2 = createErrl( 0x2727, 0x19, OCC_NO_EXTENDED_RC, ERRL_SEV_CALLHOME_DATA, g_trac_inf, 32, 0x2, 0x3); // @nh001c @at012c + l_handle2 = createErrl( 0x2727, 0x19, OCC_NO_EXTENDED_RC, ERRL_SEV_CALLHOME_DATA, g_trac_inf, 32, 0x2, 0x3); CHECK_CONDITION( l_handle2 == INVALID_ERR_HNDL, l_rc); deleteErrl(&l_handle); @@ -796,8 +773,6 @@ uint32_t errlTestCreate2InfoCallhomeLog() // // Description: errlTestCreateMaxLogs // -// Flow: FN=None -// // End Function Specification uint32_t errlTestCreateMaxLogs() { @@ -820,7 +795,7 @@ uint32_t errlTestCreateMaxLogs() uint64_t l_time = ssx_timebase_get(); l_sev = l_time%2 ? ERRL_SEV_PREDICTIVE : ERRL_SEV_UNRECOVERABLE; - l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, l_sev, g_trac_inf, 512, 0x1, l_index); // @nh001c @at012c + l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, l_sev, g_trac_inf, 512, 0x1, l_index); CHECK_CONDITION( (l_handle != INVALID_ERR_HNDL) && (l_handle != NULL), l_rc); @@ -836,10 +811,10 @@ uint32_t errlTestCreateMaxLogs() } // check if something wrong in for loop if(l_rc != 0) - break; + break; // Create one more and it should fail - l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, l_sev, g_trac_inf, 512, 0x1, l_index); // @nh001c @at012c + l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, l_sev, g_trac_inf, 512, 0x1, l_index); CHECK_CONDITION( l_handle == INVALID_ERR_HNDL, l_rc); // delete errl @@ -853,7 +828,7 @@ uint32_t errlTestCreateMaxLogs() // Check log id overflow for(l_index = 0; l_index < 256; l_index++) { - l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, l_sev, g_trac_inf, 512, 0x1, l_index); // @nh001c @at012c + l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, l_sev, g_trac_inf, 512, 0x1, l_index); CHECK_CONDITION( (l_handle != INVALID_ERR_HNDL) && (l_handle != NULL), l_rc); @@ -872,10 +847,7 @@ uint32_t errlTestCreateMaxLogs() // // Description: errlTestCallouts // -// Flow: FN=None -// // End Function Specification -// @jh001c uint32_t errlTestCallouts() { uint32_t l_rc = 0; @@ -888,7 +860,7 @@ uint32_t errlTestCallouts() /****************************************************/ // Check max callouts - l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_PREDICTIVE,g_trac_inf, 128, 0x1, 0x2); // @nh001c @at012c + l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_PREDICTIVE,g_trac_inf, 128, 0x1, 0x2); CHECK_CONDITION( l_handle != INVALID_ERR_HNDL, l_rc); ERRL_CALLOUT_PRIORITY l_array[8] = { @@ -933,21 +905,21 @@ uint32_t errlTestCallouts() /****************************************************/ // Check callouts after errl is committed // Create log - l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_PREDICTIVE,g_trac_inf, 32, 0x1, 0x2); // @nh001c @at012c + l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_PREDICTIVE,g_trac_inf, 32, 0x1, 0x2); errlHndl_t l_log = l_handle; CHECK_CONDITION( l_handle != INVALID_ERR_HNDL, l_rc); // Commit log and add callout. But adding callout should fail commitErrl( &l_handle ); addCalloutToErrl(l_handle,l_type[0],0,l_array[0]); - CHECK_CONDITION( l_log->iv_numCallouts == ERRL_MAX_CALLOUTS, l_rc); // @jh003c + CHECK_CONDITION( l_log->iv_numCallouts == ERRL_MAX_CALLOUTS, l_rc); deleteErrl(&l_log); /****************************************************/ // Check addCalloutToErrl for ERRL_SEV_INFORMATIONAL log // Create ERRL_SEV_INFORMATIONAL log - l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_INFORMATIONAL,g_trac_inf, 128, 0x1, 0x2); // @nh001c @at012c + l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_INFORMATIONAL,g_trac_inf, 128, 0x1, 0x2); CHECK_CONDITION( l_handle != INVALID_ERR_HNDL, l_rc); if(l_handle == INVALID_ERR_HNDL) @@ -971,8 +943,6 @@ uint32_t errlTestCallouts() // // Description: errlTestSetErrlSevToInfo // -// Flow: FN=None -// // End Function Specification uint32_t errlTestSetErrlSevToInfo() { @@ -986,11 +956,11 @@ uint32_t errlTestSetErrlSevToInfo() /****************************************************/ // Check setErrlSevToInfo // Create ERRL_SEV_PREDICTIVE log - l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_PREDICTIVE,g_trac_inf, 128, 0x1, 0x2); // @nh001c @at012c + l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_PREDICTIVE,g_trac_inf, 128, 0x1, 0x2); CHECK_CONDITION( l_handle != INVALID_ERR_HNDL, l_rc); // Add callout - addCalloutToErrl(l_handle,ERRL_CALLOUT_TYPE_HUID,0x00,ERRL_CALLOUT_PRIORITY_LOW); // @jh001c + addCalloutToErrl(l_handle,ERRL_CALLOUT_TYPE_HUID,0x00,ERRL_CALLOUT_PRIORITY_LOW); CHECK_CONDITION( l_handle->iv_numCallouts == 1, l_rc); // Call setErrlSevToInfo. Callouts within log should be cleared and @@ -1005,19 +975,19 @@ uint32_t errlTestSetErrlSevToInfo() /****************************************************/ // Check setErrlSevToInfo after errl is committed // Create log - l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_PREDICTIVE,g_trac_inf, 128, 0x1, 0x2); // @nh001c @at012c + l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_PREDICTIVE,g_trac_inf, 128, 0x1, 0x2); CHECK_CONDITION( l_handle != INVALID_ERR_HNDL, l_rc); errlHndl_t l_log = l_handle; // Add callout - addCalloutToErrl(l_handle,ERRL_CALLOUT_TYPE_HUID,0x00,ERRL_CALLOUT_PRIORITY_LOW); // @jh001c + addCalloutToErrl(l_handle,ERRL_CALLOUT_TYPE_HUID,0x00,ERRL_CALLOUT_PRIORITY_LOW); CHECK_CONDITION( l_handle->iv_numCallouts == 1, l_rc); // Commit log and call setErrlSevToInfo. But setErrlSevToInfo will do nothing commitErrl( &l_handle ); setErrlSevToInfo(l_handle); - CHECK_CONDITION( (l_log->iv_numCallouts == ERRL_MAX_CALLOUTS) && // @jh003c + CHECK_CONDITION( (l_log->iv_numCallouts == ERRL_MAX_CALLOUTS) && (l_log->iv_severity == ERRL_SEV_PREDICTIVE), l_rc); deleteErrl(&l_log); @@ -1034,8 +1004,6 @@ uint32_t errlTestSetErrlSevToInfo() // // Description: errlTestWordAlign // -// Flow: FN=None -// // End Function Specification uint32_t errlTestWordAlign() { @@ -1049,7 +1017,7 @@ uint32_t errlTestWordAlign() /****************************************************/ // Test word align for addUsrDtlsToErrl // Create log - errlHndl_t l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_PREDICTIVE, NULL, 0, 0x1, 0x2); // @nh001c + errlHndl_t l_handle = createErrl( TEST_MODULE_ID, 0x08, OCC_NO_EXTENDED_RC, ERRL_SEV_PREDICTIVE, NULL, 0, 0x1, 0x2); CHECK_CONDITION( l_handle != INVALID_ERR_HNDL, l_rc); // l_handle will set to NULL after calling the commitErrl, so we need to store it @@ -1075,7 +1043,7 @@ uint32_t errlTestWordAlign() ERRL_DBG("Slots after create + 21 bytes" ); ppdumpslot(); // (header + WORDALIGN(21)) is the size that add to entry - CHECK_CONDITION( l_entrySizeAfter <= (l_entrySizeBefore+sizeof(ErrlUserDetailsEntry_t)+24), l_rc); // @at012c + CHECK_CONDITION( l_entrySizeAfter <= (l_entrySizeBefore+sizeof(ErrlUserDetailsEntry_t)+24), l_rc); commitErrl( &l_handle ); deleteErrl(&l_handleX); @@ -1094,8 +1062,6 @@ uint32_t errlTestWordAlign() // // Description: dumpLog // -// Flow: FN=None -// // End Function Specification void dumpLog( errlHndl_t i_log, uint32_t i_len ) { @@ -1168,8 +1134,6 @@ void dumpLog( errlHndl_t i_log, uint32_t i_len ) // // Description: ppdumpslot // -// Flow: FN=None -// // End Function Specification void ppdumpslot(void) { diff --git a/src/occApplet/testApplet/linkTestApplet.cmd b/src/occApplet/testApplet/linkTestApplet.cmd index d5635d0..8ab30f3 100755 --- a/src/occApplet/testApplet/linkTestApplet.cmd +++ b/src/occApplet/testApplet/linkTestApplet.cmd @@ -1,6 +1,28 @@ - -// $Id$ - +// IBM_PROLOG_BEGIN_TAG +// This is an automatically generated prolog. +// +// $Source: src/occApplet/testApplet/linkTestApplet.cmd $ +// +// OpenPOWER OnChipController Project +// +// Contributors Listed Below - COPYRIGHT 2011,2014 +// [+] Google Inc. +// [+] International Business Machines Corp. +// +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +// implied. See the License for the specific language governing +// permissions and limitations under the License. +// +// IBM_PROLOG_END_TAG // This linker script for the test applet @@ -19,42 +41,42 @@ MEMORY SECTIONS { . = APP_IMAGE_SRAM_START_ADDR; - + __START_ADDR__ = .; - + //////////////////////////////// // start read-only section - //////////////////////////////// + //////////////////////////////// imageHeader . : { *(imageHeader) } > AppMem - + //////////////////////////////// // text section 1024 byte aligned - //////////////////////////////// + //////////////////////////////// .text . : { *(.text) . = ALIGN(BYTE_ALIGN);} > AppMem // NOTE: rodata section needs to be 1k aligned as it is used for setting // mmu permission during applet execution .rodata . : { *(.rodata) *(.got2) *(.rodata.str1.1) *(.rodata.str1.4) . = ALIGN(BYTE_ALIGN);} > AppMem - + __READ_ONLY_DATA_LEN__ = . - APP_IMAGE_SRAM_START_ADDR ; - + //////////////////////////////// // start writeable section - //////////////////////////////// + //////////////////////////////// __WRITEABLE_DATA_ADDR__ = .; //////////////////////////////// // read-write section 1024 byte aligned - //////////////////////////////// + //////////////////////////////// .rela . : { *(.rela*) . = ALIGN(WORD_ALIGN);} > AppMem - // NOTE: rwdata section needs to be 1024 bytes aligned for setting mmu - // permission, so that applet total size is 1024 bytes aligned. + // NOTE: rwdata section needs to be 1024 bytes aligned for setting mmu + // permission, so that applet total size is 1024 bytes aligned. // It is needed for doing DMA copy of the applet. - // NOTE: add one dummy bye "BYTE(1)" to prevent this section empty. If section + // NOTE: add one dummy bye "BYTE(1)" to prevent an empty section. If section // is empty, "ALIGN(BYTE_ALIGN)" won't work. .rwdata . : { *(.data) *(.bss) *(COMMON) BYTE(1); . = ALIGN(BYTE_ALIGN);} > AppMem __WRITEABLE_DATA_LEN__ = . - __WRITEABLE_DATA_ADDR__ ; - // NOTE: make sure the whole image is 128-byte aligned - + // NOTE: make sure the whole image is 128-byte aligned + } diff --git a/src/occApplet/testApplet/occLinkInputFile b/src/occApplet/testApplet/occLinkInputFile index 273836b..1fe4523 100644 --- a/src/occApplet/testApplet/occLinkInputFile +++ b/src/occApplet/testApplet/occLinkInputFile @@ -1 +1,26 @@ +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. +# +# $Source: src/occApplet/testApplet/occLinkInputFile $ +# +# OpenPOWER OnChipController Project +# +# Contributors Listed Below - COPYRIGHT 2011,2014 +# [+] Google Inc. +# [+] International Business Machines Corp. +# +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. See the License for the specific language governing +# permissions and limitations under the License. +# +# IBM_PROLOG_END_TAG INPUT ( pstApplet.o ) diff --git a/src/occApplet/testApplet/pstApplet.c b/src/occApplet/testApplet/pstApplet.c index a658d1a..776c224 100755 --- a/src/occApplet/testApplet/pstApplet.c +++ b/src/occApplet/testApplet/pstApplet.c @@ -1,22 +1,25 @@ -/****************************************************************************** -// @file pstApplet.c -// @brief pstate_applet -*/ -/****************************************************************************** - * - * @page ChangeLogs Change Logs - * @section pstApplet.c PSTAPPLET.c - * @verbatim - * - * Flag Def/Fea Userid Date Description - * ------- ---------- -------- ---------- ---------------------------------- - * prpulusa 02/05/14 created - * @gm043 928988 milesg 06/19/14 checked in to cmvc after some bug fixes. - * - * @endverbatim - * - *///*************************************************************************/ - +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/occApplet/testApplet/pstApplet.c $ */ +/* */ +/* OpenPOWER OnChipController Project */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2011,2014 */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ //************************************************************************* // Includes @@ -67,7 +70,7 @@ errlHndl_t myEntryPoint(void * i_arg) { TRAC_INFO("Enter"); - //initialize variables + //initialize variables errlHndl_t l_err = NULL; int rc=0; GlobalPstateTable * l_gpst_ptr = NULL; @@ -83,19 +86,19 @@ errlHndl_t myEntryPoint(void * i_arg) Pstate max_ps = gpst_pmax(l_gpst_ptr); int iterations; for(iterations=0;iterations<1000;iterations++){ - //loop through the functioning cores - int core; - for (core = 0; core < PGP_NCORES; core++) { - if (deconfigured_cores & (0x80000000 >> core)) continue; - //go through all the valid power states - int ps; - for (ps=min_ps;ps<=max_ps;ps++){ - - //Issue scoms l - pmcr.fields.local_pstate_req=ps; - pmcr.fields.global_pstate_req=ps; - rc = _putscom(CORE_CHIPLET_ADDRESS(PCBS_POWER_MANAGEMENT_CONTROL_REG,core),pmcr.value, SCOM_TIMEOUT * 20); - if (rc) { + //loop through the functioning cores + int core; + for (core = 0; core < PGP_NCORES; core++) { + if (deconfigured_cores & (0x80000000 >> core)) continue; + //go through all the valid power states + int ps; + for (ps=min_ps;ps<=max_ps;ps++){ + + //Issue scoms l + pmcr.fields.local_pstate_req=ps; + pmcr.fields.global_pstate_req=ps; + rc = _putscom(CORE_CHIPLET_ADDRESS(PCBS_POWER_MANAGEMENT_CONTROL_REG,core),pmcr.value, SCOM_TIMEOUT * 20); + if (rc) { if(trace_count[core] < 5) { trace_count[core]++; @@ -106,13 +109,13 @@ errlHndl_t myEntryPoint(void * i_arg) { continue; } - break; - } - //Wait 500us before changing the pstate - ssx_sleep(SSX_MICROSECONDS(500)); + break; + } + //Wait 500us before changing the pstate + ssx_sleep(SSX_MICROSECONDS(500)); - } - } + } + } } TRAC_INFO("Exit"); return l_err; diff --git a/src/occApplet/testApplet/sensorTest.c b/src/occApplet/testApplet/sensorTest.c index 74a51be..f098e47 100755 --- a/src/occApplet/testApplet/sensorTest.c +++ b/src/occApplet/testApplet/sensorTest.c @@ -1,37 +1,26 @@ -/****************************************************************************** -// @file sensorTest.c -// @brief OCC Sensor test applet -*/ -/****************************************************************************** - * - * @page ChangeLogs Change Logs - * @section sensorTest.c SENSORTEST.c - * @verbatim - * - * Flag Def/Fea Userid Date Description - * ------- ---------- -------- ---------- ---------------------------------- - * pbavari 08/17/2011 created - * @pb003 pbavari 08/31/2011 mini-sensor support - * @pb004 pbavari 09/14/2011 Changed to call sensor_init - * product applet - * @pb00A pbavari 11/14/2011 Moved sensor_init from applet and - * updated with latest design change - * @th005 thallet 11/21/2011 #if'd out reset of sensor test so - * it would compile - * @dw000 dwoodham 12/12/2011 Update call to IMAGE_HEADER macro - * @at001 alvinwan 01/10/2012 Enable sensor test applet due to - * sensor interface design changes - * @rc003 rickylie 02/03/2012 Verify & Clean Up OCC Headers & Comments - * @at003 alvinwan 03/19/2012 Add test case for querySensorList. - * @nh001 neilhsu 05/23/2012 Add missing error log tags - * @ai003 ailutsar 11/06/2012 Fix OCC Test Applets so they don't crash OCC - * @th030 thallet 02/04/2013 Removed sensor list query b/c too big - * @gm002 885429 milesg 05/30/2013 change type/location to 16 bit bitmask - * @rt002 901927 tapiar 10/02/2013 update error log to use unique module id - * @fk009 942864 fmkassem 09/30/2014 BMC/HTMGT Poll command version 0x10 support. - * @endverbatim - * - *///*************************************************************************/ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/occApplet/testApplet/sensorTest.c $ */ +/* */ +/* OpenPOWER OnChipController Project */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2011,2014 */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ + #define SNSR_DEBUG //************************************************************************* // Includes @@ -45,7 +34,7 @@ #include <trac.h> // For traces #include <appletManager.h> #include <sensorQueryList.h> -#include <appletId.h> // For applet ID @dw000a +#include <appletId.h> // For applet ID #include <aplt_service_codes.h> // For test applet module ID #include <testApltId.h> // For test applet ID @@ -128,13 +117,12 @@ typedef enum //************************************************************************* // Globals //************************************************************************* -// @ai003A // Stack size for test applet thread is only 4000 bytes, -// put big structure here for prevent stack overflow +// put big structure here to prevent stack overflow -// @th030 -- ifdef'd out b/c the sensor list is too big to test in applet +// ifdef'd out b/c the sensor list is too big to test in applet #if 0 -sensorQueryList_t G_snsrList[NUMBER_OF_SENSORS_IN_LIST]; +sensorQueryList_t G_snsrList[NUMBER_OF_SENSORS_IN_LIST]; #endif //************************************************************************* @@ -156,8 +144,6 @@ uint32_t sensorTestQueryList(); // // Description: Entry point function // -// Flow: FN=None -// // End Function Specification errlHndl_t sensorTestMain(void * i_arg) { @@ -192,7 +178,7 @@ errlHndl_t sensorTestMain(void * i_arg) TRAC_INFO("Failure on common test"); break; } -// @th030 - If'd out b/c the sensor list is too big for an applet +// If'd out b/c the sensor list is too big for an applet #if 0 l_rc = sensorTestQueryList(); if( l_rc != SUCCESS_RC) @@ -206,9 +192,9 @@ errlHndl_t sensorTestMain(void * i_arg) if( l_rc != SUCCESS_RC) { - SNSR_DBG("**********************************************\n"); + SNSR_DBG("**********************************************\n"); SNSR_DBG("* Sensor Test Failed: ModId: 0x%x,l_rc: 0x%x\n",l_modId,l_rc); - SNSR_DBG("**********************************************\n"); + SNSR_DBG("**********************************************\n"); /* @ * @errortype * @moduleid TEST_APLT_MODID_SENSORTEST @@ -229,9 +215,9 @@ errlHndl_t sensorTestMain(void * i_arg) } else { - SNSR_DBG("**********************************************\n"); - SNSR_DBG("* Sensor Test Passed\n"); - SNSR_DBG("**********************************************\n"); + SNSR_DBG("**********************************************\n"); + SNSR_DBG("* Sensor Test Passed\n"); + SNSR_DBG("**********************************************\n"); } @@ -247,8 +233,6 @@ errlHndl_t sensorTestMain(void * i_arg) // // Description: SensorTestNullPointers // -// Flow: FN=None -// // End Function Specification uint32_t sensorTestNullPointer() { @@ -307,8 +291,6 @@ uint32_t sensorTestNullPointer() // // Description: SensorTestGetSensorByGsid // -// Flow: FN=None -// // End Function Specification uint32_t sensorTestGetSensorByGsid() { @@ -341,8 +323,6 @@ uint32_t sensorTestGetSensorByGsid() // // Description: printSensor // -// Flow: FN=None -// // End Function Specification void printSensor(sensor_t i_snsr) { @@ -387,8 +367,6 @@ void printSensor(sensor_t i_snsr) // // Description: sensorTestCommon // -// Flow: FN=None -// // End Function Specification uint32_t sensorTestCommon() { @@ -734,8 +712,8 @@ uint32_t sensorTestCommon() /****************************************************/ //so far the source sensors of vector sensor are: - // l_sensor2=12 - // l_sensor=5 + // l_sensor2=12 + // l_sensor=5 // test updating vector element with status reset bit set and // average op @@ -851,8 +829,6 @@ uint32_t sensorTestCommon() // // Description: querySensorList: Will call the SenosrQeryList product applet // -// Flow: FN=None -// // End Function Specification errlHndl_t callQuerySensorList(const uint16_t i_startGsid, const uint8_t i_present, @@ -860,7 +836,7 @@ errlHndl_t callQuerySensorList(const uint16_t i_startGsid, const uint16_t i_loc, uint16_t * io_numOfSensors, sensorQueryList_t * o_sensors, - sensor_info_t * o_sensorInfoPtrs // @at003A + sensor_info_t * o_sensorInfoPtrs ) { OCC_APLT_STATUS_CODES l_status = OCC_APLT_SUCCESS; @@ -873,13 +849,13 @@ errlHndl_t callQuerySensorList(const uint16_t i_startGsid, i_loc, io_numOfSensors, o_sensors, - o_sensorInfoPtrs // @at003A + o_sensorInfoPtrs }; //Call sensor query list applet runApplet(OCC_APLT_SNSR_QUERY, // Applet enum Name - &l_querySensorListAppletArg, // Applet arguments + &l_querySensorListAppletArg, // Applet arguments TRUE, // Blocking call? NULL, // Applet finished semaphore &l_errl, // Error log handle @@ -896,17 +872,15 @@ errlHndl_t callQuerySensorList(const uint16_t i_startGsid, // // Description: printQuerySensor // -// Flow: FN=None -// // End Function Specification void printQuerySensor( const uint16_t i_count, sensorQueryList_t * i_sensors, sensor_info_t * i_sensorInfos) { int i; - if(i_count!=0 && // @at003M - ( (i_sensors!=NULL) || // @at003M - (i_sensorInfos!=NULL) ) ) // @at003M + if(i_count!=0 && + ( (i_sensors!=NULL) || + (i_sensorInfos!=NULL) ) ) { // Print sensorQueryList_t if( i_sensors != NULL ) @@ -922,7 +896,6 @@ void printQuerySensor( const uint16_t i_count, SNSR_DBG("*******************************\n"); } - // @at003A begin // Print sensor_info_t if ( i_sensorInfos != NULL ) { @@ -942,12 +915,11 @@ void printQuerySensor( const uint16_t i_count, SNSR_DBG("*******************************\n"); } } - // @at003A end } -// @th030 -- ifdef'd out b/c the sensor list is too big to test this in an applet -#if 0 +// ifdef'd out b/c the sensor list is too big to test this in an applet +#if 0 // Function Specification // @@ -955,8 +927,6 @@ void printQuerySensor( const uint16_t i_count, // // Description: sensorTestQueryList // -// Flow: FN=None -// // End Function Specification uint32_t sensorTestQueryList() { @@ -967,11 +937,11 @@ uint32_t sensorTestQueryList() do { uint16_t l_numOfSensors = 0; - sensor_info_t l_sensorInfo; // @at003M + sensor_info_t l_sensorInfo; /****************************************************/ // Test with invalid GSID. Must return error l_err = callQuerySensorList(0xFFFF,1,SENSOR_TYPE_ALL,SENSOR_LOC_ALL, - &l_numOfSensors,G_snsrList, NULL); // @at003M // @ai003M + &l_numOfSensors,G_snsrList, NULL); if( NULL == l_err) { @@ -979,7 +949,7 @@ uint32_t sensorTestQueryList() break; } else if( (l_err != INVALID_ERR_HNDL) && - (l_err->iv_reasonCode != INTERNAL_FAILURE)) // @nh001c + (l_err->iv_reasonCode != INTERNAL_FAILURE)) { l_rc = QUERY_LIST_FAILURE12; break; @@ -991,7 +961,7 @@ uint32_t sensorTestQueryList() /****************************************************/ // Test with NULL number of sensor pointer. Must return error l_err = callQuerySensorList(0,1,SENSOR_TYPE_ALL,SENSOR_LOC_ALL, - NULL,G_snsrList, NULL); // @at003M // @ai003M + NULL,G_snsrList, NULL); if( NULL == l_err) { @@ -999,7 +969,7 @@ uint32_t sensorTestQueryList() break; } else if( (l_err != INVALID_ERR_HNDL) && - (l_err->iv_reasonCode != INTERNAL_FAILURE)) // @nh001c + (l_err->iv_reasonCode != INTERNAL_FAILURE)) { l_rc = QUERY_LIST_FAILURE13; break; @@ -1011,7 +981,7 @@ uint32_t sensorTestQueryList() /****************************************************/ // Test with NULL sensor list pointer. Must return error l_err = callQuerySensorList(0,1,SENSOR_TYPE_ALL,SENSOR_LOC_ALL, - &l_numOfSensors,NULL, NULL); // @at003M + &l_numOfSensors,NULL, NULL); if( NULL == l_err) { @@ -1019,7 +989,7 @@ uint32_t sensorTestQueryList() break; } else if( (l_err != INVALID_ERR_HNDL) && - (l_err->iv_reasonCode != INTERNAL_FAILURE)) // @nh001c + (l_err->iv_reasonCode != INTERNAL_FAILURE)) { l_rc = QUERY_LIST_FAILURE14; break; @@ -1031,7 +1001,7 @@ uint32_t sensorTestQueryList() /****************************************************/ // Query 0 # of sensors. Must return 0 sensors and no error l_err = callQuerySensorList(0,1,SENSOR_TYPE_ALL,SENSOR_LOC_ALL, - &l_numOfSensors,G_snsrList,NULL); // @at003M // @ai003M + &l_numOfSensors,G_snsrList,NULL); if( (l_err != NULL) || (l_numOfSensors != 0)) { @@ -1043,7 +1013,7 @@ uint32_t sensorTestQueryList() // Query All sensors except last one. Must return no error l_numOfSensors = l_count -1; //(-1) to leave out last sensor l_err = callQuerySensorList(0,1,SENSOR_TYPE_ALL,SENSOR_LOC_ALL, - &l_numOfSensors,G_snsrList, NULL); // @at003M // @ai003M + &l_numOfSensors,G_snsrList, NULL); if( (l_err != NULL) || (l_numOfSensors > (l_count-1))) @@ -1061,7 +1031,7 @@ uint32_t sensorTestQueryList() sensor_update(l_sensor, 10); l_err = callQuerySensorList(l_count-1,1,SENSOR_TYPE_ALL, - SENSOR_LOC_ALL,&l_numOfSensors,G_snsrList, NULL); // @at003M // @ai003M + SENSOR_LOC_ALL,&l_numOfSensors,G_snsrList, NULL); if( (l_err != NULL) || (l_numOfSensors != 1) || (l_sensor->gsid!=l_count-1)) @@ -1075,8 +1045,8 @@ uint32_t sensorTestQueryList() // Query sensors that are not present Must return no error. l_numOfSensors = 10; l_err = callQuerySensorList(PROBE250US0,0,SENSOR_TYPE_ALL, - SENSOR_LOC_ALL,&l_numOfSensors,G_snsrList, NULL); // @at003M // @ai003M - //printQuerySensor(l_numOfSensors,G_snsrList, NULL ); // @ai003M + SENSOR_LOC_ALL,&l_numOfSensors,G_snsrList, NULL); + //printQuerySensor(l_numOfSensors,G_snsrList, NULL ); if( (l_err != NULL) || (l_numOfSensors == 0)) { l_rc = QUERY_LIST_FAILURE7; @@ -1088,8 +1058,8 @@ uint32_t sensorTestQueryList() // does not match any. Must return no error and no sensors l_numOfSensors = 10; l_err = callQuerySensorList(PROBE250US0,1,0x0,0x0, - &l_numOfSensors,G_snsrList, NULL); // @at003M // @ai003M - printQuerySensor(l_numOfSensors,G_snsrList, NULL ); // @ai003M + &l_numOfSensors,G_snsrList, NULL); + printQuerySensor(l_numOfSensors,G_snsrList, NULL ); if( (l_err != NULL) || (l_numOfSensors != 0)) { @@ -1103,7 +1073,7 @@ uint32_t sensorTestQueryList() l_numOfSensors = 10; l_err = callQuerySensorList(PROBE250US0,1,AMEC_SENSOR_TYPE_GENERIC, AMEC_SENSOR_LOC_OCC, - &l_numOfSensors,G_snsrList, NULL); // @at003M // @ai003M + &l_numOfSensors,G_snsrList, NULL); if( (l_err != NULL) || (l_numOfSensors == 0)) { @@ -1117,7 +1087,7 @@ uint32_t sensorTestQueryList() l_numOfSensors = 10; l_err = callQuerySensorList(PROBE250US0,1,AMEC_SENSOR_TYPE_GENERIC, SENSOR_LOC_ALL, - &l_numOfSensors,G_snsrList, NULL); // @at003M // @ai003M + &l_numOfSensors,G_snsrList, NULL); if( (l_err != NULL) || (l_numOfSensors == 0)) { @@ -1131,7 +1101,7 @@ uint32_t sensorTestQueryList() l_numOfSensors = 10; l_err = callQuerySensorList(PROBE250US0,1,SENSOR_TYPE_ALL, AMEC_SENSOR_LOC_OCC,&l_numOfSensors, - G_snsrList, NULL); // @at003M // @ai003M + G_snsrList, NULL); if( (l_err != NULL) || (l_numOfSensors == 0)) { @@ -1139,21 +1109,19 @@ uint32_t sensorTestQueryList() break; } - // @at003A begin /****************************************************/ // Query sensors to get sensor info,any type and // location=AMEC_SENSOR_LOC_OCC. Must return no error. l_numOfSensors = 1; l_err = callQuerySensorList(PROBE250US0,1,SENSOR_TYPE_ALL, SENSOR_LOC_ALL,&l_numOfSensors, - NULL, &l_sensorInfo); // @at003M + NULL, &l_sensorInfo); if( (l_err != NULL) || (l_numOfSensors == 0)) { l_rc = QUERY_LIST_FAILURE11; break; } printQuerySensor(l_numOfSensors,NULL, &l_sensorInfo ); - // @at003A end }while(0); @@ -1170,6 +1138,6 @@ uint32_t sensorTestQueryList() /*****************************************************************************/ // Image Header /*****************************************************************************/ -// @dw000 - call macro with Applet ID arg +// call macro with Applet ID arg IMAGE_HEADER (G_sensorTestMain,sensorTestMain,SENSORTESTMAIN_ID,OCC_APLT_TEST); diff --git a/src/occApplet/testApplet/testApltId.h b/src/occApplet/testApplet/testApltId.h index cda2e64..0c72947 100755 --- a/src/occApplet/testApplet/testApltId.h +++ b/src/occApplet/testApplet/testApltId.h @@ -1,20 +1,25 @@ -/****************************************************************************** -// @file testApltId.h -// @brief Error codes for aplt component. -*/ -/****************************************************************************** - * - * @page ChangeLogs Change Logs - * @section testApltId.h - * @verbatim - * - * Flag Def/Fea Userid Date Description - * ------- ---------- -------- ---------- ---------------------------------- - * @nh001 neilhsu 05/23/2012 Add missing error log tags - * - * @endverbatim - * - *///*************************************************************************/ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/occApplet/testApplet/testApltId.h $ */ +/* */ +/* OpenPOWER OnChipController Project */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2011,2014 */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ #ifndef _TESTAPLTID_H_ #define _TESTAPLTID_H_ diff --git a/src/occApplet/testApplet/testappletfiles.mk b/src/occApplet/testApplet/testappletfiles.mk index 7a0962d..f0177ab 100755 --- a/src/occApplet/testApplet/testappletfiles.mk +++ b/src/occApplet/testApplet/testappletfiles.mk @@ -1,37 +1,33 @@ -# @file libofiles.mk +# IBM_PROLOG_BEGIN_TAG +# This is an automatically generated prolog. # -# @brief mk for libssx.a object files +# $Source: src/occApplet/testApplet/testappletfiles.mk $ # -# @page ChangeLogs Change Logs -# @section ofiles.mk -# @verbatim +# OpenPOWER OnChipController Project # +# Contributors Listed Below - COPYRIGHT 2011,2014 +# [+] Google Inc. +# [+] International Business Machines Corp. # -# Change Log ****************************************************************** -# Flag Defect/Feature User Date Description -# ------ -------------- ---------- ------------ ----------- -# @pb00E pbavari 03/28/2012 Makefile ODE support -# @gm043 928988 milesg 06/19/2014 Added pstApplet # -# @endverbatim +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -########################################################################## -# INCLUDES -########################################################################## -# New test applet source file must to listed as part of the SOURCES variable -# to create test applet image. This will only create the image. It will not -# add these images as part of the mainstore single image. To make it part of -# of the mainstore single image, please see comments for IMAGE_TO_COMBINE -# variable -C-SOURCES = sensorTest.c apsstest.c errlTest.c traceTest.c pstApplet.c +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +# implied. See the License for the specific language governing +# permissions and limitations under the License. +# +# IBM_PROLOG_END_TAG +C-SOURCES = sensorTest.c apsstest.c errlTest.c traceTest.c pstApplet.c TESTAPLT_OBJECTS = $(C-SOURCES:.c=.o) - sensorTest_OFILES = sensorTest.o apsstest_OFILES = apsstest.o errlTest_OFILES = errlTest.o traceTest_OFILES = traceTest.o pstApplet_OFILES = pstApplet.o - - - diff --git a/src/occApplet/testApplet/traceTest.c b/src/occApplet/testApplet/traceTest.c index 975ea72..ee1a65a 100755 --- a/src/occApplet/testApplet/traceTest.c +++ b/src/occApplet/testApplet/traceTest.c @@ -1,21 +1,25 @@ -/****************************************************************************** -// @file traceTest.c -// @brief Test applet for trace functions -*/ -/****************************************************************************** - * - * @page ChangeLogs Change Logs - * @section traceTest.c TRACETEST.c - * @verbatim - * - * Flag Def/Fea Userid Date Description - * ------- ---------- -------- ---------- ---------------------------------- - * ailutsar 11/13/12 created - * - * @endverbatim - * - *///*************************************************************************/ - +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/occApplet/testApplet/traceTest.c $ */ +/* */ +/* OpenPOWER OnChipController Project */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2011,2014 */ +/* */ +/* Licensed under the Apache License, Version 2.0 (the "License"); */ +/* you may not use this file except in compliance with the License. */ +/* You may obtain a copy of the License at */ +/* */ +/* http://www.apache.org/licenses/LICENSE-2.0 */ +/* */ +/* Unless required by applicable law or agreed to in writing, software */ +/* distributed under the License is distributed on an "AS IS" BASIS, */ +/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ +/* implied. See the License for the specific language governing */ +/* permissions and limitations under the License. */ +/* */ +/* IBM_PROLOG_END_TAG */ //************************************************************************* // Includes @@ -24,7 +28,7 @@ #include <errl.h> // For error handle #include "ssx_io.h" // For printfs #include <trac.h> // For traces -#include <appletId.h> // For applet ID @dw000a +#include <appletId.h> // For applet ID #include <trac_service_codes.h> //************************************************************************* @@ -82,23 +86,23 @@ char G_trac_buffer[TRACE_BUFFER_SIZE + 100]; int traceSemTest(void) { UINT l_rc = 0; - + // lock trace semaphore first l_rc = ssx_semaphore_pend(&g_trac_mutex, TRAC_INTF_MUTEX_TIMEOUT); if(SSX_OK == l_rc) { // create one trace TRAC_INFO("traceTest Applet: test trace semaphore"); - + // Unlock trace semaphore ssx_semaphore_post(&g_trac_mutex); - + } else { l_rc = 1; } - + return l_rc; } @@ -109,11 +113,11 @@ int traceFuncTest() UINT l_entry_count = 0; UINT l_buffer_size = 0; tracDesc_t l_head = NULL; - + do { // Test target - trac_write_XXX(), TRAC_get_buffer() and TRAC_get_td() - // This testcase would create l_max_trace_entries +1 trace entries + // This testcase would create l_max_trace_entries +1 trace entries // to fill trace buffer, times_wrap should be larger than zero do{ l_entry_count++; @@ -121,8 +125,8 @@ int traceFuncTest() TRAC_ERR("traceTest applet ERR record: count %d", (int)l_entry_count); TRAC_IMP("traceTest applet IMP record: count %d", (int)l_entry_count); }while(l_max_trace_entries >= l_entry_count); - - // Check times_wrap in TRAC_INFO. + + // Check times_wrap in TRAC_INFO. // Because structures are all the same, skip TRAC_ERR and TRAC_IMP l_rc = TRAC_get_buffer(TRAC_get_td("INF"), G_trac_buffer); l_head = (tracDesc_t)&G_trac_buffer; @@ -131,9 +135,9 @@ int traceFuncTest() printf("Fail: times_wrap error in trace buffer: %d, %d\n", l_rc, l_head->times_wrap); break; } - + // Test target - TRAC_get_buffer() and TRAC_get_td() - // case: invalid paramenters + // case: invalid parameters l_rc = TRAC_get_buffer(TRAC_get_td("INF"), NULL); l_head = (tracDesc_t)&G_trac_buffer; if(l_rc == 0) @@ -142,7 +146,7 @@ int traceFuncTest() printf("Fail: test TRAC_get_buffer() invalid 1th parameter\n"); break; } - + l_rc = TRAC_get_buffer(NULL, G_trac_buffer); l_head = (tracDesc_t)&G_trac_buffer; if(l_rc == 0) @@ -151,9 +155,9 @@ int traceFuncTest() printf("Fail: test TRAC_get_buffer() invalid 2nd parameter\n"); break; } - + // Test target - TRAC_get_buffer_partial() and TRAC_get_td() - // case: invalid paramenters + // case: invalid parameters l_buffer_size = TRACE_BUFFER_SIZE; l_rc = TRAC_get_buffer_partial(NULL, G_trac_buffer, &l_buffer_size); if((l_rc != TRAC_INVALID_PARM) && (l_buffer_size !=0)) @@ -162,7 +166,7 @@ int traceFuncTest() printf("Fail: test TRAC_get_buffer_partial() invalid 1st parameter\n"); break; } - + l_rc = TRAC_get_buffer_partial(TRAC_get_td("UNKNOWN"), NULL, &l_buffer_size); if((l_rc != TRAC_INVALID_PARM) && (l_buffer_size !=0)) { @@ -170,7 +174,7 @@ int traceFuncTest() printf("Fail: test TRAC_get_buffer_partial() invalid 1st parameter\n"); break; } - + l_rc = TRAC_get_buffer_partial(TRAC_get_td("INF"), NULL, &l_buffer_size); if((l_rc != TRAC_INVALID_PARM) && (l_buffer_size !=0)) { @@ -178,7 +182,7 @@ int traceFuncTest() printf("Fail: test TRAC_get_buffer_partial() invalid 2nd parameter\n"); break; } - + l_rc = TRAC_get_buffer_partial(TRAC_get_td("ERR"), G_trac_buffer, NULL); if(l_rc != TRAC_INVALID_PARM) { @@ -186,7 +190,7 @@ int traceFuncTest() printf("Fail: test TRAC_get_buffer_partial() invalid 3rd parameter\n"); break; } - + // Test target - TRAC_get_buffer_partial() // case: input buffer less then the size of trace buffer header l_buffer_size = sizeof(trace_buf_head_t) - 1; @@ -197,7 +201,7 @@ int traceFuncTest() printf("Fail: test TRAC_get_buffer_partial() with illegal small input buffer\n"); break; } - + // Test target - TRAC_get_buffer_partial() // case: input buffer is small then then trace buffer l_buffer_size = sizeof(trace_buf_head_t) + (TRACE_BUFFER_SIZE/4); @@ -208,7 +212,7 @@ int traceFuncTest() printf("Fail: test TRAC_get_buffer_partial() with small input buffer\n"); break; } - + // Test target - TRAC_get_buffer_partial() // case: input buffer is larger then trace buffer l_buffer_size = sizeof(G_trac_buffer); @@ -219,7 +223,7 @@ int traceFuncTest() printf("Fail: test TRAC_get_buffer_partial() with too large input buffer\n"); break; } - + // Test target - TRAC_reset_buf() and TRAC_get_buffer_partial() // case: clear trace buffer and check with buffer larger than trace buffer TRAC_reset_buf(); @@ -231,7 +235,7 @@ int traceFuncTest() printf("Fail: test TRAC_reset_buf()/TRAC_get_buffer_partial() with empty trace\n"); break; } - + // Test target - TRAC_reset_buf() and TRAC_get_buffer_partial() // case: clear trace buffer and check it with buffer smaller than trace buffer TRAC_reset_buf(); @@ -243,7 +247,7 @@ int traceFuncTest() printf("Fail: test TRAC_reset_buf()/TRAC_get_buffer_partial() with empty trace\n"); break; } - + // Test target - TRAC_get_buffer_partial() // case: create some traces and test with large input buffer l_entry_count = 0; @@ -262,7 +266,7 @@ int traceFuncTest() printf("Fail: test TRAC_get_buffer_partial() with large input buffer\n"); break; } - + // Test target - TRAC_get_buffer_partial() // case: create some traces and test with small input buffer l_buffer_size = sizeof(trace_buf_head_t) + (TRACE_BUFFER_SIZE/4); @@ -273,9 +277,9 @@ int traceFuncTest() printf("Fail: test TRAC_get_buffer_partial() with small input buffer\n"); break; } - + }while(0); - + return l_rc; } @@ -286,7 +290,7 @@ errlHndl_t traceTest(void * i_arg) { errlHndl_t l_err = NULL; UINT l_rc = 0; - + do { // function unit test @@ -296,28 +300,27 @@ errlHndl_t traceTest(void * i_arg) printf("traceTest Applet: Function test failed\n"); break; } - + // Macro test: test basic trace macros with/without parameters - // Please check occ memory dump with fsp-trace - + // int: supported TRAC_INFO(para_int_0); TRAC_INFO(para_int_1, 1); TRAC_INFO(para_int_5, 1, 2, 3, 4, 5); TRAC_INFO(para_int_6, 1, 2, 3, 4, 5, 6); - + // hex: supported TRAC_ERR(para_hex_0); TRAC_ERR(para_hex_1, 0xA); TRAC_ERR(para_hex_5, 0xA, 0xB, 0xC, 0xD, 0xE); TRAC_ERR(para_hex_6, 0xA, 0xB, 0xC, 0xD, 0xE, 0xF); - + // char: not supported TRAC_IMP(para_int_0); TRAC_IMP(para_chr_1, "1"); TRAC_IMP(para_chr_5, "1", "2", "3", "4", "5"); TRAC_IMP(para_chr_6, "1", "2", "3", "4", "5", "6"); - + #ifdef TEST_SEMAPHORE // semaphore test l_rc = traceSemTest(); @@ -328,8 +331,8 @@ errlHndl_t traceTest(void * i_arg) } #endif }while(0); - - printf("traceTest Applet: test finish\n"); + + printf("traceTest Applet: test finished\n"); return l_err; } |