2 * Copyright © 2016 Intel Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
30 #include "common/gen_device_info.h"
36 static inline uint32_t gen_make_gen(uint32_t major
, uint32_t minor
)
38 return (major
<< 8) | minor
;
41 struct gen_group
*gen_spec_find_struct(struct gen_spec
*spec
, const char *name
);
42 struct gen_spec
*gen_spec_load(const struct gen_device_info
*devinfo
);
43 struct gen_spec
*gen_spec_load_from_path(const struct gen_device_info
*devinfo
,
45 uint32_t gen_spec_get_gen(struct gen_spec
*spec
);
46 struct gen_group
*gen_spec_find_instruction(struct gen_spec
*spec
, const uint32_t *p
);
47 struct gen_group
*gen_spec_find_register(struct gen_spec
*spec
, uint32_t offset
);
48 int gen_group_get_length(struct gen_group
*group
, const uint32_t *p
);
49 const char *gen_group_get_name(struct gen_group
*group
);
50 uint32_t gen_group_get_opcode(struct gen_group
*group
);
52 struct gen_field_iterator
{
53 struct gen_group
*group
;
56 char description
[128];
65 struct gen_field
**fields
;
66 uint32_t group_offset
, group_count
;
71 /* Register specific */
72 uint32_t register_offset
;
90 /* Struct definition for GEN_TYPE_STRUCT */
91 struct gen_group
*gen_struct
;
93 /* Integer and fractional sizes for GEN_TYPE_UFIXED and GEN_TYPE_SFIXED */
100 struct gen_type type
;
102 uint32_t default_value
;
104 struct gen_value
**values
;
106 uint32_t n_allocated_values
;
114 void gen_field_iterator_init(struct gen_field_iterator
*iter
,
115 struct gen_group
*group
,
119 bool gen_field_iterator_next(struct gen_field_iterator
*iter
);
121 #endif /* DECODER_H */