FreeCalypso > hg > tcs211-c139
comparison chipsetsw/services/etm/etm_api.c @ 40:58d50d1f238d
band-aid fix in ETM for the crash on boot (race condition)
author | Mychaela Falconia <falcon@ivan.Harhan.ORG> |
---|---|
date | Thu, 05 Nov 2015 01:31:02 +0000 |
parents | 509db1a7b7b8 |
children | 616f63f3e501 |
comparison
equal
deleted
inserted
replaced
39:acba9be2fc15 | 40:58d50d1f238d |
---|---|
46 | 46 |
47 int etm_register(char name[], int mid, int task_id, T_RVF_ADDR_ID addr_id, ETM_CALLBACK_FUNC callback) | 47 int etm_register(char name[], int mid, int task_id, T_RVF_ADDR_ID addr_id, ETM_CALLBACK_FUNC callback) |
48 { | 48 { |
49 /* Type for a registration event. */ | 49 /* Type for a registration event. */ |
50 T_ETM_REGISTER_REQ *etm_registration_p; | 50 T_ETM_REGISTER_REQ *etm_registration_p; |
51 | |
52 /* | |
53 * FreeCalypso change: the following hack is a band-aid fix | |
54 * for what appears to be a race condition bug that has always | |
55 * been present in TI's TCS211 fw. It appears that some parts | |
56 * of the fw can call etm_register() before ETM has initialized | |
57 * itself, and the call to etm_malloc() below results in a | |
58 * crash. | |
59 */ | |
60 if (!strcmp(name, "TML1")) | |
61 return ETM_AGAIN; | |
51 | 62 |
52 tr_etm(TgTrEtmLow, "ETM API: _register bridge function(%s)", name); | 63 tr_etm(TgTrEtmLow, "ETM API: _register bridge function(%s)", name); |
53 | 64 |
54 /* Allocate the memory for the message to send */ | 65 /* Allocate the memory for the message to send */ |
55 if ((etm_registration_p = (T_ETM_REGISTER_REQ*) etm_malloc(sizeof(T_ETM_REGISTER_REQ))) == NULL) | 66 if ((etm_registration_p = (T_ETM_REGISTER_REQ*) etm_malloc(sizeof(T_ETM_REGISTER_REQ))) == NULL) |