view cdg-hybrid/cdginc/p_mphp.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_mphp.val                                                     |
| SOURCE  : "sap\mphp.pdf"                                                 |
| LastModified : "2003-01-13"                                              |
| IdAndVersion : "8441.100.03.011"                                         |
| SrcFileTime  : "Mon Nov 24 15:49:34 2003"                                |
| 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_MPHP_VAL
#define P_MPHP_VAL


#define CDG_ENTER__P_MPHP_VAL

#define CDG_ENTER__FILENAME _P_MPHP_VAL
#define CDG_ENTER__P_MPHP_VAL__FILE_TYPE CDGINC
#define CDG_ENTER__P_MPHP_VAL__LAST_MODIFIED _2003_01_13
#define CDG_ENTER__P_MPHP_VAL__ID_AND_VERSION _8441_100_03_011

#define CDG_ENTER__P_MPHP_VAL__SRC_FILE_TIME _Mon_Nov_24_15_49_34_2003

#include "CDG_ENTER.h"

#undef CDG_ENTER__P_MPHP_VAL

#undef CDG_ENTER__FILENAME


/*
 * Value constants for VAL_psi_nr
 */
#define VAL_PSI_NR___0                 (0x0)      /* read all PSI                   */

/*
 * Value constants for VAL_bs_pbcch_blks
 */
#define VAL_BS_PBCCH_BLKS___0          (0x0)      /* B0 is used for PBCCH           */
#define VAL_BS_PBCCH_BLKS___1          (0x1)      /* B0, B6 is used for PBCCH       */
#define VAL_BS_PBCCH_BLKS___2          (0x2)      /* B0, B6, B3 is used for PBCCH   */
#define VAL_BS_PBCCH_BLKS___3          (0x3)      /* B0, B6, B3, B9 is used for PBCCH */

/*
 * Value constants for VAL_psi1_rep_period
 */

/*
 * Value constants for VAL_relative_pos_array
 */

/*
 * Value constants for VAL_hopping
 */
#define VAL_HOPPING___0                (0x0)      /* static                         */
#define VAL_HOPPING___1                (0x1)      /* hopping                        */
#define MPHP_INT_MEAS_STATIC           (0x2)      /* static                         */
#define MPHP_INT_MEAS_HOPPING          (0x3)      /* hopping                        */
#define VAL_HOPPING___4                (0x4)      /* static                         */
#define VAL_HOPPING___5                (0x5)      /* hopping                        */

/*
 * Value constants for VAL_tsc
 */

/*
 * Value constants for VAL_tn
 */
#define VAL_TN___FF                    (0xff)     /* Value not present              */

/*
 * Value constants for VAL_l2_channel
 */
#define L2_PCHANNEL_PCCCH              (0x1)      /* PCCCH block                    */
#define L2_PCHANNEL_PBCCH              (0x2)      /* PBCCH block                    */
#define L2_PCHANNEL_PPCH               (0x3)      /* PPCH block                     */
#define L2_PCHANNEL_PEPCH              (0x4)      /* PEPCH block                    */
#define L2_PCHANNEL_PACCH              (0x5)      /* PACCH block                    */

/*
 * Value constants for VAL_error_flag
 */
#define VAL_ERROR_FLAG___1             (0x1)      /* valid block info               */
#define VAL_ERROR_FLAG___0             (0x0)      /* invalid block info             */

/*
 * Value constants for VAL_bs_pag_blks_res
 */

/*
 * Value constants for VAL_page_mode
 */
#define PAGE_NORMAL                    (0x0)      /* normal paging                  */
#define PAGE_EXT                       (0x1)      /* extended paging                */
#define PAGE_REORG                     (0x2)      /* paging reorganisation          */

/*
 * Value constants for VAL_nb_carrier
 */

/*
 * Value constants for VAL_nmeas
 */

/*
 * Value constants for VAL_fn_offset
 */

/*
 * Value constants for VAL_time_alignment
 */

/*
 * Value constants for VAL_bs_prach_blks
 */
#define VAL_BS_PRACH_BLKS___0          (0x0)      /* No block is reserved for PRACH (default) */
#define VAL_BS_PRACH_BLKS___1          (0x1)      /* B0 is used for PRACH           */
#define VAL_BS_PRACH_BLKS___2          (0x2)      /* B0, B6 is used for PRACH       */
#define VAL_BS_PRACH_BLKS___3          (0x3)      /* B0, B6, B3 is used for PRACH   */
#define VAL_BS_PRACH_BLKS___4          (0x4)      /* B0, B6, B3, B9 is used for PRACH */
#define VAL_BS_PRACH_BLKS___5          (0x5)      /* B0, B6, B3, B9, B1 is used for PRACH */
#define VAL_BS_PRACH_BLKS___6          (0x6)      /* B0, B6, B3, B9, B1, B7 is used for PRACH */
#define VAL_BS_PRACH_BLKS___7          (0x7)      /* B0, B6, B3, B9, B1, B7, B4 is used for PRACH */
#define VAL_BS_PRACH_BLKS___8          (0x8)      /* B0, B6, B3, B9, B1, B7, B4, B10 is used for PRACH */
#define VAL_BS_PRACH_BLKS___9          (0x9)      /* B0, B6, B3, B9, B1, B7, B4, B10, B2 is used for PRACH */
#define VAL_BS_PRACH_BLKS___A          (0xa)      /* B0, B6, B3, B9, B1, B7, B4, B10, B2, B8 is used for PRACH */
#define VAL_BS_PRACH_BLKS___B          (0xb)      /* B0, B6, B3, B9, B1, B7, B4, B10, B2, B8, B5 is used for PRACH */
#define VAL_BS_PRACH_BLKS___C          (0xc)      /* B0, B6, B3, B9, B1, B7, B4, B10, B2, B8, B5, B11 is used for PRACH */

/*
 * Value constants for VAL_burst_type
 */
#define ACCESS_8_BIT                   (0x0)      
#define ACCESS_11_BIT                  (0x1)      

/*
 * Value constants for VAL_assign_cmd
 */
#define DL_ASSIGNMENT                  (0x0)      /* Downlink assignment            */
#define UL_ASSIGNMENT                  (0x1)      /* Uplink assignment              */
#define UL_DL_ASSIGNMENT               (0x2)      /* Uplink and downlink assignment */

/*
 * Value constants for VAL_m_class
 */

/*
 * Value constants for VAL_repeat_alloc
 */
#define VAL_REPEAT_ALLOC___0           (0x0)      /* cancel any pending repeat allocation */
#define VAL_REPEAT_ALLOC___1           (0x1)      /* repeat the current fixed allocation when it ends */

/*
 * Value constants for VAL_purpose
 */
#define VAL_PURPOSE___0                (0x0)      /* reserved                       */
#define VAL_PURPOSE___1                (0x1)      /* reserved                       */
#define VAL_PURPOSE___2                (0x2)      /* reserved                       */
#define SINGLE_BLOCK_TRANSFER_DL       (0x3)      /* todo ??? reception?            */
#define SINGLE_BLOCK_TRANSFER_UL       (0x4)      /* i.e. measurement report        */
#define TWO_PHASE_ACESS                (0x5)      /* two phases access              */

/*
 * Value constants for VAL_ta_value
 */
#define VAL_TA_VALUE___FF              (0xff)     /* value not present              */

/*
 * Value constants for VAL_ta_index
 */
#define VAL_TA_INDEX___FF              (0xff)     /* value not present              */

/*
 * Value constants for VAL_ul_tfi
 */

/*
 * Value constants for VAL_dl_tfi
 */

/*
 * Value constants for VAL_mac_mode
 */
#define DA                             (0x0)      /* Dynamic allocation             */
#define EDA                            (0x1)      /* Extended Dynamic allocation    */
#define FA                             (0x2)      /* Fixed allocation, not half duplex mode */
#define FA_HD                          (0x3)      /* Fixed allocation, half duplex mode */

/*
 * Value constants for VAL_usf_gran
 */
#define VAL_USF_GRAN___0               (0x0)      /* the ms shall transmit one RLC/MAC-Block */
#define VAL_USF_GRAN___1               (0x1)      /* the ms shall transmit four consecutive RLC/MAC-Block */

/*
 * Value constants for VAL_dl_ctrl_ts
 */

/*
 * Value constants for VAL_size_bitmap
 */

/*
 * Value constants for VAL_tbf_start_present
 */
#define VAL_TBF_START_PRESENT___0      (0x0)      /* not present                    */
#define VAL_TBF_START_PRESENT___1      (0x1)      /* present                        */

/*
 * Value constants for VAL_pc_meas_chan
 */
#define MEAS_BCCH                      (0x0)      
#define MEAS_PDCH                      (0x1)      

/*
 * Value constants for VAL_tbf_type
 */
#define REL_DL_TBF                     (0x0)      /* Release only the downlink TBF  */
#define REL_UL_TBF                     (0x1)      /* Release only the uplink TBF    */
#define REL_ALL_TBF                    (0x2)      /* Release both uplink and downlink TBFs */

/*
 * Value constants for VAL_poll_resp_type
 */
#define POLL_RESP_NB_CS1               (0x3)      /* normal burst                   */
#define POLL_RESP_AB_8_BIT             (0x7)      /* access burst                   */
#define POLL_RESP_AB_11_BIT            (0x8)      /* access burst                   */

/*
 * Value constants for VAL_sb_status
 */
#define SB_STAT_OK                     (0x0)      /* In uplink, indicates that the single block was sent. */
#define SB_STAT_DL_CRC_ERROR           (0x0)      /* In downlink, indicates that the downlink single block was received with no CRC_ERROR. */
#define SB_STAT_STIME_PASSED           (0x1)      /* Starting time is passed. Single block uplink/downlink was not sent/received. */
#define SB_STAT_TA_INVALID             (0x2)      /* No valid timing advance. Single block was not sent. */
#define SB_STAT_DL_OK                  (0x3)      /* Valid downlink single block received ( NO CRC_ERROR). */

/*
 * Value constants for VAL_if_meas_enable
 */
#define MPHP_IM_DISABLED               (0x0)      /* interference measurement processing disabled */
#define MPHP_IM_ENABLED                (0x1)      /* interference measurement processing enabled */

/*
 * user defined constants
 */
#define MAX_L2_FRAME_SIZE              (0x17)     
#define MAX_RELATIVE_POS               (0x14)     
#define MPHP_NUMC_MA                   (0x40)     
#define MAX_USF_TABLE                  (0x8)      
#define MAX_ALLOC_BITMAP               (0x7f)     
#define MPHP_NUMC_BA_GPRS_SC           (0x21)     

#include "CDG_LEAVE.h"


#endif