view cdg-hybrid/cdginc/p_ra.val @ 220:0ed36de51973

ABB semaphore protection overhaul The ABB semaphone protection logic that came with TCS211 from TI was broken in several ways: * Some semaphore-protected functions were called from Application_Initialize() context. NU_Obtain_Semaphore() called with NU_SUSPEND fails with NU_INVALID_SUSPEND in this context, but the return value wasn't checked, and NU_Release_Semaphore() would be called unconditionally at the end. The latter call would increment the semaphore count past 1, making the semaphore no longer binary and thus no longer effective for resource protection. The fix is to check the return value from NU_Obtain_Semaphore() and skip the NU_Release_Semaphore() call if the semaphore wasn't properly obtained. * Some SPI hardware manipulation was being done before entering the semaphore- protected critical section. The fix is to reorder the code: first obtain the semaphore, then do everything else. * In the corner case of L1/DSP recovery, l1_abb_power_on() would call some non-semaphore-protected ABB & SPI init functions. The fix is to skip those calls in the case of recovery. * A few additional corner cases existed, all of which are fixed by making ABB semaphore protection 100% consistent for all ABB functions and code paths. There is still one remaining problem of priority inversion: suppose a low- priority task calls an ABB function, and some medium-priority task just happens to preempt right in the middle of that semaphore-protected ABB operation. Then the high-priority SPI task is locked out for a non-deterministic time until that medium-priority task finishes its work and goes back to sleep. This priority inversion problem remains outstanding for now.
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 26 Apr 2021 20:55:25 +0000
parents 35f7a1dc9f7d
children
line wrap: on
line source

/*
+--------------------------------------------------------------------------+
| PROJECT : PROTOCOL STACK                                                 |
| FILE    : p_ra.val                                                       |
| SOURCE  : "sap\ra.pdf"                                                   |
| LastModified : "2002-04-26"                                              |
| IdAndVersion : "8411.102.98.204"                                         |
| SrcFileTime  : "Thu Nov 29 09:51:34 2007"                                |
| Generated by CCDGEN_2.5.5A on Fri Oct 14 21:41:52 2016                   |
|           !!DO NOT MODIFY!!DO NOT MODIFY!!DO NOT MODIFY!!                |
+--------------------------------------------------------------------------+
*/

/* PRAGMAS
 * PREFIX                 : NONE
 * COMPATIBILITY_DEFINES  : NO (require PREFIX)
 * ALWAYS_ENUM_IN_VAL_FILE: NO
 * ENABLE_GROUP: NO
 * CAPITALIZE_TYPENAME: NO
 */


#ifndef P_RA_VAL
#define P_RA_VAL


#define CDG_ENTER__P_RA_VAL

#define CDG_ENTER__FILENAME _P_RA_VAL
#define CDG_ENTER__P_RA_VAL__FILE_TYPE CDGINC
#define CDG_ENTER__P_RA_VAL__LAST_MODIFIED _2002_04_26
#define CDG_ENTER__P_RA_VAL__ID_AND_VERSION _8411_102_98_204

#define CDG_ENTER__P_RA_VAL__SRC_FILE_TIME _Thu_Nov_29_09_51_34_2007

#include "CDG_ENTER.h"

#undef CDG_ENTER__P_RA_VAL

#undef CDG_ENTER__FILENAME


/*
 * Value constants for VAL_model
 */
#define RA_MODEL_SPEECH                (0x0)      /* model speech                   */
#define RA_MODEL_TRANS                 (0x1)      /* model 1b async transparent     */
#define RA_MODEL_RLP                   (0x2)      /* model 3b async nontransparent  */
#define RA_MODEL_FAX                   (0x3)      /* model 5b fax 3.45              */

/*
 * Value constants for VAL_tra_rate
 */
#define TRA_FULLRATE_2400              (0x0)      /* fullrate 2,4/3,6 kBit          */
#define TRA_HALFRATE_2400              (0x1)      /* halfrate 2,4/3,6 kBit          */
#define TRA_FULLRATE_4800              (0x2)      /* fullrate 4,8/6 kBit            */
#define TRA_HALFRATE_4800              (0x3)      /* halfrate 4,8/6 kBit            */
#define TRA_FULLRATE_9600              (0x4)      /* fullrate 9,6/12 kBit           */
#define TRA_FULLRATE_14400             (0x5)      /* fullrate 13,4/14,4 kBit        */

/*
 * Value constants for VAL_user_rate
 */
#define URA_300                        (0x0)      /* user rate 300bps               */
#define URA_1200                       (0x1)      /* user rate 1200bps              */
#define URA_2400                       (0x2)      /* user rate 2400bps              */
#define URA_4800                       (0x3)      /* user rate 4800bps              */
#define URA_9600                       (0x4)      /* user rate 9600bps              */
#define URA_1200_75                    (0x5)      /* user rate 1200/75bps           */
#define URA_14400                      (0x6)      /* user rate 14400bps             */

/*
 * Value constants for VAL_dtx_flg
 */
#define DTX_DIS                        (0x0)      /* Disable DTX                    */
#define DTX_EN                         (0x1)      /* Enable DTX                     */

/*
 * Value constants for VAL_fr_type
 */
#define FR_T4DATA                      (0x0)      /* GSM 3.45 Data frame            */
#define FR_STATUS                      (0x1)      /* GSM 3.45 Status (BCS) frame    */
#define FR_SYNC                        (0x2)      /* GSM 3.45 Sync frame            */
#define FR_TRAIN                       (0x3)      /* GSM 3.45 Status (TRAIN) frame  */
#define FR_TRANS                       (0x4)      /* Transparent Data frame         */
#define FR_RLP                         (0x5)      /* Valid RLP frame                */
#define FR_INVALID                     (0xf)      /* Invalid frame or FCS error detected in RLP mode */

/*
 * Value constants for VAL_status
 */
#define ST_SA                          (0x1)      /* Status SA                      */
#define ST_SB                          (0x2)      /* Status SB                      */
#define ST_X                           (0x4)      /* Status X                       */
#define ST_OVER                        (0x8)      /* Overspeed flag                 */

/*
 * Value constants for VAL_ack_flg
 */
#define RA_ACK                         (0x0)      /* acknowledged                   */
#define RA_NAK                         (0x1)      /* not acknowledged               */

/*
 * Value constants for VAL_detect
 */
#define DET_NO_STATUS                  (0x0)      /* do not detect status frames    */
#define DET_STATUS                     (0x1)      /* detect status frames           */

/*
 * Value constants for VAL_tick_dir
 */
#define TICK_UL                        (0x1)      /* tick uplink                    */
#define TICK_DL                        (0x2)      /* tick downlink                  */
#define TICK_UL_DL                     (0x3)      /* tick uplink & downlink         */

/*
 * Value constants for VAL_offset
 */
#define ra_conf                        (0x0)      /* Configurations                 */
#define ra_act                         (0x1)      /* Activities                     */
#define ra_test                        (0x2)      /* Test                           */
#define ra_statu                       (0x3)      /* Uplink status                  */
#define ra_statd                       (0x4)      /* Downlink status                */
#define fax_status_det                 (0x5)      /* Fax status detection           */
#define rau                            (0x6)      /* Buffer for uplink characters   */
#define rad                            (0x7)      /* Buffer for downlink characters */
#define ntu                            (0x8)      /* Buffer for uplink RLP frames   */
#define ntd                            (0x9)      /* Buffer for downlink RLP frames */
#define faxu                           (0xa)      /* Buffer for uplink fax data     */
#define faxd                           (0xb)      /* Buffer for downlink fax data   */

/*
 * user defined constants
 */
#define DUMMY_RA                       (0x0)      

#include "CDG_LEAVE.h"


#endif