Lines Matching refs:atts
131 get_array_offset_count(const char **atts, uint32_t *offset, uint32_t *count,
134 for (int i = 0; atts[i]; i += 2) {
137 if (strcmp(atts[i], "count") == 0) {
138 *count = strtoul(atts[i + 1], &p, 0);
141 } else if (strcmp(atts[i], "start") == 0) {
142 *offset = strtoul(atts[i + 1], &p, 0);
143 } else if (strcmp(atts[i], "size") == 0) {
144 *size = strtoul(atts[i + 1], &p, 0);
153 const char **atts,
173 for (int i = 0; atts[i]; i += 2) {
175 if (strcmp(atts[i], "length") == 0) {
176 group->dw_length = strtoul(atts[i + 1], &p, 0);
177 } else if (strcmp(atts[i], "bias") == 0) {
178 group->bias = strtoul(atts[i + 1], &p, 0);
179 } else if (strcmp(atts[i], "engine") == 0) {
181 char *tmp = ralloc_strdup(mem_ctx, atts[i + 1]);
194 fprintf(stderr, "unknown engine class defined for instruction \"%s\": %s\n", name, atts[i + 1]);
206 get_array_offset_count(atts,
217 create_enum(struct parser_context *ctx, const char *name, const char **atts)
229 get_register_offset(const char **atts, uint32_t *offset)
231 for (int i = 0; atts[i]; i += 2) {
234 if (strcmp(atts[i], "num") == 0)
235 *offset = strtoul(atts[i + 1], &p, 0);
311 create_field(struct parser_context *ctx, const char **atts)
318 for (int i = 0; atts[i]; i += 2) {
321 if (strcmp(atts[i], "name") == 0) {
322 field->name = ralloc_strdup(field, atts[i + 1]);
326 } else if (strcmp(atts[i], "start") == 0) {
327 field->start = strtoul(atts[i + 1], &p, 0);
328 } else if (strcmp(atts[i], "end") == 0) {
329 field->end = strtoul(atts[i + 1], &p, 0);
330 } else if (strcmp(atts[i], "type") == 0) {
331 field->type = string_to_type(ctx, atts[i + 1]);
332 } else if (strcmp(atts[i], "default") == 0 &&
335 field->default_value = strtoul(atts[i + 1], &p, 0);
357 create_value(struct parser_context *ctx, const char **atts)
361 for (int i = 0; atts[i]; i += 2) {
362 if (strcmp(atts[i], "name") == 0)
363 value->name = ralloc_strdup(value, atts[i + 1]);
364 else if (strcmp(atts[i], "value") == 0)
365 value->value = strtoul(atts[i + 1], NULL, 0);
373 const char **atts,
377 create_array_field(ctx, array) : create_field(ctx, atts);
395 start_element(void *data, const char *element_name, const char **atts)
403 for (int i = 0; atts[i]; i += 2) {
404 if (strcmp(atts[i], "name") == 0)
405 name = atts[i + 1];
406 else if (strcmp(atts[i], "gen") == 0)
407 gen = atts[i + 1];
425 ctx->group = create_group(ctx, name, atts, NULL, false);
427 ctx->group = create_group(ctx, name, atts, NULL, true);
429 ctx->group = create_group(ctx, name, atts, NULL, true);
430 get_register_offset(atts, &ctx->group->register_offset);
432 struct intel_group *group = create_group(ctx, "", atts, ctx->group, false);
436 ctx->last_field = create_and_append_field(ctx, atts, NULL);
438 ctx->enoom = create_enum(ctx, name, atts);
447 ctx->values[ctx->n_values++] = create_value(ctx, atts);