diff options
Diffstat (limited to 'include/acpi/acparser.h')
| -rw-r--r-- | include/acpi/acparser.h | 255 |
1 files changed, 83 insertions, 172 deletions
diff --git a/include/acpi/acparser.h b/include/acpi/acparser.h index 698276571818..d352d40de1f3 100644 --- a/include/acpi/acparser.h +++ b/include/acpi/acparser.h | |||
| @@ -41,18 +41,15 @@ | |||
| 41 | * POSSIBILITY OF SUCH DAMAGES. | 41 | * POSSIBILITY OF SUCH DAMAGES. |
| 42 | */ | 42 | */ |
| 43 | 43 | ||
| 44 | |||
| 45 | #ifndef __ACPARSER_H__ | 44 | #ifndef __ACPARSER_H__ |
| 46 | #define __ACPARSER_H__ | 45 | #define __ACPARSER_H__ |
| 47 | 46 | ||
| 48 | |||
| 49 | #define OP_HAS_RETURN_VALUE 1 | 47 | #define OP_HAS_RETURN_VALUE 1 |
| 50 | 48 | ||
| 51 | /* variable # arguments */ | 49 | /* variable # arguments */ |
| 52 | 50 | ||
| 53 | #define ACPI_VAR_ARGS ACPI_UINT32_MAX | 51 | #define ACPI_VAR_ARGS ACPI_UINT32_MAX |
| 54 | 52 | ||
| 55 | |||
| 56 | #define ACPI_PARSE_DELETE_TREE 0x0001 | 53 | #define ACPI_PARSE_DELETE_TREE 0x0001 |
| 57 | #define ACPI_PARSE_NO_TREE_DELETE 0x0000 | 54 | #define ACPI_PARSE_NO_TREE_DELETE 0x0000 |
| 58 | #define ACPI_PARSE_TREE_MASK 0x0001 | 55 | #define ACPI_PARSE_TREE_MASK 0x0001 |
| @@ -63,7 +60,7 @@ | |||
| 63 | #define ACPI_PARSE_MODE_MASK 0x0030 | 60 | #define ACPI_PARSE_MODE_MASK 0x0030 |
| 64 | 61 | ||
| 65 | #define ACPI_PARSE_DEFERRED_OP 0x0100 | 62 | #define ACPI_PARSE_DEFERRED_OP 0x0100 |
| 66 | 63 | #define ACPI_PARSE_DISASSEMBLE 0x0200 | |
| 67 | 64 | ||
| 68 | /****************************************************************************** | 65 | /****************************************************************************** |
| 69 | * | 66 | * |
| @@ -71,251 +68,165 @@ | |||
| 71 | * | 68 | * |
| 72 | *****************************************************************************/ | 69 | *****************************************************************************/ |
| 73 | 70 | ||
| 74 | |||
| 75 | /* | 71 | /* |
| 76 | * psxface - Parser external interfaces | 72 | * psxface - Parser external interfaces |
| 77 | */ | 73 | */ |
| 78 | acpi_status | 74 | acpi_status acpi_ps_execute_method(struct acpi_parameter_info *info); |
| 79 | acpi_psx_load_table ( | ||
| 80 | u8 *pcode_addr, | ||
| 81 | u32 pcode_length); | ||
| 82 | |||
| 83 | acpi_status | ||
| 84 | acpi_psx_execute ( | ||
| 85 | struct acpi_parameter_info *info); | ||
| 86 | |||
| 87 | 75 | ||
| 88 | /* | 76 | /* |
| 89 | * psargs - Parse AML opcode arguments | 77 | * psargs - Parse AML opcode arguments |
| 90 | */ | 78 | */ |
| 91 | u8 * | 79 | u8 *acpi_ps_get_next_package_end(struct acpi_parse_state *parser_state); |
| 92 | acpi_ps_get_next_package_end ( | ||
| 93 | struct acpi_parse_state *parser_state); | ||
| 94 | 80 | ||
| 95 | char * | 81 | char *acpi_ps_get_next_namestring(struct acpi_parse_state *parser_state); |
| 96 | acpi_ps_get_next_namestring ( | ||
| 97 | struct acpi_parse_state *parser_state); | ||
| 98 | 82 | ||
| 99 | void | 83 | void |
| 100 | acpi_ps_get_next_simple_arg ( | 84 | acpi_ps_get_next_simple_arg(struct acpi_parse_state *parser_state, |
| 101 | struct acpi_parse_state *parser_state, | 85 | u32 arg_type, union acpi_parse_object *arg); |
| 102 | u32 arg_type, | ||
| 103 | union acpi_parse_object *arg); | ||
| 104 | 86 | ||
| 105 | acpi_status | 87 | acpi_status |
| 106 | acpi_ps_get_next_namepath ( | 88 | acpi_ps_get_next_namepath(struct acpi_walk_state *walk_state, |
| 107 | struct acpi_walk_state *walk_state, | 89 | struct acpi_parse_state *parser_state, |
| 108 | struct acpi_parse_state *parser_state, | 90 | union acpi_parse_object *arg, u8 method_call); |
| 109 | union acpi_parse_object *arg, | ||
| 110 | u8 method_call); | ||
| 111 | 91 | ||
| 112 | acpi_status | 92 | acpi_status |
| 113 | acpi_ps_get_next_arg ( | 93 | acpi_ps_get_next_arg(struct acpi_walk_state *walk_state, |
| 114 | struct acpi_walk_state *walk_state, | 94 | struct acpi_parse_state *parser_state, |
| 115 | struct acpi_parse_state *parser_state, | 95 | u32 arg_type, union acpi_parse_object **return_arg); |
| 116 | u32 arg_type, | ||
| 117 | union acpi_parse_object **return_arg); | ||
| 118 | |||
| 119 | 96 | ||
| 120 | /* | 97 | /* |
| 121 | * psfind | 98 | * psfind |
| 122 | */ | 99 | */ |
| 123 | union acpi_parse_object * | 100 | union acpi_parse_object *acpi_ps_find_name(union acpi_parse_object *scope, |
| 124 | acpi_ps_find_name ( | 101 | u32 name, u32 opcode); |
| 125 | union acpi_parse_object *scope, | ||
| 126 | u32 name, | ||
| 127 | u32 opcode); | ||
| 128 | |||
| 129 | union acpi_parse_object* | ||
| 130 | acpi_ps_get_parent ( | ||
| 131 | union acpi_parse_object *op); | ||
| 132 | 102 | ||
| 103 | union acpi_parse_object *acpi_ps_get_parent(union acpi_parse_object *op); | ||
| 133 | 104 | ||
| 134 | /* | 105 | /* |
| 135 | * psopcode - AML Opcode information | 106 | * psopcode - AML Opcode information |
| 136 | */ | 107 | */ |
| 137 | const struct acpi_opcode_info * | 108 | const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode); |
| 138 | acpi_ps_get_opcode_info ( | ||
| 139 | u16 opcode); | ||
| 140 | |||
| 141 | char * | ||
| 142 | acpi_ps_get_opcode_name ( | ||
| 143 | u16 opcode); | ||
| 144 | 109 | ||
| 110 | char *acpi_ps_get_opcode_name(u16 opcode); | ||
| 145 | 111 | ||
| 146 | /* | 112 | /* |
| 147 | * psparse - top level parsing routines | 113 | * psparse - top level parsing routines |
| 148 | */ | 114 | */ |
| 149 | acpi_status | 115 | acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state); |
| 150 | acpi_ps_parse_aml ( | ||
| 151 | struct acpi_walk_state *walk_state); | ||
| 152 | 116 | ||
| 153 | u32 | 117 | u32 acpi_ps_get_opcode_size(u32 opcode); |
| 154 | acpi_ps_get_opcode_size ( | ||
| 155 | u32 opcode); | ||
| 156 | 118 | ||
| 157 | u16 | 119 | u16 acpi_ps_peek_opcode(struct acpi_parse_state *state); |
| 158 | acpi_ps_peek_opcode ( | ||
| 159 | struct acpi_parse_state *state); | ||
| 160 | 120 | ||
| 121 | acpi_status | ||
| 122 | acpi_ps_complete_this_op(struct acpi_walk_state *walk_state, | ||
| 123 | union acpi_parse_object *op); | ||
| 124 | |||
| 125 | acpi_status | ||
| 126 | acpi_ps_next_parse_state(struct acpi_walk_state *walk_state, | ||
| 127 | union acpi_parse_object *op, | ||
| 128 | acpi_status callback_status); | ||
| 129 | |||
| 130 | /* | ||
| 131 | * psloop - main parse loop | ||
| 132 | */ | ||
| 133 | acpi_status acpi_ps_parse_loop(struct acpi_walk_state *walk_state); | ||
| 161 | 134 | ||
| 162 | /* | 135 | /* |
| 163 | * psscope - Scope stack management routines | 136 | * psscope - Scope stack management routines |
| 164 | */ | 137 | */ |
| 165 | acpi_status | 138 | acpi_status |
| 166 | acpi_ps_init_scope ( | 139 | acpi_ps_init_scope(struct acpi_parse_state *parser_state, |
| 167 | struct acpi_parse_state *parser_state, | 140 | union acpi_parse_object *root); |
| 168 | union acpi_parse_object *root); | ||
| 169 | 141 | ||
| 170 | union acpi_parse_object * | 142 | union acpi_parse_object *acpi_ps_get_parent_scope(struct acpi_parse_state |
| 171 | acpi_ps_get_parent_scope ( | 143 | *state); |
| 172 | struct acpi_parse_state *state); | ||
| 173 | 144 | ||
| 174 | u8 | 145 | u8 acpi_ps_has_completed_scope(struct acpi_parse_state *parser_state); |
| 175 | acpi_ps_has_completed_scope ( | ||
| 176 | struct acpi_parse_state *parser_state); | ||
| 177 | 146 | ||
| 178 | void | 147 | void |
| 179 | acpi_ps_pop_scope ( | 148 | acpi_ps_pop_scope(struct acpi_parse_state *parser_state, |
| 180 | struct acpi_parse_state *parser_state, | 149 | union acpi_parse_object **op, |
| 181 | union acpi_parse_object **op, | 150 | u32 * arg_list, u32 * arg_count); |
| 182 | u32 *arg_list, | ||
| 183 | u32 *arg_count); | ||
| 184 | 151 | ||
| 185 | acpi_status | 152 | acpi_status |
| 186 | acpi_ps_push_scope ( | 153 | acpi_ps_push_scope(struct acpi_parse_state *parser_state, |
| 187 | struct acpi_parse_state *parser_state, | 154 | union acpi_parse_object *op, |
| 188 | union acpi_parse_object *op, | 155 | u32 remaining_args, u32 arg_count); |
| 189 | u32 remaining_args, | ||
| 190 | u32 arg_count); | ||
| 191 | |||
| 192 | void | ||
| 193 | acpi_ps_cleanup_scope ( | ||
| 194 | struct acpi_parse_state *state); | ||
| 195 | 156 | ||
| 157 | void acpi_ps_cleanup_scope(struct acpi_parse_state *state); | ||
| 196 | 158 | ||
| 197 | /* | 159 | /* |
| 198 | * pstree - parse tree manipulation routines | 160 | * pstree - parse tree manipulation routines |
| 199 | */ | 161 | */ |
| 200 | void | 162 | void |
| 201 | acpi_ps_append_arg( | 163 | acpi_ps_append_arg(union acpi_parse_object *op, union acpi_parse_object *arg); |
| 202 | union acpi_parse_object *op, | ||
| 203 | union acpi_parse_object *arg); | ||
| 204 | |||
| 205 | union acpi_parse_object* | ||
| 206 | acpi_ps_find ( | ||
| 207 | union acpi_parse_object *scope, | ||
| 208 | char *path, | ||
| 209 | u16 opcode, | ||
| 210 | u32 create); | ||
| 211 | |||
| 212 | union acpi_parse_object * | ||
| 213 | acpi_ps_get_arg( | ||
| 214 | union acpi_parse_object *op, | ||
| 215 | u32 argn); | ||
| 216 | 164 | ||
| 217 | #ifdef ACPI_FUTURE_USAGE | 165 | union acpi_parse_object *acpi_ps_find(union acpi_parse_object *scope, |
| 218 | union acpi_parse_object * | 166 | char *path, u16 opcode, u32 create); |
| 219 | acpi_ps_get_depth_next ( | ||
| 220 | union acpi_parse_object *origin, | ||
| 221 | union acpi_parse_object *op); | ||
| 222 | #endif /* ACPI_FUTURE_USAGE */ | ||
| 223 | 167 | ||
| 168 | union acpi_parse_object *acpi_ps_get_arg(union acpi_parse_object *op, u32 argn); | ||
| 169 | |||
| 170 | #ifdef ACPI_FUTURE_USAGE | ||
| 171 | union acpi_parse_object *acpi_ps_get_depth_next(union acpi_parse_object *origin, | ||
| 172 | union acpi_parse_object *op); | ||
| 173 | #endif /* ACPI_FUTURE_USAGE */ | ||
| 224 | 174 | ||
| 225 | /* | 175 | /* |
| 226 | * pswalk - parse tree walk routines | 176 | * pswalk - parse tree walk routines |
| 227 | */ | 177 | */ |
| 228 | acpi_status | 178 | acpi_status |
| 229 | acpi_ps_walk_parsed_aml ( | 179 | acpi_ps_walk_parsed_aml(union acpi_parse_object *start_op, |
| 230 | union acpi_parse_object *start_op, | 180 | union acpi_parse_object *end_op, |
| 231 | union acpi_parse_object *end_op, | 181 | union acpi_operand_object *mth_desc, |
| 232 | union acpi_operand_object *mth_desc, | 182 | struct acpi_namespace_node *start_node, |
| 233 | struct acpi_namespace_node *start_node, | 183 | union acpi_operand_object **params, |
| 234 | union acpi_operand_object **params, | 184 | union acpi_operand_object **caller_return_desc, |
| 235 | union acpi_operand_object **caller_return_desc, | 185 | acpi_owner_id owner_id, |
| 236 | acpi_owner_id owner_id, | 186 | acpi_parse_downwards descending_callback, |
| 237 | acpi_parse_downwards descending_callback, | 187 | acpi_parse_upwards ascending_callback); |
| 238 | acpi_parse_upwards ascending_callback); | ||
| 239 | |||
| 240 | acpi_status | ||
| 241 | acpi_ps_get_next_walk_op ( | ||
| 242 | struct acpi_walk_state *walk_state, | ||
| 243 | union acpi_parse_object *op, | ||
| 244 | acpi_parse_upwards ascending_callback); | ||
| 245 | 188 | ||
| 246 | acpi_status | 189 | acpi_status |
| 247 | acpi_ps_delete_completed_op ( | 190 | acpi_ps_get_next_walk_op(struct acpi_walk_state *walk_state, |
| 248 | struct acpi_walk_state *walk_state); | 191 | union acpi_parse_object *op, |
| 192 | acpi_parse_upwards ascending_callback); | ||
| 249 | 193 | ||
| 250 | void | 194 | acpi_status acpi_ps_delete_completed_op(struct acpi_walk_state *walk_state); |
| 251 | acpi_ps_delete_parse_tree ( | ||
| 252 | union acpi_parse_object *root); | ||
| 253 | 195 | ||
| 196 | void acpi_ps_delete_parse_tree(union acpi_parse_object *root); | ||
| 254 | 197 | ||
| 255 | /* | 198 | /* |
| 256 | * psutils - parser utilities | 199 | * psutils - parser utilities |
| 257 | */ | 200 | */ |
| 258 | union acpi_parse_object * | 201 | union acpi_parse_object *acpi_ps_create_scope_op(void); |
| 259 | acpi_ps_create_scope_op ( | ||
| 260 | void); | ||
| 261 | 202 | ||
| 262 | void | 203 | void acpi_ps_init_op(union acpi_parse_object *op, u16 opcode); |
| 263 | acpi_ps_init_op ( | ||
| 264 | union acpi_parse_object *op, | ||
| 265 | u16 opcode); | ||
| 266 | 204 | ||
| 267 | union acpi_parse_object * | 205 | union acpi_parse_object *acpi_ps_alloc_op(u16 opcode); |
| 268 | acpi_ps_alloc_op ( | ||
| 269 | u16 opcode); | ||
| 270 | 206 | ||
| 271 | void | 207 | void acpi_ps_free_op(union acpi_parse_object *op); |
| 272 | acpi_ps_free_op ( | ||
| 273 | union acpi_parse_object *op); | ||
| 274 | 208 | ||
| 275 | u8 | 209 | u8 acpi_ps_is_leading_char(u32 c); |
| 276 | acpi_ps_is_leading_char ( | ||
| 277 | u32 c); | ||
| 278 | 210 | ||
| 279 | u8 | 211 | u8 acpi_ps_is_prefix_char(u32 c); |
| 280 | acpi_ps_is_prefix_char ( | ||
| 281 | u32 c); | ||
| 282 | 212 | ||
| 283 | #ifdef ACPI_FUTURE_USAGE | 213 | #ifdef ACPI_FUTURE_USAGE |
| 284 | u32 | 214 | u32 acpi_ps_get_name(union acpi_parse_object *op); |
| 285 | acpi_ps_get_name( | 215 | #endif /* ACPI_FUTURE_USAGE */ |
| 286 | union acpi_parse_object *op); | ||
| 287 | #endif /* ACPI_FUTURE_USAGE */ | ||
| 288 | |||
| 289 | void | ||
| 290 | acpi_ps_set_name( | ||
| 291 | union acpi_parse_object *op, | ||
| 292 | u32 name); | ||
| 293 | |||
| 294 | #ifdef ACPI_ENABLE_OBJECT_CACHE | ||
| 295 | void | ||
| 296 | acpi_ps_delete_parse_cache ( | ||
| 297 | void); | ||
| 298 | #endif | ||
| 299 | 216 | ||
| 217 | void acpi_ps_set_name(union acpi_parse_object *op, u32 name); | ||
| 300 | 218 | ||
| 301 | /* | 219 | /* |
| 302 | * psdump - display parser tree | 220 | * psdump - display parser tree |
| 303 | */ | 221 | */ |
| 304 | u32 | 222 | u32 |
| 305 | acpi_ps_sprint_path ( | 223 | acpi_ps_sprint_path(char *buffer_start, |
| 306 | char *buffer_start, | 224 | u32 buffer_size, union acpi_parse_object *op); |
| 307 | u32 buffer_size, | ||
| 308 | union acpi_parse_object *op); | ||
| 309 | 225 | ||
| 310 | u32 | 226 | u32 |
| 311 | acpi_ps_sprint_op ( | 227 | acpi_ps_sprint_op(char *buffer_start, |
| 312 | char *buffer_start, | 228 | u32 buffer_size, union acpi_parse_object *op); |
| 313 | u32 buffer_size, | ||
| 314 | union acpi_parse_object *op); | ||
| 315 | |||
| 316 | void | ||
| 317 | acpi_ps_show ( | ||
| 318 | union acpi_parse_object *op); | ||
| 319 | 229 | ||
| 230 | void acpi_ps_show(union acpi_parse_object *op); | ||
| 320 | 231 | ||
| 321 | #endif /* __ACPARSER_H__ */ | 232 | #endif /* __ACPARSER_H__ */ |
