1 /******************************************************************************
3 * Name: acstruct.h - Internal structs
6 *****************************************************************************/
9 * Copyright (C) 2000, 2001 R. Byron Moore
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 #ifndef __ACSTRUCT_H__
27 #define __ACSTRUCT_H__
30 /*****************************************************************************
32 * Tree walking typedefs and structs
34 ****************************************************************************/
38 * Walk state - current state of a parse tree walk. Used for both a leisurely stroll through
39 * the tree (for whatever reason), and for control method execution.
42 #define NEXT_OP_DOWNWARD 1
43 #define NEXT_OP_UPWARD 2
45 #define WALK_NON_METHOD 0
47 #define WALK_METHOD_RESTART 2
49 typedef struct acpi_walk_state
51 u8 data_type
; /* To differentiate various internal objs */\
52 ACPI_OWNER_ID owner_id
; /* Owner of objects created during the walk */
53 u8 last_predicate
; /* Result of last predicate */
54 u8 next_op_info
; /* Info about Next_op */
55 u8 num_operands
; /* Stack pointer for Operands[] array */
56 u8 current_result
; /* */
58 struct acpi_walk_state
*next
; /* Next Walk_state in list */
59 ACPI_PARSE_OBJECT
*origin
; /* Start of walk [Obsolete] */
61 /* TBD: Obsolete with removal of WALK procedure ? */
62 ACPI_PARSE_OBJECT
*prev_op
; /* Last op that was processed */
63 ACPI_PARSE_OBJECT
*next_op
; /* next op to be processed */
66 ACPI_GENERIC_STATE
*results
; /* Stack of accumulated results */
67 ACPI_GENERIC_STATE
*control_state
; /* List of control states (nested IFs) */
68 ACPI_GENERIC_STATE
*scope_info
; /* Stack of nested scopes */
69 ACPI_PARSE_STATE
*parser_state
; /* Current state of parser */
71 ACPI_OPCODE_INFO
*op_info
; /* Info on current opcode */
72 ACPI_PARSE_DOWNWARDS descending_callback
;
73 ACPI_PARSE_UPWARDS ascending_callback
;
75 union acpi_operand_obj
*return_desc
; /* Return object, if any */
76 union acpi_operand_obj
*method_desc
; /* Method descriptor if running a method */
77 struct acpi_node
*method_node
; /* Method Node if running a method */
78 ACPI_PARSE_OBJECT
*method_call_op
; /* Method_call Op if running a method */
79 struct acpi_node
*method_call_node
; /* Called method Node*/
80 union acpi_operand_obj
*operands
[OBJ_NUM_OPERANDS
]; /* Operands passed to the interpreter */
81 struct acpi_node arguments
[MTH_NUM_ARGS
]; /* Control method arguments */
82 struct acpi_node local_variables
[MTH_NUM_LOCALS
]; /* Control method locals */
83 struct acpi_walk_list
*walk_list
;
87 u16 opcode
; /* Current AML opcode */
89 u16 current_sync_level
; /* Mutex Sync (nested acquire) level */
93 u32 method_breakpoint
;
100 * Walk list - head of a tree of walk states. Multiple walk states are created when there
101 * are nested control methods executing.
103 typedef struct acpi_walk_list
106 ACPI_WALK_STATE
*walk_state
;
107 ACPI_OBJECT_MUTEX acquired_mutex_list
; /* List of all currently acquired mutexes */
112 /* Info used by Acpi_ps_init_objects */
114 typedef struct acpi_init_walk_info
122 ACPI_TABLE_DESC
*table_desc
;
124 } ACPI_INIT_WALK_INFO
;
127 /* Info used by TBD */
129 typedef struct acpi_device_walk_info
134 ACPI_TABLE_DESC
*table_desc
;
136 } ACPI_DEVICE_WALK_INFO
;
139 /* TBD: [Restructure] Merge with struct above */
141 typedef struct acpi_walk_info
148 typedef struct acpi_get_devices_info
150 WALK_CALLBACK user_function
;
154 } ACPI_GET_DEVICES_INFO
;