00001 /** ============================================================================ 00002 * @file failure.h 00003 * 00004 * @path $(DSPLINK)/dsp/inc/ 00005 * 00006 * @brief Header file for failure handler module. 00007 * 00008 * @ver 1.65.00.03 00009 * ============================================================================ 00010 * @copyright Copyright (C) 2002-2009, Texas Instruments Incorporated - 00011 * http://www.ti.com/ 00012 * 00013 * Redistribution and use in source and binary forms, with or without 00014 * modification, are permitted provided that the following conditions 00015 * are met: 00016 * 00017 * * Redistributions of source code must retain the above copyright 00018 * notice, this list of conditions and the following disclaimer. 00019 * 00020 * * Redistributions in binary form must reproduce the above copyright 00021 * notice, this list of conditions and the following disclaimer in the 00022 * documentation and/or other materials provided with the distribution. 00023 * 00024 * * Neither the name of Texas Instruments Incorporated nor the names of 00025 * its contributors may be used to endorse or promote products derived 00026 * from this software without specific prior written permission. 00027 * 00028 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00029 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 00030 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00031 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 00032 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00033 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00034 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 00035 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 00036 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 00037 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 00038 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00039 * ============================================================================ 00040 */ 00041 00042 00043 #if !defined (FAILURE_H) 00044 #define FAILURE_H 00045 00046 00047 /* ----------------------------------- DSP/BIOS Headers */ 00048 #include <std.h> 00049 00050 00051 #if defined (__cplusplus) 00052 extern "C" { 00053 #endif /* defined (__cplusplus) */ 00054 00055 00056 #if defined (_DEBUG) 00057 /* ============================================================================ 00058 * @name CCS_BREAKPOINT 00059 * 00060 * @brief If USE_CCS_BREAKPOINT is defined the breakpoint instruction 00061 * specific to CCS is used. 00062 * ============================================================================ 00063 */ 00064 #if (defined(USE_CCS_BREAKPOINT) && defined( _55_ )) 00065 00066 #define CCS_BREAKPOINT \ 00067 asm(" ;\n .if (.MNEMONIC)\n ESTOP_1\n .else\n ESTOP_1()\n .endif\n NOP") 00068 00069 #endif /* (defined(USE_CCS_BREAKPOINT) && defined( _55_ )) */ 00070 00071 00072 /** ============================================================================ 00073 * @name FID_XXX 00074 * 00075 * @brief File ids for files in LINK IOM driver. 00076 * ============================================================================ 00077 */ 00078 #define FID_BASE (0x100) 00079 #define FID_APP_C (FID_BASE + 0x1) 00080 #define FID_HAL_C (FID_BASE + 0x2) 00081 #define FID_DRV_C (FID_BASE + 0x3) 00082 #define FID_SHMDRV_C (FID_BASE + 0x4) 00083 #define FID_DSPLINKIPS_C (FID_BASE + 0x5) 00084 #define FID_IPS_C (FID_BASE + 0x6) 00085 #define FID_DSPLINKPOOL_C (FID_BASE + 0x7) 00086 #define FID_SMAPOOL_C (FID_BASE + 0x8) 00087 #define FID_MPCS_C (FID_BASE + 0x9) 00088 #define FID__MPCS_C (FID_BASE + 0xA) 00089 #define FID_MPLIST_C (FID_BASE + 0xB) 00090 #define FID__MPLIST_C (FID_BASE + 0xC) 00091 #define FID_DSPLINKMQT_C (FID_BASE + 0xD) 00092 #define FID_ZCPYMQT_C (FID_BASE + 0xE) 00093 #define FID_DSPLINKDATA_C (FID_BASE + 0xF) 00094 #define FID_ZCPYDATA_C (FID_BASE + 0x10) 00095 #define FID_NOTIFY_C (FID_BASE + 0x11) 00096 #define FID__NOTIFY_C (FID_BASE + 0x12) 00097 #define FID_RINGIO_C (FID_BASE + 0x13) 00098 #define FID__RINGIO_C (FID_BASE + 0x14) 00099 #define FID_DSPLINKMSQ_C (FID_BASE + 0x15) 00100 00101 /** ============================================================================ 00102 * @macro SET_FAILURE_REASON 00103 * 00104 * @brief Sets the failure reason. 00105 * ============================================================================ 00106 */ 00107 #define SET_FAILURE_REASON(code) SetReason (FILEID, __LINE__, code) 00108 00109 00110 /** ============================================================================ 00111 * @func SetReason 00112 * 00113 * @brief Sets the reason of failure. 00114 * The reason is set for first failure only. 00115 * 00116 * @param fileId 00117 * An ID representing a file. 00118 * lineNo 00119 * Line number from where this function is called. 00120 * failureCode 00121 * Failure code. 00122 * 00123 * @return None 00124 * 00125 * @pre None 00126 * 00127 * @post None 00128 * 00129 * @see None 00130 * ============================================================================ 00131 */ 00132 Void SetReason (int fileId, int lineNo, int failureCode) ; 00133 00134 #else /* if defined (_DEBUG) */ 00135 00136 #define SET_FAILURE_REASON(code) 00137 00138 #endif /* if defined (_DEBUG) */ 00139 00140 00141 #if defined (__cplusplus) 00142 } 00143 #endif /* defined (__cplusplus) */ 00144 00145 00146 #endif /* if !defined (FAILURE_H) */