FreeCalypso > hg > fc-tourmaline
view cdg-hybrid/cdginc/p_8010_147_l1_include.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_8010_147_l1_include.val | | SOURCE : "sap\8010_147_L1_include.pdf" | | LastModified : "2003-07-28" | | IdAndVersion : "8010.147.03.002" | | SrcFileTime : "Thu Nov 29 09:28:46 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: YES * ENABLE_GROUP: NO * CAPITALIZE_TYPENAME: YES */ #ifndef P_8010_147_L1_INCLUDE_VAL #define P_8010_147_L1_INCLUDE_VAL #define CDG_ENTER__P_8010_147_L1_INCLUDE_VAL #define CDG_ENTER__FILENAME _P_8010_147_L1_INCLUDE_VAL #define CDG_ENTER__P_8010_147_L1_INCLUDE_VAL__FILE_TYPE CDGINC #define CDG_ENTER__P_8010_147_L1_INCLUDE_VAL__LAST_MODIFIED _2003_07_28 #define CDG_ENTER__P_8010_147_L1_INCLUDE_VAL__ID_AND_VERSION _8010_147_03_002 #define CDG_ENTER__P_8010_147_L1_INCLUDE_VAL__SRC_FILE_TIME _Thu_Nov_29_09_28_46_2007 #include "CDG_ENTER.h" #undef CDG_ENTER__P_8010_147_L1_INCLUDE_VAL #undef CDG_ENTER__FILENAME /* * Enum to value table VAL_rf_chan_cnt * CCDGEN:WriteEnum_Count==70 */ #ifndef __T_VAL_RF_CHAN_CNT__ #define __T_VAL_RF_CHAN_CNT__ typedef enum { VAL_RF_CHAN_CNT__RANGE_MIN = 0x0, /* minimum */ VAL_RF_CHAN_CNT__RANGE_MAX = 0x40 /* maximum */ }T_VAL_RF_CHAN_CNT; #endif /* * Enum to value table VAL_radio_freq * CCDGEN:WriteEnum_Count==71 */ #ifndef __T_VAL_RADIO_FREQ__ #define __T_VAL_RADIO_FREQ__ typedef enum { GSM900__RANGE_MIN = 0x1, /* Layer 1 encoded frequency */ GSM900__RANGE_MAX = 0x7c, /* Layer 1 encoded frequency */ GSM900E__RANGE_MIN = 0x1, /* Layer 1 encoded frequency */ GSM900E__RANGE_MAX = 0xae, /* Layer 1 encoded frequency */ GSM1800_GSM1900__RANGE_MIN = 0x200, /* Layer 1 encoded frequency */ GSM1800_GSM1900__RANGE_MAX = 0x32a, /* Layer 1 encoded frequency */ GSM1800__RANGE_MIN = 0x32b, /* Layer 1 encoded frequency */ GSM1800__RANGE_MAX = 0x375, /* Layer 1 encoded frequency */ GSM900_GSM1800__RANGE_MIN = 0x1, /* Layer 1 encoded frequency */ GSM900_GSM1800__RANGE_MAX = 0x1f2, /* Layer 1 encoded frequency */ GSM900E_GSM1800__RANGE_MIN = 0x1, /* Layer 1 encoded frequency */ GSM900E_GSM1800__RANGE_MAX = 0x224, /* Layer 1 encoded frequency */ GSM850__RANGE_MIN = 0x80, /* Layer 1 encoded frequency */ GSM850__RANGE_MAX = 0xfb, /* Layer 1 encoded frequency */ GSM850_GSM1900__RANGE_MIN = 0x1, /* Layer 1 encoded frequency */ GSM850_GSM1900__RANGE_MAX = 0x1a8 /* Layer 1 encoded frequency */ }T_VAL_RADIO_FREQ; #endif /* * Enum to value table VAL_error_flag * CCDGEN:WriteEnum_Count==72 */ #ifndef __T_VAL_ERROR_FLAG__ #define __T_VAL_ERROR_FLAG__ typedef enum { VALID_BLOCK = 0x0, /* Valid block received */ INVALID_BLOCK = 0x1 /* Invalid block received */ }T_VAL_ERROR_FLAG; #endif /* * Enum to value table VAL_fn * CCDGEN:WriteEnum_Count==73 */ #ifndef __T_VAL_FN__ #define __T_VAL_FN__ typedef enum { VAL_FN__RANGE_MIN = 0x0, /* minimum */ VAL_FN__RANGE_MAX = 0x296fff /* maximum */ }T_VAL_FN; #endif /* * Enum to value table VAL_fn_offset * CCDGEN:WriteEnum_Count==74 */ #ifndef __T_VAL_FN_OFFSET__ #define __T_VAL_FN_OFFSET__ typedef enum { VAL_FN_OFFSET__RANGE_MIN = 0x0, /* minimum */ VAL_FN_OFFSET__RANGE_MAX = 0x296fff /* maximum */ }T_VAL_FN_OFFSET; #endif /* * Enum to value table VAL_hsn * CCDGEN:WriteEnum_Count==75 */ #ifndef __T_VAL_HSN__ #define __T_VAL_HSN__ typedef enum { VAL_HSN__RANGE_MIN = 0x0, /* minimum */ VAL_HSN__RANGE_MAX = 0x3f /* maximum */ }T_VAL_HSN; #endif /* * Enum to value table VAL_maio * CCDGEN:WriteEnum_Count==76 */ #ifndef __T_VAL_MAIO__ #define __T_VAL_MAIO__ typedef enum { VAL_MAIO__RANGE_MIN = 0x0, /* minimum */ VAL_MAIO__RANGE_MAX = 0x3f /* maximum */ }T_VAL_MAIO; #endif /* * Enum to value table VAL_l2_channel * CCDGEN:WriteEnum_Count==77 */ #ifndef __T_VAL_L2_CHANNEL__ #define __T_VAL_L2_CHANNEL__ typedef enum { L2_CHANNEL_SACCH = 0x1, /* SACCH block (MPHC) */ L2_CHANNEL_SDCCH = 0x2, /* SDCCH block (MPHC) */ L2_CHANNEL_FACCH_H = 0x3, /* FACCH half (MPHC) */ L2_CHANNEL_FACCH_F = 0x4, /* FACCH full (MPHC) */ L2_CHANNEL_CCCH = 0x5, /* CCCH block (MPHC) */ L2_CHANNEL_NBCCH = 0x6, /* Normal BCCH block (MPHC) */ L2_CHANNEL_PCH = 0x7, /* PCH block (MPHC) */ L2_CHANNEL_EPCH = 0x8, /* Extended PCH block (MPHC) */ L2_CHANNEL_CBCH = 0x9, /* CBCH block (MPHC) */ L2_CHANNEL_EBCCH = 0xa, /* Extended BCCH (MPHC) */ L2_PCHANNEL_PCCCH = 0x1, /* PCCCH block (MPHP) */ L2_PCHANNEL_PBCCH = 0x2, /* PBCCH block (MPHP) */ L2_PCHANNEL_PPCH = 0x3, /* PPCH block (MPHP) */ L2_PCHANNEL_PEPCH = 0x4, /* PEPCH block (MPHP) */ L2_PCHANNEL_PACCH = 0x5 /* PACCH block (MPHP) */ }T_VAL_L2_CHANNEL; #endif /* * Enum to value table VAL_page_mode * CCDGEN:WriteEnum_Count==78 */ #ifndef __T_VAL_PAGE_MODE__ #define __T_VAL_PAGE_MODE__ typedef enum { PAGE_NORMAL = 0x0, /* Normal paging */ PAGE_EXT = 0x1, /* Extended paging */ PAGE_REORG = 0x2 /* Paging reorganisation */ }T_VAL_PAGE_MODE; #endif /* * Enum to value table VAL_rxlev * CCDGEN:WriteEnum_Count==79 */ #ifndef __T_VAL_RXLEV__ #define __T_VAL_RXLEV__ typedef enum { RXLEV_NO_INT_MEAS = 0x80 /* Specific value used for value of interference level when no measurement has been performed. */ }T_VAL_RXLEV; #endif /* * Enum to value table VAL_timeslot_no * CCDGEN:WriteEnum_Count==80 */ #ifndef __T_VAL_TIMESLOT_NO__ #define __T_VAL_TIMESLOT_NO__ typedef enum { TIMESLOT_NO__RANGE_MIN = 0x0, /* Range of timeslot number */ TIMESLOT_NO__RANGE_MAX = 0x7, /* Range of timeslot number */ CBCH_TIMESLOT__RANGE_MIN = 0x0, /* Range of timeslot number for CBCH */ CBCH_TIMESLOT__RANGE_MAX = 0x3, /* Range of timeslot number for CBCH */ TN_NOT_PRESENT = 0xff /* Value for not present */ }T_VAL_TIMESLOT_NO; #endif /* * Enum to value table VAL_tsc * CCDGEN:WriteEnum_Count==81 */ #ifndef __T_VAL_TSC__ #define __T_VAL_TSC__ typedef enum { VAL_TSC__RANGE_MIN = 0x0, /* minimum */ VAL_TSC__RANGE_MAX = 0x7 /* maximum */ }T_VAL_TSC; #endif /* * enum to UnionController CHN_SEL_CHOICE * CCDGEN:WriteEnum_Count==82 */ #ifndef __T_CTRL_CHN_SEL_CHOICE__ #define __T_CTRL_CHN_SEL_CHOICE__ typedef enum { is_single = 0x0, is_hopping = 0x1 }T_CTRL_CHN_SEL_CHOICE; #endif /* * user defined constants */ #define MAX_MA_CARRIER (0x40) #define MAX_L2_FRAME_SIZE (0x17) #include "CDG_LEAVE.h" #endif