FreeCalypso > hg > fc-tourmaline
view cdg-hybrid/cdginc/m_rr_short_pd.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 : m_rr_short_pd.val | | SOURCE : "msg\rr_short_pd.mdf" | | LastModified : "2003-11-06" | | IdAndVersion : "8010.602.03.001" | | SrcFileTime : "Wed Nov 28 10:21:00 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 * CCDNAME: RR_SHORT */ #ifndef M_RR_SHORT_PD_VAL #define M_RR_SHORT_PD_VAL #define CDG_ENTER__M_RR_SHORT_PD_VAL #define CDG_ENTER__FILENAME _M_RR_SHORT_PD_VAL #define CDG_ENTER__M_RR_SHORT_PD_VAL__FILE_TYPE CDGINC #define CDG_ENTER__M_RR_SHORT_PD_VAL__LAST_MODIFIED _2003_11_06 #define CDG_ENTER__M_RR_SHORT_PD_VAL__ID_AND_VERSION _8010_602_03_001 #define CDG_ENTER__M_RR_SHORT_PD_VAL__SRC_FILE_TIME _Wed_Nov_28_10_21_00_2007 #include "CDG_ENTER.h" #undef CDG_ENTER__M_RR_SHORT_PD_VAL #undef CDG_ENTER__FILENAME #include "m_rr_com.val" /* Access values independent from the corresponding h-file. */ /* * Value constants for VAL_bsic_seen */ #define NO_INV_BSIC_SEEN (0x0) /* No cell with invalid BSIC and allowed NCC part of BSIC is seen. */ #define INV_BSIC_SEEN (0x1) /* One cell or more with invalid BSIC and allowed NCC part of BSIC is seen. */ /* * Value constants for VAL_cv_bep */ #define CV_BEP_0 (0x0) /* 2.00 > std(BEP)/mean(BEP) > 1.75 */ #define CV_BEP_1 (0x1) /* 1.75 > std(BEP)/mean(BEP) > 1.50 */ #define CV_BEP_2 (0x2) /* 1.50 > std(BEP)/mean(BEP) > 1.25 */ #define CV_BEP_3 (0x3) /* 1.25 > std(BEP)/mean(BEP) > 1.00 */ #define CV_BEP_4 (0x4) /* 1.00 > std(BEP)/mean(BEP) > 0.75 */ #define CV_BEP_5 (0x5) /* 0.75 > std(BEP)/mean(BEP) > 0.50 */ #define CV_BEP_6 (0x6) /* 0.50 > std(BEP)/mean(BEP) > 0.25 */ #define CV_BEP_7 (0x7) /* 0.25 > std(BEP)/mean(BEP) > 0.00 */ /* * Value constants for VAL_dtx_used */ #define DTX_USED_NO (0x0) /* DTX was not used */ #define DTX_USED_YES (0x1) /* DTX was used */ /* * Value constants for VAL_inv_bsic_rep */ #define NO_REPORT (0x0) /* Indicates that GSM cells with invalid BSIC and allowed NCC part should not be reported */ #define YES_REPORT (0x1) /* Indicates that GSM cells with invalid BSIC and allowed NCC part should be reported */ /* * Value constants for VAL_pow_ctrl */ #define POW_CTRL_NO (0x0) /* PWRC is not set */ #define POW_CTRL_YES (0x1) /* PWRC is set */ /* * Value constants for VAL_rep_rate */ #define NORMAL_RATE (0x0) /* SACCH rate reporting. */ #define REDUCED_RATE (0x1) /* Reduced reporting rate allowed. */ /* * Value constants for VAL_report_type */ #define RT_EMR (0x0) /* MS shall use the Enhanced Measurement Report message, if at least one BSIC is allocated to each BA frequency, otherwise the Measurement Report message. */ #define RT_MR (0x1) /* The MS shall use the Measurement Report message for reporting. */ /* * Value constants for VAL_scale */ #define SCALE_ZERO_DB (0x0) /* 0 dB offset is used for the reported RXLEV values */ #define SCALE_TEN_DB (0x1) /* +10 dB offset is used for the reported RXLEV values */ /* * Value constants for VAL_scale_ord */ #define SC_ORD_ZERO_DB (0x0) /* 0 dB offset, which shall be used for the reported RXLEV values */ #define SC_ORD_TEN_DB (0x1) /* +10 dB offset, which shall be used for the reported RXLEV values */ #define SC_ORD_AUTOMATIC (0x2) /* automatic offset, which shall be used for the reported RXLEV values */ /* * Value constants for VAL_sl2h */ #define VAL_SL2H___DEF (0x0) /* reserved */ #define SL2H_0 (0x0) /* Short Layer 2 header: UI command frame */ /* * user defined constants */ #define L3MAX_ACK (0xfb) #define L3MAX (0xfb) #define MAX_NNC (0x60) #define MAX_BSICI (0x8) #define MAX_2GEXT (0x84) #include "CDG_LEAVE.h" #endif
