Lines Matching defs:atts

132 get_array_offset_count(const char **atts, uint32_t *offset, uint32_t *count,
135 for (int i = 0; atts[i]; i += 2) {
138 if (strcmp(atts[i], "count") == 0) {
139 *count = strtoul(atts[i + 1], &p, 0);
142 } else if (strcmp(atts[i], "start") == 0) {
143 *offset = strtoul(atts[i + 1], &p, 0);
144 } else if (strcmp(atts[i], "size") == 0) {
145 *size = strtoul(atts[i + 1], &p, 0);
154 const char **atts,
174 for (int i = 0; atts[i]; i += 2) {
176 if (strcmp(atts[i], "length") == 0) {
177 group->dw_length = strtoul(atts[i + 1], &p, 0);
178 } else if (strcmp(atts[i], "bias") == 0) {
179 group->bias = strtoul(atts[i + 1], &p, 0);
180 } else if (strcmp(atts[i], "engine") == 0) {
182 char *tmp = ralloc_strdup(mem_ctx, atts[i + 1]);
195 fprintf(stderr, "unknown engine class defined for instruction \"%s\": %s\n", name, atts[i + 1]);
207 get_array_offset_count(atts,
218 create_enum(struct parser_context *ctx, const char *name, const char **atts)
230 get_register_offset(const char **atts, uint32_t *offset)
232 for (int i = 0; atts[i]; i += 2) {
235 if (strcmp(atts[i], "num") == 0)
236 *offset = strtoul(atts[i + 1], &p, 0);
314 create_field(struct parser_context *ctx, const char **atts)
321 for (int i = 0; atts[i]; i += 2) {
324 if (strcmp(atts[i], "name") == 0) {
325 field->name = ralloc_strdup(field, atts[i + 1]);
329 } else if (strcmp(atts[i], "start") == 0) {
330 field->start = strtoul(atts[i + 1], &p, 0);
331 } else if (strcmp(atts[i], "end") == 0) {
332 field->end = strtoul(atts[i + 1], &p, 0);
333 } else if (strcmp(atts[i], "type") == 0) {
334 field->type = string_to_type(ctx, atts[i + 1]);
335 } else if (strcmp(atts[i], "default") == 0 &&
338 field->default_value = strtoul(atts[i + 1], &p, 0);
360 create_value(struct parser_context *ctx, const char **atts)
364 for (int i = 0; atts[i]; i += 2) {
365 if (strcmp(atts[i], "name") == 0)
366 value->name = ralloc_strdup(value, atts[i + 1]);
367 else if (strcmp(atts[i], "value") == 0)
368 value->value = strtoul(atts[i + 1], NULL, 0);
376 const char **atts,
380 create_array_field(ctx, array) : create_field(ctx, atts);
398 start_element(void *data, const char *element_name, const char **atts)
406 for (int i = 0; atts[i]; i += 2) {
407 if (strcmp(atts[i], "name") == 0)
408 name = atts[i + 1];
409 else if (strcmp(atts[i], "gen") == 0)
410 gen = atts[i + 1];
428 ctx->group = create_group(ctx, name, atts, NULL, false);
430 ctx->group = create_group(ctx, name, atts, NULL, true);
432 ctx->group = create_group(ctx, name, atts, NULL, true);
433 get_register_offset(atts, &ctx->group->register_offset);
435 struct intel_group *group = create_group(ctx, "", atts, ctx->group, false);
439 ctx->last_field = create_and_append_field(ctx, atts, NULL);
441 ctx->enoom = create_enum(ctx, name, atts);
450 ctx->values[ctx->n_values++] = create_value(ctx, atts);