annotate src/gpf2/ccd/bitfun.h @ 662:8cd8fd15a095

SIM speed enhancement re-enabled and made configurable TI's original code supported SIM speed enhancement, but Openmoko had it disabled, and OM's disabling of speed enhancement somehow caused certain SIM cards to start working which didn't work before (OM's bug #666). Because our FC community is much smaller in year 2020 than OM's community was in their day, we are not able to find one of those #666-affected SIMs, thus the real issue they had encountered remains elusive. Thus our solution is to re-enable SIM speed enhancement and simply wait for if and when someone runs into a #666-affected SIM once again. We provide a SIM_allow_speed_enhancement global variable that allows SIM speed enhancement to be enabled or disabled per session, and an /etc/SIM_spenh file in FFS that allows it to enabled or disabled on a non-volatile basis. SIM speed enhancement is now enabled by default.
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 24 May 2020 05:02:28 +0000
parents 864b8cc0cf63
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 +-----------------------------------------------------------------------------
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 | Project :
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 | Modul : bitfun.h
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 +-----------------------------------------------------------------------------
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 | Copyright 2002 Texas Instruments Berlin, AG
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 | All rights reserved.
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 |
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 | This file is confidential and a trade secret of Texas
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 | Instruments Berlin, AG
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 | The receipt of or possession of this file does not convey
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 | any rights to reproduce or disclose its contents or to
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 | manufacture, use, or sell anything it may describe, in
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 | whole, or in part, without the specific written consent of
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 | Texas Instruments Berlin, AG.
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 +-----------------------------------------------------------------------------
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 | Purpose : Condat Coder Decoder
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 | Prototypes of the elementary bit manipulation functions
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 +-----------------------------------------------------------------------------
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 */
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 #ifndef __BITFUN
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24 #define __BITFUN
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 #ifndef __BITFUN_C__
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 EXTERN void bf_writePadBits (T_CCD_Globs *globs);
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 EXTERN void bf_writeVal (ULONG value, ULONG bSize, T_CCD_Globs *globs);
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 EXTERN ULONG bf_getBits (ULONG len, T_CCD_Globs *globs);
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 EXTERN void bf_writeBitStr_PER (USHORT len, T_CCD_Globs *globs);
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 EXTERN void bf_readBitStr_PER (USHORT len, T_CCD_Globs *globs);
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 EXTERN void bf_writeBits (ULONG len, T_CCD_Globs *globs);
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 EXTERN void bf_readBits (ULONG len, T_CCD_Globs *globs);
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 EXTERN void bf_writeBitChunk (ULONG len, T_CCD_Globs *globs);
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 EXTERN void bf_readBitChunk (ULONG len, T_CCD_Globs *globs);
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 EXTERN BOOL bf_readBit (T_CCD_Globs *globs);
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 EXTERN void bf_writeBit (BOOL Bit, T_CCD_Globs *globs);
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 EXTERN UBYTE bf_decodeByteNumber (const ULONG len, T_CCD_Globs *globs);
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 EXTERN ULONG bf_decodeShortNumber (const ULONG len, T_CCD_Globs *globs);
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 EXTERN ULONG bf_decodeLongNumber (UBYTE len, T_CCD_Globs *globs);
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 EXTERN void bf_codeShortNumber (UBYTE len, USHORT val, T_CCD_Globs *globs);
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 EXTERN void bf_codeByteNumber (UBYTE len, UBYTE val, T_CCD_Globs *globs);
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 EXTERN void bf_codeLongNumber (UBYTE len, ULONG val, T_CCD_Globs *globs);
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 EXTERN void bf_recodeShortNumber (USHORT pos, UBYTE len, USHORT val, T_CCD_Globs *globs);
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 EXTERN void bf_recodeByteNumber (USHORT pos, UBYTE len, UBYTE val, T_CCD_Globs *globs);
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 EXTERN void bf_recodeBit (USHORT pos, UBYTE Bit, T_CCD_Globs *globs);
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 EXTERN void bf_rShift8Bit (USHORT srcBitPos, USHORT bitLen, T_CCD_Globs *globs);
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 #endif /* __BITFUN_C__ */
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 /* a Macro for incrementing the position in the bitbuffer */
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 /* _bitpos, _bytepos and _byteoffs are recalculated */
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 #define bf_incBitpos(A, globs) globs->bitpos = (USHORT)(globs->bitpos+(A));\
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 globs->bytepos = (USHORT)(globs->bitpos >> 3);\
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 globs->byteoffs = (UBYTE)(globs->bitpos & 7)
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 #define bf_setBitpos(A, globs) globs->bitpos = (USHORT)(A);\
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 globs->bytepos = (USHORT)(globs->bitpos >> 3);\
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 globs->byteoffs = (UBYTE)(globs->bitpos & 7)
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 /*
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 * end of bitstream if we can not read almost 4 bits
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 */
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 #define bf_endOfBitstream(globs) (globs->bitpos >= globs->maxBitpos)
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67
864b8cc0cf63 src/gpf2: preened GPF goo from TCS211
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 #endif