2
* Copyright © 2016 Intel Corporation
3
* Copyright © 2017 Broadcom
5
* Permission is hereby granted, free of charge, to any person obtaining a
6
* copy of this software and associated documentation files (the "Software"),
7
* to deal in the Software without restriction, including without limitation
8
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
9
* and/or sell copies of the Software, and to permit persons to whom the
10
* Software is furnished to do so, subject to the following conditions:
12
* The above copyright notice and this permission notice (including the next
13
* paragraph) shall be included in all copies or substantial portions of the
16
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
32
#include "broadcom/common/v3d_device_info.h"
39
struct v3d_group *v3d_spec_find_struct(struct v3d_spec *spec, const char *name);
40
struct v3d_spec *v3d_spec_load(const struct v3d_device_info *devinfo);
41
struct v3d_group *v3d_spec_find_instruction(struct v3d_spec *spec, const uint8_t *p);
42
struct v3d_group *v3d_spec_find_register(struct v3d_spec *spec, uint32_t offset);
43
struct v3d_group *v3d_spec_find_register_by_name(struct v3d_spec *spec, const char *name);
44
int v3d_group_get_length(struct v3d_group *group);
45
const char *v3d_group_get_name(struct v3d_group *group);
46
uint8_t v3d_group_get_opcode(struct v3d_group *group);
47
struct v3d_enum *v3d_spec_find_enum(struct v3d_spec *spec, const char *name);
49
struct v3d_field_iterator {
50
struct v3d_group *group;
53
struct v3d_group *struct_desc;
55
int offset; /**< current field starts at &p[offset] */
60
struct v3d_field *field;
64
struct v3d_spec *spec;
67
struct v3d_field **fields;
71
uint32_t group_offset, group_count;
75
struct v3d_group *parent;
76
struct v3d_group *next;
80
/* Register specific */
81
uint32_t register_offset;
92
struct v3d_value **values;
112
/* Struct definition for V3D_TYPE_STRUCT */
114
struct v3d_group *v3d_struct;
115
struct v3d_enum *v3d_enum;
117
/* Integer and fractional sizes for V3D_TYPE_UFIXED and
128
struct v3d_type type;
131
uint32_t default_value;
133
struct v3d_enum inline_enum;
136
void v3d_field_iterator_init(struct v3d_field_iterator *iter,
137
struct v3d_group *group,
140
bool v3d_field_iterator_next(struct clif_dump *clif,
141
struct v3d_field_iterator *iter);
143
void v3d_print_group(struct clif_dump *clif,
144
struct v3d_group *group,
145
uint64_t offset, const uint8_t *p);
147
#endif /* V3D_DECODER_H */