2018-03-14 23:13:07 +00:00
|
|
|
// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
|
2005-04-16 22:20:36 +00:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* Module Name: dswstate - Dispatcher parse tree walk management routines
|
|
|
|
*
|
2023-04-05 13:38:21 +00:00
|
|
|
* Copyright (C) 2000 - 2023, Intel Corp.
|
2005-04-16 22:20:36 +00:00
|
|
|
*
|
2018-03-14 23:13:07 +00:00
|
|
|
*****************************************************************************/
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
#include <acpi/acpi.h>
|
2009-01-09 05:30:03 +00:00
|
|
|
#include "accommon.h"
|
|
|
|
#include "acparser.h"
|
|
|
|
#include "acdispat.h"
|
|
|
|
#include "acnamesp.h"
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
#define _COMPONENT ACPI_DISPATCHER
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_MODULE_NAME("dswstate")
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2008-04-10 15:06:36 +00:00
|
|
|
/* Local prototypes */
|
2012-10-31 02:25:45 +00:00
|
|
|
static acpi_status
|
|
|
|
acpi_ds_result_stack_push(struct acpi_walk_state *walk_state);
|
|
|
|
static acpi_status acpi_ds_result_stack_pop(struct acpi_walk_state *walk_state);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: acpi_ds_result_pop
|
|
|
|
*
|
2012-07-12 01:40:10 +00:00
|
|
|
* PARAMETERS: object - Where to return the popped object
|
2005-04-16 22:20:36 +00:00
|
|
|
* walk_state - Current Walk state
|
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
2008-04-10 15:06:36 +00:00
|
|
|
* DESCRIPTION: Pop an object off the top of this walk's result stack
|
2005-04-16 22:20:36 +00:00
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
acpi_status
|
2008-04-10 15:06:36 +00:00
|
|
|
acpi_ds_result_pop(union acpi_operand_object **object,
|
|
|
|
struct acpi_walk_state *walk_state)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2008-06-10 05:42:13 +00:00
|
|
|
u32 index;
|
2005-08-05 04:44:28 +00:00
|
|
|
union acpi_generic_state *state;
|
2008-04-10 15:06:36 +00:00
|
|
|
acpi_status status;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 21:15:00 +00:00
|
|
|
ACPI_FUNCTION_NAME(ds_result_pop);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
state = walk_state->results;
|
|
|
|
|
2008-04-10 15:06:36 +00:00
|
|
|
/* Incorrect state of result stack */
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2008-04-10 15:06:36 +00:00
|
|
|
if (state && !walk_state->result_count) {
|
|
|
|
ACPI_ERROR((AE_INFO, "No results on result stack"));
|
|
|
|
return (AE_AML_INTERNAL);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2008-04-10 15:06:36 +00:00
|
|
|
if (!state && walk_state->result_count) {
|
|
|
|
ACPI_ERROR((AE_INFO, "No result state for result stack"));
|
|
|
|
return (AE_AML_INTERNAL);
|
|
|
|
}
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2008-04-10 15:06:36 +00:00
|
|
|
/* Empty result stack */
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
if (!state) {
|
2008-04-10 15:06:36 +00:00
|
|
|
ACPI_ERROR((AE_INFO, "Result stack is empty! State=%p",
|
2006-01-27 21:43:00 +00:00
|
|
|
walk_state));
|
2005-04-16 22:20:36 +00:00
|
|
|
return (AE_AML_NO_RETURN_VALUE);
|
|
|
|
}
|
|
|
|
|
2008-04-10 15:06:36 +00:00
|
|
|
/* Return object of the top element and clean that top element result stack */
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2008-04-10 15:06:36 +00:00
|
|
|
walk_state->result_count--;
|
2009-04-22 05:13:48 +00:00
|
|
|
index = (u32)walk_state->result_count % ACPI_RESULTS_FRAME_OBJ_NUM;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2008-04-10 15:06:36 +00:00
|
|
|
*object = state->results.obj_desc[index];
|
2005-04-16 22:20:36 +00:00
|
|
|
if (!*object) {
|
2006-01-27 21:43:00 +00:00
|
|
|
ACPI_ERROR((AE_INFO,
|
2008-04-10 15:06:36 +00:00
|
|
|
"No result objects on result stack, State=%p",
|
|
|
|
walk_state));
|
2005-04-16 22:20:36 +00:00
|
|
|
return (AE_AML_NO_RETURN_VALUE);
|
|
|
|
}
|
|
|
|
|
2008-04-10 15:06:36 +00:00
|
|
|
state->results.obj_desc[index] = NULL;
|
|
|
|
if (index == 0) {
|
|
|
|
status = acpi_ds_result_stack_pop(walk_state);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
|
return (status);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
|
|
|
|
"Obj=%p [%s] Index=%X State=%p Num=%X\n", *object,
|
|
|
|
acpi_ut_get_object_type_name(*object),
|
2008-06-10 05:42:13 +00:00
|
|
|
index, walk_state, walk_state->result_count));
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
return (AE_OK);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: acpi_ds_result_push
|
|
|
|
*
|
2012-07-12 01:40:10 +00:00
|
|
|
* PARAMETERS: object - Where to return the popped object
|
2005-04-16 22:20:36 +00:00
|
|
|
* walk_state - Current Walk state
|
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
|
|
|
* DESCRIPTION: Push an object onto the current result stack
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
acpi_status
|
2016-05-05 04:57:53 +00:00
|
|
|
acpi_ds_result_push(union acpi_operand_object *object,
|
|
|
|
struct acpi_walk_state *walk_state)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2005-08-05 04:44:28 +00:00
|
|
|
union acpi_generic_state *state;
|
2008-04-10 15:06:36 +00:00
|
|
|
acpi_status status;
|
2008-06-10 05:42:13 +00:00
|
|
|
u32 index;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 21:15:00 +00:00
|
|
|
ACPI_FUNCTION_NAME(ds_result_push);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2008-04-10 15:06:36 +00:00
|
|
|
if (walk_state->result_count > walk_state->result_size) {
|
|
|
|
ACPI_ERROR((AE_INFO, "Result stack is full"));
|
|
|
|
return (AE_AML_INTERNAL);
|
|
|
|
} else if (walk_state->result_count == walk_state->result_size) {
|
|
|
|
|
|
|
|
/* Extend the result stack */
|
|
|
|
|
|
|
|
status = acpi_ds_result_stack_push(walk_state);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
|
ACPI_ERROR((AE_INFO,
|
|
|
|
"Failed to extend the result stack"));
|
|
|
|
return (status);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!(walk_state->result_count < walk_state->result_size)) {
|
|
|
|
ACPI_ERROR((AE_INFO, "No free elements in result stack"));
|
|
|
|
return (AE_AML_INTERNAL);
|
|
|
|
}
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
state = walk_state->results;
|
|
|
|
if (!state) {
|
2006-01-27 21:43:00 +00:00
|
|
|
ACPI_ERROR((AE_INFO, "No result stack frame during push"));
|
2005-04-16 22:20:36 +00:00
|
|
|
return (AE_AML_INTERNAL);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!object) {
|
2006-01-27 21:43:00 +00:00
|
|
|
ACPI_ERROR((AE_INFO,
|
2023-05-29 15:09:43 +00:00
|
|
|
"Null Object! State=%p Num=%u",
|
|
|
|
walk_state, walk_state->result_count));
|
2005-04-16 22:20:36 +00:00
|
|
|
return (AE_BAD_PARAMETER);
|
|
|
|
}
|
|
|
|
|
2008-04-10 15:06:36 +00:00
|
|
|
/* Assign the address of object to the top free element of result stack */
|
|
|
|
|
2009-04-22 05:13:48 +00:00
|
|
|
index = (u32)walk_state->result_count % ACPI_RESULTS_FRAME_OBJ_NUM;
|
2008-04-10 15:06:36 +00:00
|
|
|
state->results.obj_desc[index] = object;
|
|
|
|
walk_state->result_count++;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Obj=%p [%s] State=%p Num=%X Cur=%X\n",
|
|
|
|
object,
|
|
|
|
acpi_ut_get_object_type_name((union
|
|
|
|
acpi_operand_object *)
|
2008-04-10 15:06:36 +00:00
|
|
|
object), walk_state,
|
|
|
|
walk_state->result_count,
|
2005-08-05 04:44:28 +00:00
|
|
|
walk_state->current_result));
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
return (AE_OK);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: acpi_ds_result_stack_push
|
|
|
|
*
|
|
|
|
* PARAMETERS: walk_state - Current Walk state
|
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
2008-04-10 15:06:36 +00:00
|
|
|
* DESCRIPTION: Push an object onto the walk_state result stack
|
2005-04-16 22:20:36 +00:00
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
2008-04-10 15:06:36 +00:00
|
|
|
static acpi_status acpi_ds_result_stack_push(struct acpi_walk_state *walk_state)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2005-08-05 04:44:28 +00:00
|
|
|
union acpi_generic_state *state;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 21:15:00 +00:00
|
|
|
ACPI_FUNCTION_NAME(ds_result_stack_push);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2008-04-10 15:06:36 +00:00
|
|
|
/* Check for stack overflow */
|
|
|
|
|
2008-04-10 15:06:40 +00:00
|
|
|
if (((u32) walk_state->result_size + ACPI_RESULTS_FRAME_OBJ_NUM) >
|
2008-04-10 15:06:36 +00:00
|
|
|
ACPI_RESULTS_OBJ_NUM_MAX) {
|
2010-03-05 09:56:40 +00:00
|
|
|
ACPI_ERROR((AE_INFO, "Result stack overflow: State=%p Num=%u",
|
2008-04-10 15:06:36 +00:00
|
|
|
walk_state, walk_state->result_size));
|
|
|
|
return (AE_STACK_OVERFLOW);
|
|
|
|
}
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
state = acpi_ut_create_generic_state();
|
2005-04-16 22:20:36 +00:00
|
|
|
if (!state) {
|
|
|
|
return (AE_NO_MEMORY);
|
|
|
|
}
|
|
|
|
|
2006-03-17 21:44:00 +00:00
|
|
|
state->common.descriptor_type = ACPI_DESC_TYPE_STATE_RESULT;
|
2005-08-05 04:44:28 +00:00
|
|
|
acpi_ut_push_generic_state(&walk_state->results, state);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2008-04-10 15:06:36 +00:00
|
|
|
/* Increase the length of the result stack by the length of frame */
|
|
|
|
|
|
|
|
walk_state->result_size += ACPI_RESULTS_FRAME_OBJ_NUM;
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Results=%p State=%p\n",
|
|
|
|
state, walk_state));
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
return (AE_OK);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: acpi_ds_result_stack_pop
|
|
|
|
*
|
|
|
|
* PARAMETERS: walk_state - Current Walk state
|
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
2008-04-10 15:06:36 +00:00
|
|
|
* DESCRIPTION: Pop an object off of the walk_state result stack
|
2005-04-16 22:20:36 +00:00
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
2008-04-10 15:06:36 +00:00
|
|
|
static acpi_status acpi_ds_result_stack_pop(struct acpi_walk_state *walk_state)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2005-08-05 04:44:28 +00:00
|
|
|
union acpi_generic_state *state;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 21:15:00 +00:00
|
|
|
ACPI_FUNCTION_NAME(ds_result_stack_pop);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* Check for stack underflow */
|
|
|
|
|
|
|
|
if (walk_state->results == NULL) {
|
2008-04-10 15:06:36 +00:00
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
|
|
|
|
"Result stack underflow - State=%p\n",
|
2005-08-05 04:44:28 +00:00
|
|
|
walk_state));
|
2005-04-16 22:20:36 +00:00
|
|
|
return (AE_AML_NO_OPERAND);
|
|
|
|
}
|
|
|
|
|
2008-04-10 15:06:36 +00:00
|
|
|
if (walk_state->result_size < ACPI_RESULTS_FRAME_OBJ_NUM) {
|
|
|
|
ACPI_ERROR((AE_INFO, "Insufficient result stack size"));
|
|
|
|
return (AE_AML_INTERNAL);
|
|
|
|
}
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
state = acpi_ut_pop_generic_state(&walk_state->results);
|
2008-04-10 15:06:36 +00:00
|
|
|
acpi_ut_delete_generic_state(state);
|
|
|
|
|
|
|
|
/* Decrease the length of result stack by the length of frame */
|
|
|
|
|
|
|
|
walk_state->result_size -= ACPI_RESULTS_FRAME_OBJ_NUM;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 21:15:00 +00:00
|
|
|
"Result=%p RemainingResults=%X State=%p\n",
|
2008-04-10 15:06:36 +00:00
|
|
|
state, walk_state->result_count, walk_state));
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
return (AE_OK);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: acpi_ds_obj_stack_push
|
|
|
|
*
|
2012-07-12 01:40:10 +00:00
|
|
|
* PARAMETERS: object - Object to push
|
2005-04-16 22:20:36 +00:00
|
|
|
* walk_state - Current Walk state
|
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
|
|
|
* DESCRIPTION: Push an object onto this walk's object/operand stack
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
acpi_status
|
2016-05-05 04:57:53 +00:00
|
|
|
acpi_ds_obj_stack_push(void *object, struct acpi_walk_state *walk_state)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 21:15:00 +00:00
|
|
|
ACPI_FUNCTION_NAME(ds_obj_stack_push);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* Check for stack overflow */
|
|
|
|
|
|
|
|
if (walk_state->num_operands >= ACPI_OBJ_NUM_OPERANDS) {
|
2006-01-27 21:43:00 +00:00
|
|
|
ACPI_ERROR((AE_INFO,
|
2010-03-05 09:56:40 +00:00
|
|
|
"Object stack overflow! Obj=%p State=%p #Ops=%u",
|
2006-01-27 21:43:00 +00:00
|
|
|
object, walk_state, walk_state->num_operands));
|
2005-04-16 22:20:36 +00:00
|
|
|
return (AE_STACK_OVERFLOW);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Put the object onto the stack */
|
|
|
|
|
2008-04-10 15:06:36 +00:00
|
|
|
walk_state->operands[walk_state->operand_index] = object;
|
2005-04-16 22:20:36 +00:00
|
|
|
walk_state->num_operands++;
|
|
|
|
|
2008-04-10 15:06:36 +00:00
|
|
|
/* For the usual order of filling the operand stack */
|
|
|
|
|
|
|
|
walk_state->operand_index++;
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Obj=%p [%s] State=%p #Ops=%X\n",
|
|
|
|
object,
|
|
|
|
acpi_ut_get_object_type_name((union
|
|
|
|
acpi_operand_object *)
|
|
|
|
object), walk_state,
|
|
|
|
walk_state->num_operands));
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
return (AE_OK);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: acpi_ds_obj_stack_pop
|
|
|
|
*
|
|
|
|
* PARAMETERS: pop_count - Number of objects/entries to pop
|
|
|
|
* walk_state - Current Walk state
|
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
2012-10-31 02:26:55 +00:00
|
|
|
* DESCRIPTION: Pop this walk's object stack. Objects on the stack are NOT
|
2005-04-16 22:20:36 +00:00
|
|
|
* deleted by this routine.
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
acpi_status
|
2016-05-05 04:57:53 +00:00
|
|
|
acpi_ds_obj_stack_pop(u32 pop_count, struct acpi_walk_state *walk_state)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2005-08-05 04:44:28 +00:00
|
|
|
u32 i;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 21:15:00 +00:00
|
|
|
ACPI_FUNCTION_NAME(ds_obj_stack_pop);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
for (i = 0; i < pop_count; i++) {
|
2006-10-02 04:00:00 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
/* Check for stack underflow */
|
|
|
|
|
|
|
|
if (walk_state->num_operands == 0) {
|
2006-01-27 21:43:00 +00:00
|
|
|
ACPI_ERROR((AE_INFO,
|
2010-03-05 09:56:40 +00:00
|
|
|
"Object stack underflow! Count=%X State=%p #Ops=%u",
|
2006-01-27 21:43:00 +00:00
|
|
|
pop_count, walk_state,
|
|
|
|
walk_state->num_operands));
|
2005-04-16 22:20:36 +00:00
|
|
|
return (AE_STACK_UNDERFLOW);
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Just set the stack entry to null */
|
|
|
|
|
|
|
|
walk_state->num_operands--;
|
2005-08-05 04:44:28 +00:00
|
|
|
walk_state->operands[walk_state->num_operands] = NULL;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2010-03-05 09:56:40 +00:00
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Count=%X State=%p #Ops=%u\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
pop_count, walk_state, walk_state->num_operands));
|
|
|
|
|
|
|
|
return (AE_OK);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: acpi_ds_obj_stack_pop_and_delete
|
|
|
|
*
|
|
|
|
* PARAMETERS: pop_count - Number of objects/entries to pop
|
|
|
|
* walk_state - Current Walk state
|
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
|
|
|
* DESCRIPTION: Pop this walk's object stack and delete each object that is
|
|
|
|
* popped off.
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
2008-04-10 15:06:36 +00:00
|
|
|
void
|
2005-08-05 04:44:28 +00:00
|
|
|
acpi_ds_obj_stack_pop_and_delete(u32 pop_count,
|
2008-04-10 15:06:36 +00:00
|
|
|
struct acpi_walk_state *walk_state)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2008-06-10 05:42:13 +00:00
|
|
|
s32 i;
|
2005-08-05 04:44:28 +00:00
|
|
|
union acpi_operand_object *obj_desc;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 21:15:00 +00:00
|
|
|
ACPI_FUNCTION_NAME(ds_obj_stack_pop_and_delete);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2008-04-10 15:06:36 +00:00
|
|
|
if (pop_count == 0) {
|
|
|
|
return;
|
|
|
|
}
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2016-05-05 04:57:53 +00:00
|
|
|
for (i = (s32)pop_count - 1; i >= 0; i--) {
|
2005-04-16 22:20:36 +00:00
|
|
|
if (walk_state->num_operands == 0) {
|
2008-04-10 15:06:36 +00:00
|
|
|
return;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Pop the stack and delete an object if present in this stack entry */
|
|
|
|
|
|
|
|
walk_state->num_operands--;
|
2008-04-10 15:06:36 +00:00
|
|
|
obj_desc = walk_state->operands[i];
|
2005-04-16 22:20:36 +00:00
|
|
|
if (obj_desc) {
|
2008-04-10 15:06:36 +00:00
|
|
|
acpi_ut_remove_reference(walk_state->operands[i]);
|
|
|
|
walk_state->operands[i] = NULL;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Count=%X State=%p #Ops=%X\n",
|
2005-04-16 22:20:36 +00:00
|
|
|
pop_count, walk_state, walk_state->num_operands));
|
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: acpi_ds_get_current_walk_state
|
|
|
|
*
|
2012-07-12 01:40:10 +00:00
|
|
|
* PARAMETERS: thread - Get current active state for this Thread
|
2005-04-16 22:20:36 +00:00
|
|
|
*
|
|
|
|
* RETURN: Pointer to the current walk state
|
|
|
|
*
|
|
|
|
* DESCRIPTION: Get the walk state that is at the head of the list (the "current"
|
|
|
|
* walk state.)
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
struct acpi_walk_state *acpi_ds_get_current_walk_state(struct acpi_thread_state
|
|
|
|
*thread)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 21:15:00 +00:00
|
|
|
ACPI_FUNCTION_NAME(ds_get_current_walk_state);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
if (!thread) {
|
|
|
|
return (NULL);
|
|
|
|
}
|
|
|
|
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 21:15:00 +00:00
|
|
|
ACPI_DEBUG_PRINT((ACPI_DB_PARSE, "Current WalkState %p\n",
|
2005-08-05 04:44:28 +00:00
|
|
|
thread->walk_state_list));
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
return (thread->walk_state_list);
|
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: acpi_ds_push_walk_state
|
|
|
|
*
|
|
|
|
* PARAMETERS: walk_state - State to push
|
2012-07-12 01:40:10 +00:00
|
|
|
* thread - Thread state object
|
2005-04-16 22:20:36 +00:00
|
|
|
*
|
|
|
|
* RETURN: None
|
|
|
|
*
|
2008-04-10 15:06:36 +00:00
|
|
|
* DESCRIPTION: Place the Thread state at the head of the state list
|
2005-04-16 22:20:36 +00:00
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
void
|
2005-08-05 04:44:28 +00:00
|
|
|
acpi_ds_push_walk_state(struct acpi_walk_state *walk_state,
|
|
|
|
struct acpi_thread_state *thread)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 21:15:00 +00:00
|
|
|
ACPI_FUNCTION_TRACE(ds_push_walk_state);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
walk_state->next = thread->walk_state_list;
|
2005-04-16 22:20:36 +00:00
|
|
|
thread->walk_state_list = walk_state;
|
|
|
|
|
|
|
|
return_VOID;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: acpi_ds_pop_walk_state
|
|
|
|
*
|
2012-07-12 01:40:10 +00:00
|
|
|
* PARAMETERS: thread - Current thread state
|
2005-04-16 22:20:36 +00:00
|
|
|
*
|
2005-04-19 02:49:35 +00:00
|
|
|
* RETURN: A walk_state object popped from the thread's stack
|
2005-04-16 22:20:36 +00:00
|
|
|
*
|
|
|
|
* DESCRIPTION: Remove and return the walkstate object that is at the head of
|
2012-10-31 02:26:55 +00:00
|
|
|
* the walk stack for the given walk list. NULL indicates that
|
2005-04-16 22:20:36 +00:00
|
|
|
* the list is empty.
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
struct acpi_walk_state *acpi_ds_pop_walk_state(struct acpi_thread_state *thread)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2005-08-05 04:44:28 +00:00
|
|
|
struct acpi_walk_state *walk_state;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 21:15:00 +00:00
|
|
|
ACPI_FUNCTION_TRACE(ds_pop_walk_state);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
walk_state = thread->walk_state_list;
|
|
|
|
|
|
|
|
if (walk_state) {
|
2006-10-02 04:00:00 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
/* Next walk state becomes the current walk state */
|
|
|
|
|
|
|
|
thread->walk_state_list = walk_state->next;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Don't clear the NEXT field, this serves as an indicator
|
|
|
|
* that there is a parent WALK STATE
|
2005-04-19 02:49:35 +00:00
|
|
|
* Do Not: walk_state->Next = NULL;
|
2005-04-16 22:20:36 +00:00
|
|
|
*/
|
|
|
|
}
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
return_PTR(walk_state);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: acpi_ds_create_walk_state
|
|
|
|
*
|
2005-04-19 02:49:35 +00:00
|
|
|
* PARAMETERS: owner_id - ID for object creation
|
2012-07-12 01:40:10 +00:00
|
|
|
* origin - Starting point for this walk
|
2006-03-17 21:44:00 +00:00
|
|
|
* method_desc - Method object
|
2012-07-12 01:40:10 +00:00
|
|
|
* thread - Current thread state
|
2005-04-16 22:20:36 +00:00
|
|
|
*
|
|
|
|
* RETURN: Pointer to the new walk state.
|
|
|
|
*
|
2012-10-31 02:26:55 +00:00
|
|
|
* DESCRIPTION: Allocate and initialize a new walk state. The current walk
|
2005-04-16 22:20:36 +00:00
|
|
|
* state is set to this new state.
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
2012-10-31 02:25:45 +00:00
|
|
|
struct acpi_walk_state *acpi_ds_create_walk_state(acpi_owner_id owner_id,
|
|
|
|
union acpi_parse_object
|
|
|
|
*origin,
|
|
|
|
union acpi_operand_object
|
|
|
|
*method_desc,
|
|
|
|
struct acpi_thread_state
|
2005-08-05 04:44:28 +00:00
|
|
|
*thread)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2005-08-05 04:44:28 +00:00
|
|
|
struct acpi_walk_state *walk_state;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 21:15:00 +00:00
|
|
|
ACPI_FUNCTION_TRACE(ds_create_walk_state);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2006-10-03 04:00:00 +00:00
|
|
|
walk_state = ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_walk_state));
|
2005-04-16 22:20:36 +00:00
|
|
|
if (!walk_state) {
|
2005-08-05 04:44:28 +00:00
|
|
|
return_PTR(NULL);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2006-03-17 21:44:00 +00:00
|
|
|
walk_state->descriptor_type = ACPI_DESC_TYPE_WALK;
|
|
|
|
walk_state->method_desc = method_desc;
|
2005-08-05 04:44:28 +00:00
|
|
|
walk_state->owner_id = owner_id;
|
|
|
|
walk_state->origin = origin;
|
|
|
|
walk_state->thread = thread;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
walk_state->parser_state.start_op = origin;
|
|
|
|
|
|
|
|
/* Init the method args/local */
|
|
|
|
|
2018-12-13 20:30:27 +00:00
|
|
|
#ifndef ACPI_CONSTANT_EVAL_ONLY
|
2005-08-05 04:44:28 +00:00
|
|
|
acpi_ds_method_data_init(walk_state);
|
2005-04-16 22:20:36 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Put the new state at the head of the walk list */
|
|
|
|
|
|
|
|
if (thread) {
|
2005-08-05 04:44:28 +00:00
|
|
|
acpi_ds_push_walk_state(walk_state, thread);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
return_PTR(walk_state);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: acpi_ds_init_aml_walk
|
|
|
|
*
|
|
|
|
* PARAMETERS: walk_state - New state to be initialized
|
2012-07-12 01:40:10 +00:00
|
|
|
* op - Current parse op
|
2005-04-16 22:20:36 +00:00
|
|
|
* method_node - Control method NS node, if any
|
|
|
|
* aml_start - Start of AML
|
|
|
|
* aml_length - Length of AML
|
2012-07-12 01:40:10 +00:00
|
|
|
* info - Method info block (params, etc.)
|
2005-04-16 22:20:36 +00:00
|
|
|
* pass_number - 1, 2, or 3
|
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
|
|
|
* DESCRIPTION: Initialize a walk state for a pass 1 or 2 parse tree walk
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
acpi_status
|
2005-08-05 04:44:28 +00:00
|
|
|
acpi_ds_init_aml_walk(struct acpi_walk_state *walk_state,
|
|
|
|
union acpi_parse_object *op,
|
|
|
|
struct acpi_namespace_node *method_node,
|
|
|
|
u8 * aml_start,
|
|
|
|
u32 aml_length,
|
2006-05-26 20:36:00 +00:00
|
|
|
struct acpi_evaluate_info *info, u8 pass_number)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2005-08-05 04:44:28 +00:00
|
|
|
acpi_status status;
|
|
|
|
struct acpi_parse_state *parser_state = &walk_state->parser_state;
|
|
|
|
union acpi_parse_object *extra_op;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 21:15:00 +00:00
|
|
|
ACPI_FUNCTION_TRACE(ds_init_aml_walk);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
walk_state->parser_state.aml =
|
ACPICA: Avoid undefined behavior: applying zero offset to null pointer
ACPICA commit 770653e3ba67c30a629ca7d12e352d83c2541b1e
Before this change we see the following UBSAN stack trace in Fuchsia:
#0 0x000021e4213b3302 in acpi_ds_init_aml_walk(struct acpi_walk_state*, union acpi_parse_object*, struct acpi_namespace_node*, u8*, u32, struct acpi_evaluate_info*, u8) ../../third_party/acpica/source/components/dispatcher/dswstate.c:682 <platform-bus-x86.so>+0x233302
#1.2 0x000020d0f660777f in ubsan_get_stack_trace() compiler-rt/lib/ubsan/ubsan_diag.cpp:41 <libclang_rt.asan.so>+0x3d77f
#1.1 0x000020d0f660777f in maybe_print_stack_trace() compiler-rt/lib/ubsan/ubsan_diag.cpp:51 <libclang_rt.asan.so>+0x3d77f
#1 0x000020d0f660777f in ~scoped_report() compiler-rt/lib/ubsan/ubsan_diag.cpp:387 <libclang_rt.asan.so>+0x3d77f
#2 0x000020d0f660b96d in handlepointer_overflow_impl() compiler-rt/lib/ubsan/ubsan_handlers.cpp:809 <libclang_rt.asan.so>+0x4196d
#3 0x000020d0f660b50d in compiler-rt/lib/ubsan/ubsan_handlers.cpp:815 <libclang_rt.asan.so>+0x4150d
#4 0x000021e4213b3302 in acpi_ds_init_aml_walk(struct acpi_walk_state*, union acpi_parse_object*, struct acpi_namespace_node*, u8*, u32, struct acpi_evaluate_info*, u8) ../../third_party/acpica/source/components/dispatcher/dswstate.c:682 <platform-bus-x86.so>+0x233302
#5 0x000021e4213e2369 in acpi_ds_call_control_method(struct acpi_thread_state*, struct acpi_walk_state*, union acpi_parse_object*) ../../third_party/acpica/source/components/dispatcher/dsmethod.c:605 <platform-bus-x86.so>+0x262369
#6 0x000021e421437fac in acpi_ps_parse_aml(struct acpi_walk_state*) ../../third_party/acpica/source/components/parser/psparse.c:550 <platform-bus-x86.so>+0x2b7fac
#7 0x000021e4214464d2 in acpi_ps_execute_method(struct acpi_evaluate_info*) ../../third_party/acpica/source/components/parser/psxface.c:244 <platform-bus-x86.so>+0x2c64d2
#8 0x000021e4213aa052 in acpi_ns_evaluate(struct acpi_evaluate_info*) ../../third_party/acpica/source/components/namespace/nseval.c:250 <platform-bus-x86.so>+0x22a052
#9 0x000021e421413dd8 in acpi_ns_init_one_device(acpi_handle, u32, void*, void**) ../../third_party/acpica/source/components/namespace/nsinit.c:735 <platform-bus-x86.so>+0x293dd8
#10 0x000021e421429e98 in acpi_ns_walk_namespace(acpi_object_type, acpi_handle, u32, u32, acpi_walk_callback, acpi_walk_callback, void*, void**) ../../third_party/acpica/source/components/namespace/nswalk.c:298 <platform-bus-x86.so>+0x2a9e98
#11 0x000021e4214131ac in acpi_ns_initialize_devices(u32) ../../third_party/acpica/source/components/namespace/nsinit.c:268 <platform-bus-x86.so>+0x2931ac
#12 0x000021e42147c40d in acpi_initialize_objects(u32) ../../third_party/acpica/source/components/utilities/utxfinit.c:304 <platform-bus-x86.so>+0x2fc40d
#13 0x000021e42126d603 in acpi::acpi_impl::initialize_acpi(acpi::acpi_impl*) ../../src/devices/board/lib/acpi/acpi-impl.cc:224 <platform-bus-x86.so>+0xed603
Add a simple check that avoids incrementing a pointer by zero, but
otherwise behaves as before. Note that our findings are against ACPICA
20221020, but the same code exists on master.
Link: https://github.com/acpica/acpica/commit/770653e3
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2023-04-05 13:42:43 +00:00
|
|
|
walk_state->parser_state.aml_start =
|
|
|
|
walk_state->parser_state.aml_end =
|
|
|
|
walk_state->parser_state.pkg_end = aml_start;
|
|
|
|
/* Avoid undefined behavior: applying zero offset to null pointer */
|
|
|
|
if (aml_length != 0) {
|
|
|
|
walk_state->parser_state.aml_end += aml_length;
|
|
|
|
walk_state->parser_state.pkg_end += aml_length;
|
|
|
|
}
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* The next_op of the next_walk will be the beginning of the method */
|
|
|
|
|
2005-04-19 02:49:35 +00:00
|
|
|
walk_state->next_op = NULL;
|
2005-07-29 22:15:00 +00:00
|
|
|
walk_state->pass_number = pass_number;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
if (info) {
|
2008-06-10 04:38:10 +00:00
|
|
|
walk_state->params = info->parameters;
|
|
|
|
walk_state->caller_return_desc = &info->return_object;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
status = acpi_ps_init_scope(&walk_state->parser_state, op);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
|
return_ACPI_STATUS(status);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (method_node) {
|
|
|
|
walk_state->parser_state.start_node = method_node;
|
2005-08-05 04:44:28 +00:00
|
|
|
walk_state->walk_type = ACPI_WALK_METHOD;
|
|
|
|
walk_state->method_node = method_node;
|
|
|
|
walk_state->method_desc =
|
|
|
|
acpi_ns_get_attached_object(method_node);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* Push start scope on scope stack and make it current */
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
status =
|
|
|
|
acpi_ds_scope_stack_push(method_node, ACPI_TYPE_METHOD,
|
|
|
|
walk_state);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
|
return_ACPI_STATUS(status);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Init the method arguments */
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
status = acpi_ds_method_data_init_args(walk_state->params,
|
|
|
|
ACPI_METHOD_NUM_ARGS,
|
|
|
|
walk_state);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
|
return_ACPI_STATUS(status);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
2005-08-05 04:44:28 +00:00
|
|
|
} else {
|
2005-04-16 22:20:36 +00:00
|
|
|
/*
|
|
|
|
* Setup the current scope.
|
|
|
|
* Find a Named Op that has a namespace node associated with it.
|
2012-10-31 02:26:55 +00:00
|
|
|
* search upwards from this Op. Current scope is the first
|
2005-04-16 22:20:36 +00:00
|
|
|
* Op with a namespace node.
|
|
|
|
*/
|
|
|
|
extra_op = parser_state->start_op;
|
|
|
|
while (extra_op && !extra_op->common.node) {
|
|
|
|
extra_op = extra_op->common.parent;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!extra_op) {
|
|
|
|
parser_state->start_node = NULL;
|
2005-08-05 04:44:28 +00:00
|
|
|
} else {
|
2005-04-16 22:20:36 +00:00
|
|
|
parser_state->start_node = extra_op->common.node;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (parser_state->start_node) {
|
2006-10-02 04:00:00 +00:00
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
/* Push start scope on scope stack and make it current */
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
status =
|
|
|
|
acpi_ds_scope_stack_push(parser_state->start_node,
|
|
|
|
parser_state->start_node->
|
|
|
|
type, walk_state);
|
|
|
|
if (ACPI_FAILURE(status)) {
|
|
|
|
return_ACPI_STATUS(status);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
status = acpi_ds_init_callbacks(walk_state, pass_number);
|
|
|
|
return_ACPI_STATUS(status);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
*
|
|
|
|
* FUNCTION: acpi_ds_delete_walk_state
|
|
|
|
*
|
|
|
|
* PARAMETERS: walk_state - State to delete
|
|
|
|
*
|
|
|
|
* RETURN: Status
|
|
|
|
*
|
|
|
|
* DESCRIPTION: Delete a walk state including all internal data structures
|
|
|
|
*
|
|
|
|
******************************************************************************/
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
void acpi_ds_delete_walk_state(struct acpi_walk_state *walk_state)
|
2005-04-16 22:20:36 +00:00
|
|
|
{
|
2005-08-05 04:44:28 +00:00
|
|
|
union acpi_generic_state *state;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
ACPI: ACPICA 20060421
Removed a device initialization optimization introduced in
20051216 where the _STA method was not run unless an _INI
was also present for the same device. This optimization
could cause problems because it could allow _INI methods
to be run within a not-present device subtree (If a
not-present device had no _INI, _STA would not be run,
the not-present status would not be discovered, and the
children of the device would be incorrectly traversed.)
Implemented a new _STA optimization where namespace
subtrees that do not contain _INI are identified and
ignored during device initialization. Selectively running
_STA can significantly improve boot time on large machines
(with assistance from Len Brown.)
Implemented support for the device initialization case
where the returned _STA flags indicate a device not-present
but functioning. In this case, _INI is not run, but the
device children are examined for presence, as per the
ACPI specification.
Implemented an additional change to the IndexField support
in order to conform to MS behavior. The value written to
the Index Register is not simply a byte offset, it is a
byte offset in units of the access width of the parent
Index Field. (Fiodor Suietov)
Defined and deployed a new OSL interface,
acpi_os_validate_address(). This interface is called during
the creation of all AML operation regions, and allows
the host OS to exert control over what addresses it will
allow the AML code to access. Operation Regions whose
addresses are disallowed will cause a runtime exception
when they are actually accessed (will not affect or abort
table loading.)
Defined and deployed a new OSL interface,
acpi_os_validate_interface(). This interface allows the host OS
to match the various "optional" interface/behavior strings
for the _OSI predefined control method as appropriate
(with assistance from Bjorn Helgaas.)
Restructured and corrected various problems in the
exception handling code paths within DsCallControlMethod
and DsTerminateControlMethod in dsmethod (with assistance
from Takayoshi Kochi.)
Modified the Linux source converter to ignore quoted string
literals while converting identifiers from mixed to lower
case. This will correct problems with the disassembler
and other areas where such strings must not be modified.
The ACPI_FUNCTION_* macros no longer require quotes around
the function name. This allows the Linux source converter
to convert the names, now that the converter ignores
quoted strings.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-04-21 21:15:00 +00:00
|
|
|
ACPI_FUNCTION_TRACE_PTR(ds_delete_walk_state, walk_state);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
if (!walk_state) {
|
2012-10-31 02:26:01 +00:00
|
|
|
return_VOID;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2006-03-17 21:44:00 +00:00
|
|
|
if (walk_state->descriptor_type != ACPI_DESC_TYPE_WALK) {
|
2006-01-27 21:43:00 +00:00
|
|
|
ACPI_ERROR((AE_INFO, "%p is not a valid walk state",
|
|
|
|
walk_state));
|
2012-10-31 02:26:01 +00:00
|
|
|
return_VOID;
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2006-05-26 20:36:00 +00:00
|
|
|
/* There should not be any open scopes */
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
if (walk_state->parser_state.scope) {
|
2006-01-27 21:43:00 +00:00
|
|
|
ACPI_ERROR((AE_INFO, "%p walk still has a scope list",
|
|
|
|
walk_state));
|
2006-05-26 20:36:00 +00:00
|
|
|
acpi_ps_cleanup_scope(&walk_state->parser_state);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Always must free any linked control states */
|
|
|
|
|
|
|
|
while (walk_state->control_state) {
|
|
|
|
state = walk_state->control_state;
|
|
|
|
walk_state->control_state = state->common.next;
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
acpi_ut_delete_generic_state(state);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Always must free any linked parse states */
|
|
|
|
|
|
|
|
while (walk_state->scope_info) {
|
|
|
|
state = walk_state->scope_info;
|
|
|
|
walk_state->scope_info = state->common.next;
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
acpi_ut_delete_generic_state(state);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Always must free any stacked result states */
|
|
|
|
|
|
|
|
while (walk_state->results) {
|
|
|
|
state = walk_state->results;
|
|
|
|
walk_state->results = state->common.next;
|
|
|
|
|
2005-08-05 04:44:28 +00:00
|
|
|
acpi_ut_delete_generic_state(state);
|
2005-04-16 22:20:36 +00:00
|
|
|
}
|
|
|
|
|
2006-10-03 04:00:00 +00:00
|
|
|
ACPI_FREE(walk_state);
|
2005-04-16 22:20:36 +00:00
|
|
|
return_VOID;
|
|
|
|
}
|