annotate src/condat/com/include/gsm.h @ 75:6738273be0b3

Nucleus gcc assembly modules compile
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 20 Jul 2018 05:51:53 +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 : GSM-PS (6147)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 | Modul : GSM
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 : Definition of global constants, types, and macros
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 | for the GSM 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 GSM_H
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23 #define GSM_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 #ifndef CCONST_CDG
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 #include "mconst.cdg" /* MAX_BITSTREAM_LEN */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 #endif /* CCONST_CDG */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 #ifndef PCONST_CDG
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 #include "pconst.cdg" /* MAX_PSTRUCT_LEN */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
30 #endif /* PCONST_CDG */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
31
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 /*==== CONSTANTS ==================================================*/
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 #define MAX_2_PRM 1
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 #define MAX_4_PRM 3
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36 #define MAX_8_PRM 7
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 #define MAX_16_PRM 15
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 #define MAX_32_PRM 31
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 #define PRM_MASK 0x00FF /* protocol primitive mask*/
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 #define OPC_MASK 0xFF00 /* entity mask */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42 #define SYS_MASK 0x8000 /* system primitive mask */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 #define SYS_CONFIG_REQ 0xF000
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 #define L3_CODING_OFFSET 32 /* coding offset in bits */
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 /*
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 * Not Present Value
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 #define NOT_PRESENT_8BIT 0xFF
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 #define NOT_PRESENT_CHAR (CHAR)0xFF
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 #define NOT_PRESENT_16BIT 0xFFFF
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 #define NOT_PRESENT_32BIT 0xFFFFFFFFL
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 #define INVALID_ADDRESS 0xFFFFFFFFL
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 #define SET_NOT_PRESENT(A) ((A) = ((sizeof ((A)) EQ 1)\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 ? NOT_PRESENT_8BIT\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 : (sizeof ((A)) EQ 2)\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 ? NOT_PRESENT_16BIT\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 : NOT_PRESENT_32BIT))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 #define IS_PRESENT(A) ((A) NEQ ((sizeof ((A)) EQ 1)\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 ? NOT_PRESENT_8BIT\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 : (sizeof ((A)) EQ 2)\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 ? NOT_PRESENT_16BIT\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 : NOT_PRESENT_32BIT)) /* VK 09-12-96 */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69 #ifndef NEW_FRAME
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 * Static Configurations
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 #ifndef TC_FUNC
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 #define TC_FUNC 1
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 #ifdef TRACE_FKT
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 #define TRACE_FUNCTION(a) vsi_o_trace(VSI_CALLER TC_FUNC,a);
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 #else
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 // China change HM 6.07.00, one of this commented out
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82 #define TRACE_FUNCTION(a)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 //#define TRACE_FUNCTION(a) vsi_o_mtrace(a);
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 #endif
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 #ifndef TC_EVE
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 #define TC_EVE 2
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 #endif
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 #ifdef TRACE_EVE
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
91 #define TRACE_EVENT(a) vsi_o_trace(VSI_CALLER TC_EVENT,a);
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
92 #else
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 #define TRACE_EVENT(a)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
95
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
96 #ifndef TC_ERROR
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
97 #define TC_ERROR 4
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
98 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
99 #ifdef TRACE_ERR
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
100 #define TRACE_ERROR(a) vsi_o_trace(VSI_CALLER TC_ERROR,a);
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
101 #else
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
102 #define TRACE_ERROR(a)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
103 #endif
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 #ifndef TC_PRIM
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
106 #define TC_PRIM 8
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
107 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
108
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
109 #ifdef TRACE_PRIM
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
110 #define TRACE_PRIMITIVE(a) vsi_o_trace(VSI_CALLER TC_PRIM,a);
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
111 #else
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
112 #define TRACE_PRIMITIVE(a)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
113 #endif
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 #ifndef TC_SYSTEM
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
116 #define TC_SYSTEM 16
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
117 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
118
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
119 /*
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
120 * Assert wrapper
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
121 */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
122
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
123 #if defined NDEBUG
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
124 #define TRACE_ASSERT(e) ((void)0)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
125 #else
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
126 #ifdef SHARED_VSI
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
127 #define TRACE_ASSERT(e) if ( !(e) ) vsi_o_assert("",#e,__FILE__,__LINE__)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
128 #else
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
129 #define TRACE_ASSERT(e) if ( !(e) ) vsi_o_assert(#e,__FILE__,__LINE__)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
130 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
131 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
132
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
133 #ifdef assert
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
134 #undef assert
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
135 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
136 #define assert TRACE_ASSERT
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
137
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
138 #endif /* NEW_FRAME */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
139
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
140 /*
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
141 * Memory Management(I)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
142 */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
143
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
144 #ifdef OPTION_REF
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
145 #define FREE_BUFFER(p) vsi_c_free(VSI_CALLER (void **)&p)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
146 /*lint -e773 Expression-like macro not parenthesized*/
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
147 #define NEW_BUFFER(p,s) T_PRIM *p = vsi_c_new(VSI_CALLER (T_VSI_CSIZE)((s)+sizeof(T_PRIM_HEADER)))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
148 /*lint +e773*/
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
149 #else
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
150 #define FREE_BUFFER(p)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
151 #define NEW_BUFFER(p,s) UBYTE buf_##p [(s)+sizeof(T_PRIM_HEADER)]; T_PRIM *p=(T_PRIM*)p1
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
152 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
153
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
154 #if !defined (_TMS470)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
155 #define Sprintf sprintf
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
156 #else
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
157 int sprintf( char *buffer, const char *format, ... );
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
158 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
159
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
160 #ifndef NEW_FRAME
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
161
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
162 #ifdef _TMS470
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
163 #define SET_PRIM_OPCODE(P,O) P->custom.opc = O; P->custom.opc2 = 0
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
164 #else
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
165 #define SET_PRIM_OPCODE(P,O) P->custom.opc = O
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
166 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
167
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
168 #ifdef OPTION_LENGTH
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
169 #define SEND_PRIM(E,P,O,T) SET_PRIM_OPCODE (P,O); vsi_c_send (VSI_CALLER hComm##E, P, sizeof(T_PRIM_HEADER) + sizeof (T))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
170 #define SEND_PRIM_0(E,P,O) SET_PRIM_OPCODE (P,O); vsi_c_send (VSI_CALLER hComm##E, P, sizeof(T_PRIM_HEADER))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
171 #define SEND_PRIM_SDU(E,P,O,T,L) SET_PRIM_OPCODE (P,O); vsi_c_send (VSI_CALLER hComm##E, P, (T_VSI_CSIZE) (sizeof(T_PRIM_HEADER) + sizeof (T) + (L) - SDU_TRAIL))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
172 #else
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
173 #define SEND_PRIM(E,P,O,T) SET_PRIM_OPCODE (P,O); vsi_c_send (VSI_CALLER hComm##E, P, sizeof(T_PRIM_HEADER) + sizeof (T))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
174 #define SEND_PRIM_0(E,P,O) SET_PRIM_OPCODE (P,O); vsi_c_send (VSI_CALLER hComm##E, P, sizeof(T_PRIM_HEADER))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
175 #define SEND_PRIM_SDU(E,P,O,T,L) SET_PRIM_OPCODE (P,O); vsi_c_send (VSI_CALLER hComm##E, P, (T_VSI_CSIZE) (sizeof(T_PRIM_HEADER) + sizeof (T) + (L) - SDU_TRAIL))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
176 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
177
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
178 #endif /* NEW_FRAME */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
179 /*
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
180 * declares a pointer variable (D) of the type T
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
181 * and initialize it with the startaddress of the data part
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
182 * of the primitive P
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
183 */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
184 #ifndef ALLOC_CHECK
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
185 #if defined (_TMS470) AND defined (NWARN)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
186 #define PRIM_ACCESS(P,S) &P->data
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
187 #else
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
188 #define PRIM_ACCESS(P,S) P->data
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
189 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
190 #else
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
191 #define PRIM_ACCESS(P,S) vsi_c_access(VSI_CALLER P,S)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
192 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
193 /*lint -e773 Expression-like macro not parenthesized*/
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
194 #define PRIM_CAST(P,D,T) T *D = (T *) PRIM_ACCESS (P, sizeof (T))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
195 /*lint +e773*/
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
196 /*
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
197 * declares a pointer variable (D) of the type T and
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
198 * initialize it with the start address of the global declared
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
199 * buffer _decodedMsg[] wich contains the decoded message
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
200 * structure before encoding or after decoding the message
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
201 * with CCD.
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
202 */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
203 /*lint -e773 Expression-like macro not parenthesized*/
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
204 #define MSG_CAST(D,T) T *D = (T *) _decodedMsg
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
205 /*lint +e773*/
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
206 /*
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
207 * Memory Management(II)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
208 */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
209
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
210 #ifndef NEW_FRAME
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
211
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
212 #if defined (_TMS470) AND defined (NWARN)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
213 #define P2D(P) (&(P)->data)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
214 #else
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
215 #define P2D(P) ((P)->data)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
216 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
217 #define D2P(D) ((T_PRIM*)((T_PRIM_HEADER*)(D)-1))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
218
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
219 #ifdef ALLOC_CHECK
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
220 #define P2D_AC(P,T) PRIM_ACCESS(P,sizeof(T))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
221 #else
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
222 #define P2D_AC(P,T) P2D(P)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
223 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
224
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
225 #define PRIM_TO_DATA P2D
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
226 #define DATA_TO_PRIM D2P
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
227
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
228 #define P_OPC(P) (P)->custom.opc
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
229 #define P_OPC2(P) (P)->custom.opc2
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
230 #define P_LEN(P) (P)->custom.len
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
231 #define P_TID(P) (P)->custom.tid
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
232 #define P_SDU(P) (P)->custom.sdu
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
233
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
234 #define D_OPC(D) P_OPC(D2P(D))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
235 #define D_OPC2(D) P_OPC2(D2P(D))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
236 #define D_LEN(D) P_LEN(D2P(D))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
237 #define D_TID(D) P_TID(D2P(D))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
238 #define D_SDU(D) P_SDU(D2P(D))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
239
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
240 #define D_SDU_LEN(D) D_SDU(D)->l_buf
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
241 #define D_SDU_OFF(D) D_SDU(D)->o_buf
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
242
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
243 #define BITS_PER_BYTE 8
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
244 #define BYTELEN(BITLEN) ((BITLEN)<=0?0:((((BITLEN)-1)/BITS_PER_BYTE)+1))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
245
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
246 #define PRIM_SIZE(D) (sizeof(T_PRIM_HEADER)+sizeof(*(D)))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
247 #define PRIM_SIZE_SDU(D) (PRIM_SIZE(D)+BYTELEN((D)->sdu.o_buf+(D)->sdu.l_buf))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
248
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
249 #define PSIZE(D) (D_LEN(D)+((D_SDU(D)==0)?0:(BYTELEN(D_SDU_LEN(D)+D_SDU_OFF(D))-SDU_TRAIL)))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
250
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
251 #define SIZ(T) (sizeof(T_PRIM_HEADER)+sizeof(T))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
252
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
253 #define SIZ_SDU(T,M) (SIZ(T)+BYTELEN((M)+ENCODE_OFFSET)-SDU_TRAIL)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
254
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
255 #define P_ALL(T) (T_PRIM *) vsi_c_new(VSI_CALLER (T_VSI_CSIZE)SIZ(T) )
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
256 #define P_ALL_SDU(T,M) (T_PRIM *) vsi_c_new(VSI_CALLER (T_VSI_CSIZE)SIZ_SDU(T,M))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
257
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
258 #endif /* NEW_FRAME */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
259
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
260 #define OFFSETOF(P,C) ((char*)&(P->C) - (char*)P)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
261
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
262 #ifdef NTRACE
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
263 #define xxxNotify(A,B,C,D,E)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
264 #else
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
265 #define xxxNotify(A,B,C,D,E) /* not used yet */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
266 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
267
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
268
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
269 #define ACT_PALLOC 0x01
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
270 #define ACT_PALLOC_SDU 0x02
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
271 #define ACT_PALLOC_MSG 0x03
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
272 #define ACT_PREUSE 0x04
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
273 #define ACT_PREUSE_SDU 0x05
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
274 #define ACT_PREUSE_MSG 0x06
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
275 #define ACT_PFREE 0x07
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
276 #define ACT_PSEND 0x08
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
277 #define ACT_PSTORE 0x09
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
278 #define ACT_PRETRIEVE 0x0A
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
279 #define ACT_PACCESS 0x0B
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
280 #define ACT_PPASS 0x0C
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
281 #define ACT_PCAST 0x0D
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
282
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
283 /*** memory alloction ***/
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
284
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
285
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
286 #ifndef NEW_FRAME
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
287
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
288 #define PSENDX PSEND
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
289
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
290 #define PALLOC(D,T) T_##T *D = (T_##T*)P2D(P_ALL(T_##T));\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
291 D_OPC(D) = (T);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
292 D_OPC2(D) = 0;\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
293 D_LEN(D) = SIZ(T_##T);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
294 D_SDU(D) = 0;\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
295 xxxNotify(ACT_PALLOC,VSI_CALLER,__FILE__,__LINE__,D2P(D))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
296
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
297 #define PALLOC_MSG(D,T,M) T_##T *D = (T_##T*)P2D(P_ALL_SDU(T_##T,BSIZE_##M));\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
298 D_OPC(D) = (T);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
299 D_OPC2(D) = 0;\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
300 D_LEN(D) = SIZ(T_##T);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
301 D_SDU(D) = &((D)->sdu);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
302 D_SDU_LEN(D) = (BSIZE_##M);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
303 D_SDU_OFF(D) = ENCODE_OFFSET;\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
304 xxxNotify(ACT_PALLOC_MSG,VSI_CALLER,__FILE__,__LINE__,D2P(D))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
305
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
306 #define PALLOC_SDU(D,T,N) T_##T *D = (T_##T*)P2D(P_ALL_SDU(T_##T,N));\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
307 D_OPC(D) = (T);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
308 D_OPC2(D) = 0;\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
309 D_LEN(D) = SIZ(T_##T);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
310 D_SDU(D) = &((D)->sdu);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
311 D_SDU_LEN(D) = (N);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
312 D_SDU_OFF(D) = ENCODE_OFFSET;\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
313 xxxNotify(ACT_PALLOC_SDU,VSI_CALLER,__FILE__,__LINE__,D2P(D))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
314
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
315 #define PREUSE(D0,D,T) T_##T *D = (T_##T*)P2D_AC(D2P(D0),T);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
316 D_OPC(D) = (T);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
317 D_OPC2(D) = 0;\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
318 D_LEN(D) = SIZ(T_##T);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
319 D_SDU(D) = 0;\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
320 xxxNotify(ACT_REUSE,VSI_CALLER,__FILE__,__LINE__,D2P(D))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
321
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
322 #define PREUSE_MSG(D,T,M) T_##T *D = (T_##T*)P2D_AC(D2P(D0),T);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
323 D_OPC(D) = (T);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
324 D_OPC2(D) = 0;\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
325 D_LEN(D) = SIZ(T_##T);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
326 D_SDU(D) = &((D)->sdu);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
327 D_SDU_LEN(D) = (BSIZE_##M);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
328 D_SDU_OFF(D) = ENCODE_OFFSET;\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
329 xxxNotify(ACT_PREUSE_MSG,VSI_CALLER,__FILE__,__LINE__,D2P(D))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
330
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
331 #define PREUSE_SDU(D,T,N) T_##T *D = (T_##T*)P2D_AC(D2P(D0),T);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
332 USHORT BSIZE_##N;\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
333 D_OPC(D) = (T);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
334 D_OPC2(D) = 0;\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
335 D_LEN(D) = SIZ(T_##T);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
336 D_SDU(D) = &((D)->sdu);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
337 D_SDU_LEN(D) = (N);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
338 D_SDU_OFF(D) = ENCODE_OFFSET;\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
339 xxxNotify(ACT_PREUSE_SDU,VSI_CALLER,__FILE__,__LINE__,D2P(D))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
340
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
341 #define PFREE(D) { void *z=(void*)D2P(D);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
342 vsi_c_free(VSI_CALLER (void **)&z);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
343 xxxNotify(ACT_PFREE,VSI_CALLER,__FILE__,__LINE__,D2P(D)); }
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
344
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
345 #define PSEND(E,D) PTRACE_OUT(D_OPC(D));\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
346 vsi_c_send (VSI_CALLER hComm##E, D2P(D), (T_VSI_CSIZE) PSIZE(D));\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
347 xxxNotify(ACT_PSEND,VSI_CALLER,__FILE__,__LINE__,D2P(D))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
348
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
349 #define PPASS(D0,D,T) T_##T *D = (T_##T*)P2D_AC(D2P(D0),T);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
350 D_OPC(D) = (T);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
351 xxxNotify(ACT_PPASS,VSI_CALLER,__FILE__,__LINE__,D2P(D))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
352
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
353 #define PACCESS(D) xxxNotify(ACT_PACCESS,VSI_CALLER,__FILE__,__LINE__,D2P(D))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
354
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
355
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
356 #endif /* NEW_FRAME */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
357
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
358 /*
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
359 * to achieve backward compatibility
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
360 */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
361
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
362 #if defined (NEW_FRAME)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
363 #ifdef TI_PS_HCOMM_CHANGE
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
364 #define PSENDX(A,B) PSEND(_hComm##A,B)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
365 #define _hCommACI hCommACI
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
366 #else
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
367 #define PSENDX(A,B) PSEND(hComm##A,B)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
368 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
369 #else
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
370 #define PSENDX PSEND
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
371 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
372
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
373
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
374
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
375 #define PRETRIEVE /* NOT DEFINED YET */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
376
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
377
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
378 #define MCAST(D,T) MSG_CAST(D,T_##T)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
379 #define PCAST(P,D,T) T_##T *D = (T_##T*)P2D_AC(P,T);\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
380 P_OPC(P)=T;\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
381 xxxNotify(ACT_PCAST,VSI_CALLER,__FILE__,__LINE__,D2P(D))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
382
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
383 #define PCOPY(DEST,SOURCE) memcpy(DEST,SOURCE,PSIZE(SOURCE)-sizeof(T_PRIM_HEADER))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
384
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
385 /*** trace primitive, trace state ***/
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
386
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
387 #ifndef NEW_FRAME
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
388
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
389 #ifdef NTRACE
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
390
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
391 #define SET_STATE(PROCESS,STATE) ENTITY_DATA->state[PROCESS] = STATE
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
392 #define GET_STATE(PROCESS) ENTITY_DATA->state[PROCESS]
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
393
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
394 #define PTRACE_IN(OPC)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
395 #define PTRACE_OUT(OPC)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
396
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
397 #else
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
398
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
399 #define SET_STATE(PROCESS,STATE)\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
400 ENTITY_DATA->state[PROCESS] =\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
401 vsi_o_strace (VSI_CALLER\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
402 PROCESS_NAME[PROCESS],\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
403 PROCESS##_NAME [ ENTITY_DATA->state[PROCESS] ],\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
404 PROCESS##_NAME [ STATE ],\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
405 STATE )
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
406
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
407 #define GET_STATE(PROCESS)\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
408 vsi_o_strace (VSI_CALLER\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
409 PROCESS_NAME[PROCESS],\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
410 PROCESS##_NAME [ ENTITY_DATA->state[PROCESS] ],\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
411 NULL ,\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
412 ENTITY_DATA->state[PROCESS] )
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
413
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
414 #define PTRACE_IN(OPC) vsi_o_ptrace (VSI_CALLER OPC, 0)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
415 #define PTRACE_OUT(OPC) vsi_o_ptrace (VSI_CALLER OPC, 1)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
416
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
417 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
418
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
419 #endif /* NEW_FRAME */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
420 /*
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
421 * Timer, Jump Table, Configuration
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
422 */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
423
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
424 #ifdef OPTION_TIMER
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
425 #define TSTART(i,h,v) tim_start_timer(i,h,v)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
426 #else
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
427 #define TSTART(i,h,v) TIMER_START(VSI_CALLER h,v)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
428 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
429
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
430 #ifdef OPTION_RELATIVE
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
431 #define JUMP(a) (a+offset)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
432 #else
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
433 #define JUMP(a) (a)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
434 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
435
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
436 #ifdef OPTION_SET_CONFIG_ONLY
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
437 #define GET_CONFIG(s,i)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
438 #else
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
439 #define GET_CONFIG(s,i) pei_get_config(s,i)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
440 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
441
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
442 /* Cause Concept (begin) */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
443 /*
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
444 * For a definition of the cause concept please refer to document number
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
445 * 8443.711, named in February 2002 "cause_concept.doc"
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
446 */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
447
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
448 /* definitions for calling the macros */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
449 /* DefinedBy bit */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
450 #define DEFBY_STD 0
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
451 #define DEFBY_CONDAT 1
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
452 /* OriginatingSide bit */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
453 #define ORIGSIDE_NET 0
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
454 #define ORIGSIDE_MS 1
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
455 /*
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
456 * note that OriginatingEntity definitions are in the SAP GSMCOM, which is a
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
457 * central (pseudo) SAP and the definitions are referenced in the using
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
458 * "real" SAPs, like e.g. MNSS SAP for the originating entity SS
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
459 */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
460
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
461 /* need to decide whether to mask ORIGIN_ENTITY (max. 6 bits) in the following macro */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
462 #define CAUSE_MAKE(DEFINED_BY, ORIGIN_SIDE, ORIGIN_ENTITY, CAUSE_VALUE) \
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
463 (USHORT)(((CAUSE_VALUE) & 0x00FF) |\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
464 ((DEFINED_BY) << 15) |\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
465 ((ORIGIN_SIDE) << 14) |\
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
466 ((ORIGIN_ENTITY) << 8))
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
467
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
468 /* Get the cause value without the originating entity */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
469 #define GET_CAUSE_VALUE(cause) (UBYTE)((cause) & 0xFF)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
470
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
471 /* Get the entity originating the cause */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
472 #define GET_CAUSE_ORIGIN_ENTITY(cause) (UBYTE)(((cause) >> 8) & 0x3F)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
473
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
474 /* Get the DefinedBy bit */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
475 #define GET_CAUSE_DEFBY(cause) (UBYTE)((cause) >> 15)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
476
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
477 /* Get the OriginatingSide bit */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
478 #define GET_CAUSE_ORIGSIDE(cause) (UBYTE)(((cause) >> 14) & 0x01)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
479
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
480 /* Determine if a cause is invalid */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
481 #define IS_CAUSE_INVALID(cause) (((cause) & 0x80FF) EQ 0x80FF)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
482
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
483 /* Cause Concept (end) */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
484
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
485
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
486 /*==== TYPES ======================================================*/
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
487 #if defined (_TMS470) && defined (NWARN)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
488 typedef struct
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
489 {
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
490 UBYTE x [MAX_PSTRUCT_LEN
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
491 + (
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
492 L3_CODING_OFFSET
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
493 + MAX_BITSTREAM_LEN
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
494 ) / 8 + 1
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
495 ];
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
496 } T_PARAMETER;
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
497
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
498 typedef struct
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
499 {
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
500 T_PRIM_HEADER custom;
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
501 T_PARAMETER data;
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
502 } T_PRIM;
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
503 #else
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
504 typedef struct
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
505 {
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
506 T_PRIM_HEADER custom;
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
507 UBYTE data [MAX_PSTRUCT_LEN
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
508 + (
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
509 L3_CODING_OFFSET
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
510 + MAX_BITSTREAM_LEN
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
511 ) / 8 + 1
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
512 ];
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
513 } T_PRIM;
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
514 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
515
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
516 /*==== EXPORT =====================================================*/
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
517
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
518
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
519
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
520 /*
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
521 * Multithreading
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
522 */
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
523
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
524
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
525
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
526 #ifdef OPTION_MULTITHREAD
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
527 #if defined (ENTITY_CST)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
528 #define _ENTITY_PREFIXED(N) cst_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
529 #elif defined (ENTITY_ACI)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
530 #define _ENTITY_PREFIXED(N) aci_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
531 #elif defined (ENTITY_MFW)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
532 #define _ENTITY_PREFIXED(N) aci_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
533 #elif defined (ENTITY_MMI)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
534 #define _ENTITY_PREFIXED(N) aci_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
535 #elif defined (ENTITY_SMI)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
536 #define _ENTITY_PREFIXED(N) aci_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
537 #elif defined (ENTITY_SIM)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
538 #define _ENTITY_PREFIXED(N) sim_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
539 #elif defined (ENTITY_PL)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
540 #define _ENTITY_PREFIXED(N) pl_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
541 #elif defined (ENTITY_L1)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
542 #define _ENTITY_PREFIXED(N) l1_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
543 #elif defined (ENTITY_CC)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
544 #define _ENTITY_PREFIXED(N) cc_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
545 #elif defined (ENTITY_SS)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
546 #define _ENTITY_PREFIXED(N) ss_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
547 #elif defined (ENTITY_ESIM)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
548 #define _ENTITY_PREFIXED(N) esim_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
549 #elif defined (ENTITY_SMS)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
550 #define _ENTITY_PREFIXED(N) sms_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
551 #elif defined (ENTITY_MM)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
552 #define _ENTITY_PREFIXED(N) mm_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
553 #elif defined (ENTITY_RR)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
554 #define _ENTITY_PREFIXED(N) rr_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
555 #elif defined (ENTITY_DL)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
556 #define _ENTITY_PREFIXED(N) dl_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
557 #elif defined (ENTITY_L2R)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
558 #define _ENTITY_PREFIXED(N) l2r_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
559 #elif defined (ENTITY_TRA)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
560 #define _ENTITY_PREFIXED(N) tra_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
561 #elif defined (ENTITY_RLP)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
562 #define _ENTITY_PREFIXED(N) rlp_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
563 #elif defined (ENTITY_T30)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
564 #define _ENTITY_PREFIXED(N) t30_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
565 #elif defined (ENTITY_FAD)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
566 #define _ENTITY_PREFIXED(N) fad_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
567 #elif defined (ENTITY_RA)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
568 #define _ENTITY_PREFIXED(N) ra_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
569 #elif defined (ENTITY_WAP)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
570 #define _ENTITY_PREFIXED(N) wap_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
571 #elif defined (ENTITY_UDP)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
572 #define _ENTITY_PREFIXED(N) udp_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
573 #elif defined (ENTITY_IP)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
574 #define _ENTITY_PREFIXED(N) ip_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
575 #elif defined (ENTITY_RRLP)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
576 #define _ENTITY_PREFIXED(N) rrlp_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
577 #elif defined (ENTITY_PPP)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
578 #define _ENTITY_PREFIXED(N) ppp_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
579 #elif defined (ENTITY_BTI)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
580 #define _ENTITY_PREFIXED(N) bti_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
581 #elif defined (ENTITY_L1)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
582 #ifdef NEW_FRAME
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
583 #include "ofe.h"
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
584 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
585 #elif defined (ENTITY_TAP)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
586 #define _ENTITY_PREFIXED(N) tap_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
587 #elif defined (ENTITY_PCO)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
588 #define _ENTITY_PREFIXED(N) pco_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
589 #elif defined (ENTITY_PAN)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
590 #define _ENTITY_PREFIXED(N) pan_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
591 #elif defined (ENTITY_TST)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
592 #define _ENTITY_PREFIXED(N) tst_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
593 #elif defined (ENTITY_APP)
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
594 #define _ENTITY_PREFIXED(N) app_##N
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
595 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
596 #endif
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
597
6e457872f745 src/condat: hybrid import from Magnetite
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
598 #endif