comparison src/g23m-fad/rlp/rlp_kers.c @ 179:338bf7edbd47

src/g23m-fad/rlp/rlp_kers.c: workaround for TI's compiler BUG
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 13 Oct 2016 03:14:28 +0000
parents 90eb61ecd093
children
comparison
equal deleted inserted replaced
178:d8197af7e058 179:338bf7edbd47
1153 +------------------------------------------------------------------------------ 1153 +------------------------------------------------------------------------------
1154 */ 1154 */
1155 1155
1156 GLOBAL void sig_rcv_ker_ready_ind(void) 1156 GLOBAL void sig_rcv_ker_ready_ind(void)
1157 { 1157 {
1158 /*
1159 * FreeCalypso: when we tried to compile this code from TCS3.2
1160 * in our TCS211-mimicking Magnetite environment, we hit a BUG
1161 * in TI's compiler, or more precisely, the compiler version used
1162 * in TCS211: compiling this C module would fail as the compiler
1163 * was producing bad assembly which the asm step rejected.
1164 * Analysis of the generated asm showed that the switch table
1165 * and all of the switch case code was omitted, but the reference
1166 * to the switch table was still there, hence asm failing.
1167 *
1168 * The following four volatile char initialized but otherwise unused
1169 * automatic variables constitute the workaround we have added to
1170 * get this C module past the broken compiler. This workaround was
1171 * inspired by the disassembly of the rlp_kers.obj binary object
1172 * from the TCS211 blob library: it appears that TI had applied a
1173 * very similar workaround on their end to get this code past the
1174 * same broken compiler. The generated code we get is not exactly
1175 * the same as what's in the blob, so our recreation of TI's compiler
1176 * workaround is probably inexact, but it does the job of getting
1177 * this C module past the compiler.
1178 */
1179 volatile char bug1 = 'A';
1180 volatile char bug2 = 'B';
1181 volatile char bug3 = 'C';
1182 volatile char bug4 = 0;
1158 1183
1159 TRACE_FUNCTION ("sig_rcv_ker_ready_ind()"); 1184 TRACE_FUNCTION ("sig_rcv_ker_ready_ind()");
1160 1185
1161 switch (GET_STATE (KER)) 1186 switch (GET_STATE (KER))
1162 { 1187 {