Lines Matching refs:ctx

122 static int erst_exec_load_var1(struct apei_exec_context *ctx,  in erst_exec_load_var1()  argument
125 return __apei_exec_read_register(entry, &ctx->var1); in erst_exec_load_var1()
128 static int erst_exec_load_var2(struct apei_exec_context *ctx, in erst_exec_load_var2() argument
131 return __apei_exec_read_register(entry, &ctx->var2); in erst_exec_load_var2()
134 static int erst_exec_store_var1(struct apei_exec_context *ctx, in erst_exec_store_var1() argument
137 return __apei_exec_write_register(entry, ctx->var1); in erst_exec_store_var1()
140 static int erst_exec_add(struct apei_exec_context *ctx, in erst_exec_add() argument
143 ctx->var1 += ctx->var2; in erst_exec_add()
147 static int erst_exec_subtract(struct apei_exec_context *ctx, in erst_exec_subtract() argument
150 ctx->var1 -= ctx->var2; in erst_exec_subtract()
154 static int erst_exec_add_value(struct apei_exec_context *ctx, in erst_exec_add_value() argument
163 val += ctx->value; in erst_exec_add_value()
168 static int erst_exec_subtract_value(struct apei_exec_context *ctx, in erst_exec_subtract_value() argument
177 val -= ctx->value; in erst_exec_subtract_value()
182 static int erst_exec_stall(struct apei_exec_context *ctx, in erst_exec_stall() argument
187 if (ctx->value > FIRMWARE_MAX_STALL) { in erst_exec_stall()
191 ctx->value); in erst_exec_stall()
194 stall_time = ctx->value; in erst_exec_stall()
199 static int erst_exec_stall_while_true(struct apei_exec_context *ctx, in erst_exec_stall_while_true() argument
207 if (ctx->var1 > FIRMWARE_MAX_STALL) { in erst_exec_stall_while_true()
211 ctx->var1); in erst_exec_stall_while_true()
214 stall_time = ctx->var1; in erst_exec_stall_while_true()
220 if (val != ctx->value) in erst_exec_stall_while_true()
229 struct apei_exec_context *ctx, in erst_exec_skip_next_instruction_if_true() argument
238 if (val == ctx->value) { in erst_exec_skip_next_instruction_if_true()
239 ctx->ip += 2; in erst_exec_skip_next_instruction_if_true()
246 static int erst_exec_goto(struct apei_exec_context *ctx, in erst_exec_goto() argument
249 ctx->ip = ctx->value; in erst_exec_goto()
253 static int erst_exec_set_src_address_base(struct apei_exec_context *ctx, in erst_exec_set_src_address_base() argument
256 return __apei_exec_read_register(entry, &ctx->src_base); in erst_exec_set_src_address_base()
259 static int erst_exec_set_dst_address_base(struct apei_exec_context *ctx, in erst_exec_set_dst_address_base() argument
262 return __apei_exec_read_register(entry, &ctx->dst_base); in erst_exec_set_dst_address_base()
265 static int erst_exec_move_data(struct apei_exec_context *ctx, in erst_exec_move_data() argument
282 src = ioremap(ctx->src_base + offset, ctx->var2); in erst_exec_move_data()
285 dst = ioremap(ctx->dst_base + offset, ctx->var2); in erst_exec_move_data()
291 memmove(dst, src, ctx->var2); in erst_exec_move_data()
378 static inline void erst_exec_ctx_init(struct apei_exec_context *ctx) in erst_exec_ctx_init() argument
380 apei_exec_ctx_init(ctx, erst_ins_type, ARRAY_SIZE(erst_ins_type), in erst_exec_ctx_init()
386 struct apei_exec_context ctx; in erst_get_erange() local
389 erst_exec_ctx_init(&ctx); in erst_get_erange()
390 rc = apei_exec_run(&ctx, ACPI_ERST_GET_ERROR_RANGE); in erst_get_erange()
393 range->base = apei_exec_ctx_get_output(&ctx); in erst_get_erange()
394 rc = apei_exec_run(&ctx, ACPI_ERST_GET_ERROR_LENGTH); in erst_get_erange()
397 range->size = apei_exec_ctx_get_output(&ctx); in erst_get_erange()
398 rc = apei_exec_run(&ctx, ACPI_ERST_GET_ERROR_ATTRIBUTES); in erst_get_erange()
401 range->attr = apei_exec_ctx_get_output(&ctx); in erst_get_erange()
408 struct apei_exec_context ctx; in __erst_get_record_count() local
411 erst_exec_ctx_init(&ctx); in __erst_get_record_count()
412 rc = apei_exec_run(&ctx, ACPI_ERST_GET_RECORD_COUNT); in __erst_get_record_count()
415 return apei_exec_ctx_get_output(&ctx); in __erst_get_record_count()
452 struct apei_exec_context ctx; in __erst_get_next_record_id() local
455 erst_exec_ctx_init(&ctx); in __erst_get_next_record_id()
456 rc = apei_exec_run(&ctx, ACPI_ERST_GET_RECORD_ID); in __erst_get_next_record_id()
459 *record_id = apei_exec_ctx_get_output(&ctx); in __erst_get_next_record_id()
639 struct apei_exec_context ctx; in __erst_write_to_storage() local
644 erst_exec_ctx_init(&ctx); in __erst_write_to_storage()
645 rc = apei_exec_run_optional(&ctx, ACPI_ERST_BEGIN_WRITE); in __erst_write_to_storage()
648 apei_exec_ctx_set_input(&ctx, offset); in __erst_write_to_storage()
649 rc = apei_exec_run(&ctx, ACPI_ERST_SET_RECORD_OFFSET); in __erst_write_to_storage()
652 rc = apei_exec_run(&ctx, ACPI_ERST_EXECUTE_OPERATION); in __erst_write_to_storage()
656 rc = apei_exec_run(&ctx, ACPI_ERST_CHECK_BUSY_STATUS); in __erst_write_to_storage()
659 val = apei_exec_ctx_get_output(&ctx); in __erst_write_to_storage()
665 rc = apei_exec_run(&ctx, ACPI_ERST_GET_COMMAND_STATUS); in __erst_write_to_storage()
668 val = apei_exec_ctx_get_output(&ctx); in __erst_write_to_storage()
669 rc = apei_exec_run_optional(&ctx, ACPI_ERST_END); in __erst_write_to_storage()
678 struct apei_exec_context ctx; in __erst_read_from_storage() local
683 erst_exec_ctx_init(&ctx); in __erst_read_from_storage()
684 rc = apei_exec_run_optional(&ctx, ACPI_ERST_BEGIN_READ); in __erst_read_from_storage()
687 apei_exec_ctx_set_input(&ctx, offset); in __erst_read_from_storage()
688 rc = apei_exec_run(&ctx, ACPI_ERST_SET_RECORD_OFFSET); in __erst_read_from_storage()
691 apei_exec_ctx_set_input(&ctx, record_id); in __erst_read_from_storage()
692 rc = apei_exec_run(&ctx, ACPI_ERST_SET_RECORD_ID); in __erst_read_from_storage()
695 rc = apei_exec_run(&ctx, ACPI_ERST_EXECUTE_OPERATION); in __erst_read_from_storage()
699 rc = apei_exec_run(&ctx, ACPI_ERST_CHECK_BUSY_STATUS); in __erst_read_from_storage()
702 val = apei_exec_ctx_get_output(&ctx); in __erst_read_from_storage()
708 rc = apei_exec_run(&ctx, ACPI_ERST_GET_COMMAND_STATUS); in __erst_read_from_storage()
711 val = apei_exec_ctx_get_output(&ctx); in __erst_read_from_storage()
712 rc = apei_exec_run_optional(&ctx, ACPI_ERST_END); in __erst_read_from_storage()
721 struct apei_exec_context ctx; in __erst_clear_from_storage() local
726 erst_exec_ctx_init(&ctx); in __erst_clear_from_storage()
727 rc = apei_exec_run_optional(&ctx, ACPI_ERST_BEGIN_CLEAR); in __erst_clear_from_storage()
730 apei_exec_ctx_set_input(&ctx, record_id); in __erst_clear_from_storage()
731 rc = apei_exec_run(&ctx, ACPI_ERST_SET_RECORD_ID); in __erst_clear_from_storage()
734 rc = apei_exec_run(&ctx, ACPI_ERST_EXECUTE_OPERATION); in __erst_clear_from_storage()
738 rc = apei_exec_run(&ctx, ACPI_ERST_CHECK_BUSY_STATUS); in __erst_clear_from_storage()
741 val = apei_exec_ctx_get_output(&ctx); in __erst_clear_from_storage()
747 rc = apei_exec_run(&ctx, ACPI_ERST_GET_COMMAND_STATUS); in __erst_clear_from_storage()
750 val = apei_exec_ctx_get_output(&ctx); in __erst_clear_from_storage()
751 rc = apei_exec_run_optional(&ctx, ACPI_ERST_END); in __erst_clear_from_storage()
1125 struct apei_exec_context ctx; in erst_init() local
1157 erst_exec_ctx_init(&ctx); in erst_init()
1158 rc = apei_exec_collect_resources(&ctx, &erst_resources); in erst_init()
1164 rc = apei_exec_pre_map_gars(&ctx); in erst_init()
1220 apei_exec_post_unmap_gars(&ctx); in erst_init()