diff options
author | Lionel Landwerlin <[email protected]> | 2017-09-28 02:36:30 +0100 |
---|---|---|
committer | Lionel Landwerlin <[email protected]> | 2017-11-01 17:23:49 +0000 |
commit | 20156931bf456932a4b53ad6685da42a7ad33ec2 (patch) | |
tree | f5c9d5a8d19446ed922bd156791ea45d1aaa9143 /src/intel/common/gen_decoder.c | |
parent | cab93a901e14e97d4d243e4a451521dad957f0ac (diff) |
intel: decoder: simplify field_is_header()
Signed-off-by: Lionel Landwerlin <[email protected]>
Reviewed-by: Scott D Phillips <[email protected]>
Diffstat (limited to 'src/intel/common/gen_decoder.c')
-rw-r--r-- | src/intel/common/gen_decoder.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/intel/common/gen_decoder.c b/src/intel/common/gen_decoder.c index c0a46e5212e..760a8769c56 100644 --- a/src/intel/common/gen_decoder.c +++ b/src/intel/common/gen_decoder.c @@ -288,6 +288,7 @@ create_field(struct parser_context *ctx, const char **atts) struct gen_field *field; field = rzalloc(ctx->group, struct gen_field); + field->parent = ctx->group; for (int i = 0; atts[i]; i += 2) { char *p; @@ -960,7 +961,7 @@ print_dword_header(FILE *outfile, } bool -gen_group_header_is_header(struct gen_group *group, struct gen_field *field) +gen_field_is_header(struct gen_field *field) { uint32_t bits; @@ -970,7 +971,7 @@ gen_group_header_is_header(struct gen_group *group, struct gen_field *field) bits = (1U << (field->end - field->start + 1)) - 1; bits <<= field->start; - return (group->opcode_mask & bits) != 0; + return (field->parent->opcode_mask & bits) != 0; } void @@ -987,7 +988,7 @@ gen_print_group(FILE *outfile, struct gen_group *group, print_dword_header(outfile, &iter, offset, i); last_dword = iter.dword; } - if (!gen_group_header_is_header(group, iter.field)) { + if (!gen_field_is_header(iter.field)) { fprintf(outfile, " %s: %s\n", iter.name, iter.value); if (iter.struct_desc) { uint64_t struct_offset = offset + 4 * iter.dword; |