annotate src/condat/com/inc/macdef.h @ 134:7d50d8d13711

FFS code sync with Magnetite + gcc version fix This change brings the new flash autodetection for FC and Pirelli targets from Magnetite, and should also fix the gcc version for C1xx and gtamodem targets, which were previously broken because they used TI's original flash autodetect code (which operates at address 0) while the boot ROM is mapped there.
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 11 Dec 2018 08:43:25 +0000
parents 6e457872f745
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 +-----------------------------------------------------------------------------
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 | Project :
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 | Modul :
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 +-----------------------------------------------------------------------------
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 | Copyright 2002 Texas Instruments Berlin, AG
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7 | All rights reserved.
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 |
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 | This file is confidential and a trade secret of Texas
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 | Instruments Berlin, AG
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 | The receipt of or possession of this file does not convey
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 | any rights to reproduce or disclose its contents or to
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13 | manufacture, use, or sell anything it may describe, in
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 | whole, or in part, without the specific written consent of
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 | Texas Instruments Berlin, AG.
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 +-----------------------------------------------------------------------------
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 | Purpose : Contains macros for the unified implementation of the
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 | Protocol Stack
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 +-----------------------------------------------------------------------------
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 #ifndef MACDEF_H
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 #define MACDEF_H
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
24
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 /*
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 * Get/Set state for one incarnation. Init state has to be called first.
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 #undef GET_STATE
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 #undef SET_STATE
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31 #ifdef TRACE_STATE
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 #define INIT_STATE(P,S) ENTITY_DATA->P name = SERVICE_NAME_##P; \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 ENTITY_DATA->P state = S; \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 ENTITY_DATA->P state_name = #S;
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 #define SET_STATE(P,S) {ENTITY_DATA->P state = S; \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 vsi_o_ttrace (VSI_CALLER \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 TC_STATE, \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 #P ":%s -> " #S, \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 ENTITY_DATA->P state_name ); \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 ENTITY_DATA->P state_name = #S;}
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 #define GET_STATE(P) (vsi_o_ttrace (VSI_CALLER \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 TC_STATE, \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 #P ":%s", ENTITY_DATA->P state_name ), \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 ENTITY_DATA->P state)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 #else
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 #define INIT_STATE(P,S) {ENTITY_DATA->P state = S;}
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 #define SET_STATE(P,S) {ENTITY_DATA->P state = S;}
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 #define GET_STATE(P) (ENTITY_DATA->P state)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 #endif /* TRACE_STATE */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 /*
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 * MFREE_DESC() is used to free the given descriptor, along with all following
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 * descriptors.
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 *
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 * Parameters: d -- "pointer" to the descriptor, either of type T_desc *, or
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 * an ULONG
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62 #define MFREE_DESC(d) { T_desc *desc = (T_desc *)d; \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 T_desc *next_desc; \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 while (desc NEQ NULL) \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 { \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 next_desc = (T_desc *)desc->next; \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 MFREE (desc); \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 desc = next_desc; \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 } \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 }
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73 /*
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 * PFREE_DESC() is used to free the given primitive, along with all
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 * descriptors in the descriptor list of the primitive.
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 *
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 * Parameters: p -- pointer to the primitive containing a descriptor list
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 * (if it is an ULONG, it has to be casted to the pointer
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 * because the type cannot be determined by the macro!)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 #define PFREE_DESC(p) { MFREE_DESC ((p)->desc_list.first); \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82 PFREE ((p)); \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 }
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 /*
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 * MFREE_DESC() is used to free the given descriptor, along with all following
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 * descriptors.
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89 *
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 * Parameters: d -- "pointer" to the descriptor, either of type T_desc *, or
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 * an ULONG
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92 */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 #define MFREE_DESC2(d) { T_desc2 *desc2 = (T_desc2 *)d; \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94 T_desc2 *next_desc2; \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95 while (desc2 NEQ NULL) \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96 { \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 next_desc2 = (T_desc2 *)desc2->next; \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98 MFREE (desc2); \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 desc2 = next_desc2; \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 } \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101 }
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
104 /*
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
105 * PFREE_DESC() is used to free the given primitive, along with all
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106 * descriptors in the descriptor list of the primitive.
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107 *
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108 * Parameters: p -- pointer to the primitive containing a descriptor list
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 * (if it is an ULONG, it has to be casted to the pointer
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110 * because the type cannot be determined by the macro!)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111 */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 #define PFREE_DESC2(p) { MFREE_DESC2 ((p)->desc_list2.first); \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 PFREE ((p)); \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
114 }
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
115
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117 #endif /* !MACDEF_H */