aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/common/gen_decoder.h
diff options
context:
space:
mode:
authorLionel Landwerlin <[email protected]>2017-08-02 19:31:08 +0100
committerLionel Landwerlin <[email protected]>2017-11-01 13:19:20 +0000
commit3ae5c579169a62ee11be23d1587792a45747b77f (patch)
tree0fac5fd8a01074f60ffac5575683503d0ad53f3f /src/intel/common/gen_decoder.h
parent957a6eea7a674205c9990de1a682a19a94f9b7f2 (diff)
intel: decoder: build sorted linked lists of fields
The xml files don't always have fields in order. This might confuse our parsing of the commands. Let's have the fields in order. To do this, the easiest way it to use a linked list. It also helps a bit with the iterator. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Scott D Phillips <[email protected]>
Diffstat (limited to 'src/intel/common/gen_decoder.h')
-rw-r--r--src/intel/common/gen_decoder.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/intel/common/gen_decoder.h b/src/intel/common/gen_decoder.h
index ba9a19b55fe..b8666ca3044 100644
--- a/src/intel/common/gen_decoder.h
+++ b/src/intel/common/gen_decoder.h
@@ -61,7 +61,6 @@ struct gen_field_iterator {
int start; /**< current field starts at this bit number */
int end; /**< current field ends at this bit number */
- int field_iter;
int group_iter;
struct gen_field *field;
@@ -85,9 +84,7 @@ struct gen_group {
struct gen_spec *spec;
char *name;
- struct gen_field **fields;
- uint32_t nfields;
- uint32_t fields_size;
+ struct gen_field *fields; /* linked list of fields */
uint32_t group_offset, group_count;
uint32_t group_size;
@@ -142,6 +139,8 @@ struct gen_type {
};
struct gen_field {
+ struct gen_field *next;
+
char *name;
int start, end;
struct gen_type type;