Lines Matching refs:ctx
112 static int erst_exec_load_var1(struct apei_exec_context *ctx,
115 return __apei_exec_read_register(entry, &ctx->var1);
118 static int erst_exec_load_var2(struct apei_exec_context *ctx,
121 return __apei_exec_read_register(entry, &ctx->var2);
124 static int erst_exec_store_var1(struct apei_exec_context *ctx,
127 return __apei_exec_write_register(entry, ctx->var1);
130 static int erst_exec_add(struct apei_exec_context *ctx,
133 ctx->var1 += ctx->var2;
137 static int erst_exec_subtract(struct apei_exec_context *ctx,
140 ctx->var1 -= ctx->var2;
144 static int erst_exec_add_value(struct apei_exec_context *ctx,
153 val += ctx->value;
158 static int erst_exec_subtract_value(struct apei_exec_context *ctx,
167 val -= ctx->value;
172 static int erst_exec_stall(struct apei_exec_context *ctx,
177 if (ctx->value > FIRMWARE_MAX_STALL) {
181 ctx->value);
184 stall_time = ctx->value;
189 static int erst_exec_stall_while_true(struct apei_exec_context *ctx,
197 if (ctx->var1 > FIRMWARE_MAX_STALL) {
201 ctx->var1);
204 stall_time = ctx->var1;
210 if (val != ctx->value)
219 struct apei_exec_context *ctx,
228 if (val == ctx->value) {
229 ctx->ip += 2;
236 static int erst_exec_goto(struct apei_exec_context *ctx,
239 ctx->ip = ctx->value;
243 static int erst_exec_set_src_address_base(struct apei_exec_context *ctx,
246 return __apei_exec_read_register(entry, &ctx->src_base);
249 static int erst_exec_set_dst_address_base(struct apei_exec_context *ctx,
252 return __apei_exec_read_register(entry, &ctx->dst_base);
255 static int erst_exec_move_data(struct apei_exec_context *ctx,
272 src = ioremap(ctx->src_base + offset, ctx->var2);
275 dst = ioremap(ctx->dst_base + offset, ctx->var2);
281 memmove(dst, src, ctx->var2);
368 static inline void erst_exec_ctx_init(struct apei_exec_context *ctx)
370 apei_exec_ctx_init(ctx, erst_ins_type, ARRAY_SIZE(erst_ins_type),
376 struct apei_exec_context ctx;
379 erst_exec_ctx_init(&ctx);
380 rc = apei_exec_run(&ctx, ACPI_ERST_GET_ERROR_RANGE);
383 range->base = apei_exec_ctx_get_output(&ctx);
384 rc = apei_exec_run(&ctx, ACPI_ERST_GET_ERROR_LENGTH);
387 range->size = apei_exec_ctx_get_output(&ctx);
388 rc = apei_exec_run(&ctx, ACPI_ERST_GET_ERROR_ATTRIBUTES);
391 range->attr = apei_exec_ctx_get_output(&ctx);
398 struct apei_exec_context ctx;
401 erst_exec_ctx_init(&ctx);
402 rc = apei_exec_run(&ctx, ACPI_ERST_GET_RECORD_COUNT);
405 return apei_exec_ctx_get_output(&ctx);
442 struct apei_exec_context ctx;
445 erst_exec_ctx_init(&ctx);
446 rc = apei_exec_run(&ctx, ACPI_ERST_GET_RECORD_ID);
449 *record_id = apei_exec_ctx_get_output(&ctx);
623 struct apei_exec_context ctx;
628 erst_exec_ctx_init(&ctx);
629 rc = apei_exec_run_optional(&ctx, ACPI_ERST_BEGIN_WRITE);
632 apei_exec_ctx_set_input(&ctx, offset);
633 rc = apei_exec_run(&ctx, ACPI_ERST_SET_RECORD_OFFSET);
636 rc = apei_exec_run(&ctx, ACPI_ERST_EXECUTE_OPERATION);
640 rc = apei_exec_run(&ctx, ACPI_ERST_CHECK_BUSY_STATUS);
643 val = apei_exec_ctx_get_output(&ctx);
649 rc = apei_exec_run(&ctx, ACPI_ERST_GET_COMMAND_STATUS);
652 val = apei_exec_ctx_get_output(&ctx);
653 rc = apei_exec_run_optional(&ctx, ACPI_ERST_END);
662 struct apei_exec_context ctx;
667 erst_exec_ctx_init(&ctx);
668 rc = apei_exec_run_optional(&ctx, ACPI_ERST_BEGIN_READ);
671 apei_exec_ctx_set_input(&ctx, offset);
672 rc = apei_exec_run(&ctx, ACPI_ERST_SET_RECORD_OFFSET);
675 apei_exec_ctx_set_input(&ctx, record_id);
676 rc = apei_exec_run(&ctx, ACPI_ERST_SET_RECORD_ID);
679 rc = apei_exec_run(&ctx, ACPI_ERST_EXECUTE_OPERATION);
683 rc = apei_exec_run(&ctx, ACPI_ERST_CHECK_BUSY_STATUS);
686 val = apei_exec_ctx_get_output(&ctx);
692 rc = apei_exec_run(&ctx, ACPI_ERST_GET_COMMAND_STATUS);
695 val = apei_exec_ctx_get_output(&ctx);
696 rc = apei_exec_run_optional(&ctx, ACPI_ERST_END);
705 struct apei_exec_context ctx;
710 erst_exec_ctx_init(&ctx);
711 rc = apei_exec_run_optional(&ctx, ACPI_ERST_BEGIN_CLEAR);
714 apei_exec_ctx_set_input(&ctx, record_id);
715 rc = apei_exec_run(&ctx, ACPI_ERST_SET_RECORD_ID);
718 rc = apei_exec_run(&ctx, ACPI_ERST_EXECUTE_OPERATION);
722 rc = apei_exec_run(&ctx, ACPI_ERST_CHECK_BUSY_STATUS);
725 val = apei_exec_ctx_get_output(&ctx);
731 rc = apei_exec_run(&ctx, ACPI_ERST_GET_COMMAND_STATUS);
734 val = apei_exec_ctx_get_output(&ctx);
735 rc = apei_exec_run_optional(&ctx, ACPI_ERST_END);
1097 struct apei_exec_context ctx;
1129 erst_exec_ctx_init(&ctx);
1130 rc = apei_exec_collect_resources(&ctx, &erst_resources);
1136 rc = apei_exec_pre_map_gars(&ctx);
1194 apei_exec_post_unmap_gars(&ctx);