Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9accd464 authored by Lin Ming's avatar Lin Ming Committed by Len Brown
Browse files

ACPICA: Methods now implicitly return 0 in slack mode

Implemented an enhancement to the interpreter "slack mode". In the
absence of an explicit return or an implicitly returned object from
the last executed opcode, a control method will now implicitly
return an integer of value 0 for Microsoft compatibility.

http://www.acpica.org/bugzilla/show_bug.cgi?id=392



Signed-off-by: default avatarLin Ming <ming.m.lin@intel.com>
Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarAlexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 8246934b
Loading
Loading
Loading
Loading
+24 −0
Original line number Original line Diff line number Diff line
@@ -594,6 +594,30 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
				 * The object is deleted
				 * The object is deleted
				 */
				 */
				if (!previous_walk_state->return_desc) {
				if (!previous_walk_state->return_desc) {
					/*
					 * In slack mode execution, if there is no return value
					 * we should implicitly return zero (0) as a default value.
					 */
					if (acpi_gbl_enable_interpreter_slack &&
					    !previous_walk_state->
					    implicit_return_obj) {
						previous_walk_state->
						    implicit_return_obj =
						    acpi_ut_create_internal_object
						    (ACPI_TYPE_INTEGER);
						if (!previous_walk_state->
						    implicit_return_obj) {
							return_ACPI_STATUS
							    (AE_NO_MEMORY);
						}

						previous_walk_state->
						    implicit_return_obj->
						    integer.value = 0;
					}

					/* Restart the calling control method */

					status =
					status =
					    acpi_ds_restart_control_method
					    acpi_ds_restart_control_method
					    (walk_state,
					    (walk_state,