comparison src/g23m-gsm/l1/l1_pei.c @ 110:49254db81128

implemented fix for the L1/ETM boot time race condition bug
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 06 Oct 2016 00:13:12 +0000
parents 267cefdca4b6
children
comparison
equal deleted inserted replaced
109:45ceec943347 110:49254db81128
181 LOCAL SHORT pei_init ( T_HANDLE Handle ) 181 LOCAL SHORT pei_init ( T_HANDLE Handle )
182 #else 182 #else
183 T_PEI_RETURN pei_init (void) 183 T_PEI_RETURN pei_init (void)
184 #endif 184 #endif
185 { 185 {
186 extern int etm_is_running; /* FreeCalypso addition */
187
186 #if defined (NEW_FRAME) 188 #if defined (NEW_FRAME)
187 L1_Handle = Handle; 189 L1_Handle = Handle;
188 #endif 190 #endif
189 191
190 192
262 if ((hCommSNDCP = vsi_c_open (VSI_CALLER SNDCP_NAME)) < VSI_OK) 264 if ((hCommSNDCP = vsi_c_open (VSI_CALLER SNDCP_NAME)) < VSI_OK)
263 return PEI_ERROR; 265 return PEI_ERROR;
264 _osx_open (VSI_CALLER SNDCP_QUEUE, hCommSNDCP); 266 _osx_open (VSI_CALLER SNDCP_QUEUE, hCommSNDCP);
265 } 267 }
266 #endif 268 #endif
269
270 /*
271 * FreeCalypso addition: TI's original code contains a boot time
272 * race condition: if the L1A task starts running before ETM over
273 * in RiViera land has initialized itself, the etm_register() call
274 * at the beginning of l1a_task() that registers L1TM causes a
275 * boot time crash. It appears that this race condition has always
276 * been there, but it has been unmasked when we made a port of R2D
277 * to the Motorola C139 LCD.
278 *
279 * Our solution: we hold off on L1 GPF task startup until ETM
280 * has been initialized, just like we hold off until the message
281 * queues L1 needs to send to have been created.
282 */
283 if (!etm_is_running)
284 return PEI_ERROR;
267 285
268 /* 286 /*
269 * Register VSI_CALLER as generic caller entity. 287 * Register VSI_CALLER as generic caller entity.
270 */ 288 */
271 _osx_open (VSI_CALLER 0, 0); 289 _osx_open (VSI_CALLER 0, 0);