replicode
replicode_defs.h
Go to the documentation of this file.
1 // replicode_defs.h
2 //
3 // Author: Eric Nivel
4 //
5 // BSD license:
6 // Copyright (c) 2010, Eric Nivel
7 // All rights reserved.
8 // Redistribution and use in source and binary forms, with or without
9 // modification, are permitted provided that the following conditions are met:
10 //
11 // - Redistributions of source code must retain the above copyright
12 // notice, this list of conditions and the following disclaimer.
13 // - Redistributions in binary form must reproduce the above copyright
14 // notice, this list of conditions and the following disclaimer in the
15 // documentation and/or other materials provided with the distribution.
16 // - Neither the name of Eric Nivel nor the
17 // names of their contributors may be used to endorse or promote products
18 // derived from this software without specific prior written permission.
19 //
20 // THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
21 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
22 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23 // DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
24 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
26 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
27 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 
31 #ifndef replicode_defs_h
32 #define replicode_defs_h
33 
34 
35 #define EXECUTIVE_DEVICE 0xA1000000
36 
37 
38 #define VIEW_CODE_MAX_SIZE 13 // size of the code of the largest view (grp view) + 1 (oid used by rMems); view set opcode's index is 0.
39 
40 #define VIEW_OPCODE 0
41 #define VIEW_SYNC 1
42 #define VIEW_IJT 2 // iptr to timestamp (+3 atoms)
43 #define VIEW_SLN 3
44 #define VIEW_RES 4
45 #define VIEW_HOST 5
46 #define VIEW_ORG 6
47 #define VIEW_ACT 7
48 #define GRP_VIEW_COV 7
49 #define GRP_VIEW_VIS 8
50 #define VIEW_CTRL_0 10 // for nong-group views, this uint64_t (not atom) may hold control data (ex: cache status).
51 #define VIEW_CTRL_1 11 // idem.
52 #define VIEW_OID 12
53 
54 #define VIEW_ARITY 6
55 #define PGM_VIEW_ARITY 7
56 
57 
58 #define OBJECT_CLASS 0
59 
60 
61 #define GRP_UPR 1
62 #define GRP_SLN_THR 2
63 #define GRP_ACT_THR 3
64 #define GRP_VIS_THR 4
65 #define GRP_C_SLN 5
66 #define GRP_C_SLN_THR 6
67 #define GRP_C_ACT 7
68 #define GRP_C_ACT_THR 8
69 #define GRP_DCY_PER 9
70 #define GRP_DCY_TGT 10
71 #define GRP_DCY_PRD 11
72 #define GRP_DCY_AUTO 12
73 #define GRP_SLN_CHG_THR 13
74 #define GRP_SLN_CHG_PRD 14
75 #define GRP_ACT_CHG_THR 15
76 #define GRP_ACT_CHG_PRD 16
77 #define GRP_AVG_SLN 17
78 #define GRP_HIGH_SLN 18
79 #define GRP_LOW_SLN 19
80 #define GRP_AVG_ACT 20
81 #define GRP_HIGH_ACT 21
82 #define GRP_LOW_ACT 22
83 #define GRP_HIGH_SLN_THR 23
84 #define GRP_LOW_SLN_THR 24
85 #define GRP_SLN_NTF_PRD 25
86 #define GRP_HIGH_ACT_THR 26
87 #define GRP_LOW_ACT_THR 27
88 #define GRP_ACT_NTF_PRD 28
89 #define GRP_NTF_NEW 29
90 #define GRP_LOW_RES_THR 30
91 #define GRP_NTF_GRPS 31
92 #define GRP_ARITY 32
93 
94 
95 #define PGM_TPL_ARGS 1
96 #define PGM_INPUTS 2
97 #define PGM_GUARDS 3
98 #define PGM_PRODS 4
99 #define PGM_ARITY 5
100 
101 
102 #define IPGM_PGM 1
103 #define IPGM_ARGS 2
104 #define IPGM_RUN 3
105 #define IPGM_TSC 4
106 #define IPGM_RES 5
107 #define IPGM_NFR 6
108 #define IPGM_ARITY 7
109 
110 
111 #define ICPP_PGM_NAME 1
112 #define ICPP_PGM_ARGS 2
113 #define ICPP_PGM_RUN 3
114 #define ICPP_PGM_TSC 4
115 #define ICPP_PGM_RES 5
116 #define ICPP_PGM_NFR 6
117 #define ICPP_PGM_ARITY 7
118 
119 
120 #define MK_RDX_CODE 1
121 #define MK_RDX_INPUTS 2
122 #define MK_RDX_PRODS 3
123 #define MK_RDX_ARITY 4
124 
125 #define MK_RDX_IHLP_REF 0
126 #define MK_RDX_MDL_INPUT_REF 1
127 #define MK_RDX_MDL_PRODUCTION_REF 2
128 
129 
130 #define CMD_FUNCTION 1
131 #define CMD_ARGS 2
132 #define CMD_ARITY 3
133 
134 
135 #define VAL_HLD_ARITY 2
136 
137 
138 #define MK_VAL_OBJ 1
139 #define MK_VAL_ATTR 2
140 #define MK_VAL_VALUE 3
141 #define MK_VAL_ARITY 4
142 
143 
144 #define CST_TPL_ARGS 1
145 #define CST_OBJS 2
146 #define CST_FWD_GUARDS 3
147 #define CST_BWD_GUARDS 4
148 #define CST_OUT_GRPS 5
149 #define CST_ARITY 6
150 
151 #define CST_HIDDEN_REFS 1
152 
153 
154 #define MDL_TPL_ARGS 1
155 #define MDL_OBJS 2
156 #define MDL_FWD_GUARDS 3
157 #define MDL_BWD_GUARDS 4
158 #define MDL_OUT_GRPS 5
159 #define MDL_STRENGTH 6
160 #define MDL_CNT 7
161 #define MDL_SR 8
162 #define MDL_DSR 9
163 #define MDL_ARITY 10
164 
165 #define MDL_HIDDEN_REFS 1
166 
167 #define HLP_HIDDEN_REFS 1
168 
169 
170 #define HLP_TPL_ARGS 1
171 #define HLP_OBJS 2
172 #define HLP_FWD_GUARDS 3
173 #define HLP_BWD_GUARDS 4
174 #define HLP_OUT_GRPS 5
175 
176 
177 #define I_HLP_OBJ 1
178 #define I_HLP_TPL_ARGS 2
179 #define I_HLP_ARGS 3
180 #define I_HLP_WR_E 4
181 #define I_HLP_ARITY 5
182 
183 
184 #define FACT_OBJ 1
185 #define FACT_AFTER 2
186 #define FACT_BEFORE 3
187 #define FACT_CFD 4
188 #define FACT_ARITY 5
189 
190 #define FACT_OBJ_REF 0
191 
192 
193 #define PRED_TARGET 1
194 #define PRED_ARITY 2
195 
196 #define PRED_TARGET_REF 0
197 
198 
199 #define GOAL_TARGET 1
200 #define GOAL_ACTR 2
201 #define GOAL_ARITY 3
202 
203 
204 #define SUCCESS_OBJ 1
205 #define SUCCESS_EVD 2
206 #define SUCCESS_ARITY 3
207 
208 
209 #define GRP_PAIR_FIRST 1
210 #define GRP_PAIR_SECOND 2
211 #define GRP_PAIR_ARITY 3
212 
213 
214 #define PERF_RDX_LTCY 1
215 #define PERF_D_RDX_LTCY 2
216 #define PERF_TIME_LTCY 3
217 #define PERF_D_TIME_LTCY 4
218 #define PERF_ARITY 5
219 
220 #endif