Lines Matching refs:ctx
119 static int erst_exec_load_var1(struct apei_exec_context *ctx, in erst_exec_load_var1() argument
122 return __apei_exec_read_register(entry, &ctx->var1); in erst_exec_load_var1()
125 static int erst_exec_load_var2(struct apei_exec_context *ctx, in erst_exec_load_var2() argument
128 return __apei_exec_read_register(entry, &ctx->var2); in erst_exec_load_var2()
131 static int erst_exec_store_var1(struct apei_exec_context *ctx, in erst_exec_store_var1() argument
134 return __apei_exec_write_register(entry, ctx->var1); in erst_exec_store_var1()
137 static int erst_exec_add(struct apei_exec_context *ctx, in erst_exec_add() argument
140 ctx->var1 += ctx->var2; in erst_exec_add()
144 static int erst_exec_subtract(struct apei_exec_context *ctx, in erst_exec_subtract() argument
147 ctx->var1 -= ctx->var2; in erst_exec_subtract()
151 static int erst_exec_add_value(struct apei_exec_context *ctx, in erst_exec_add_value() argument
160 val += ctx->value; in erst_exec_add_value()
165 static int erst_exec_subtract_value(struct apei_exec_context *ctx, in erst_exec_subtract_value() argument
174 val -= ctx->value; in erst_exec_subtract_value()
179 static int erst_exec_stall(struct apei_exec_context *ctx, in erst_exec_stall() argument
184 if (ctx->value > FIRMWARE_MAX_STALL) { in erst_exec_stall()
188 ctx->value); in erst_exec_stall()
191 stall_time = ctx->value; in erst_exec_stall()
196 static int erst_exec_stall_while_true(struct apei_exec_context *ctx, in erst_exec_stall_while_true() argument
204 if (ctx->var1 > FIRMWARE_MAX_STALL) { in erst_exec_stall_while_true()
208 ctx->var1); in erst_exec_stall_while_true()
211 stall_time = ctx->var1; in erst_exec_stall_while_true()
217 if (val != ctx->value) in erst_exec_stall_while_true()
226 struct apei_exec_context *ctx, in erst_exec_skip_next_instruction_if_true() argument
235 if (val == ctx->value) { in erst_exec_skip_next_instruction_if_true()
236 ctx->ip += 2; in erst_exec_skip_next_instruction_if_true()
243 static int erst_exec_goto(struct apei_exec_context *ctx, in erst_exec_goto() argument
246 ctx->ip = ctx->value; in erst_exec_goto()
250 static int erst_exec_set_src_address_base(struct apei_exec_context *ctx, in erst_exec_set_src_address_base() argument
253 return __apei_exec_read_register(entry, &ctx->src_base); in erst_exec_set_src_address_base()
256 static int erst_exec_set_dst_address_base(struct apei_exec_context *ctx, in erst_exec_set_dst_address_base() argument
259 return __apei_exec_read_register(entry, &ctx->dst_base); in erst_exec_set_dst_address_base()
262 static int erst_exec_move_data(struct apei_exec_context *ctx, in erst_exec_move_data() argument
279 src = ioremap(ctx->src_base + offset, ctx->var2); in erst_exec_move_data()
282 dst = ioremap(ctx->dst_base + offset, ctx->var2); in erst_exec_move_data()
288 memmove(dst, src, ctx->var2); in erst_exec_move_data()
375 static inline void erst_exec_ctx_init(struct apei_exec_context *ctx) in erst_exec_ctx_init() argument
377 apei_exec_ctx_init(ctx, erst_ins_type, ARRAY_SIZE(erst_ins_type), in erst_exec_ctx_init()
383 struct apei_exec_context ctx; in erst_get_erange() local
386 erst_exec_ctx_init(&ctx); in erst_get_erange()
387 rc = apei_exec_run(&ctx, ACPI_ERST_GET_ERROR_RANGE); in erst_get_erange()
390 range->base = apei_exec_ctx_get_output(&ctx); in erst_get_erange()
391 rc = apei_exec_run(&ctx, ACPI_ERST_GET_ERROR_LENGTH); in erst_get_erange()
394 range->size = apei_exec_ctx_get_output(&ctx); in erst_get_erange()
395 rc = apei_exec_run(&ctx, ACPI_ERST_GET_ERROR_ATTRIBUTES); in erst_get_erange()
398 range->attr = apei_exec_ctx_get_output(&ctx); in erst_get_erange()
405 struct apei_exec_context ctx; in __erst_get_record_count() local
408 erst_exec_ctx_init(&ctx); in __erst_get_record_count()
409 rc = apei_exec_run(&ctx, ACPI_ERST_GET_RECORD_COUNT); in __erst_get_record_count()
412 return apei_exec_ctx_get_output(&ctx); in __erst_get_record_count()
449 struct apei_exec_context ctx; in __erst_get_next_record_id() local
452 erst_exec_ctx_init(&ctx); in __erst_get_next_record_id()
453 rc = apei_exec_run(&ctx, ACPI_ERST_GET_RECORD_ID); in __erst_get_next_record_id()
456 *record_id = apei_exec_ctx_get_output(&ctx); in __erst_get_next_record_id()
636 struct apei_exec_context ctx; in __erst_write_to_storage() local
641 erst_exec_ctx_init(&ctx); in __erst_write_to_storage()
642 rc = apei_exec_run_optional(&ctx, ACPI_ERST_BEGIN_WRITE); in __erst_write_to_storage()
645 apei_exec_ctx_set_input(&ctx, offset); in __erst_write_to_storage()
646 rc = apei_exec_run(&ctx, ACPI_ERST_SET_RECORD_OFFSET); in __erst_write_to_storage()
649 rc = apei_exec_run(&ctx, ACPI_ERST_EXECUTE_OPERATION); in __erst_write_to_storage()
653 rc = apei_exec_run(&ctx, ACPI_ERST_CHECK_BUSY_STATUS); in __erst_write_to_storage()
656 val = apei_exec_ctx_get_output(&ctx); in __erst_write_to_storage()
662 rc = apei_exec_run(&ctx, ACPI_ERST_GET_COMMAND_STATUS); in __erst_write_to_storage()
665 val = apei_exec_ctx_get_output(&ctx); in __erst_write_to_storage()
666 rc = apei_exec_run_optional(&ctx, ACPI_ERST_END); in __erst_write_to_storage()
675 struct apei_exec_context ctx; in __erst_read_from_storage() local
680 erst_exec_ctx_init(&ctx); in __erst_read_from_storage()
681 rc = apei_exec_run_optional(&ctx, ACPI_ERST_BEGIN_READ); in __erst_read_from_storage()
684 apei_exec_ctx_set_input(&ctx, offset); in __erst_read_from_storage()
685 rc = apei_exec_run(&ctx, ACPI_ERST_SET_RECORD_OFFSET); in __erst_read_from_storage()
688 apei_exec_ctx_set_input(&ctx, record_id); in __erst_read_from_storage()
689 rc = apei_exec_run(&ctx, ACPI_ERST_SET_RECORD_ID); in __erst_read_from_storage()
692 rc = apei_exec_run(&ctx, ACPI_ERST_EXECUTE_OPERATION); in __erst_read_from_storage()
696 rc = apei_exec_run(&ctx, ACPI_ERST_CHECK_BUSY_STATUS); in __erst_read_from_storage()
699 val = apei_exec_ctx_get_output(&ctx); in __erst_read_from_storage()
705 rc = apei_exec_run(&ctx, ACPI_ERST_GET_COMMAND_STATUS); in __erst_read_from_storage()
708 val = apei_exec_ctx_get_output(&ctx); in __erst_read_from_storage()
709 rc = apei_exec_run_optional(&ctx, ACPI_ERST_END); in __erst_read_from_storage()
718 struct apei_exec_context ctx; in __erst_clear_from_storage() local
723 erst_exec_ctx_init(&ctx); in __erst_clear_from_storage()
724 rc = apei_exec_run_optional(&ctx, ACPI_ERST_BEGIN_CLEAR); in __erst_clear_from_storage()
727 apei_exec_ctx_set_input(&ctx, record_id); in __erst_clear_from_storage()
728 rc = apei_exec_run(&ctx, ACPI_ERST_SET_RECORD_ID); in __erst_clear_from_storage()
731 rc = apei_exec_run(&ctx, ACPI_ERST_EXECUTE_OPERATION); in __erst_clear_from_storage()
735 rc = apei_exec_run(&ctx, ACPI_ERST_CHECK_BUSY_STATUS); in __erst_clear_from_storage()
738 val = apei_exec_ctx_get_output(&ctx); in __erst_clear_from_storage()
744 rc = apei_exec_run(&ctx, ACPI_ERST_GET_COMMAND_STATUS); in __erst_clear_from_storage()
747 val = apei_exec_ctx_get_output(&ctx); in __erst_clear_from_storage()
748 rc = apei_exec_run_optional(&ctx, ACPI_ERST_END); in __erst_clear_from_storage()
1122 struct apei_exec_context ctx; in erst_init() local
1154 erst_exec_ctx_init(&ctx); in erst_init()
1155 rc = apei_exec_collect_resources(&ctx, &erst_resources); in erst_init()
1161 rc = apei_exec_pre_map_gars(&ctx); in erst_init()
1217 apei_exec_post_unmap_gars(&ctx); in erst_init()