Lines Matching +full:break +full:- +full:control

1 // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
4 * Module Name: dscontrol - Support for execution control opcodes -
7 * Copyright (C) 2000 - 2022, Intel Corp.
25 * PARAMETERS: walk_list - The list that owns the walk stack
26 * op - The control Op
30 * DESCRIPTION: Handles all control ops encountered during control method
44 op, op->common.aml_opcode, walk_state)); in acpi_ds_exec_begin_control_op()
46 switch (op->common.aml_opcode) { in acpi_ds_exec_begin_control_op()
50 * There is no need to allocate a new control state. in acpi_ds_exec_begin_control_op()
52 if (walk_state->control_state) { in acpi_ds_exec_begin_control_op()
53 if (walk_state->control_state->control. in acpi_ds_exec_begin_control_op()
55 (walk_state->parser_state.aml - 1)) { in acpi_ds_exec_begin_control_op()
57 /* Reset the state to start-of-loop */ in acpi_ds_exec_begin_control_op()
59 walk_state->control_state->common.state = in acpi_ds_exec_begin_control_op()
61 break; in acpi_ds_exec_begin_control_op()
69 * IF/WHILE: Create a new control state to manage these in acpi_ds_exec_begin_control_op()
76 break; in acpi_ds_exec_begin_control_op()
82 control_state->control.aml_predicate_start = in acpi_ds_exec_begin_control_op()
83 walk_state->parser_state.aml - 1; in acpi_ds_exec_begin_control_op()
84 control_state->control.package_end = in acpi_ds_exec_begin_control_op()
85 walk_state->parser_state.pkg_end; in acpi_ds_exec_begin_control_op()
86 control_state->control.opcode = op->common.aml_opcode; in acpi_ds_exec_begin_control_op()
87 control_state->control.loop_timeout = acpi_os_get_timer() + in acpi_ds_exec_begin_control_op()
90 /* Push the control state on this walk's control stack */ in acpi_ds_exec_begin_control_op()
92 acpi_ut_push_generic_state(&walk_state->control_state, in acpi_ds_exec_begin_control_op()
94 break; in acpi_ds_exec_begin_control_op()
101 if (walk_state->last_predicate) { in acpi_ds_exec_begin_control_op()
105 break; in acpi_ds_exec_begin_control_op()
109 break; in acpi_ds_exec_begin_control_op()
113 break; in acpi_ds_exec_begin_control_op()
123 * PARAMETERS: walk_list - The list that owns the walk stack
124 * op - The control Op
128 * DESCRIPTION: Handles all control ops encountered during control method
142 switch (op->common.aml_opcode) { in acpi_ds_exec_end_control_op()
151 walk_state->last_predicate = in acpi_ds_exec_end_control_op()
152 (u8)walk_state->control_state->common.value; in acpi_ds_exec_end_control_op()
155 * Pop the control state that was created at the start in acpi_ds_exec_end_control_op()
159 acpi_ut_pop_generic_state(&walk_state->control_state); in acpi_ds_exec_end_control_op()
161 break; in acpi_ds_exec_end_control_op()
165 break; in acpi_ds_exec_end_control_op()
171 control_state = walk_state->control_state; in acpi_ds_exec_end_control_op()
172 if (control_state->common.value) { in acpi_ds_exec_end_control_op()
183 control_state->control. in acpi_ds_exec_end_control_op()
186 break; in acpi_ds_exec_end_control_op()
194 walk_state->aml_last_while = in acpi_ds_exec_end_control_op()
195 control_state->control.aml_predicate_start; in acpi_ds_exec_end_control_op()
196 break; in acpi_ds_exec_end_control_op()
204 /* Pop this control state and free it */ in acpi_ds_exec_end_control_op()
207 acpi_ut_pop_generic_state(&walk_state->control_state); in acpi_ds_exec_end_control_op()
209 break; in acpi_ds_exec_end_control_op()
215 op->common.value.arg)); in acpi_ds_exec_end_control_op()
218 * One optional operand -- the return value in acpi_ds_exec_end_control_op()
222 if (op->common.value.arg) { in acpi_ds_exec_end_control_op()
232 op->common.value.arg); in acpi_ds_exec_end_control_op()
243 acpi_ex_resolve_to_value(&walk_state->operands[0], in acpi_ds_exec_end_control_op()
251 * value. This is the only place where walk_state->return_desc in acpi_ds_exec_end_control_op()
254 walk_state->return_desc = walk_state->operands[0]; in acpi_ds_exec_end_control_op()
255 } else if (walk_state->result_count) { in acpi_ds_exec_end_control_op()
272 (walk_state->results->results.obj_desc[0]) == in acpi_ds_exec_end_control_op()
274 && ((walk_state->results->results.obj_desc[0])-> in acpi_ds_exec_end_control_op()
276 && ((walk_state->results->results.obj_desc[0])-> in acpi_ds_exec_end_control_op()
279 acpi_ex_resolve_to_value(&walk_state-> in acpi_ds_exec_end_control_op()
280 results->results. in acpi_ds_exec_end_control_op()
288 walk_state->return_desc = in acpi_ds_exec_end_control_op()
289 walk_state->results->results.obj_desc[0]; in acpi_ds_exec_end_control_op()
293 if (walk_state->num_operands) { in acpi_ds_exec_end_control_op()
294 acpi_ut_remove_reference(walk_state-> in acpi_ds_exec_end_control_op()
298 walk_state->operands[0] = NULL; in acpi_ds_exec_end_control_op()
299 walk_state->num_operands = 0; in acpi_ds_exec_end_control_op()
300 walk_state->return_desc = NULL; in acpi_ds_exec_end_control_op()
305 walk_state, walk_state->return_desc)); in acpi_ds_exec_end_control_op()
307 /* End the control method execution right now */ in acpi_ds_exec_end_control_op()
310 break; in acpi_ds_exec_end_control_op()
316 break; in acpi_ds_exec_end_control_op()
326 break; in acpi_ds_exec_end_control_op()
331 /* Pop and delete control states until we find a while */ in acpi_ds_exec_end_control_op()
333 while (walk_state->control_state && in acpi_ds_exec_end_control_op()
334 (walk_state->control_state->control.opcode != in acpi_ds_exec_end_control_op()
337 acpi_ut_pop_generic_state(&walk_state-> in acpi_ds_exec_end_control_op()
344 if (!walk_state->control_state) { in acpi_ds_exec_end_control_op()
348 /* Was: walk_state->aml_last_while = walk_state->control_state->Control.aml_predicate_start; */ in acpi_ds_exec_end_control_op()
350 walk_state->aml_last_while = in acpi_ds_exec_end_control_op()
351 walk_state->control_state->control.package_end; in acpi_ds_exec_end_control_op()
355 if (op->common.aml_opcode == AML_BREAK_OP) { in acpi_ds_exec_end_control_op()
360 break; in acpi_ds_exec_end_control_op()
364 ACPI_ERROR((AE_INFO, "Unknown control opcode=0x%X Op=%p", in acpi_ds_exec_end_control_op()
365 op->common.aml_opcode, op)); in acpi_ds_exec_end_control_op()
368 break; in acpi_ds_exec_end_control_op()