2018-03-15 07:13:07 +08:00
|
|
|
/* SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 */
|
2005-04-17 06:20:36 +08:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* Name: acstruct.h - Internal structs
|
|
|
|
*
|
2023-04-05 21:38:21 +08:00
|
|
|
* Copyright (C) 2000 - 2023, Intel Corp.
|
2005-04-17 06:20:36 +08:00
|
|
|
*
|
2018-03-15 07:13:07 +08:00
|
|
|
*****************************************************************************/
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
#ifndef __ACSTRUCT_H__
|
|
|
|
#define __ACSTRUCT_H__
|
|
|
|
|
2006-03-18 05:44:00 +08:00
|
|
|
/* acpisrc:struct_defs -- for acpisrc conversion */
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/*****************************************************************************
|
|
|
|
*
|
|
|
|
* Tree walking typedefs and structs
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/*
|
2012-10-31 10:26:55 +08:00
|
|
|
* Walk state - current state of a parse tree walk. Used for both a leisurely
|
2006-05-27 04:36:00 +08:00
|
|
|
* stroll through the tree (for whatever reason), and for control method
|
|
|
|
* execution.
|
2005-04-17 06:20:36 +08:00
|
|
|
*/
|
|
|
|
#define ACPI_NEXT_OP_DOWNWARD 1
|
|
|
|
#define ACPI_NEXT_OP_UPWARD 2
|
|
|
|
|
2006-05-27 04:36:00 +08:00
|
|
|
/*
|
|
|
|
* Groups of definitions for walk_type used for different implementations of
|
|
|
|
* walkers (never simultaneously) - flags for interpreter:
|
|
|
|
*/
|
2005-04-17 06:20:36 +08:00
|
|
|
#define ACPI_WALK_NON_METHOD 0
|
2006-05-27 04:36:00 +08:00
|
|
|
#define ACPI_WALK_METHOD 0x01
|
|
|
|
#define ACPI_WALK_METHOD_RESTART 0x02
|
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
struct acpi_walk_state {
|
2006-03-18 05:44:00 +08:00
|
|
|
struct acpi_walk_state *next; /* Next walk_state in list */
|
|
|
|
u8 descriptor_type; /* To differentiate various internal objs */
|
2005-08-05 12:44:28 +08:00
|
|
|
u8 walk_type;
|
2006-03-18 05:44:00 +08:00
|
|
|
u16 opcode; /* Current AML opcode */
|
2005-08-05 12:44:28 +08:00
|
|
|
u8 next_op_info; /* Info about next_op */
|
|
|
|
u8 num_operands; /* Stack pointer for Operands[] array */
|
2008-04-10 23:06:36 +08:00
|
|
|
u8 operand_index; /* Index into operand stack, to be used by acpi_ds_obj_stack_push */
|
2006-03-18 05:44:00 +08:00
|
|
|
acpi_owner_id owner_id; /* Owner of objects created during the walk */
|
|
|
|
u8 last_predicate; /* Result of last predicate */
|
|
|
|
u8 current_result;
|
2005-08-05 12:44:28 +08:00
|
|
|
u8 return_used;
|
|
|
|
u8 scope_depth;
|
|
|
|
u8 pass_number; /* Parse pass during table load */
|
2015-07-01 14:44:17 +08:00
|
|
|
u8 namespace_override; /* Override existing objects */
|
2008-04-10 23:06:36 +08:00
|
|
|
u8 result_size; /* Total elements for the result stack */
|
|
|
|
u8 result_count; /* Current number of occupied elements of result stack */
|
2015-07-23 12:52:11 +08:00
|
|
|
u8 *aml;
|
2005-08-05 12:44:28 +08:00
|
|
|
u32 arg_types;
|
|
|
|
u32 method_breakpoint; /* For single stepping */
|
|
|
|
u32 user_breakpoint; /* User AML breakpoint */
|
|
|
|
u32 parse_flags;
|
2006-03-18 05:44:00 +08:00
|
|
|
|
|
|
|
struct acpi_parse_state parser_state; /* Current state of parser */
|
2005-08-05 12:44:28 +08:00
|
|
|
u32 prev_arg_types;
|
ACPI: ACPICA 20060331
Implemented header file support for the following
additional ACPI tables: ASF!, BOOT, CPEP, DBGP, MCFG, SPCR,
SPMI, TCPA, and WDRT. With this support, all current and
known ACPI tables are now defined in the ACPICA headers and
are available for use by device drivers and other software.
Implemented support to allow tables that contain ACPI
names with invalid characters to be loaded. Previously,
this would cause the table load to fail, but since
there are several known cases of such tables on
existing machines, this change was made to enable
ACPI support for them. Also, this matches the
behavior of the Microsoft ACPI implementation.
https://bugzilla.novell.com/show_bug.cgi?id=147621
Fixed a couple regressions introduced during the memory
optimization in the 20060317 release. The namespace
node definition required additional reorganization and
an internal datatype that had been changed to 8-bit was
restored to 32-bit. (Valery Podrezov)
Fixed a problem where a null pointer passed to
acpi_ut_delete_generic_state() could be passed through
to acpi_os_release_object which is unexpected. Such
null pointers are now trapped and ignored, matching
the behavior of the previous implementation before the
deployment of acpi_os_release_object(). (Valery Podrezov,
Fiodor Suietov)
Fixed a memory mapping leak during the deletion of
a SystemMemory operation region where a cached memory
mapping was not deleted. This became a noticeable problem
for operation regions that are defined within frequently
used control methods. (Dana Meyers)
Reorganized the ACPI table header files into two main
files: one for the ACPI tables consumed by the ACPICA core,
and another for the miscellaneous ACPI tables that are
consumed by the drivers and other software. The various
FADT definitions were merged into one common section and
three different tables (ACPI 1.0, 1.0+, and 2.0)
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-03-31 13:00:00 +08:00
|
|
|
u32 arg_count; /* push for fixed or var args */
|
2018-12-14 04:30:33 +08:00
|
|
|
u16 method_nesting_depth;
|
|
|
|
u8 method_is_nested;
|
2005-08-05 12:44:28 +08:00
|
|
|
|
|
|
|
struct acpi_namespace_node arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */
|
2006-03-18 05:44:00 +08:00
|
|
|
struct acpi_namespace_node local_variables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */
|
|
|
|
union acpi_operand_object *operands[ACPI_OBJ_NUM_OPERANDS + 1]; /* Operands passed to the interpreter (+1 for NULL terminator) */
|
|
|
|
union acpi_operand_object **params;
|
|
|
|
|
|
|
|
u8 *aml_last_while;
|
2005-08-05 12:44:28 +08:00
|
|
|
union acpi_operand_object **caller_return_desc;
|
|
|
|
union acpi_generic_state *control_state; /* List of control states (nested IFs) */
|
|
|
|
struct acpi_namespace_node *deferred_node; /* Used when executing deferred opcodes */
|
|
|
|
union acpi_operand_object *implicit_return_obj;
|
|
|
|
struct acpi_namespace_node *method_call_node; /* Called method Node */
|
|
|
|
union acpi_parse_object *method_call_op; /* method_call Op if running a method */
|
|
|
|
union acpi_operand_object *method_desc; /* Method descriptor if running a method */
|
2018-12-14 04:30:33 +08:00
|
|
|
struct acpi_namespace_node *method_node; /* Method node if running a method */
|
|
|
|
char *method_pathname; /* Full pathname of running method */
|
2005-08-05 12:44:28 +08:00
|
|
|
union acpi_parse_object *op; /* Current parser op */
|
|
|
|
const struct acpi_opcode_info *op_info; /* Info on current opcode */
|
|
|
|
union acpi_parse_object *origin; /* Start of walk [Obsolete] */
|
|
|
|
union acpi_operand_object *result_obj;
|
|
|
|
union acpi_generic_state *results; /* Stack of accumulated results */
|
|
|
|
union acpi_operand_object *return_desc; /* Return object, if any */
|
|
|
|
union acpi_generic_state *scope_info; /* Stack of nested scopes */
|
|
|
|
union acpi_parse_object *prev_op; /* Last op that was processed */
|
|
|
|
union acpi_parse_object *next_op; /* next op to be processed */
|
2006-03-18 05:44:00 +08:00
|
|
|
struct acpi_thread_state *thread;
|
2005-08-05 12:44:28 +08:00
|
|
|
acpi_parse_downwards descending_callback;
|
|
|
|
acpi_parse_upwards ascending_callback;
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
2010-05-26 11:20:47 +08:00
|
|
|
/* Info used by acpi_ns_initialize_objects and acpi_ds_initialize_objects */
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
struct acpi_init_walk_info {
|
2008-06-10 13:42:13 +08:00
|
|
|
u32 table_index;
|
2010-05-26 11:20:47 +08:00
|
|
|
u32 object_count;
|
|
|
|
u32 method_count;
|
2014-03-24 14:49:00 +08:00
|
|
|
u32 serial_method_count;
|
|
|
|
u32 non_serial_method_count;
|
|
|
|
u32 serialized_method_count;
|
2010-05-26 11:20:47 +08:00
|
|
|
u32 device_count;
|
|
|
|
u32 op_region_count;
|
|
|
|
u32 field_count;
|
|
|
|
u32 buffer_count;
|
|
|
|
u32 package_count;
|
|
|
|
u32 op_region_init;
|
|
|
|
u32 field_init;
|
|
|
|
u32 buffer_init;
|
|
|
|
u32 package_init;
|
|
|
|
acpi_owner_id owner_id;
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
struct acpi_get_devices_info {
|
|
|
|
acpi_walk_callback user_function;
|
|
|
|
void *context;
|
2007-08-21 23:18:20 +08:00
|
|
|
const char *hid;
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
union acpi_aml_operands {
|
|
|
|
union acpi_operand_object *operands[7];
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
struct {
|
|
|
|
struct acpi_object_integer *type;
|
|
|
|
struct acpi_object_integer *code;
|
|
|
|
struct acpi_object_integer *argument;
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
} fatal;
|
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
struct {
|
|
|
|
union acpi_operand_object *source;
|
|
|
|
struct acpi_object_integer *index;
|
|
|
|
union acpi_operand_object *target;
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
} index;
|
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
struct {
|
|
|
|
union acpi_operand_object *source;
|
|
|
|
struct acpi_object_integer *index;
|
|
|
|
struct acpi_object_integer *length;
|
|
|
|
union acpi_operand_object *target;
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
} mid;
|
|
|
|
};
|
|
|
|
|
2006-05-27 04:36:00 +08:00
|
|
|
/*
|
2013-05-30 10:00:01 +08:00
|
|
|
* Structure used to pass object evaluation information and parameters.
|
2006-05-27 04:36:00 +08:00
|
|
|
* Purpose is to reduce CPU stack use.
|
|
|
|
*/
|
|
|
|
struct acpi_evaluate_info {
|
2013-05-30 10:00:01 +08:00
|
|
|
/* The first 3 elements are passed by the caller to acpi_ns_evaluate */
|
|
|
|
|
|
|
|
struct acpi_namespace_node *prefix_node; /* Input: starting node */
|
2016-03-24 09:40:40 +08:00
|
|
|
const char *relative_pathname; /* Input: path relative to prefix_node */
|
2013-05-30 10:00:01 +08:00
|
|
|
union acpi_operand_object **parameters; /* Input: argument list */
|
|
|
|
|
|
|
|
struct acpi_namespace_node *node; /* Resolved node (prefix_node:relative_pathname) */
|
|
|
|
union acpi_operand_object *obj_desc; /* Object attached to the resolved node */
|
|
|
|
char *full_pathname; /* Full pathname of the resolved node */
|
|
|
|
|
|
|
|
const union acpi_predefined_info *predefined; /* Used if Node is a predefined name */
|
|
|
|
union acpi_operand_object *return_object; /* Object returned from the evaluation */
|
|
|
|
union acpi_operand_object *parent_package; /* Used if return object is a Package */
|
|
|
|
|
|
|
|
u32 return_flags; /* Used for return value analysis */
|
|
|
|
u32 return_btype; /* Bitmapped type of the returned object */
|
|
|
|
u16 param_count; /* Count of the input argument list */
|
2019-08-17 05:43:21 +08:00
|
|
|
u16 node_flags; /* Same as Node->Flags */
|
2013-05-30 10:00:01 +08:00
|
|
|
u8 pass_number; /* Parser pass number */
|
|
|
|
u8 return_object_type; /* Object type of the returned object */
|
|
|
|
u8 flags; /* General flags */
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
2006-05-27 04:36:00 +08:00
|
|
|
/* Values for Flags above */
|
|
|
|
|
2013-05-30 10:00:01 +08:00
|
|
|
#define ACPI_IGNORE_RETURN_VALUE 1
|
|
|
|
|
|
|
|
/* Defines for return_flags field above */
|
|
|
|
|
|
|
|
#define ACPI_OBJECT_REPAIRED 1
|
|
|
|
#define ACPI_OBJECT_WRAPPED 2
|
2006-05-27 04:36:00 +08:00
|
|
|
|
|
|
|
/* Info used by acpi_ns_initialize_devices */
|
|
|
|
|
|
|
|
struct acpi_device_walk_info {
|
|
|
|
struct acpi_table_desc *table_desc;
|
|
|
|
struct acpi_evaluate_info *evaluate_info;
|
2010-05-26 11:48:22 +08:00
|
|
|
u32 device_count;
|
|
|
|
u32 num_STA;
|
|
|
|
u32 num_INI;
|
2006-05-27 04:36:00 +08:00
|
|
|
};
|
|
|
|
|
2019-10-26 05:36:55 +08:00
|
|
|
/* Info used by Acpi acpi_db_display_fields */
|
|
|
|
|
|
|
|
struct acpi_region_walk_info {
|
|
|
|
u32 debug_level;
|
|
|
|
u32 count;
|
|
|
|
acpi_owner_id owner_id;
|
|
|
|
u8 display_type;
|
|
|
|
u32 address_space_id;
|
|
|
|
};
|
|
|
|
|
2006-05-27 04:36:00 +08:00
|
|
|
/* TBD: [Restructure] Merge with struct above */
|
|
|
|
|
|
|
|
struct acpi_walk_info {
|
|
|
|
u32 debug_level;
|
|
|
|
u32 count;
|
|
|
|
acpi_owner_id owner_id;
|
|
|
|
u8 display_type;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* Display Types */
|
|
|
|
|
|
|
|
#define ACPI_DISPLAY_SUMMARY (u8) 0
|
|
|
|
#define ACPI_DISPLAY_OBJECTS (u8) 1
|
|
|
|
#define ACPI_DISPLAY_MASK (u8) 1
|
|
|
|
|
|
|
|
#define ACPI_DISPLAY_SHORT (u8) 2
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
#endif
|