2 * Copyright (C) 2010 Marcin KoĆcielnicki <koriakin@0x04.net>
3 * Copyright (C) 2010 Luca Barbieri <luca@luca-barbieri.com>
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice (including the next
14 * paragraph) shall be included in all copies or substantial portions of the
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
45 struct rnnauthor
**authors
;
51 struct rnncopyright copyright
;
52 struct rnnenum
**enums
;
55 struct rnnbitset
**bitsets
;
58 struct rnndomain
**domains
;
61 struct rnngroup
**groups
;
64 struct rnnspectype
**spectypes
;
74 struct rnnenum
*venum
;
83 struct rnnenum
*prefenum
;
85 struct rnnvarset
**varsets
;
94 struct rnnvarinfo varinfo
;
95 struct rnnvalue
**vals
;
107 struct rnnvarinfo varinfo
;
116 RNN_TTYPE_INLINE_ENUM
,
117 RNN_TTYPE_INLINE_BITSET
,
128 RNN_TTYPE_A3XX_REGID
,
130 struct rnnenum
*eenum
;
131 struct rnnbitset
*ebitset
;
132 struct rnnspectype
*spectype
;
133 struct rnnbitfield
**bitfields
;
136 struct rnnvalue
**vals
;
140 uint64_t min
, max
, align
, radix
;
142 int minvalid
, maxvalid
, alignvalid
, radixvalid
;
145 static inline uint64_t typeinfo_mask(struct rnntypeinfo
*ti
)
148 return -(1ULL << ti
->low
);
150 return (1ULL << (ti
->high
+ 1)) - (1ULL << ti
->low
);
157 struct rnnvarinfo varinfo
;
158 struct rnnbitfield
**bitfields
;
167 struct rnnvarinfo varinfo
;
168 struct rnntypeinfo typeinfo
;
179 struct rnnvarinfo varinfo
;
180 struct rnndelem
**subelems
;
189 struct rnndelem
**subelems
;
209 uint64_t *offsets
; /* for "array" with irregular offsets */
218 struct rnndelem
**subelems
;
221 struct rnnvarinfo varinfo
;
222 struct rnntypeinfo typeinfo
;
223 struct rnnenum
*index
; /* for arrays, for symbolic idx values */
230 struct rnntypeinfo typeinfo
;
235 struct rnndb
*rnn_newdb(void);
236 void rnn_parsefile (struct rnndb
*db
, char *file
);
237 void rnn_prepdb (struct rnndb
*db
);
238 struct rnnenum
*rnn_findenum (struct rnndb
*db
, const char *name
);
239 struct rnnbitset
*rnn_findbitset (struct rnndb
*db
, const char *name
);
240 struct rnndomain
*rnn_finddomain (struct rnndb
*db
, const char *name
);
241 struct rnnspectype
*rnn_findspectype (struct rnndb
*db
, const char *name
);