⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 resext.c

📁 OMAP1030 处理器的ARM 侧硬件测试代码 OMAP1030 是TI的双核处理器
💻 C
📖 第 1 页 / 共 2 页
字号:
    CHECK_INPUT_RANGE_MIN0(numArray,RES_BUF_SPACE-res_pTabOffset, RET_FULL, RES_RES_BASE + RES_TABLE_FULL_FAIL);
    
    /* write start of array marker */
    returnCode = RES_Set(RES_START_ARRAY_BASE + RES_START_ARRAY);
    CHECK_RETURN_VALUE_RET(returnCode, TEST_OK, returnCode);
    
    /* write number of bytes to write */
    returnCode = RES_Set(numArray);
    CHECK_RETURN_VALUE_RET(returnCode, TEST_OK, returnCode);

    /* while ther are elements in array to output */
    while (counter < numArray)    
    {
        /* Write next Array output value */
        RES_SetVar(statusArray[counter]);
        counter++;
    }

    return returnCode;
}		


/*==================== Function Separator =============================*/

ReturnCode_t  RES_GetCurrentStatus(
                UWORD16 *const pCurRes
                )
{
    ReturnCode_t returnCode = TEST_OK;
    UWORD32      curOffset;
    UWORD16      curValue;
    UWORD16      arraySize;
    
    /* skip first value as it reserved for global result */
    for (curOffset = RES_FIRST_DATA_LOCATION; 
         curOffset < res_pTabOffset; 
         curOffset++ )
    {
        /* get result range */
        curValue = *(res_pIntStart + curOffset) & RES_RANGE_MASK_VAL;
    
        /* check for bad value */
        if((curValue >= RES_MIN_BAD_VAL) &&
           (curValue <= RES_MAX_BAD_VAL))
        {
            /* get failing result */
            *pCurRes = *(res_pIntStart + curOffset);
            
            return RET_FAIL;
        }
        /* else if start of an array */
        else if (curValue == RES_START_ARRAY)
        {
            /* jump to next value in the array */
            curOffset++;
            
            /* save array size */
            arraySize = *(res_pIntStart + curOffset);
            
            /* skip the array values */
            curOffset += arraySize;
        }
    }
    
    /* if data has been dumped */
    if(res_pTabOffset > RES_FIRST_DATA_LOCATION)
    {
        /* return last result written */
        *pCurRes = *(res_pIntStart + res_pTabOffset);
    }
    else
    {
        /* indicate test not failed yet */
        *pCurRes = RES_INIT_OK;
    }
 
    return returnCode;
}		

/*==================== Function Separator =============================*/

ReturnCode_t  RES_GetFinalStatus(
                UWORD16 *const pFinalRes
                )
{
    ReturnCode_t returnCode = TEST_OK;
    UWORD32      curOffset;
    UWORD16      curValue;
    UWORD16      arraySize;
    
    /* skip first value as it reserved for global result */
    for (curOffset = RES_FIRST_DATA_LOCATION; 
         curOffset < res_pTabOffset; 
         curOffset++ )
    {
        /* get result range */
        curValue = *(res_pIntStart + curOffset) & RES_RANGE_MASK_VAL;
    
        /* check for bad value */
        if((curValue >= RES_MIN_BAD_VAL) &&
           (curValue <= RES_MAX_BAD_VAL))
        {
            /* indicate that test failed */
            *res_pIntStart = RES_TEST_FAILED;

            *res_pExtStart = RES_TEST_FAILED;
            
            /* get failing result */
            *pFinalRes = *(res_pIntStart + curOffset);
            
            return RET_FAIL;
        }
        /* else if start of an array */
        else if (curValue == RES_START_ARRAY)
        {
            /* jump to next value in the array */
            curOffset++;
            
            /* save array size */
            arraySize = *(res_pIntStart + curOffset);
            
            /* skip the array values */
            curOffset += arraySize;
        }
    }
    
    /* indicate that test finished OK */
    *res_pExtStart = RES_TEST_PASSED;
    *res_pIntStart = RES_TEST_PASSED;

    /* get final result */
    *pFinalRes = *res_pIntStart;
 
    return returnCode;
}		

/*==================== Function Separator =============================*/

ReturnCode_t RES_End(
            void
            )
{
  ReturnCode_t returnCode = TEST_OK;

  /* write end marker to last element in array */
  *(res_pIntStart+RES_BUF_SIZE-1) = RES_THE_END;

  *(res_pExtStart+RES_BUF_SIZE-1) = RES_THE_END;
 
  return returnCode;
}		


/*==================== Function Separator =============================*/
ReturnCode_t RES_GetDspSpy( void )
{

    UWORD32 message;
	UWORD32 dspSpyAddr;
	ReturnCode_t checkReturn;
	UWORD16 *pDspSpy;
	UWORD16 iVal;

    checkReturn = RET_FAIL;

    message = MSG_Read(MSG_UMA_SYSTEM_QUEUE);
	if ( ( message & ~MSG_CODE_MASK )!= ( MSG_SOURCE_UMA |
	                                      MSG_SYSTEM_ID  |
										  MSG_SPY_ADDR_HI ) )
	{
	    return ( checkReturn );
	}

    /* Get Upper Part of DSP Spy address */
	dspSpyAddr = ( (message & MSG_CODE_MASK) << 16 );

    message = MSG_Read(MSG_UMA_SYSTEM_QUEUE);
	if ( ( message & ~MSG_CODE_MASK )!= ( MSG_SOURCE_UMA |
	                                      MSG_SYSTEM_ID  |
										  MSG_SPY_ADDR_LO ) )
	{
	    return ( checkReturn );
	}

    /* Get Lower Part of DSP Spy address */
	dspSpyAddr = dspSpyAddr | ( message & MSG_CODE_MASK );

    pDspSpy = (UWORD16 *)(DSP_SS_DMEM_BASE + dspSpyAddr);

    /* Skip Global test pass/fail status */
	pDspSpy ++;

    iVal = *pDspSpy;
    while ( iVal )
	{
	    RES_Set(iVal);
        
        /* Move to next value*/              
		pDspSpy++;
        iVal = *pDspSpy;
	}

    checkReturn = TEST_OK;

    return ( checkReturn );


} /* RES_GetDspSpy() */

/*==================== Function Separator =============================*/
ReturnCode_t RES_GetIvaSpy( void )
{

    UWORD32 message;
	UWORD32 ivaSpyAddr;
	ReturnCode_t checkReturn;
	UWORD16 *pIvaSpy;
	UWORD16 iVal;

    checkReturn = RET_FAIL;

    message = MSG_Read(MSG_IVA_SYSTEM_QUEUE);
	if ( ( message & ~MSG_CODE_MASK ) != ( MSG_SOURCE_IVA |
	                                       MSG_SYSTEM_ID  |
										   MSG_SPY_ADDR_HI ) )
	{
	    return ( checkReturn );
	}

    /* Get Upper Part of DSP Spy address */
	ivaSpyAddr = ( (message & MSG_CODE_MASK) << 16 );

    message = MSG_Read(MSG_IVA_SYSTEM_QUEUE);
	if ( ( message & ~MSG_CODE_MASK ) != ( MSG_SOURCE_IVA |
	                                       MSG_SYSTEM_ID  |
										   MSG_SPY_ADDR_LO ) )
	{
	    return ( checkReturn );
	}
    
    /* Get Lower Part of IVA Spy address */
	ivaSpyAddr |= ( message & MSG_CODE_MASK );

    pIvaSpy = (UWORD16 *)( IVA_SS_DMEM_BASE + ivaSpyAddr );

    /* Skip Global test pass/fail status */
	pIvaSpy++;

    iVal = *pIvaSpy;
    while ( iVal )
	{
	    RES_Set(iVal);

        /* Move to next value*/      
	    pIvaSpy++;
    	iVal = *pIvaSpy;
 	}

    return ( TEST_OK );

} /* RES_GetIvaSpy() */


/* ============================================================================
* LOCAL FUNCTIONS
* =============================================================================
*/

/* EOF */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -