diff options
author | William Bryan <wilbryan@us.ibm.com> | 2016-05-11 11:57:13 -0500 |
---|---|---|
committer | William A. Bryan <wilbryan@us.ibm.com> | 2016-05-13 12:48:06 -0400 |
commit | 6f82299cb1e306dabef5bbae1a9d4e5817dbcea9 (patch) | |
tree | 77d9cd1179c5101155a8b38111fa0920f0c0e6ef /src | |
parent | 3ad5dcc5de34f47b029c9b0716d985c0335dd013 (diff) | |
download | talos-occ-6f82299cb1e306dabef5bbae1a9d4e5817dbcea9.tar.gz talos-occ-6f82299cb1e306dabef5bbae1a9d4e5817dbcea9.zip |
Fix up SRC parsing errors
Change-Id: I4c708fbc0158577ff143462490e7abe8d3795d66
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/24382
Tested-by: FSP CI Jenkins
Reviewed-by: Martha Broyles <mbroyles@us.ibm.com>
Reviewed-by: Wael El-Essawy <welessa@us.ibm.com>
Diffstat (limited to 'src')
-rwxr-xr-x | src/occApplet/Makefile | 57 | ||||
-rwxr-xr-x | src/occApplet/template.c | 79 | ||||
-rwxr-xr-x | src/occApplet/testApplet/Makefile | 86 | ||||
-rwxr-xr-x | src/occApplet/testApplet/apsstest.c | 108 | ||||
-rwxr-xr-x | src/occApplet/testApplet/errlTest.c | 1176 | ||||
-rwxr-xr-x | src/occApplet/testApplet/linkTestApplet.cmd | 82 | ||||
-rw-r--r-- | src/occApplet/testApplet/occLinkInputFile | 26 | ||||
-rwxr-xr-x | src/occApplet/testApplet/pstApplet.c | 129 | ||||
-rwxr-xr-x | src/occApplet/testApplet/sensorTest.c | 1145 | ||||
-rwxr-xr-x | src/occApplet/testApplet/testApltId.h | 67 | ||||
-rwxr-xr-x | src/occApplet/testApplet/testappletfiles.mk | 33 | ||||
-rwxr-xr-x | src/occApplet/testApplet/traceTest.c | 349 | ||||
-rwxr-xr-x | src/occ_405/dcom/dcom.c | 8 | ||||
-rw-r--r-- | src/occ_405/occ_service_codes.h | 2 |
14 files changed, 6 insertions, 3341 deletions
diff --git a/src/occApplet/Makefile b/src/occApplet/Makefile deleted file mode 100755 index 3a338be..0000000 --- a/src/occApplet/Makefile +++ /dev/null @@ -1,57 +0,0 @@ -# IBM_PROLOG_BEGIN_TAG -# This is an automatically generated prolog. -# -# $Source: src/occApplet/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)/../ -export OCCROOT = $(ROOTPATH) -endif - -#******************************************************************************* -# Variables -#******************************************************************************* -SUBDIRS = productApplet testApplet -CLEANCMD = $(MAKE) clean -C $(dir) -ALLCMD = $(MAKE) -C $(dir) -COMBINEIMAGE = $(MAKE) combineImage -C $(dir) - -#******************************************************************************* -# Compilation -#******************************************************************************* -all: - $(foreach dir,$(SUBDIRS),$(ALLCMD) &&) true - -#******************************************************************************* -# combineImage -#******************************************************************************* -.PHONY : combineImage -combineImage: - $(foreach dir,$(SUBDIRS),$(COMBINEIMAGE) &&) true - -#******************************************************************************* -# Clean -#******************************************************************************* -clean: - $(foreach dir,$(SUBDIRS),$(CLEANCMD) &&) true - diff --git a/src/occApplet/template.c b/src/occApplet/template.c deleted file mode 100755 index 868b8e9..0000000 --- a/src/occApplet/template.c +++ /dev/null @@ -1,79 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/occApplet/template.c $ */ -/* */ -/* OpenPOWER OnChipController Project */ -/* */ -/* COPYRIGHT International Business Machines Corp. 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 */ - -//************************************************************************* -// Includes -//************************************************************************* -#include <common_types.h> // imageHdr_t declaration and image header macro -#include <errl.h> // For error handle -#include "ssx_io.h" // For printfs -#include <trac.h> // For traces -#include <appletId.h> // For applet ID - -//************************************************************************* -// Externs -//************************************************************************* - -//************************************************************************* -// Macros -//************************************************************************* - -//************************************************************************* -// Defines/Enums -//************************************************************************* -#define <FUNCNM>_ID "<APPLET_ID_STR>\0" - -//************************************************************************* -// Structures -//************************************************************************* - -//************************************************************************* -// Globals -//************************************************************************* - -//************************************************************************* -// Function Prototypes -//************************************************************************* - -//************************************************************************* -// Functions -//************************************************************************* - -//************************************************************************* -// Entry point function -//************************************************************************* -errlHndl_t <funcNm>(void * i_arg) -{ - TRAC_INFO("Enter"); - errlHndl_t l_err = NULL; - - TRAC_INFO("Exit"); - return l_err; -} - -//************************************************************************* -// Image Header -//************************************************************************* -IMAGE_HEADER (G_<funcNm>,<funcNm>,<FUNCNM>_ID,<APLT_ID>); diff --git a/src/occApplet/testApplet/Makefile b/src/occApplet/testApplet/Makefile deleted file mode 100755 index 09d1622..0000000 --- a/src/occApplet/testApplet/Makefile +++ /dev/null @@ -1,86 +0,0 @@ -# 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)/../../ -export OCCROOT = $(ROOTPATH) -endif - -#******************************************************************************* -# make variables -#******************************************************************************* -OCC = ../../occ -BOOTLOADER = ../../occBootLoader -SSX = ../../ssx -TESTAPPLET = . -LIB = ../../lib -LDFLAGS += --oformat=elf32-powerpc -melf32ppc - -buildImage = $(LD) -R $(OCC)/occ.out $(obj) -Tlinkscript $(LDFLAGS) \ --Map $(basename $(obj)).map -Bstatic -o $(basename $(obj)).out && \ -$(OBJCOPY) -I elf32-powerpc -O binary $(basename $(obj)).out $(basename $(obj)).bin && \ -$(OBJDUMP) -d $(basename $(obj)).out > $(basename $(obj)).dis && \ -$(BOOTLOADER)/imageHdrScript $(basename $(obj)).bin `md5sum $(OCC)/occ.out | cut -c 1-4` - -#******************************************************************************* -# Includes -#******************************************************************************* -include $(SSX)/pgp/ssx.mk -include testappletfiles.mk - -INCLUDES = -I. -I$(OCC)/rtls -I$(OCC)/incl -I$(OCC)/errl -I$(OCC)/trac -I$(LIB) -I$(SSX)/ssx -INCLUDES += -I$(SSX)/ppc405 -I$(SSX)/pgp -I$(SSX)/ppc32 -I$(SSX)/pgp/registers -INCLUDES += -I$(OCC)/sensor -I$(OCC)/pss -I$(OCC)/gpe -I$(OCC) -I$(OCC)/aplt -I$(OCC)/dcom -INCLUDES += -I$(OCC)/aplt/incl -I$(OCC)/cmdh - -#******************************************************************************* -# Defs -#******************************************************************************* -DEFS += $(D) -DEFS += -DOCC=1 -DUSE_SSX_APP_CFG_H=1 - -GCC-CFLAGS = -c -g -Wall -fsigned-char -msoft-float -pipe \ --m32 -mbig-endian -Wa,-m405 -mcpu=405 -mmultiple -mstring -meabi \ --ffreestanding -Os -mno-sdata - -#******************************************************************************* -# Compilation -#******************************************************************************* -all: $(TESTAPLT_OBJECTS) - $(CPP) -P $(DEFS) < linkTestApplet.cmd > linkscript - $(foreach obj,$(TESTAPLT_OBJECTS),$(buildImage) &&) true - -#******************************************************************************* -# combineImage -#******************************************************************************* -.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 deleted file mode 100755 index c50bd5d..0000000 --- a/src/occApplet/testApplet/apsstest.c +++ /dev/null @@ -1,108 +0,0 @@ -/* 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 */ -/* [+] 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 */ - -//************************************************************************* -// Includes -//************************************************************************* -#include <common_types.h> // imageHdr_t declaration and image header macro -#include <errl.h> // For error handle -#include "ssx_io.h" // For printfs -#include <apss.h> // APSS Interfaces -#include <appletId.h> // For applet ID -#include <trac.h> // For traces - -//************************************************************************* -// Externs -//************************************************************************* -extern PoreEntryPoint GPE_pore_nop; // Sleep for specified amount of time... - -//************************************************************************* -// Macros -//************************************************************************* - -//************************************************************************* -// Defines/Enums -//************************************************************************* -#define APSSTESTMAIN_ID "apsstest1\0" - -//************************************************************************* -// Structures -//************************************************************************* - -//************************************************************************* -// Globals -//************************************************************************* - -//************************************************************************* -// Function Prototypes -//************************************************************************* - -//************************************************************************* -// Functions -//************************************************************************* - -// Function Specification -// -// Name: apssTestMain -// -// Description: -// -// End Function Specification -errlHndl_t apssTestMain(void * i_arg) -{ - APSS_DBG("Running apssTestMain\n"); - errlHndl_t l_err = NULL; - task_apss_start_pwr_meas(NULL); - - // Schedule GPE program to delay to ensure the data is available... (BLOCKING) - // bad: 48, good: 56 - PoreFlex test_request; - APSS_DBG("apss_test_pwr_meas: delay...\n"); - pore_flex_create(&test_request, - &G_pore_gpe0_queue, - (void*)GPE_pore_nop, // entry_point - (uint32_t)56, // entry_point argument - SSX_WAIT_FOREVER, // no timeout - NULL, // callback, - NULL, // callback arg - ASYNC_REQUEST_BLOCKING); // options - pore_flex_schedule(&test_request); - APSS_DBG("apss_test_pwr_meas: delay complete\n"); - - task_apss_continue_pwr_meas(NULL); - - task_apss_complete_pwr_meas(NULL); - - APSS_DBG("Done apssTestMain\n"); - - return l_err; -} - -/*****************************************************************************/ -// Image Header -/*****************************************************************************/ -// 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 deleted file mode 100755 index 3130d8a..0000000 --- a/src/occApplet/testApplet/errlTest.c +++ /dev/null @@ -1,1176 +0,0 @@ -/* 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 */ -/* [+] 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 */ - -#define ERRL_DEBUG -/*****************************************************************************/ -// Includes -/*****************************************************************************/ -#include <common_types.h> // imageHdr_t declaration and image header macro -#include "ssx.h" -#include "ssx_io.h" // For ERRL_DBGs -#include <errl.h> -#include <appletId.h> // For applet ID -#include <trac.h> // For traces -#include <occ_service_codes.h> // Reason code -#include <cmdh_fsp.h> // Needed for rc codes. -#include <trac_interface.h> -#include <aplt_service_codes.h> // For test applet module ID -#include <testApltId.h> // For test applet ID - -//************************************************************************* -// Externs -//************************************************************************* - -//************************************************************************* -// Macros -//************************************************************************* -#define CHECK_CONDITION(cond, rv) \ - if( !(cond) ) \ - { \ - rv = __LINE__; \ - break; \ - } - -//************************************************************************* -// Defines/Enums -//************************************************************************* -#define ERRLTESTMAIN_ID "errl Test\0" -#define TRAC_PATTERN 0x55 -#define MAX_BUFFER_SIZE MAX_ERRL_CALL_HOME_SZ -#define TEST_MODULE_ID 0x1616 - -// sensor test module ID enumeration -typedef enum -{ - TEST_ERROR_HANDLING = 0x00, - TEST_CREATE_COMMIT_DELETE_LOG = 0x01, - TEST_ADD_USRDTLS_TO_ERRL = 0x02, - TEST_ADD_TRACE_TO_ERRL = 0x03, - TEST_TIME = 0x04, - TEST_CREATE2INFO_CALLHOMELOG = 0x05, - TEST_CREATE_MAX_LOGS = 0x06, - TEST_CALLOUTS = 0x07, - TEST_SET_ERRLSEV_TO_INFO = 0x08, - TEST_ERRL_TEST_WORD_ALIGN = 0x09 -} errlTestModId; - -// errl test return codes -typedef enum -{ - SUCCESS_RC = 0x00000000, -} errlTestRc; - -//************************************************************************* -// Structures -//************************************************************************* - -//************************************************************************* -// Globals -//************************************************************************* -// TRACE: Trace buffers initialized -uint8_t G_data[ MAX_BUFFER_SIZE]; - -//************************************************************************* -// Function Prototypes -//************************************************************************* -uint32_t errlTestErrorHandling(); -uint32_t errlTestAddUsrDtlsToErrl(); -uint32_t errlTestAddTraceToErrl(); -uint32_t errlTestDtlSizeLimit(); -uint32_t errlTestTime(); -uint32_t errlTestCreateCommitDeleteLog(); -uint32_t errlTestCreate2InfoCallhomeLog(); -uint32_t errlTestCreateMaxLogs(); -uint32_t errlTestCallouts(); -uint32_t errlTestSetErrlSevToInfo(); -uint32_t errlTestWordAlign(); -void dumpLog( errlHndl_t i_log, uint32_t i_len ); -void ppdumpslot(void); - -//************************************************************************* -// Functions -//************************************************************************* -// Function errlTestMain -// -// Name: sensorTestMain -// -// Description: Entry point function -// -// End Function Specification -errlHndl_t errlTestMain(void * i_arg) -{ - - errlHndl_t l_err = NULL; - uint16_t l_modId = 0; - uint32_t l_rc = ERRL_RC_SUCCESS; - - ERRL_DBG("Enter errlTestMain\n"); - - do - { - l_rc = errlTestErrorHandling(); - l_modId = TEST_ERROR_HANDLING; - - if( l_rc != ERRL_RC_SUCCESS) - { - TRAC_INFO("Failure on error handling test"); - break; - }; - - l_rc = errlTestCreateCommitDeleteLog(); - l_modId = TEST_CREATE_COMMIT_DELETE_LOG ; - if( l_rc != ERRL_RC_SUCCESS) - { - TRAC_INFO("Failure on Log test"); - break; - } - - l_rc = errlTestAddUsrDtlsToErrl(); - l_modId = TEST_ADD_USRDTLS_TO_ERRL ; - if( l_rc != ERRL_RC_SUCCESS) - { - TRAC_INFO("Failure on add user detail test"); - break; - } - - l_rc = errlTestAddTraceToErrl(); - l_modId = TEST_ADD_TRACE_TO_ERRL ; - if( l_rc != ERRL_RC_SUCCESS) - { - TRAC_INFO("Failure on add trace test"); - break; - } - - l_rc = errlTestTime(); - l_modId = TEST_TIME ; - if( l_rc != ERRL_RC_SUCCESS) - { - TRAC_INFO("Failure on time test"); - break; - } - - l_rc = errlTestCreate2InfoCallhomeLog(); - l_modId = TEST_CREATE2INFO_CALLHOMELOG ; - if( l_rc != ERRL_RC_SUCCESS) - { - TRAC_INFO("Failure on create call home log test"); - break; - } - - l_rc = errlTestCreateMaxLogs(); - l_modId = TEST_CREATE_MAX_LOGS ; - if( l_rc != ERRL_RC_SUCCESS) - { - TRAC_INFO("Failure on create max logs test"); - break; - } - - l_rc = errlTestCallouts(); - l_modId = TEST_CALLOUTS ; - if( l_rc != ERRL_RC_SUCCESS) - { - TRAC_INFO("Failure on callouts test"); - break; - } - - l_rc = errlTestSetErrlSevToInfo(); - l_modId = TEST_SET_ERRLSEV_TO_INFO ; - if( l_rc != ERRL_RC_SUCCESS) - { - TRAC_INFO("Failure on SetErrlSevToInfo test"); - break; - } - - } while (0); - - if( l_rc != ERRL_RC_SUCCESS) - { - ERRL_DBG("**********************************************"); - ERRL_DBG("* errl Test Failed (errlTest.c): line: %d",l_rc); - ERRL_DBG("**********************************************"); - /* @ - * @errortype - * @moduleid TEST_APLT_MODID_ERRLTEST - * @reasoncode INTERNAL_FAILURE - * @userdata1 Test Applet ID - * @userdata2 Return Code - * @userdata4 OCC_NO_EXTENDED_RC - * @devdesc Failure executing test applet - */ - l_err = createErrl(TEST_APLT_MODID_ERRLTEST, - INTERNAL_FAILURE, - OCC_NO_EXTENDED_RC, - ERRL_SEV_INFORMATIONAL, - NULL, - 0, - ERRL_TEST_APLT, - l_rc); - } - else - { - ERRL_DBG("**********************************************"); - ERRL_DBG("* errl Test Passed (errlTest.c)"); - ERRL_DBG("**********************************************"); - } - - ERRL_DBG("Exit errlTestMain\n"); - - return l_err; -} - - -// Function Specification -// -// Name: errlTestErrorHandling -// -// Description: errlTestErrorHandling -// -// End Function Specification -uint32_t errlTestErrorHandling() -{ - uint32_t l_rc = 0; - errlHndl_t l_errlHnd = NULL; - uint8_t l_dataPtr[10]; - uint16_t l_entrySizeBefore = 0; - uint16_t l_entrySizeAfter = 0; - - ERRL_DBG(" START"); - do - { - /****************************************************/ - // 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); - 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); - CHECK_CONDITION( l_errlHnd != INVALID_ERR_HNDL, l_rc); - - // i_trace = NULL, so entry size doesn't change - l_entrySizeBefore = l_errlHnd->iv_userDetails.iv_entrySize; - addTraceToErrl(NULL, 5, l_errlHnd); - l_entrySizeAfter = l_errlHnd->iv_userDetails.iv_entrySize; - CHECK_CONDITION(l_entrySizeBefore == l_entrySizeAfter, l_rc); - - // i_traceSz = 0, entry size doesn't change - l_entrySizeBefore = l_errlHnd->iv_userDetails.iv_entrySize; - addTraceToErrl(g_trac_inf, 0, l_errlHnd); // @at012c - l_entrySizeAfter = l_errlHnd->iv_userDetails.iv_entrySize; - CHECK_CONDITION( l_entrySizeBefore == l_entrySizeAfter, l_rc); - - // io_err = NULL, entry size doesn't change - l_entrySizeBefore = l_errlHnd->iv_userDetails.iv_entrySize; - addTraceToErrl(g_trac_inf, 32, NULL); // @at012c - l_entrySizeAfter = l_errlHnd->iv_userDetails.iv_entrySize; - CHECK_CONDITION( l_entrySizeBefore == l_entrySizeAfter, l_rc); - - // test addTraceToErrl after log is comitted so entry size doesn't change - errlHndl_t l_errlHndx = l_errlHnd; - commitErrl(&l_errlHnd); - l_entrySizeBefore = l_errlHndx->iv_userDetails.iv_entrySize; - addTraceToErrl(g_trac_inf, 32, l_errlHndx); // @at012c - l_entrySizeAfter = l_errlHndx->iv_userDetails.iv_entrySize; - CHECK_CONDITION( l_entrySizeBefore == l_entrySizeAfter, l_rc); - - deleteErrl(&l_errlHndx); - CHECK_CONDITION( l_errlHndx == NULL, l_rc); - - // 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 occurred by checking anything. (It will just cause - // a TLB exception) - l_errlHnd = INVALID_ERR_HNDL; - addTraceToErrl(g_trac_inf, 32, l_errlHnd); - - /****************************************************/ - // 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 occurred by checking anything. (It will just cause - // a TLB exception) - commitErrl( NULL); - - // l_errlHnd should be set to NULL - l_errlHnd = INVALID_ERR_HNDL; - commitErrl(&l_errlHnd); - CHECK_CONDITION( l_errlHnd == NULL, l_rc); - - /****************************************************/ - // 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 occurred by checking anything. (It will just cause - // a TLB exception) - deleteErrl( NULL); - - // l_errlHnd should be set to NULL - l_errlHnd = INVALID_ERR_HNDL; - deleteErrl(&l_errlHnd); - CHECK_CONDITION( l_errlHnd == NULL, l_rc); - - /****************************************************/ - // 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 occurred by checking anything. (It will just cause - // a TLB exception) - 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 occurred by checking anything. (It will just cause - // a TLB exception) - 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); - 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 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 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); - - // i_dataPtr = NULL so entry size doesn't change - l_entrySizeBefore = l_errlHnd->iv_userDetails.iv_entrySize; - addUsrDtlsToErrl(l_errlHnd, NULL, 10, ERRL_USR_DTL_STRUCT_VERSION_1, ERRL_USR_DTL_TRACE_DATA); - l_entrySizeAfter = l_errlHnd->iv_userDetails.iv_entrySize; - CHECK_CONDITION( l_entrySizeBefore == l_entrySizeAfter, l_rc); - - // i_size = 0 so so entry size doesn't change - l_entrySizeBefore = l_errlHnd->iv_userDetails.iv_entrySize; - addUsrDtlsToErrl(l_errlHnd, l_dataPtr, 0, ERRL_USR_DTL_STRUCT_VERSION_1, ERRL_USR_DTL_TRACE_DATA); - l_entrySizeAfter = l_errlHnd->iv_userDetails.iv_entrySize; - CHECK_CONDITION( l_entrySizeBefore == l_entrySizeAfter, l_rc); - - // test addUsrDtlsToErrl after log is committed so entry size doesn't change - l_errlHndx = l_errlHnd; - commitErrl(&l_errlHnd); - l_entrySizeBefore = l_errlHndx->iv_userDetails.iv_entrySize; - addUsrDtlsToErrl(l_errlHndx, l_dataPtr, 10, ERRL_USR_DTL_STRUCT_VERSION_1, ERRL_USR_DTL_TRACE_DATA); - l_entrySizeAfter = l_errlHndx->iv_userDetails.iv_entrySize; - CHECK_CONDITION( l_entrySizeBefore == l_entrySizeAfter, l_rc); - - deleteErrl(&l_errlHndx); - CHECK_CONDITION( l_errlHndx == NULL, l_rc); - - /****************************************************/ - // Test setErrlSevToInfo 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 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 occurred by checking anything. (It will just cause - // a TLB exception) - setErrlSevToInfo(INVALID_ERR_HNDL); - }while(0); - - return l_rc; -} - -// Function Specification -// -// Name: errlTestCreateCommitDeleteLog -// -// Description: errlTestCreateCommitDeleteLog -// -// End Function Specification -uint32_t errlTestCreateCommitDeleteLog() -{ - ERRL_DBG("START"); - uint32_t l_rc = 0; - - do - { - /****************************************************/ - // 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); - CHECK_CONDITION( l_handle != INVALID_ERR_HNDL, l_rc); - - ERRL_DBG("Slots after Creating call home log" ); - ppdumpslot(); - - /****************************************************/ - // Test commit log - errlHndl_t l_handle2 = l_handle; - commitErrl( &l_handle ); - CHECK_CONDITION( (l_handle == NULL) && - (l_handle2->iv_userDetails.iv_committed == 1), l_rc); - - ERRL_DBG("Slots after Commiting call home log" ); - dumpLog( l_handle2, l_handle2->iv_userDetails.iv_entrySize ); - ppdumpslot(); - - /****************************************************/ - // Test delete log - deleteErrl(&l_handle2); - CHECK_CONDITION( l_handle2 == NULL, l_rc); - - ERRL_DBG("Slots after delete Log" ); - ppdumpslot(); - - ERRL_DBG("END \n"); - - }while(0); - - return l_rc; -} - -// Function Specification -// -// Name: errlTestAddUsrDtlsToErrl -// -// Description: errlTestAddUsrDtlsToErrl -// -// End Function Specification -uint32_t errlTestAddUsrDtlsToErrl() -{ - uint32_t l_rc = 0; - ERRL_DBG("START"); - uint16_t l_entrySizeBefore = 0; - uint16_t l_entrySizeAfter = 0; - - do - { - // Create three err logs - errlHndl_t l_handle = NULL; - 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); - 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; - errlHndl_t l_handle2X = l_handle2; - errlHndl_t l_handle3X = l_handle3; - ERRL_DBG("Slots after Create - 3 slots should be used (one of each"); - ppdumpslot(); - - CHECK_CONDITION( (l_handle != INVALID_ERR_HNDL) && - (l_handle2 != INVALID_ERR_HNDL) && - (l_handle3 != INVALID_ERR_HNDL), l_rc); - - /****************************************************/ - // 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 ) ); - addUsrDtlsToErrl( l_handle, G_data, sizeof( G_data ), ERRL_USR_DTL_STRUCT_VERSION_1, ERRL_USR_DTL_TRACE_DATA ); - l_entrySizeAfter = l_handle->iv_userDetails.iv_entrySize; - CHECK_CONDITION( l_entrySizeAfter == MAX_ERRL_ENTRY_SZ, l_rc); - - // Add "user details" data that exceeds the max size for l_handle2 - l_entrySizeBefore = l_handle2->iv_userDetails.iv_entrySize; - memset( G_data, 0xDD, sizeof( G_data ) ); - addUsrDtlsToErrl( l_handle2, G_data, sizeof( G_data ), ERRL_USR_DTL_STRUCT_VERSION_1, ERRL_USR_DTL_CALLHOME_DATA ); - l_entrySizeAfter = l_handle2->iv_userDetails.iv_entrySize; - CHECK_CONDITION( l_entrySizeAfter == MAX_ERRL_CALL_HOME_SZ, l_rc); - - // Add "user details" with size 76 for l_handle3 - l_entrySizeBefore = l_handle3->iv_userDetails.iv_entrySize; - memset( G_data, 0xEE, sizeof( G_data ) ); - addUsrDtlsToErrl( l_handle3, G_data, 76, ERRL_USR_DTL_STRUCT_VERSION_1, ERRL_USR_DTL_TRACE_DATA ); - l_entrySizeAfter = l_handle3->iv_userDetails.iv_entrySize; - // (header + 76) is the size that add to entry - CHECK_CONDITION( l_entrySizeAfter == (l_entrySizeBefore+sizeof(ErrlUserDetailsEntry_t)+76), l_rc); - - dumpLog( l_handle, l_handle->iv_userDetails.iv_entrySize ); - dumpLog( l_handle2, l_handle2->iv_userDetails.iv_entrySize ); - dumpLog( l_handle3, l_handle3->iv_userDetails.iv_entrySize ); - - commitErrl( &l_handle ); - commitErrl( &l_handle2 ); - commitErrl( &l_handle3 ); - ERRL_DBG("Slots after Commit - 3 slots should be used/committed"); - ppdumpslot(); - - deleteErrl(&l_handleX); - deleteErrl(&l_handle2X); - deleteErrl(&l_handle3X); - CHECK_CONDITION( (l_handleX == NULL) && - (l_handle2X == NULL) && - (l_handle3X == NULL), l_rc); - - ERRL_DBG("Slots after delete Log - All slots should be empty"); - ppdumpslot(); - - /****************************************************/ - // 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); - 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 - l_handleX = l_handle; - ppdumpslot(); - - // add 256 bytes of "user details" (512+256) - l_entrySizeBefore = l_handle->iv_userDetails.iv_entrySize; - memset( G_data, 0xAA, sizeof( G_data ) ); - addUsrDtlsToErrl( l_handle, G_data, 256, ERRL_USR_DTL_STRUCT_VERSION_1, ERRL_USR_DTL_TRACE_DATA ); - l_entrySizeAfter = l_handle->iv_userDetails.iv_entrySize; - 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); - - // add 512 bytes of "user details" (512+256+512) - l_entrySizeBefore = l_handle->iv_userDetails.iv_entrySize; - memset( G_data, 0xBB, sizeof( G_data ) ); - addUsrDtlsToErrl( l_handle, G_data, 512, ERRL_USR_DTL_STRUCT_VERSION_1, ERRL_USR_DTL_TRACE_DATA ); - l_entrySizeAfter = l_handle->iv_userDetails.iv_entrySize; - ERRL_DBG("Slots after create + 256 + 512 bytes"); - ppdumpslot(); - // (header + 512) is the size that add to entry - CHECK_CONDITION( l_entrySizeAfter == (l_entrySizeBefore+sizeof(ErrlUserDetailsEntry_t)+512), l_rc); - - // add 1024 bytes of "user details" (512+256+512+1024), the entry size is more than 2048 now - l_entrySizeBefore = l_handle->iv_userDetails.iv_entrySize; - memset( G_data, 0xCC, sizeof( G_data ) ); - addUsrDtlsToErrl( l_handle, G_data, 1024, ERRL_USR_DTL_STRUCT_VERSION_1, ERRL_USR_DTL_TRACE_DATA ); - l_entrySizeAfter = l_handle->iv_userDetails.iv_entrySize; - ERRL_DBG("Slots after create + 256 + 512 +1024 bytes"); - ppdumpslot(); - // (header + 1024) is the size that add to entry - CHECK_CONDITION( l_entrySizeAfter <= MAX_ERRL_ENTRY_SZ, l_rc); // @at012c - - commitErrl( &l_handle ); - deleteErrl(&l_handleX); - ERRL_DBG("Slots should now be empty"); - ppdumpslot(); - ERRL_DBG("END \n"); - }while(0); - - return l_rc; -} - -// Function Specification -// -// Name: errlTestAddTraceToErrl -// -// Description: errlTestAddTraceToErrl -// -// End Function Specification -uint32_t errlTestAddTraceToErrl() -{ - uint32_t l_rc = 0; - uint16_t l_entrySizeBefore = 0; - uint16_t l_entrySizeAfter = 0; - ERRL_DBG("START"); - - do - { - // 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); - 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 - errlHndl_t l_handleX = l_handle; - ERRL_DBG("Slots after Create - 1 slots should be used (one of each"); - ppdumpslot(); - - /****************************************************/ - // 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); - l_entrySizeAfter = l_handle->iv_userDetails.iv_entrySize; - CHECK_CONDITION( l_entrySizeAfter <= MAX_ERRL_ENTRY_SZ, l_rc); - - dumpLog( l_handle, l_handle->iv_userDetails.iv_entrySize ); - commitErrl( &l_handle ); - ERRL_DBG("Slots after Commit - 1 slots should be used/committed"); - ppdumpslot(); - - deleteErrl(&l_handleX); - ERRL_DBG("Slots after delete Log - All slots should be empty"); - ppdumpslot(); - - /****************************************************/ - // 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); - 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 - l_handleX = l_handle; - ppdumpslot(); - - // Add 256 bytes of trace (512+256) - l_entrySizeBefore = l_handle->iv_userDetails.iv_entrySize; - addTraceToErrl(g_trac_inf, 256, l_handle); // @at012c - l_entrySizeAfter = l_handle->iv_userDetails.iv_entrySize; - 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); - - // Add 512 bytes of trace (512+256+512) - l_entrySizeBefore = l_handle->iv_userDetails.iv_entrySize; - addTraceToErrl(g_trac_inf, 512, l_handle); // @at012c - 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); - - // 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; - addTraceToErrl(g_trac_inf, 1024, l_handle); // @at012c - 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); - - commitErrl( &l_handle ); - deleteErrl(&l_handleX); - ERRL_DBG("Slots should now be empty"); - ppdumpslot(); - ERRL_DBG("END \n"); - - }while(0); - - return l_rc; -} - -// Function Specification -// -// Name: errlTestTime -// -// Description: errlTestTime -// -// End Function Specification -uint32_t errlTestTime() -{ - uint32_t l_rc = 0; - - do - { - ERRL_DBG("START"); - errlHndl_t l_handle = NULL; - uint64_t l_start = 0; - uint64_t l_end = 0; - - - /****************************************************/ - // 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); - CHECK_CONDITION( l_handle != INVALID_ERR_HNDL, l_rc); - - - // check time stamp - errlHndl_t l_handle2 = l_handle; - commitErrl( &l_handle ); - l_end = ssx_timebase_get(); - CHECK_CONDITION( (l_handle2->iv_userDetails.iv_timeStamp >= l_start) && - (l_handle2->iv_userDetails.iv_timeStamp <= l_end ), l_rc); - - deleteErrl(&l_handle2); - ERRL_DBG("END \n"); - - }while(0); - - return l_rc; -} - -/*****************************************************************************/ -// errlTestCreate2InfoCallhomeLog -/*****************************************************************************/ -uint32_t errlTestCreate2InfoCallhomeLog() -{ - ERRL_DBG("START" ); - uint32_t l_rc = 0; - - do - { - /****************************************************/ - // Check creating Info logs twice - // 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); - 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); - CHECK_CONDITION( l_handle2 == INVALID_ERR_HNDL, l_rc); - - deleteErrl(&l_handle); - - /****************************************************/ - // Check creating Callhome logs twice - // 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); - 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); - CHECK_CONDITION( l_handle2 == INVALID_ERR_HNDL, l_rc); - - deleteErrl(&l_handle); - - ERRL_DBG("END \n"); - }while(0); - - return l_rc; -} - -// Function Specification -// -// Name: errlTestCreateMaxLogs -// -// Description: errlTestCreateMaxLogs -// -// End Function Specification -uint32_t errlTestCreateMaxLogs() -{ - uint32_t l_rc = 0; - - ERRL_DBG("START"); - do - { - - /****************************************************/ - // Check max logs - ERRL_SEVERITY l_sev = 0; - errlHndl_t l_backupHandle[ERRL_MAX_SLOTS-2]; - errlHndl_t l_handle = NULL; - - uint32_t l_index = 0; - // Create 7 ERRL_SEV_PREDICTIVE or ERRL_SEV_UNRECOVERABLE slots randomly - for(l_index =0; l_index < ERRL_MAX_SLOTS-2; l_index++) - { - - 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); - CHECK_CONDITION( (l_handle != INVALID_ERR_HNDL) && - (l_handle != NULL), l_rc); - - // backup handle - l_backupHandle[l_index] = l_handle; - - ERRL_DBG("Log Created @ %p with Sev: %d\n",l_handle, l_sev ); - // addUsrDtlsToErrl - memset( G_data, l_index, sizeof( G_data ) ); - addUsrDtlsToErrl( l_handle, G_data, sizeof(G_data), ERRL_USR_DTL_STRUCT_VERSION_1, ERRL_USR_DTL_TRACE_DATA ); - - // commitErrl( &l_handle ); - } - // check if something wrong in for loop - if(l_rc != 0) - 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); - CHECK_CONDITION( l_handle == INVALID_ERR_HNDL, l_rc); - - // delete errl - for(l_index = 0; l_index < ERRL_MAX_SLOTS-2; l_index++) - { - deleteErrl(&l_backupHandle[l_index]); - } - ppdumpslot(); - - /****************************************************/ - // 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); - CHECK_CONDITION( (l_handle != INVALID_ERR_HNDL) && - (l_handle != NULL), l_rc); - - deleteErrl(&l_handle); - } - - ERRL_DBG("END \n"); - }while(0); - - return l_rc; -} - -// Function Specification -// -// Name: errlTestCallouts -// -// Description: errlTestCallouts -// -// End Function Specification -uint32_t errlTestCallouts() -{ - uint32_t l_rc = 0; - ERRL_DBG("START"); - - do - { - errlHndl_t l_handle = NULL; - ERRL_DBG("--------------------------------\n"); - - /****************************************************/ - // Check max callouts - 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] = { - ERRL_CALLOUT_PRIORITY_HIGH, - ERRL_CALLOUT_PRIORITY_MED, - ERRL_CALLOUT_PRIORITY_LOW, - ERRL_CALLOUT_PRIORITY_HIGH, - ERRL_CALLOUT_PRIORITY_MED, - ERRL_CALLOUT_PRIORITY_MED, - ERRL_CALLOUT_PRIORITY_LOW, - ERRL_CALLOUT_PRIORITY_LOW, - }; - - ERRL_CALLOUT_TYPE l_type[8] = { - ERRL_CALLOUT_TYPE_HUID, - ERRL_CALLOUT_TYPE_COMPONENT_ID, - ERRL_CALLOUT_TYPE_HUID, - ERRL_CALLOUT_TYPE_COMPONENT_ID, - ERRL_CALLOUT_TYPE_HUID, - ERRL_CALLOUT_TYPE_COMPONENT_ID, - ERRL_CALLOUT_TYPE_HUID, - ERRL_CALLOUT_TYPE_COMPONENT_ID, - }; - - // add 6 (ERRL_MAX_CALLOUTS) callouts - uint8_t l_index = 0; - for(l_index = 0; l_index < ERRL_MAX_CALLOUTS; l_index++) - { - ERRL_DBG("current callouts %d attempting to add callout # %d with type %d ,priority %d", l_handle->iv_numCallouts, l_index, l_type[l_index], l_array[l_index] ); - addCalloutToErrl(l_handle,l_type[l_index],l_index,l_array[l_index]); - } - CHECK_CONDITION( l_handle->iv_numCallouts == ERRL_MAX_CALLOUTS, l_rc); - - // add one more callout and it should fail - addCalloutToErrl(l_handle,l_type[0],l_index,l_array[0]); - CHECK_CONDITION( l_handle->iv_numCallouts == ERRL_MAX_CALLOUTS, l_rc); - - dumpLog( l_handle, l_handle->iv_userDetails.iv_entrySize ); - deleteErrl( &l_handle ); - ppdumpslot(); - - /****************************************************/ - // 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); - 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); - - 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); - CHECK_CONDITION( l_handle != INVALID_ERR_HNDL, l_rc); - if(l_handle == INVALID_ERR_HNDL) - - // add one callout and it should fail - addCalloutToErrl(l_handle,l_type[0],l_index,l_array[0]); - CHECK_CONDITION( l_handle->iv_numCallouts == 0, l_rc); - - dumpLog( l_handle, l_handle->iv_userDetails.iv_entrySize ); - deleteErrl( &l_handle ); - ppdumpslot(); - - ERRL_DBG("END \n"); - }while(0); - - return l_rc; -} - -// Function Specification -// -// Name: errlTestSetErrlSevToInfo -// -// Description: errlTestSetErrlSevToInfo -// -// End Function Specification -uint32_t errlTestSetErrlSevToInfo() -{ - uint32_t l_rc = 0; - ERRL_DBG("START"); - - do - { - errlHndl_t l_handle = NULL; - - /****************************************************/ - // 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); - CHECK_CONDITION( l_handle != INVALID_ERR_HNDL, l_rc); - - // Add callout - 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 - // iv_severity should be set to ERRL_SEV_INFORMATIONAL - setErrlSevToInfo(l_handle); - CHECK_CONDITION( (l_handle->iv_numCallouts == 0) && - (l_handle->iv_severity == ERRL_SEV_INFORMATIONAL), l_rc); - - deleteErrl( &l_handle ); - ppdumpslot(); - - /****************************************************/ - // 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); - 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); - 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) && - (l_log->iv_severity == ERRL_SEV_PREDICTIVE), l_rc); - - deleteErrl(&l_log); - ERRL_DBG("END \n"); - - }while(0); - - return l_rc; -} - -// Function Specification -// -// Name: errlTestWordAlign -// -// Description: errlTestWordAlign -// -// End Function Specification -uint32_t errlTestWordAlign() -{ - uint32_t l_rc = 0; - uint16_t l_entrySizeBefore = 0; - uint16_t l_entrySizeAfter = 0; - ERRL_DBG("START"); - - do - { - /****************************************************/ - // 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); - 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 - errlHndl_t l_handleX = l_handle; - ppdumpslot(); - - // add 13 bytes of "user details" - l_entrySizeBefore = l_handle->iv_userDetails.iv_entrySize; - memset( G_data, 0xAA, sizeof( G_data ) ); - addUsrDtlsToErrl( l_handle, G_data, 13, ERRL_USR_DTL_STRUCT_VERSION_1, ERRL_USR_DTL_TRACE_DATA ); - l_entrySizeAfter = l_handle->iv_userDetails.iv_entrySize; - ERRL_DBG("Slots after create + 13 bytes" ); - ppdumpslot(); - // (header + WORDALIGN(13)) is the size that add to entry - CHECK_CONDITION( l_entrySizeAfter == (l_entrySizeBefore+sizeof(ErrlUserDetailsEntry_t)+16), l_rc); - - /****************************************************/ - // Test word align for addTraceToErrl - // add 21 bytes of trace - l_entrySizeBefore = l_handle->iv_userDetails.iv_entrySize; - addTraceToErrl(g_trac_inf, 21, l_handle); // @at012c - l_entrySizeAfter = l_handle->iv_userDetails.iv_entrySize; - 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); - - commitErrl( &l_handle ); - deleteErrl(&l_handleX); - ERRL_DBG("Slots should now be empty"); - ppdumpslot(); - ERRL_DBG("END \n"); - }while(0); - - return l_rc; -} - - -// Function Specification -// -// Name: dumpLog -// -// Description: dumpLog -// -// End Function Specification -void dumpLog( errlHndl_t i_log, uint32_t i_len ) -{ - uint32_t l_written = 0; - uint32_t l_counter = 0; - uint8_t * l_data = (uint8_t*) i_log; - - printf("----------%p---------- \n", i_log ); - - if ( i_log == NULL ) - return; - - while ( l_counter < i_len) - { - printf("| %08X ", (uint32_t) l_data + l_counter); - - // Display 16 bytes in Hex with 2 spaces in between - l_written = 0; - uint8_t i = 0; - for ( i = 0; i < 16 && l_counter < i_len; i++ ) - { - l_written += printf("%02X",l_data[l_counter++]); - - if ( ! ( l_counter % 4 ) ) - { - l_written += printf(" "); - } - } - - // Pad with spaces - uint8_t l_space[64] = {0}; - memset( l_space, 0x00, sizeof( l_space )); - memset( l_space, ' ', 43-l_written); - printf("%s", l_space ); - - // Display ASCII - l_written = 0; - uint8_t l_char = 0; - for ( ; i > 0 ; i-- ) - { - l_char = l_data[ l_counter-i ]; - - if ( isprint( l_char ) && - ( l_char != '&' ) && - ( l_char != '<' ) && - ( l_char != '>' ) - ) - { - l_written += printf("%c",l_char ); - } - else - { - l_written += printf("." ); - } - } - - // Pad with spaces - uint8_t l_space2[64] = {0}; - memset( l_space2, 0x00, sizeof( l_space2 )); - memset( l_space2, ' ', 19-l_written); - printf("%s\n", l_space2 ); - } - printf("----------%p---------- \n", i_log ); - -} - -// Function Specification -// -// Name: ppdumpslot -// -// Description: ppdumpslot -// -// End Function Specification -void ppdumpslot(void) -{ - errlHndl_t l_array[ERRL_MAX_SLOTS] = { - (errlHndl_t)G_errslot1, - (errlHndl_t)G_errslot2, - (errlHndl_t)G_errslot3, - (errlHndl_t)G_errslot4, - (errlHndl_t)G_errslot5, - (errlHndl_t)G_errslot6, - (errlHndl_t)G_errslot7, - (errlHndl_t)G_infoslot, - (errlHndl_t)G_callslot, - }; - - - printf("-------- \n"); - - uint8_t l_index = 0; - for(l_index = 0; l_index < ERRL_MAX_SLOTS; l_index++) - { - if(l_array[l_index]->iv_version != 0) - { - printf("slot[%01d] sz[%04d] id[%03d] @[%p] \n",l_index,l_array[l_index]->iv_userDetails.iv_entrySize, l_array[l_index]->iv_entryId, l_array[l_index]); - } - else - { - printf("slot[%01d] [0] \n",l_index); - } - } - printf("-------- \n"); -} - -/*****************************************************************************/ -// Image Header -/*****************************************************************************/ -IMAGE_HEADER (G_errlTestMain,errlTestMain,ERRLTESTMAIN_ID,OCC_APLT_TEST); - diff --git a/src/occApplet/testApplet/linkTestApplet.cmd b/src/occApplet/testApplet/linkTestApplet.cmd deleted file mode 100755 index 8ab30f3..0000000 --- a/src/occApplet/testApplet/linkTestApplet.cmd +++ /dev/null @@ -1,82 +0,0 @@ -// 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 - -#define APP_IMAGE_SRAM_START_ADDR 0xFFFFC000 -#define WORD_ALIGN 4 -#define BYTE_ALIGN 1024 -#ifdef OCCMK -INCLUDE occLinkInputFile -#endif - -MEMORY -{ - AppMem : ORIGIN = APP_IMAGE_SRAM_START_ADDR, LENGTH = 0x3C00 -} - -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. - // It is needed for doing DMA copy of the applet. - // 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 - -} diff --git a/src/occApplet/testApplet/occLinkInputFile b/src/occApplet/testApplet/occLinkInputFile deleted file mode 100644 index 1fe4523..0000000 --- a/src/occApplet/testApplet/occLinkInputFile +++ /dev/null @@ -1,26 +0,0 @@ -# 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 deleted file mode 100755 index b46194d..0000000 --- a/src/occApplet/testApplet/pstApplet.c +++ /dev/null @@ -1,129 +0,0 @@ -/* 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 */ -/* [+] 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 */ - -//************************************************************************* -// Includes -//************************************************************************* -#include <common_types.h> // imageHdr_t declaration and image header macro -#include <errl.h> // For error handle -#include "ssx_io.h" // For printfs -#include <trac.h> // For traces -#include <appletId.h> // For applet ID -#include "ssx.h" -#include "pgp_common.h" -#include "pstates.h" -#include "gpsm.h" - -//************************************************************************* -// Externs -//************************************************************************* - -//************************************************************************* -// Macros -//************************************************************************* - -//************************************************************************* -// Defines/Enums -//************************************************************************* -#define MYENTRYPOINT_ID "pstApplet\0" - -//************************************************************************* -// Structures -//************************************************************************* - -//************************************************************************* -// Globals -//************************************************************************* - -//************************************************************************* -// Function Prototypes -//************************************************************************* - -//************************************************************************* -// Functions -//************************************************************************* - -//************************************************************************* -// Entry point function -//************************************************************************* -errlHndl_t myEntryPoint(void * i_arg) -{ - - TRAC_INFO("Enter"); - //initialize variables - errlHndl_t l_err = NULL; - int rc=0; - GlobalPstateTable * l_gpst_ptr = NULL; - l_gpst_ptr = gpsm_gpst(); - unsigned int deconfigured_cores = in32(PMC_CORE_DECONFIGURATION_REG); - pcbs_power_management_control_reg_t pmcr; - pmcr.value=0; - unsigned char trace_count[PGP_NCORES] = {0}; - - - //get minimum and maximum p states - Pstate min_ps = gpst_pmin(l_gpst_ptr); - 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) { - if(trace_count[core] < 5) - { - trace_count[core]++; - TRAC_ERR("pstApplet: putscom failed on core %d with rc = 0x%08x, deconfig_cores = 0x%08x, iteration = %d", - core, rc, deconfigured_cores, iterations); - } - if(rc == 7) - { - continue; - } - break; - } - //Wait 500us before changing the pstate - ssx_sleep(SSX_MICROSECONDS(500)); - - } - } - } - TRAC_INFO("Exit"); - return l_err; -} - -//************************************************************************* -// Image Header -//************************************************************************* -IMAGE_HEADER (G_myEntryPoint,myEntryPoint,MYENTRYPOINT_ID,OCC_APLT_TEST); diff --git a/src/occApplet/testApplet/sensorTest.c b/src/occApplet/testApplet/sensorTest.c deleted file mode 100755 index 531174b..0000000 --- a/src/occApplet/testApplet/sensorTest.c +++ /dev/null @@ -1,1145 +0,0 @@ -/* 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 */ -/* [+] 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 */ - -#define SNSR_DEBUG -//************************************************************************* -// Includes -//************************************************************************* -#include <common_types.h> // imageHdr_t declaration and image header macro -#include <errl.h> // For error handle -#include "ssx_io.h" // For printfs -#include <sensor.h> // Sensor interfaces -#include <occ_service_codes.h> // Reason code -#include <errl.h> // For errlHndl_t -#include <trac.h> // For traces -#include <appletManager.h> -#include <sensorQueryList.h> -#include <appletId.h> // For applet ID -#include <aplt_service_codes.h> // For test applet module ID -#include <testApltId.h> // For test applet ID - -//************************************************************************* -// Externs -//************************************************************************* - -//************************************************************************* -// Macros -//************************************************************************* - -//************************************************************************* -// Defines/Enums -//************************************************************************* -#define SENSORTESTMAIN_ID "Sensor Test\0" -#define UINT16_MIN 0 - -//sensor test module ID enumeration -typedef enum -{ - TEST_NULL_POINTER = 0x00, - TEST_GET_SENSOR_BY_GSID = 0x01, - TEST_COMMON = 0x02, - TEST_QUERY_LIST = 0x03, - -} sensorTestModId; - -// sensor test return codes -typedef enum -{ - SUCCESS_RC = 0x00000000, - GET_SNSR_FAILURE = 0x00000001, - SNSR_RESET_FAILURE = 0x00000002, - SNSR_UPDT_FAILURE = 0x00000003, - SNSR_UPDT_FAILURE2 = 0x00000004, - SNSR_UPDT_FAILURE3 = 0x00000005, - SNSR_UPDT_FAILURE4 = 0x00000006, - SNSR_UPDT_FAILURE5 = 0x00000007, - SNSR_RESET_FAILURE2 = 0x00000008, - RESET_WITH_VECTORIZE_FAILURE= 0x00000009, - VECTORIZE_FAILURE = 0x0000000A, - VECTORIZE_FAILURE2 = 0x0000000B, - VECTORIZE_FAILURE3 = 0x0000000C, - VECTOR_ADD_FAILURE = 0x0000000D, - VECTOR_ADD_FAILURE2 = 0x0000000E, - VECTOR_ADD_FAILURE3 = 0x0000000F, - VECTOR_UPDT_FAILURE = 0x00000010, - VECTOR_UPDT_FAILURE2 = 0x00000011, - VECTOR_UPDT_FAILURE3 = 0x00000012, - VECTOR_UPDT_FAILURE4 = 0x00000013, - VECTOR_UPDT_FAILURE5 = 0x00000014, - VECTOR_UPDT_FAILURE6 = 0x00000015, - VECTOR_UPDT_FAILURE7 = 0x00000016, - VECTOR_UPDT_FAILURE8 = 0x00000017, - VECTOR_UPDT_FAILURE9 = 0x00000018, - VECTOR_UPDT_FAILURE10 = 0x00000019, - VECTOR_ADD_FAILURE4 = 0x0000001A, - QUERY_LIST_FAILURE = 0x0000001B, - QUERY_LIST_FAILURE2 = 0x0000001C, - QUERY_LIST_FAILURE3 = 0x0000001D, - QUERY_LIST_FAILURE4 = 0x0000001E, - QUERY_LIST_FAILURE5 = 0x0000001F, - QUERY_LIST_FAILURE6 = 0x00000020, - QUERY_LIST_FAILURE7 = 0x00000021, - QUERY_LIST_FAILURE8 = 0x00000022, - QUERY_LIST_FAILURE9 = 0x00000023, - QUERY_LIST_FAILURE10 = 0x00000024, - QUERY_LIST_FAILURE11 = 0x00000025, - QUERY_LIST_FAILURE12 = 0x00000026, - QUERY_LIST_FAILURE13 = 0x00000027, - QUERY_LIST_FAILURE14 = 0x00000028, - GET_SNSR_FAILURE1 = 0x00000029, - GET_SNSR_FAILURE2 = 0x0000002A, -} sensorTestRc; - -//************************************************************************* -// Structures -//************************************************************************* - -//************************************************************************* -// Globals -//************************************************************************* -// Stack size for test applet thread is only 4000 bytes, -// put big structure here to prevent stack overflow - -// 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]; -#endif - -//************************************************************************* -// Function Prototypes -//************************************************************************* -uint32_t sensorTestNullPointer(); -uint32_t sensorTestGetSensorByGsid(); -uint32_t sensorTestCommon(); -void printSensor(sensor_t i_snsr); -uint32_t sensorTestQueryList(); - -//************************************************************************* -// Functions -//************************************************************************* - -// Function Specification -// -// Name: sensorTestMain -// -// Description: Entry point function -// -// End Function Specification -errlHndl_t sensorTestMain(void * i_arg) -{ - SNSR_DBG("Enter sensorTestMain\n"); - errlHndl_t l_err = NULL; - - uint32_t l_rc = SUCCESS_RC; - uint8_t l_modId = 0; - - do - { - l_rc = sensorTestNullPointer(); - if( l_rc != SUCCESS_RC) - { - l_modId = TEST_NULL_POINTER; - TRAC_INFO("Failure on null pointer test"); - break; - } - - l_rc = sensorTestGetSensorByGsid(); - if( l_rc != SUCCESS_RC) - { - l_modId = TEST_GET_SENSOR_BY_GSID; - TRAC_INFO("Failure on get sensor by Gsid test"); - break; - } - - l_rc = sensorTestCommon(); - if( l_rc != SUCCESS_RC) - { - l_modId = TEST_COMMON; - TRAC_INFO("Failure on common test"); - break; - } -// If'd out b/c the sensor list is too big for an applet -#if 0 - l_rc = sensorTestQueryList(); - if( l_rc != SUCCESS_RC) - { - l_modId = TEST_QUERY_LIST; - TRAC_INFO("Failure on query list test"); - break; - } -#endif - } while (0); - - if( l_rc != SUCCESS_RC) - { - SNSR_DBG("**********************************************\n"); - SNSR_DBG("* Sensor Test Failed: ModId: 0x%x,l_rc: 0x%x\n",l_modId,l_rc); - SNSR_DBG("**********************************************\n"); - /* @ - * @errortype - * @moduleid TEST_APLT_MODID_SENSORTEST - * @reasoncode INTERNAL_FAILURE - * @userdata1 Test Applet ID - * @userdata2 Return Code - * @userdata4 OCC_NO_EXTENDED_RC - * @devdesc Failure executing test applet - */ - l_err = createErrl(TEST_APLT_MODID_SENSORTEST, - INTERNAL_FAILURE, // @nh001c - OCC_NO_EXTENDED_RC, - ERRL_SEV_INFORMATIONAL, - NULL, - 0, - SNSR_TEST_APLT, - l_rc); - } - else - { - SNSR_DBG("**********************************************\n"); - SNSR_DBG("* Sensor Test Passed\n"); - SNSR_DBG("**********************************************\n"); - } - - - SNSR_DBG("Exit sensorTestMain\n"); - - return l_err; -} - - -// Function Specification -// -// Name: sensorTestNullPointer -// -// Description: SensorTestNullPointers -// -// End Function Specification -uint32_t sensorTestNullPointer() -{ - uint32_t l_rc = SUCCESS_RC; - /****************************************************/ - // Try to clear minmax with NULL sensor pointer. Call will be no-op - sensor_clear_minmax(NULL); - - /****************************************************/ - // Try to reset sensor with NULL sensor pointer. Call will be no-op - sensor_reset(NULL); - - /****************************************************/ - // Try to vectorize with NULL sensor pointer and valid vector sensor. - // Call will be no-op - vectorSensor_t l_vecsnsr; - sensor_vectorize(NULL,&l_vecsnsr,0); - - /****************************************************/ - // Try to vectorize with NULL vector sensor pointer and valid sensor pointer - // Call will be no-op - sensor_t l_snsr; - sensor_vectorize(&l_snsr,NULL,0); - - /****************************************************/ - // Try to update sensor with NULL sensor pointer. Call will be no-op - sensor_update(NULL,1); - - /****************************************************/ - // Try to do vector update with NULL sensor pointer. Call will be no-op - sensor_vector_update(NULL,1); - - /****************************************************/ - // Try to enable vector sensor with NULL pointer. Call will be no-op - sensor_vector_elem_enable(NULL,1,1); - - /****************************************************/ - // Try to add vector element with NULL vector sensor pointer. - // Call will be no-op - sensor_t l_sensor; - sensor_vector_elem_add(NULL,1,&l_sensor); - - /****************************************************/ - // Try to add vector element with NULL element pointer. - // Call will be no-op - vectorSensor_t l_vecSensor; - sensor_vector_elem_add(&l_vecSensor,1,NULL); - - return l_rc; -} - - -// Function Specification -// -// Name: sensorTestGetSensorByGsid -// -// Description: SensorTestGetSensorByGsid -// -// End Function Specification -uint32_t sensorTestGetSensorByGsid() -{ - uint32_t l_rc = SUCCESS_RC; - - do - { - /****************************************************/ - // Try to get sensor with invalid GSID. It should return NULL - sensor_t * l_sensor = NULL; - l_sensor = getSensorByGsid(0xFFFF); - - if( l_sensor != NULL) - { - l_rc = GET_SNSR_FAILURE; - break; - } - - // Good path for this function is already tested with other test cases. - - }while(0); - - return l_rc; -} - - -// Function Specification -// -// Name: printSensor -// -// Description: printSensor -// -// End Function Specification -void printSensor(sensor_t i_snsr) -{ - SNSR_DBG("Printing sensor information\n"); - SNSR_DBG("*******************************\n"); - SNSR_DBG("GSID: 0x%x\n",i_snsr.gsid); - SNSR_DBG("sample: 0x%x\n",i_snsr.sample); - SNSR_DBG("sample_min: 0x%x\n",i_snsr.sample_min); - SNSR_DBG("sample_max: 0x%x\n",i_snsr.sample_max); - SNSR_DBG("status.reset: 0x%x\n",i_snsr.status.reset); - SNSR_DBG("accumulator: 0x%016llx\n",i_snsr.accumulator); - SNSR_DBG("update_tag: 0x%x\n",i_snsr.update_tag); - SNSR_DBG("src_accum_snapshot: 0x%x\n",i_snsr.src_accum_snapshot); - SNSR_DBG("ipmi sensor id: 0x%x\n",i_snsr.ipmi_sid); //@fk009c - SNSR_DBG("vector sensor:\n"); - if( i_snsr.vector != NULL) - { - SNSR_DBG("\toperation: 0x%x\n",i_snsr.vector->operation); - SNSR_DBG("\tsize: 0x%x\n",i_snsr.vector->size); - SNSR_DBG("\tmin_pos: 0x%x\n",i_snsr.vector->min_pos); - SNSR_DBG("\tmax_pos: 0x%x\n",i_snsr.vector->max_pos); - uint16_t i = 0; - for(; i < i_snsr.vector->size; i++) - { - SNSR_DBG("\t[%d].sample:0x%x\n",i, - i_snsr.vector->source_ptr[i]->sample); - } // end for loop - } - SNSR_DBG("mini sensor:\n"); - if( i_snsr.mini_sensor != NULL) - { - SNSR_DBG("\tmini sensor sample: 0x%x\n",*(i_snsr.mini_sensor)); - } - SNSR_DBG("*******************************\n"); - -} - - -// Function Specification -// -// Name: sensorTestCommon -// -// Description: sensorTestCommon -// -// End Function Specification -uint32_t sensorTestCommon() -{ - uint32_t l_rc = SUCCESS_RC; - /****************************************************/ - // Use test sensors to avoid the conflict with other components - // PROBE250US0, // Internal Sensor for debug via AMESTER - // PROBE250US1, // Internal Sensor for debug via AMESTER - // PROBE250US2, // Internal Sensor for debug via AMESTER - // PROBE250US3, // Internal Sensor for debug via AMESTER - // PROBE250US4, // Internal Sensor for debug via AMESTER - // PROBE250US5, // Internal Sensor for debug via AMESTER - // PROBE250US6, // Internal Sensor for debug via AMESTER - // PROBE250US7, // Internal Sensor for debug via AMESTER - - sensor_t *l_sensor=getSensorByGsid(PROBE250US0); - sensor_t *l_sensor1=getSensorByGsid(PROBE250US1); - sensor_t *l_sensor2=getSensorByGsid(PROBE250US4); - sensor_t *l_sensor3=getSensorByGsid(PROBE250US7); - do - { - // make sure getSensorByGsid did not return NULL pointer. - if( (l_sensor == NULL) || - (l_sensor1 == NULL) || - (l_sensor2 == NULL) || - (l_sensor3 == NULL)) - { - l_rc = GET_SNSR_FAILURE2; - break; - } - - //Check sensor gsid - if((l_sensor->gsid!=PROBE250US0) || - (l_sensor1->gsid!=PROBE250US1) || - (l_sensor2->gsid!=PROBE250US4) || - (l_sensor3->gsid!=PROBE250US7) ) - { - l_rc = GET_SNSR_FAILURE1; - break; - } - - // Reset sensors before any other test so that we don't - // end up using old data if exists. - sensor_reset(l_sensor); - sensor_reset(l_sensor1); - sensor_reset(l_sensor2); - sensor_reset(l_sensor3); - - /****************************************************/ - uint16_t l_miniSnsr = 0; - // Set minisnsr to test minisnr reset and update - l_sensor2->mini_sensor = &l_miniSnsr; - // test update sensors. - sensor_update(l_sensor,10); - sensor_update(l_sensor1,11); - sensor_update(l_sensor2,12); - - if( (l_sensor->sample != 10) || - (l_sensor->mini_sensor != NULL) || - (l_sensor->sample_max!=10) || - (l_sensor->sample_min!=10) || - (l_sensor1->sample != 11) || - (l_sensor1->mini_sensor != NULL) || - (l_sensor1->sample_max!=11) || - (l_sensor1->sample_min!=11) || - (l_sensor2->sample != 12) || - (l_sensor2->mini_sensor == NULL) || - (l_sensor2->sample_max!=12) || - (l_sensor2->sample_min!=12) || - (*(l_sensor2->mini_sensor) != 12) || - (l_miniSnsr != 12) - ) - { - l_rc = SNSR_UPDT_FAILURE; - break; - } - - /****************************************************/ - // test reset sensors without vectorize - sensor_reset(l_sensor2); - if( (l_sensor2->sample != 0) || - (l_sensor2->status.reset != 0) || - (l_sensor2->sample_min != UINT16_MAX) || - (l_sensor2->sample_max != UINT16_MIN) || - (*(l_sensor2->mini_sensor) != 0) || - (l_miniSnsr != 0)) - { - l_rc = SNSR_RESET_FAILURE; - break; - } - /****************************************************/ - // test update of sensor with reset status bit set - l_sensor2->status.reset = 1; - sensor_update(l_sensor2,12); - - if( (l_sensor2->sample != 12) || - (l_sensor2->status.reset != 0) || - (l_sensor2->sample_min != 12) || - (l_sensor2->sample_max != 12) ) - { - l_rc = SNSR_RESET_FAILURE2; - break; - } - - /****************************************************/ - // vectorize with reset status bit set - l_sensor->status.reset = 1; - vectorSensor_t l_vecSnsr; - - sensor_vectorize(l_sensor,&l_vecSnsr, VECTOR_OP_MIN); - - if(l_sensor->vector==NULL) - { - l_rc = VECTORIZE_FAILURE2; - break; - } - else - { - if(l_vecSnsr.operation!=VECTOR_OP_MIN) - { - l_rc = VECTORIZE_FAILURE3; - break; - } - } - - /****************************************************/ - // test getSensorByGsid with valid GSID - sensor_t * l_tempSensor = getSensorByGsid(PROBE250US0); - - if((l_tempSensor == NULL) || - (l_tempSensor->gsid!=PROBE250US0)) - { - l_rc = GET_SNSR_FAILURE; - break; - } - else - { - if( l_tempSensor->vector->operation != VECTOR_OP_MIN) - { - l_rc = VECTORIZE_FAILURE; - break; - } - } - /****************************************************/ - // test reset sensor with vectorize - sensor_reset(l_sensor); - if((l_sensor->vector->max_pos != VECTOR_SENSOR_DEFAULT_VAL) || - (l_vecSnsr.max_pos != VECTOR_SENSOR_DEFAULT_VAL) || - (l_sensor->vector->min_pos != VECTOR_SENSOR_DEFAULT_VAL) || - (l_vecSnsr.min_pos != VECTOR_SENSOR_DEFAULT_VAL) || - (l_sensor->sample_min != UINT16_MAX) || - (l_sensor->sample_max != UINT16_MIN) ) - { - l_rc = RESET_WITH_VECTORIZE_FAILURE; - break; - } - - /****************************************************/ - // test update of sensor with different min and max values - sensor_update(l_sensor,10); - - sensor_update(l_sensor3,5); - if( (l_sensor3->sample != 5) || - (l_sensor3->mini_sensor != NULL) || - (l_sensor3->sample_max!=5) || - (l_sensor3->sample_min!=5) - ) - { - l_rc = SNSR_UPDT_FAILURE2; - break; - } - sensor_update(l_sensor3,2); - if( (l_sensor3->sample != 2) || - (l_sensor3->mini_sensor != NULL) || - (l_sensor3->sample_max!=5) || - (l_sensor3->sample_min!=2) - ) - { - l_rc = SNSR_UPDT_FAILURE3; - break; - } - sensor_update(l_sensor3,8); - if( (l_sensor3->sample != 8) || - (l_sensor3->mini_sensor != NULL) || - (l_sensor3->sample_max!=8) || - (l_sensor3->sample_min!=2) - ) - { - l_rc = SNSR_UPDT_FAILURE4; - break; - } - sensor_update(l_sensor3,5); - if( (l_sensor3->sample != 5) || - (l_sensor3->mini_sensor != NULL) || - (l_sensor3->sample_max!=8) || - (l_sensor3->sample_min!=2) - ) - { - l_rc = SNSR_UPDT_FAILURE5; - break; - } - - /****************************************************/ - // test adding vector element with invalid location - sensor_vector_elem_add(l_sensor->vector,0xFF,l_sensor3); - - if( (l_sensor->vector->size != 0) || - (l_vecSnsr.size != 0)) - { - l_rc = VECTOR_ADD_FAILURE; - break; - } - - /****************************************************/ - // test adding vector element with valid location - sensor_vector_elem_add(l_sensor->vector,0,l_sensor2); - - if( (l_sensor->vector->size != 1) || - (l_vecSnsr.size != 1)) - { - l_rc = VECTOR_ADD_FAILURE4; - break; - } - - /****************************************************/ - // test adding vector element with non-contiguous location. - // It should not add element to the vector - sensor_vector_elem_add(l_sensor->vector,2,l_sensor1); - - if((l_sensor->vector->size != 1) || - (l_vecSnsr.size != 1)) - { - l_rc = VECTOR_ADD_FAILURE2; - break; - } - - /****************************************************/ - // test adding vector element with contiguous location - sensor_vector_elem_add(l_sensor->vector,1,l_sensor1); - sensor_vector_elem_add(l_sensor->vector,0,l_sensor3); - - if((l_sensor->vector->size != 2) || - (l_vecSnsr.size != 2)) - { - l_rc = VECTOR_ADD_FAILURE3; - break; - } - sensor_vector_elem_add(l_sensor->vector,2,l_sensor2); - - //so far the source sensors of vector sensor are: - // l_sensor3=5 - // l_sensor1=11 - // l_sensor2=12 - - /****************************************************/ - // test disabling vector element with valid location - sensor_vector_elem_enable(l_sensor->vector,0,0); - - /****************************************************/ - // test updating vector element with min operation and - // element disabled - - uint64_t l_tempacc=l_sensor->accumulator; - sensor_vector_update(l_sensor,0); - if( (l_sensor->sample != 11) || (l_sensor->sample_min != 10 ) || - (l_sensor->sample_max != 11 ) || - (l_sensor->accumulator != l_tempacc+11)|| - (l_sensor->vector->min_pos != 1 )) - { - l_rc = VECTOR_UPDT_FAILURE; - break; - } - - /****************************************************/ - // test enabling vector element with min - - l_tempacc=l_sensor->accumulator; - sensor_vector_elem_enable(l_sensor->vector,0,1); - sensor_vector_update(l_sensor,0); - - if( (l_sensor->sample != 5) || (l_sensor->sample_min != 5 ) || - (l_sensor->sample_max != 11 ) || - (l_sensor->accumulator != l_tempacc+5)|| - (l_sensor->vector->min_pos != 0 )) - { - l_rc = VECTOR_UPDT_FAILURE9; - break; - } - - /****************************************************/ - // test updating vector element with max operation - vectorSensor_t l_vecSnsr3; - sensor_vectorize(l_sensor3,&l_vecSnsr3,VECTOR_OP_MAX); - - sensor_vector_elem_add(l_sensor3->vector,0,l_sensor1); - sensor_vector_elem_add(l_sensor3->vector,1,l_sensor2); - sensor_vector_elem_add(l_sensor3->vector,2,l_sensor); - - - //so far the source sensors of vector sensor are: - // l_sensor1=11 - // l_sensor2=12 - // l_sensor=5 - /****************************************************/ - // test enabling vector element with invalid location - sensor_vector_elem_enable(l_sensor3->vector,0xFF,0); - sensor_vector_elem_enable(l_sensor3->vector,2,0); - - /****************************************************/ - // test updating vector element with max operation and - // disabled element - l_tempacc=l_sensor3->accumulator; - sensor_vector_update(l_sensor3,0); - - if( (l_sensor3->sample != 12) || (l_sensor3->sample_min != 2 ) || - (l_sensor3->sample_max != 12 ) || - (l_sensor3->accumulator != l_tempacc+12)|| - (l_sensor3->vector->max_pos != 1)) - { - l_rc = VECTOR_UPDT_FAILURE2; - break; - } - - l_tempacc=l_sensor3->accumulator; - sensor_vector_elem_enable(l_sensor3->vector,2,1); - sensor_vector_update(l_sensor3,0); - - if( (l_sensor3->sample != 12) || (l_sensor3->sample_min != 2 ) || - (l_sensor3->sample_max != 12 ) || - (l_sensor3->accumulator != l_tempacc+12)|| - (l_sensor3->vector->max_pos != 1)) - { - l_rc = VECTOR_UPDT_FAILURE10; - break; - } - - vectorSensor_t l_vecSnsr1; - /****************************************************/ - // test updating vector element with average operation - sensor_vectorize(l_sensor1,&l_vecSnsr1,VECTOR_OP_AVG); - sensor_vector_elem_add(l_sensor1->vector,0,l_sensor2); - sensor_vector_elem_add(l_sensor1->vector,1,l_sensor); - /****************************************************/ - - //so far the source sensors of vector sensor are: - // l_sensor2=12 - // l_sensor=5 - - // test updating vector element with status reset bit set and - // average op - l_sensor1->status.reset = 1; - sensor_vector_update(l_sensor1,11); - if( (l_sensor1->sample != 12) || (l_sensor1->sample_min != 12 ) || - (l_sensor1->sample_max != 12 ) || (l_sensor1->accumulator != 12)|| - (l_sensor1->vector->max_pos != VECTOR_SENSOR_DEFAULT_VAL) || - (l_sensor1->vector->min_pos != VECTOR_SENSOR_DEFAULT_VAL)) - { - l_rc = VECTOR_UPDT_FAILURE3; - break; - } - - /****************************************************/ - // test updating vector element with average operation and - // disabled element - l_tempacc=l_sensor1->accumulator; - sensor_vector_elem_enable(l_sensor1->vector,0,0); - sensor_vector_update(l_sensor1,2); - - if( (l_sensor1->sample != 5) || (l_sensor1->sample_min != 5 ) || - (l_sensor1->sample_max != 12 ) || - (l_sensor1->accumulator != l_tempacc+5)) - { - l_rc = VECTOR_UPDT_FAILURE7; - break; - } - - sensor_vector_elem_enable(l_sensor1->vector,0,1); - /****************************************************/ - // test updating vector element with average operation and - // threshold greater than samples - l_tempacc=l_sensor1->accumulator; - sensor_vector_update(l_sensor1,25); - - if( (l_sensor1->sample != 5) || (l_sensor1->sample_min != 5 ) || - (l_sensor1->sample_max != 12 ) || - (l_sensor1->accumulator != l_tempacc) ) - { - l_rc = VECTOR_UPDT_FAILURE4; - break; - } - - /****************************************************/ - // test updating vector element with average operation and - // threshold lower than samples - l_tempacc=l_sensor1->accumulator; - sensor_vector_update(l_sensor1,2); - if( (l_sensor1->sample != 8) || (l_sensor1->sample_min != 5 ) || - (l_sensor1->sample_max != 12 ) || - (l_sensor1->accumulator != l_tempacc+8)) - { - l_rc = VECTOR_UPDT_FAILURE8; - break; - } - - l_sensor2->status.reset = 0; - /****************************************************/ - // test update without vectorize should not do anything. Call should be - // noop - sensor_vector_update(l_sensor2,0); - - if( (l_sensor2->sample != 12)) - { - l_rc = VECTOR_UPDT_FAILURE5; - break; - } - - vectorSensor_t l_vecSnsr2; - /****************************************************/ - // test updating vector and vectorize with invalid operation - // should not update anything - sensor_vectorize(l_sensor2,&l_vecSnsr2,0xFF); - - sensor_vector_elem_add(l_sensor2->vector,0,l_sensor); - sensor_vector_elem_add(l_sensor2->vector,1,l_sensor3); - //so far the source sensors of vector sensor are: - // l_sensor=5 - // l_sensor3=12 - sensor_vector_update(l_sensor2,0); - - if( (l_sensor2->sample != 12)) - { - l_rc = VECTOR_UPDT_FAILURE6; - break; - } - - }while(0); - - if( (l_sensor != NULL) && - (l_sensor1 != NULL) && - (l_sensor2 != NULL) && - (l_sensor3 != NULL)) - { - l_sensor->vector = NULL; - l_sensor1->vector = NULL; - l_sensor2->vector = NULL; - l_sensor3->vector = NULL; - l_sensor->mini_sensor = NULL; - l_sensor1->mini_sensor = NULL; - l_sensor2->mini_sensor = NULL; - l_sensor3->mini_sensor = NULL; - } - - return l_rc; -} - - -// Function Specification -// -// Name: callQuerySensorList -// -// Description: querySensorList: Will call the SenosrQeryList product applet -// -// End Function Specification -errlHndl_t callQuerySensorList(const uint16_t i_startGsid, - const uint8_t i_present, - const uint16_t i_type, - const uint16_t i_loc, - uint16_t * io_numOfSensors, - sensorQueryList_t * o_sensors, - sensor_info_t * o_sensorInfoPtrs - ) -{ - OCC_APLT_STATUS_CODES l_status = OCC_APLT_SUCCESS; - errlHndl_t l_errl = NULL; - - querySensorListAppletArg_t l_querySensorListAppletArg={ - i_startGsid, - i_present, - i_type, - i_loc, - io_numOfSensors, - o_sensors, - o_sensorInfoPtrs - }; - - - //Call sensor query list applet - runApplet(OCC_APLT_SNSR_QUERY, // Applet enum Name - &l_querySensorListAppletArg, // Applet arguments - TRUE, // Blocking call? - NULL, // Applet finished semaphore - &l_errl, // Error log handle - &l_status); // Error status - - return l_errl; - -} - - -// Function Specification -// -// Name: printQuerySensor -// -// Description: printQuerySensor -// -// 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 && - ( (i_sensors!=NULL) || - (i_sensorInfos!=NULL) ) ) - { - // Print sensorQueryList_t - if( i_sensors != NULL ) - { - SNSR_DBG("Printing sensorQueryList_t information"); - SNSR_DBG("*******************************"); - - for(i=0;i<i_count;i++) - { - SNSR_DBG("ID:0x%4x Value:%4d Name:%s",i_sensors[i].gsid, - i_sensors[i].sample, i_sensors[i].name); - } - SNSR_DBG("*******************************\n"); - } - - // Print sensor_info_t - if ( i_sensorInfos != NULL ) - { - SNSR_DBG("Printing sensor_info_t information"); - SNSR_DBG("*******************************"); - - for(i=0;i<i_count;i++) - { - SNSR_DBG("Name:%s", i_sensorInfos[i].name); - SNSR_DBG("Frq:0x%4x", i_sensorInfos[i].sensor.freq); - SNSR_DBG("Location:0x%4x", i_sensorInfos[i].sensor.location); - SNSR_DBG("Number:0x%4x", i_sensorInfos[i].sensor.number); - SNSR_DBG("Scalefactor:0x%4x", i_sensorInfos[i].sensor.scalefactor); - SNSR_DBG("Type:0x%4x", i_sensorInfos[i].sensor.type); - SNSR_DBG("Unit:%s", i_sensorInfos[i].sensor.units); - } - SNSR_DBG("*******************************\n"); - } - } -} - - -// ifdef'd out b/c the sensor list is too big to test this in an applet -#if 0 - -// Function Specification -// -// Name: sensorTestQueryList -// -// Description: sensorTestQueryList -// -// End Function Specification -uint32_t sensorTestQueryList() -{ - uint32_t l_rc = SUCCESS_RC; - uint16_t l_count = NUMBER_OF_SENSORS_IN_LIST; - errlHndl_t l_err = NULL; - - do - { - uint16_t l_numOfSensors = 0; - 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); - - if( NULL == l_err) - { - l_rc = QUERY_LIST_FAILURE; - break; - } - else if( (l_err != INVALID_ERR_HNDL) && - (l_err->iv_reasonCode != INTERNAL_FAILURE)) - { - l_rc = QUERY_LIST_FAILURE12; - break; - - } - - deleteErrl(&l_err); - - /****************************************************/ - // 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); - - if( NULL == l_err) - { - l_rc = QUERY_LIST_FAILURE2; - break; - } - else if( (l_err != INVALID_ERR_HNDL) && - (l_err->iv_reasonCode != INTERNAL_FAILURE)) - { - l_rc = QUERY_LIST_FAILURE13; - break; - - } - - deleteErrl(&l_err); - - /****************************************************/ - // Test with NULL sensor list pointer. Must return error - l_err = callQuerySensorList(0,1,SENSOR_TYPE_ALL,SENSOR_LOC_ALL, - &l_numOfSensors,NULL, NULL); - - if( NULL == l_err) - { - l_rc = QUERY_LIST_FAILURE3; - break; - } - else if( (l_err != INVALID_ERR_HNDL) && - (l_err->iv_reasonCode != INTERNAL_FAILURE)) - { - l_rc = QUERY_LIST_FAILURE14; - break; - - } - - deleteErrl(&l_err); - - /****************************************************/ - // 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); - - if( (l_err != NULL) || (l_numOfSensors != 0)) - { - l_rc = QUERY_LIST_FAILURE4; - break; - } - - /****************************************************/ - // 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); - - - if( (l_err != NULL) || (l_numOfSensors > (l_count-1))) - { - l_rc = QUERY_LIST_FAILURE5; - break; - } - - /****************************************************/ - // Query last sensors. Must return no error. Trying to get - // more sensors but should return only once since start GSID - // is of last sensor - l_numOfSensors = 5; - sensor_t *l_sensor=getSensorByGsid(l_count-1); - sensor_update(l_sensor, 10); - - l_err = callQuerySensorList(l_count-1,1,SENSOR_TYPE_ALL, - SENSOR_LOC_ALL,&l_numOfSensors,G_snsrList, NULL); - - if( (l_err != NULL) || (l_numOfSensors != 1) || - (l_sensor->gsid!=l_count-1)) - { - l_rc = QUERY_LIST_FAILURE6; - - break; - } - - /****************************************************/ - // 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); - //printQuerySensor(l_numOfSensors,G_snsrList, NULL ); - if( (l_err != NULL) || (l_numOfSensors == 0)) - { - l_rc = QUERY_LIST_FAILURE7; - break; - } - - /****************************************************/ - // Query sensors that are present, type and location - // 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); - printQuerySensor(l_numOfSensors,G_snsrList, NULL ); - - if( (l_err != NULL) || (l_numOfSensors != 0)) - { - l_rc = QUERY_LIST_FAILURE8; - break; - } - - /****************************************************/ - // Query sensors that are present,type=AMEC_SENSOR_TYPE_GENERIC, - // loc=AMEC_SENSOR_LOC_OCC. Must return no error. - l_numOfSensors = 10; - l_err = callQuerySensorList(PROBE250US0,1,AMEC_SENSOR_TYPE_GENERIC, - AMEC_SENSOR_LOC_OCC, - &l_numOfSensors,G_snsrList, NULL); - - if( (l_err != NULL) || (l_numOfSensors == 0)) - { - l_rc = QUERY_LIST_FAILURE9; - break; - } - - /****************************************************/ - // Query sensors that are present,type=AMEC_SENSOR_TYPE_GENERIC and - // any location. Must return no error. - l_numOfSensors = 10; - l_err = callQuerySensorList(PROBE250US0,1,AMEC_SENSOR_TYPE_GENERIC, - SENSOR_LOC_ALL, - &l_numOfSensors,G_snsrList, NULL); - - if( (l_err != NULL) || (l_numOfSensors == 0)) - { - l_rc = QUERY_LIST_FAILURE10; - break; - } - - /****************************************************/ - // Query sensors that are present,any type and - // location=AMEC_SENSOR_LOC_OCC. Must return no error. - l_numOfSensors = 10; - l_err = callQuerySensorList(PROBE250US0,1,SENSOR_TYPE_ALL, - AMEC_SENSOR_LOC_OCC,&l_numOfSensors, - G_snsrList, NULL); - - if( (l_err != NULL) || (l_numOfSensors == 0)) - { - l_rc = QUERY_LIST_FAILURE11; - break; - } - - /****************************************************/ - // 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); - if( (l_err != NULL) || (l_numOfSensors == 0)) - { - l_rc = QUERY_LIST_FAILURE11; - break; - } - printQuerySensor(l_numOfSensors,NULL, &l_sensorInfo ); - - }while(0); - - if( l_err != NULL) - { - deleteErrl(&l_err); - } - - return l_rc; -} -#endif - - -/*****************************************************************************/ -// Image Header -/*****************************************************************************/ -// 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 deleted file mode 100755 index 728696b..0000000 --- a/src/occApplet/testApplet/testApltId.h +++ /dev/null @@ -1,67 +0,0 @@ -/* 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 */ -/* [+] 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 _TESTAPLTID_H_ -#define _TESTAPLTID_H_ - -//************************************************************************* -// Includes -//************************************************************************* - -//************************************************************************* -// Externs -//************************************************************************* - -//************************************************************************* -// Macros -//************************************************************************* - -//************************************************************************* -// Defines/Enums -//************************************************************************* -enum testApltIds -{ - TEST_APLT_ID_UNKNOWN = 0x00, - SNSR_TEST_APLT = 0x01, - ERRL_TEST_APLT = 0x02, -}; - -//************************************************************************* -// Structures -//************************************************************************* - -//************************************************************************* -// Globals -//************************************************************************* - -//************************************************************************* -// Function Prototypes -//************************************************************************* - -//************************************************************************* -// Functions -//************************************************************************* - -#endif /* #ifndef _TESTAPLTID_H_ */ diff --git a/src/occApplet/testApplet/testappletfiles.mk b/src/occApplet/testApplet/testappletfiles.mk deleted file mode 100755 index f0177ab..0000000 --- a/src/occApplet/testApplet/testappletfiles.mk +++ /dev/null @@ -1,33 +0,0 @@ -# IBM_PROLOG_BEGIN_TAG -# This is an automatically generated prolog. -# -# $Source: src/occApplet/testApplet/testappletfiles.mk $ -# -# 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 - -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 deleted file mode 100755 index 084df6f..0000000 --- a/src/occApplet/testApplet/traceTest.c +++ /dev/null @@ -1,349 +0,0 @@ -/* IBM_PROLOG_BEGIN_TAG */ -/* This is an automatically generated prolog. */ -/* */ -/* $Source: src/occApplet/testApplet/traceTest.c $ */ -/* */ -/* OpenPOWER OnChipController Project */ -/* */ -/* Contributors Listed Below - COPYRIGHT 2014,2015 */ -/* [+] 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 */ - -//************************************************************************* -// Includes -//************************************************************************* -#include <common_types.h> // imageHdr_t declaration and image header macro -#include <errl.h> // For error handle -#include "ssx_io.h" // For printfs -#include <trac.h> // For traces -#include <appletId.h> // For applet ID -#include <trac_service_codes.h> - -//************************************************************************* -// Externs -//************************************************************************* -extern SsxSemaphore g_trac_mutex; - -//************************************************************************* -// Macros -//************************************************************************* -#define TRAC_INTF_MUTEX_TIMEOUT SSX_SECONDS(5) -//************************************************************************* -// Defines/Enums -//************************************************************************* -#define TRACETEST_ID "traceTest\0" -#define para_int_0 "0 para" -#define para_int_1 "1 para (%d)" -//#define para_int_2 "2 para (%d) (%d)" -//#define para_int_3 "3 para (%d) (%d) (%d)" -//#define para_int_4 "4 para (%d) (%d) (%d) (%d)" -#define para_int_5 "5 para (%d) (%d) (%d) (%d) (%d)" -#define para_int_6 "6 para (%d) (%d) (%d) (%d) (%d) (%d)" -#define para_hex_0 "0 para" -#define para_hex_1 "1 para (%X)" -//#define para_hex_2 "2 para (%X) (%X)" -//#define para_hex_3 "3 para (%X) (%X) (%X)" -//#define para_hex_4 "4 para (%X) (%X) (%X) (%X)" -#define para_hex_5 "5 para (%X) (%X) (%X) (%X) (%X)" -#define para_hex_6 "6 para (%X) (%X) (%X) (%X) (%X) (%X)" -#define para_chr_0 "0 para" -#define para_chr_1 "1 para (%s)" -//#define para_chr_2 "2 para (%s) (%s)" -//#define para_chr_3 "3 para (%s) (%s) (%s)" -//#define para_chr_4 "4 para (%s) (%s) (%s) (%s)" -#define para_chr_5 "5 para (%s) (%s) (%s) (%s) (%s)" -#define para_chr_6 "6 para (%s) (%s) (%s) (%s) (%s) (%s)" -#define MIN_TRACE_ENTRY_SIZE 32 - -//************************************************************************* -// Structures -//************************************************************************* - -//************************************************************************* -// Globals -//************************************************************************* -#ifdef TRACE_BUFFER_SIZE -#undef TRACE_BUFFER_SIZE -#define TRACE_BUFFER_SIZE 8192 -#endif -char G_trac_buffer[TRACE_BUFFER_SIZE + 100]; - -//************************************************************************* -// Function Prototypes -//************************************************************************* - -//************************************************************************* -// Functions -//************************************************************************* -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; -} - -int traceFuncTest() -{ - UINT l_rc = 0; - UINT l_max_trace_entries = TRACE_BUFFER_SIZE / MIN_TRACE_ENTRY_SIZE; - 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 - // to fill trace buffer, times_wrap should be larger than zero - do{ - l_entry_count++; - TRAC_INFO("traceTest applet INFO record: count %d", (int)l_entry_count); - 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. - // 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; - if((l_rc != 0 ) || (l_head->times_wrap == 0)) - { - 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 parameters - l_rc = TRAC_get_buffer(TRAC_get_td("INF"), NULL); - l_head = (tracDesc_t)&G_trac_buffer; - if(l_rc == 0) - { - printf("TRAC_get_buffer(), reason code: %d\n", l_rc); - 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) - { - printf("TRAC_get_buffer(), reason code: %d\n", l_rc); - printf("Fail: test TRAC_get_buffer() invalid 2nd parameter\n"); - break; - } - - // Test target - TRAC_get_buffer_partial() and TRAC_get_td() - // 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)) - { - printf("TRAC_get_buffer_partial(), reason code: %d\n", l_rc); - 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)) - { - printf("TRAC_get_buffer_partial(), reason code: %d\n", l_rc); - 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)) - { - printf("TRAC_get_buffer_partial(), reason code: %d\n", l_rc); - 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) - { - printf("TRAC_get_buffer_partial(), reason code: %d\n", l_rc); - 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; - l_rc = TRAC_get_buffer_partial(TRAC_get_td("IMP"), G_trac_buffer, &l_buffer_size); - if(l_rc != TRAC_DATA_SIZE_LESS_THAN_HEADER_SIZE) - { - printf("TRAC_get_buffer_partial(), reason code: %d\n", l_rc); - 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); - l_rc = TRAC_get_buffer_partial(TRAC_get_td("INF"), G_trac_buffer, &l_buffer_size); - if(l_rc) - { - printf("TRAC_get_buffer_partial(), reason code: %d\n", l_rc); - 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); - l_rc = TRAC_get_buffer_partial(TRAC_get_td("INF"), G_trac_buffer, &l_buffer_size); - if(l_rc || (l_buffer_size != TRACE_BUFFER_SIZE)) - { - printf("TRAC_get_buffer_partial(), reason code: %d size %d/%d\n", l_rc, l_buffer_size, TRACE_BUFFER_SIZE); - 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(); - l_buffer_size = sizeof(G_trac_buffer); - l_rc = TRAC_get_buffer_partial(TRAC_get_td("ERR"), G_trac_buffer, &l_buffer_size); - if(l_rc) - { - printf("TRAC_get_buffer_partial(), reason code: %d\n", l_rc); - 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(); - l_buffer_size = TRACE_BUFFER_SIZE/2; - l_rc = TRAC_get_buffer_partial(TRAC_get_td("ERR"), G_trac_buffer, &l_buffer_size); - if(l_rc) - { - printf("TRAC_get_buffer_partial(), reason code: %d\n", l_rc); - 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; - do{ - l_entry_count++; - TRAC_INFO("traceTest applet INFO record: count %d", (int)l_entry_count); - 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/4) >= l_entry_count); - l_buffer_size = TRACE_BUFFER_SIZE; - l_rc = TRAC_get_buffer_partial(TRAC_get_td("IMP"), G_trac_buffer, &l_buffer_size); - l_head = (tracDesc_t)&G_trac_buffer; - if(l_rc || (l_head->times_wrap != 0)) - { - printf("TRAC_get_buffer_partial(), reason code: %d\n", l_rc); - 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); - l_rc = TRAC_get_buffer_partial(TRAC_get_td("INF"), G_trac_buffer, &l_buffer_size); - if(l_rc) - { - printf("TRAC_get_buffer_partial(), reason code: %d\n", l_rc); - printf("Fail: test TRAC_get_buffer_partial() with small input buffer\n"); - break; - } - - }while(0); - - return l_rc; -} - -//************************************************************************* -// Entry point function -//************************************************************************* -errlHndl_t traceTest(void * i_arg) -{ - errlHndl_t l_err = NULL; - UINT l_rc = 0; - - do - { - // function unit test - l_rc = traceFuncTest(); - if(l_rc) - { - printf("traceTest Applet: Function test failed\n"); - break; - } - - // Macro test: test basic trace macros with/without parameters - - // 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(); - if(l_rc) - { - printf("traceTest Applet: Semaphore test failed\n"); - break; - } -#endif - }while(0); - - printf("traceTest Applet: test finished\n"); - return l_err; -} - - -//************************************************************************* -// Image Header -//************************************************************************* -IMAGE_HEADER (G_traceTest,traceTest,TRACETEST_ID,OCC_APLT_TEST); diff --git a/src/occ_405/dcom/dcom.c b/src/occ_405/dcom/dcom.c index 4db4779..3f4c268 100755 --- a/src/occ_405/dcom/dcom.c +++ b/src/occ_405/dcom/dcom.c @@ -1,11 +1,11 @@ /* IBM_PROLOG_BEGIN_TAG */ /* This is an automatically generated prolog. */ /* */ -/* $Source: src/occ/dcom/dcom.c $ */ +/* $Source: src/occ_405/dcom/dcom.c $ */ /* */ /* OpenPOWER OnChipController Project */ /* */ -/* Contributors Listed Below - COPYRIGHT 2011,2015 */ +/* Contributors Listed Below - COPYRIGHT 2011,2016 */ /* [+] International Business Machines Corp. */ /* */ /* */ @@ -154,7 +154,7 @@ void dcom_initialize_roles(void) /* @ * @errortype * @moduleid DCOM_MID_INIT_ROLES - * @reasoncode INVALID_CONFIGURATION + * @reasoncode INVALID_CONFIG_DATA * @userdata1 PBAXCFG (upper) * @userdata2 PBAXCFG (lower) * @userdata4 ERC_CHIP_IDS_INVALID @@ -162,7 +162,7 @@ void dcom_initialize_roles(void) */ errlHndl_t l_errl = createErrl( DCOM_MID_INIT_ROLES, //ModId - INTERNAL_HW_FAILURE, //Reasoncode + INVALID_CONFIG_DATA, //Reasoncode ERC_CHIP_IDS_INVALID, //Extended reasoncode ERRL_SEV_UNRECOVERABLE, //Severity NULL, //Trace Buf diff --git a/src/occ_405/occ_service_codes.h b/src/occ_405/occ_service_codes.h index 0ced425..aa6d243 100644 --- a/src/occ_405/occ_service_codes.h +++ b/src/occ_405/occ_service_codes.h @@ -69,6 +69,8 @@ enum occReasonCode DIMM_ERROR_TEMP = 0x30, /// Frequency limited due to oversubscription condition OVERSUB_LIMIT_ALERT = 0x33, + /// Invalid configuration data (MRW, etc.) + INVALID_CONFIG_DATA = 0x34, /// Centaur reached error threshold CENT_ERROR_TEMP = 0x40, /// Centaur in-band scom failure |