You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge branch 'acpica'
* acpica: (42 commits) ACPICA: Update version to 20150818 ACPICA: Debugger: Cleanup debugging outputs to dump name path without trailing underscores ACPICA: Disassembler: Cleanup acpi_gbl_db_opt_verbose acpiexec usage ACPICA: Disassembler: Cleanup acpi_gbl_db_opt_disasm ACPICA: Debugger: Split debugger initialization/termination APIs ACPICA: Header support to improve compatibility with MSVC ACPICA: Make the max-number-of-loops runtime configurable ACPICA: Debugger: Add option to display namespace summary/counts ACPICA: Add additional debug info/statements ACPICA: Table handling: Cleanup and update debug output for tools ACPICA: acpiexec/acpinames: Support very large number of ACPI tables ACPICA: acpinames: Add new options and wildcard support ACPICA: Headers: Fix some comments, no functional change ACPICA: Tables: Cleanup to reduce FACS globals ACPICA: Tables: Fix global table list issues by removing fixed table indexes ACPICA: Update info messages during ACPICA init ACPICA: Disassembler: Update for new listing mode ACPICA: Update parameter validation for data_table_region and load_table ACPICA: Disassembler: Remove duplicate code in _PLD processing. ACPICA: Correctly cleanup after a ACPI table load failure ...
This commit is contained in:
@@ -11,6 +11,7 @@ obj-y += acpi.o
|
||||
acpi-y := \
|
||||
dsargs.o \
|
||||
dscontrol.o \
|
||||
dsdebug.o \
|
||||
dsfield.o \
|
||||
dsinit.o \
|
||||
dsmethod.o \
|
||||
@@ -164,6 +165,7 @@ acpi-y += \
|
||||
utmath.o \
|
||||
utmisc.o \
|
||||
utmutex.o \
|
||||
utnonansi.o \
|
||||
utobject.o \
|
||||
utosi.o \
|
||||
utownerid.o \
|
||||
|
||||
@@ -67,9 +67,6 @@ struct acpi_db_execute_walk {
|
||||
};
|
||||
|
||||
#define PARAM_LIST(pl) pl
|
||||
#define DBTEST_OUTPUT_LEVEL(lvl) if (acpi_gbl_db_opt_verbose)
|
||||
#define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\
|
||||
acpi_os_printf PARAM_LIST(fp);}
|
||||
|
||||
#define EX_NO_SINGLE_STEP 1
|
||||
#define EX_SINGLE_STEP 2
|
||||
@@ -77,10 +74,6 @@ struct acpi_db_execute_walk {
|
||||
/*
|
||||
* dbxface - external debugger interfaces
|
||||
*/
|
||||
acpi_status acpi_db_initialize(void);
|
||||
|
||||
void acpi_db_terminate(void);
|
||||
|
||||
acpi_status
|
||||
acpi_db_single_step(struct acpi_walk_state *walk_state,
|
||||
union acpi_parse_object *op, u32 op_type);
|
||||
@@ -102,6 +95,8 @@ void acpi_db_display_interfaces(char *action_arg, char *interface_name_arg);
|
||||
|
||||
acpi_status acpi_db_sleep(char *object_arg);
|
||||
|
||||
void acpi_db_trace(char *enable_arg, char *method_arg, char *once_arg);
|
||||
|
||||
void acpi_db_display_locks(void);
|
||||
|
||||
void acpi_db_display_resources(char *object_arg);
|
||||
@@ -261,6 +256,23 @@ acpi_status acpi_db_user_commands(char prompt, union acpi_parse_object *op);
|
||||
char *acpi_db_get_next_token(char *string,
|
||||
char **next, acpi_object_type * return_type);
|
||||
|
||||
/*
|
||||
* dbobject
|
||||
*/
|
||||
void acpi_db_decode_internal_object(union acpi_operand_object *obj_desc);
|
||||
|
||||
void
|
||||
acpi_db_display_internal_object(union acpi_operand_object *obj_desc,
|
||||
struct acpi_walk_state *walk_state);
|
||||
|
||||
void acpi_db_decode_arguments(struct acpi_walk_state *walk_state);
|
||||
|
||||
void acpi_db_decode_locals(struct acpi_walk_state *walk_state);
|
||||
|
||||
void
|
||||
acpi_db_dump_method_info(acpi_status status,
|
||||
struct acpi_walk_state *walk_state);
|
||||
|
||||
/*
|
||||
* dbstats - Generation and display of ACPI table statistics
|
||||
*/
|
||||
|
||||
@@ -354,4 +354,12 @@ acpi_status
|
||||
acpi_ds_result_push(union acpi_operand_object *object,
|
||||
struct acpi_walk_state *walk_state);
|
||||
|
||||
/*
|
||||
* dsdebug - parser debugging routines
|
||||
*/
|
||||
void
|
||||
acpi_ds_dump_method_stack(acpi_status status,
|
||||
struct acpi_walk_state *walk_state,
|
||||
union acpi_parse_object *op);
|
||||
|
||||
#endif /* _ACDISPAT_H_ */
|
||||
|
||||
@@ -58,11 +58,12 @@ ACPI_GLOBAL(struct acpi_table_list, acpi_gbl_root_table_list);
|
||||
|
||||
ACPI_GLOBAL(struct acpi_table_header *, acpi_gbl_DSDT);
|
||||
ACPI_GLOBAL(struct acpi_table_header, acpi_gbl_original_dsdt_header);
|
||||
ACPI_INIT_GLOBAL(u32, acpi_gbl_dsdt_index, ACPI_INVALID_TABLE_INDEX);
|
||||
ACPI_INIT_GLOBAL(u32, acpi_gbl_facs_index, ACPI_INVALID_TABLE_INDEX);
|
||||
ACPI_INIT_GLOBAL(u32, acpi_gbl_xfacs_index, ACPI_INVALID_TABLE_INDEX);
|
||||
|
||||
#if (!ACPI_REDUCED_HARDWARE)
|
||||
ACPI_GLOBAL(struct acpi_table_facs *, acpi_gbl_FACS);
|
||||
ACPI_GLOBAL(struct acpi_table_facs *, acpi_gbl_facs32);
|
||||
ACPI_GLOBAL(struct acpi_table_facs *, acpi_gbl_facs64);
|
||||
|
||||
#endif /* !ACPI_REDUCED_HARDWARE */
|
||||
|
||||
@@ -235,6 +236,10 @@ ACPI_INIT_GLOBAL(u32, acpi_gbl_nesting_level, 0);
|
||||
|
||||
ACPI_GLOBAL(struct acpi_thread_state *, acpi_gbl_current_walk_list);
|
||||
|
||||
/* Maximum number of While() loop iterations before forced abort */
|
||||
|
||||
ACPI_GLOBAL(u16, acpi_gbl_max_loop_iterations);
|
||||
|
||||
/* Control method single step flag */
|
||||
|
||||
ACPI_GLOBAL(u8, acpi_gbl_cm_single_step);
|
||||
@@ -290,8 +295,6 @@ ACPI_GLOBAL(u32, acpi_fixed_event_count[ACPI_NUM_FIXED_EVENTS]);
|
||||
|
||||
ACPI_GLOBAL(u32, acpi_gbl_original_dbg_level);
|
||||
ACPI_GLOBAL(u32, acpi_gbl_original_dbg_layer);
|
||||
ACPI_GLOBAL(u32, acpi_gbl_trace_dbg_level);
|
||||
ACPI_GLOBAL(u32, acpi_gbl_trace_dbg_layer);
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
@@ -309,9 +312,10 @@ ACPI_INIT_GLOBAL(u8, acpi_gbl_no_resource_disassembly, FALSE);
|
||||
ACPI_INIT_GLOBAL(u8, acpi_gbl_ignore_noop_operator, FALSE);
|
||||
ACPI_INIT_GLOBAL(u8, acpi_gbl_cstyle_disassembly, TRUE);
|
||||
ACPI_INIT_GLOBAL(u8, acpi_gbl_force_aml_disassembly, FALSE);
|
||||
ACPI_INIT_GLOBAL(u8, acpi_gbl_dm_opt_verbose, TRUE);
|
||||
|
||||
ACPI_GLOBAL(u8, acpi_gbl_db_opt_disasm);
|
||||
ACPI_GLOBAL(u8, acpi_gbl_db_opt_verbose);
|
||||
ACPI_GLOBAL(u8, acpi_gbl_dm_opt_disasm);
|
||||
ACPI_GLOBAL(u8, acpi_gbl_dm_opt_listing);
|
||||
ACPI_GLOBAL(u8, acpi_gbl_num_external_methods);
|
||||
ACPI_GLOBAL(u32, acpi_gbl_resolved_external_methods);
|
||||
ACPI_GLOBAL(struct acpi_external_list *, acpi_gbl_external_list);
|
||||
@@ -346,8 +350,8 @@ ACPI_GLOBAL(char, acpi_gbl_db_debug_filename[ACPI_DB_LINE_BUFFER_SIZE]);
|
||||
/*
|
||||
* Statistic globals
|
||||
*/
|
||||
ACPI_GLOBAL(u16, acpi_gbl_obj_type_count[ACPI_TYPE_NS_NODE_MAX + 1]);
|
||||
ACPI_GLOBAL(u16, acpi_gbl_node_type_count[ACPI_TYPE_NS_NODE_MAX + 1]);
|
||||
ACPI_GLOBAL(u16, acpi_gbl_obj_type_count[ACPI_TOTAL_TYPES]);
|
||||
ACPI_GLOBAL(u16, acpi_gbl_node_type_count[ACPI_TOTAL_TYPES]);
|
||||
ACPI_GLOBAL(u16, acpi_gbl_obj_type_count_misc);
|
||||
ACPI_GLOBAL(u16, acpi_gbl_node_type_count_misc);
|
||||
ACPI_GLOBAL(u32, acpi_gbl_num_nodes);
|
||||
|
||||
@@ -131,6 +131,28 @@ void
|
||||
acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
|
||||
u32 level, u32 index);
|
||||
|
||||
void
|
||||
acpi_ex_start_trace_method(struct acpi_namespace_node *method_node,
|
||||
union acpi_operand_object *obj_desc,
|
||||
struct acpi_walk_state *walk_state);
|
||||
|
||||
void
|
||||
acpi_ex_stop_trace_method(struct acpi_namespace_node *method_node,
|
||||
union acpi_operand_object *obj_desc,
|
||||
struct acpi_walk_state *walk_state);
|
||||
|
||||
void
|
||||
acpi_ex_start_trace_opcode(union acpi_parse_object *op,
|
||||
struct acpi_walk_state *walk_state);
|
||||
|
||||
void
|
||||
acpi_ex_stop_trace_opcode(union acpi_parse_object *op,
|
||||
struct acpi_walk_state *walk_state);
|
||||
|
||||
void
|
||||
acpi_ex_trace_point(acpi_trace_event_type type,
|
||||
u8 begin, u8 *aml, char *pathname);
|
||||
|
||||
/*
|
||||
* exfield - ACPI AML (p-code) execution - field manipulation
|
||||
*/
|
||||
|
||||
@@ -174,8 +174,12 @@ struct acpi_namespace_node {
|
||||
*/
|
||||
#ifdef ACPI_LARGE_NAMESPACE_NODE
|
||||
union acpi_parse_object *op;
|
||||
void *method_locals;
|
||||
void *method_args;
|
||||
u32 value;
|
||||
u32 length;
|
||||
u8 arg_count;
|
||||
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -209,11 +213,9 @@ struct acpi_table_list {
|
||||
#define ACPI_ROOT_ORIGIN_ALLOCATED (1)
|
||||
#define ACPI_ROOT_ALLOW_RESIZE (2)
|
||||
|
||||
/* Predefined (fixed) table indexes */
|
||||
/* Predefined table indexes */
|
||||
|
||||
#define ACPI_TABLE_INDEX_DSDT (0)
|
||||
#define ACPI_TABLE_INDEX_FACS (1)
|
||||
#define ACPI_TABLE_INDEX_X_FACS (2)
|
||||
#define ACPI_INVALID_TABLE_INDEX (0xFFFFFFFF)
|
||||
|
||||
struct acpi_find_context {
|
||||
char *search_for;
|
||||
@@ -404,6 +406,13 @@ struct acpi_simple_repair_info {
|
||||
|
||||
#define ACPI_NUM_RTYPES 5 /* Number of actual object types */
|
||||
|
||||
/* Info for running the _REG methods */
|
||||
|
||||
struct acpi_reg_walk_info {
|
||||
acpi_adr_space_type space_id;
|
||||
u32 reg_run_count;
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Event typedefs and structs
|
||||
@@ -715,7 +724,7 @@ union acpi_parse_value {
|
||||
union acpi_parse_object *arg; /* arguments and contained ops */
|
||||
};
|
||||
|
||||
#ifdef ACPI_DISASSEMBLER
|
||||
#if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT)
|
||||
#define ACPI_DISASM_ONLY_MEMBERS(a) a;
|
||||
#else
|
||||
#define ACPI_DISASM_ONLY_MEMBERS(a)
|
||||
@@ -726,7 +735,7 @@ union acpi_parse_value {
|
||||
u8 descriptor_type; /* To differentiate various internal objs */\
|
||||
u8 flags; /* Type of Op */\
|
||||
u16 aml_opcode; /* AML opcode */\
|
||||
u32 aml_offset; /* Offset of declaration in AML */\
|
||||
u8 *aml; /* Address of declaration in AML */\
|
||||
union acpi_parse_object *next; /* Next op */\
|
||||
struct acpi_namespace_node *node; /* For use by interpreter */\
|
||||
union acpi_parse_value value; /* Value or args associated with the opcode */\
|
||||
@@ -1103,6 +1112,9 @@ struct acpi_db_method_info {
|
||||
* Index of current thread inside all them created.
|
||||
*/
|
||||
char init_args;
|
||||
#ifdef ACPI_DEBUGGER
|
||||
acpi_object_type arg_types[4];
|
||||
#endif
|
||||
char *arguments[4];
|
||||
char num_threads_str[11];
|
||||
char id_of_thread_str[11];
|
||||
@@ -1119,6 +1131,10 @@ struct acpi_integrity_info {
|
||||
#define ACPI_DB_CONSOLE_OUTPUT 0x02
|
||||
#define ACPI_DB_DUPLICATE_OUTPUT 0x03
|
||||
|
||||
struct acpi_object_info {
|
||||
u32 types[ACPI_TOTAL_TYPES];
|
||||
};
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Debug
|
||||
|
||||
@@ -220,6 +220,15 @@
|
||||
#define ACPI_MUL_32(a) _ACPI_MUL(a, 5)
|
||||
#define ACPI_MOD_32(a) _ACPI_MOD(a, 32)
|
||||
|
||||
/* Test for ASCII character */
|
||||
|
||||
#define ACPI_IS_ASCII(c) ((c) < 0x80)
|
||||
|
||||
/* Signed integers */
|
||||
|
||||
#define ACPI_SIGN_POSITIVE 0
|
||||
#define ACPI_SIGN_NEGATIVE 1
|
||||
|
||||
/*
|
||||
* Rounding macros (Power of two boundaries only)
|
||||
*/
|
||||
|
||||
@@ -272,17 +272,20 @@ acpi_ns_check_package(struct acpi_evaluate_info *info,
|
||||
*/
|
||||
u32 acpi_ns_opens_scope(acpi_object_type type);
|
||||
|
||||
acpi_status
|
||||
acpi_ns_build_external_path(struct acpi_namespace_node *node,
|
||||
acpi_size size, char *name_buffer);
|
||||
|
||||
char *acpi_ns_get_external_pathname(struct acpi_namespace_node *node);
|
||||
|
||||
u32
|
||||
acpi_ns_build_normalized_path(struct acpi_namespace_node *node,
|
||||
char *full_path, u32 path_size, u8 no_trailing);
|
||||
|
||||
char *acpi_ns_get_normalized_pathname(struct acpi_namespace_node *node,
|
||||
u8 no_trailing);
|
||||
|
||||
char *acpi_ns_name_of_current_scope(struct acpi_walk_state *walk_state);
|
||||
|
||||
acpi_status
|
||||
acpi_ns_handle_to_pathname(acpi_handle target_handle,
|
||||
struct acpi_buffer *buffer);
|
||||
struct acpi_buffer *buffer, u8 no_trailing);
|
||||
|
||||
u8
|
||||
acpi_ns_pattern_match(struct acpi_namespace_node *obj_node, char *search_for);
|
||||
|
||||
@@ -176,6 +176,7 @@ struct acpi_object_method {
|
||||
u8 param_count;
|
||||
u8 sync_level;
|
||||
union acpi_operand_object *mutex;
|
||||
union acpi_operand_object *node;
|
||||
u8 *aml_start;
|
||||
union {
|
||||
acpi_internal_method implementation;
|
||||
|
||||
@@ -225,11 +225,11 @@ void acpi_ps_delete_parse_tree(union acpi_parse_object *root);
|
||||
/*
|
||||
* psutils - parser utilities
|
||||
*/
|
||||
union acpi_parse_object *acpi_ps_create_scope_op(void);
|
||||
union acpi_parse_object *acpi_ps_create_scope_op(u8 *aml);
|
||||
|
||||
void acpi_ps_init_op(union acpi_parse_object *op, u16 opcode);
|
||||
|
||||
union acpi_parse_object *acpi_ps_alloc_op(u16 opcode);
|
||||
union acpi_parse_object *acpi_ps_alloc_op(u16 opcode, u8 *aml);
|
||||
|
||||
void acpi_ps_free_op(union acpi_parse_object *op);
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ struct acpi_walk_state {
|
||||
u8 namespace_override; /* Override existing objects */
|
||||
u8 result_size; /* Total elements for the result stack */
|
||||
u8 result_count; /* Current number of occupied elements of result stack */
|
||||
u32 aml_offset;
|
||||
u8 *aml;
|
||||
u32 arg_types;
|
||||
u32 method_breakpoint; /* For single stepping */
|
||||
u32 user_breakpoint; /* User AML breakpoint */
|
||||
|
||||
@@ -154,14 +154,20 @@ void acpi_tb_check_dsdt_header(void);
|
||||
struct acpi_table_header *acpi_tb_copy_dsdt(u32 table_index);
|
||||
|
||||
void
|
||||
acpi_tb_install_table_with_override(u32 table_index,
|
||||
struct acpi_table_desc *new_table_desc,
|
||||
u8 override);
|
||||
acpi_tb_install_table_with_override(struct acpi_table_desc *new_table_desc,
|
||||
u8 override, u32 *table_index);
|
||||
|
||||
acpi_status
|
||||
acpi_tb_install_fixed_table(acpi_physical_address address,
|
||||
char *signature, u32 table_index);
|
||||
char *signature, u32 *table_index);
|
||||
|
||||
acpi_status acpi_tb_parse_root_table(acpi_physical_address rsdp_address);
|
||||
|
||||
u8 acpi_is_valid_signature(char *signature);
|
||||
|
||||
/*
|
||||
* tbxfload
|
||||
*/
|
||||
acpi_status acpi_tb_load_namespace(void);
|
||||
|
||||
#endif /* __ACTABLES_H__ */
|
||||
|
||||
@@ -166,6 +166,17 @@ struct acpi_pkg_info {
|
||||
#define DB_DWORD_DISPLAY 4
|
||||
#define DB_QWORD_DISPLAY 8
|
||||
|
||||
/*
|
||||
* utnonansi - Non-ANSI C library functions
|
||||
*/
|
||||
void acpi_ut_strupr(char *src_string);
|
||||
|
||||
void acpi_ut_strlwr(char *src_string);
|
||||
|
||||
int acpi_ut_stricmp(char *string1, char *string2);
|
||||
|
||||
acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer);
|
||||
|
||||
/*
|
||||
* utglobal - Global data structures and procedures
|
||||
*/
|
||||
@@ -205,8 +216,6 @@ acpi_status acpi_ut_hardware_initialize(void);
|
||||
|
||||
void acpi_ut_subsystem_shutdown(void);
|
||||
|
||||
#define ACPI_IS_ASCII(c) ((c) < 0x80)
|
||||
|
||||
/*
|
||||
* utcopy - Object construction and conversion interfaces
|
||||
*/
|
||||
@@ -508,7 +517,7 @@ const struct acpi_exception_info *acpi_ut_validate_exception(acpi_status
|
||||
|
||||
u8 acpi_ut_is_pci_root_bridge(char *id);
|
||||
|
||||
#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP)
|
||||
#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_NAMES_APP)
|
||||
u8 acpi_ut_is_aml_table(struct acpi_table_header *table);
|
||||
#endif
|
||||
|
||||
@@ -567,16 +576,6 @@ acpi_ut_get_resource_end_tag(union acpi_operand_object *obj_desc, u8 **end_tag);
|
||||
/*
|
||||
* utstring - String and character utilities
|
||||
*/
|
||||
void acpi_ut_strupr(char *src_string);
|
||||
|
||||
#ifdef ACPI_ASL_COMPILER
|
||||
void acpi_ut_strlwr(char *src_string);
|
||||
|
||||
int acpi_ut_stricmp(char *string1, char *string2);
|
||||
#endif
|
||||
|
||||
acpi_status acpi_ut_strtoul64(char *string, u32 base, u64 *ret_integer);
|
||||
|
||||
void acpi_ut_print_string(char *string, u16 max_length);
|
||||
|
||||
#if defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP
|
||||
|
||||
@@ -86,7 +86,7 @@ acpi_ds_execute_arguments(struct acpi_namespace_node *node,
|
||||
|
||||
/* Allocate a new parser op to be the root of the parsed tree */
|
||||
|
||||
op = acpi_ps_alloc_op(AML_INT_EVAL_SUBTREE_OP);
|
||||
op = acpi_ps_alloc_op(AML_INT_EVAL_SUBTREE_OP, aml_start);
|
||||
if (!op) {
|
||||
return_ACPI_STATUS(AE_NO_MEMORY);
|
||||
}
|
||||
@@ -129,7 +129,7 @@ acpi_ds_execute_arguments(struct acpi_namespace_node *node,
|
||||
|
||||
/* Evaluate the deferred arguments */
|
||||
|
||||
op = acpi_ps_alloc_op(AML_INT_EVAL_SUBTREE_OP);
|
||||
op = acpi_ps_alloc_op(AML_INT_EVAL_SUBTREE_OP, aml_start);
|
||||
if (!op) {
|
||||
return_ACPI_STATUS(AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
@@ -212,7 +212,7 @@ acpi_ds_exec_end_control_op(struct acpi_walk_state * walk_state,
|
||||
*/
|
||||
control_state->control.loop_count++;
|
||||
if (control_state->control.loop_count >
|
||||
ACPI_MAX_LOOP_ITERATIONS) {
|
||||
acpi_gbl_max_loop_iterations) {
|
||||
status = AE_AML_INFINITE_LOOP;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,231 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dsdebug - Parser/Interpreter interface - debugging
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions, and the following disclaimer,
|
||||
* without modification.
|
||||
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
|
||||
* substantially similar to the "NO WARRANTY" disclaimer below
|
||||
* ("Disclaimer") and any redistribution must be conditioned upon
|
||||
* including a substantially similar Disclaimer requirement for further
|
||||
* binary redistribution.
|
||||
* 3. Neither the names of the above-listed copyright holders nor the names
|
||||
* of any contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* Alternatively, this software may be distributed under the terms of the
|
||||
* GNU General Public License ("GPL") version 2 as published by the Free
|
||||
* Software Foundation.
|
||||
*
|
||||
* NO WARRANTY
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGES.
|
||||
*/
|
||||
|
||||
#include <acpi/acpi.h>
|
||||
#include "accommon.h"
|
||||
#include "acdispat.h"
|
||||
#include "acnamesp.h"
|
||||
#ifdef ACPI_DISASSEMBLER
|
||||
#include "acdisasm.h"
|
||||
#endif
|
||||
#include "acinterp.h"
|
||||
|
||||
#define _COMPONENT ACPI_DISPATCHER
|
||||
ACPI_MODULE_NAME("dsdebug")
|
||||
|
||||
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
|
||||
/* Local prototypes */
|
||||
static void
|
||||
acpi_ds_print_node_pathname(struct acpi_namespace_node *node,
|
||||
const char *message);
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ds_print_node_pathname
|
||||
*
|
||||
* PARAMETERS: node - Object
|
||||
* message - Prefix message
|
||||
*
|
||||
* DESCRIPTION: Print an object's full namespace pathname
|
||||
* Manages allocation/freeing of a pathname buffer
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
acpi_ds_print_node_pathname(struct acpi_namespace_node *node,
|
||||
const char *message)
|
||||
{
|
||||
struct acpi_buffer buffer;
|
||||
acpi_status status;
|
||||
|
||||
ACPI_FUNCTION_TRACE(ds_print_node_pathname);
|
||||
|
||||
if (!node) {
|
||||
ACPI_DEBUG_PRINT_RAW((ACPI_DB_DISPATCH, "[NULL NAME]"));
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/* Convert handle to full pathname and print it (with supplied message) */
|
||||
|
||||
buffer.length = ACPI_ALLOCATE_LOCAL_BUFFER;
|
||||
|
||||
status = acpi_ns_handle_to_pathname(node, &buffer, TRUE);
|
||||
if (ACPI_SUCCESS(status)) {
|
||||
if (message) {
|
||||
ACPI_DEBUG_PRINT_RAW((ACPI_DB_DISPATCH, "%s ",
|
||||
message));
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW((ACPI_DB_DISPATCH, "[%s] (Node %p)",
|
||||
(char *)buffer.pointer, node));
|
||||
ACPI_FREE(buffer.pointer);
|
||||
}
|
||||
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: acpi_ds_dump_method_stack
|
||||
*
|
||||
* PARAMETERS: status - Method execution status
|
||||
* walk_state - Current state of the parse tree walk
|
||||
* op - Executing parse op
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Called when a method has been aborted because of an error.
|
||||
* Dumps the method execution stack.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
acpi_ds_dump_method_stack(acpi_status status,
|
||||
struct acpi_walk_state *walk_state,
|
||||
union acpi_parse_object *op)
|
||||
{
|
||||
union acpi_parse_object *next;
|
||||
struct acpi_thread_state *thread;
|
||||
struct acpi_walk_state *next_walk_state;
|
||||
struct acpi_namespace_node *previous_method = NULL;
|
||||
union acpi_operand_object *method_desc;
|
||||
|
||||
ACPI_FUNCTION_TRACE(ds_dump_method_stack);
|
||||
|
||||
/* Ignore control codes, they are not errors */
|
||||
|
||||
if ((status & AE_CODE_MASK) == AE_CODE_CONTROL) {
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/* We may be executing a deferred opcode */
|
||||
|
||||
if (walk_state->deferred_node) {
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
|
||||
"Executing subtree for Buffer/Package/Region\n"));
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/*
|
||||
* If there is no Thread, we are not actually executing a method.
|
||||
* This can happen when the iASL compiler calls the interpreter
|
||||
* to perform constant folding.
|
||||
*/
|
||||
thread = walk_state->thread;
|
||||
if (!thread) {
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/* Display exception and method name */
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
|
||||
"\n**** Exception %s during execution of method ",
|
||||
acpi_format_exception(status)));
|
||||
acpi_ds_print_node_pathname(walk_state->method_node, NULL);
|
||||
|
||||
/* Display stack of executing methods */
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW((ACPI_DB_DISPATCH,
|
||||
"\n\nMethod Execution Stack:\n"));
|
||||
next_walk_state = thread->walk_state_list;
|
||||
|
||||
/* Walk list of linked walk states */
|
||||
|
||||
while (next_walk_state) {
|
||||
method_desc = next_walk_state->method_desc;
|
||||
if (method_desc) {
|
||||
acpi_ex_stop_trace_method((struct acpi_namespace_node *)
|
||||
method_desc->method.node,
|
||||
method_desc, walk_state);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
|
||||
" Method [%4.4s] executing: ",
|
||||
acpi_ut_get_node_name(next_walk_state->
|
||||
method_node)));
|
||||
|
||||
/* First method is the currently executing method */
|
||||
|
||||
if (next_walk_state == walk_state) {
|
||||
if (op) {
|
||||
|
||||
/* Display currently executing ASL statement */
|
||||
|
||||
next = op->common.next;
|
||||
op->common.next = NULL;
|
||||
|
||||
#ifdef ACPI_DISASSEMBLER
|
||||
acpi_dm_disassemble(next_walk_state, op,
|
||||
ACPI_UINT32_MAX);
|
||||
#endif
|
||||
op->common.next = next;
|
||||
}
|
||||
} else {
|
||||
/*
|
||||
* This method has called another method
|
||||
* NOTE: the method call parse subtree is already deleted at this
|
||||
* point, so we cannot disassemble the method invocation.
|
||||
*/
|
||||
ACPI_DEBUG_PRINT_RAW((ACPI_DB_DISPATCH,
|
||||
"Call to method "));
|
||||
acpi_ds_print_node_pathname(previous_method, NULL);
|
||||
}
|
||||
|
||||
previous_method = next_walk_state->method_node;
|
||||
next_walk_state = next_walk_state->next;
|
||||
ACPI_DEBUG_PRINT_RAW((ACPI_DB_DISPATCH, "\n"));
|
||||
}
|
||||
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
#else
|
||||
void
|
||||
acpi_ds_dump_method_stack(acpi_status status,
|
||||
struct acpi_walk_state *walk_state,
|
||||
union acpi_parse_object *op)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -237,12 +237,22 @@ acpi_ds_initialize_objects(u32 table_index,
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
/* DSDT is always the first AML table */
|
||||
|
||||
if (ACPI_COMPARE_NAME(table->signature, ACPI_SIG_DSDT)) {
|
||||
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
|
||||
"\nInitializing Namespace objects:\n"));
|
||||
}
|
||||
|
||||
/* Summary of objects initialized */
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW((ACPI_DB_INIT,
|
||||
"Table [%4.4s] (id %4.4X) - %4u Objects with %3u Devices, "
|
||||
"%3u Regions, %3u Methods (%u/%u/%u Serial/Non/Cvt)\n",
|
||||
table->signature, owner_id, info.object_count,
|
||||
info.device_count, info.op_region_count,
|
||||
info.method_count, info.serial_method_count,
|
||||
"Table [%4.4s:%8.8s] (id %.2X) - %4u Objects with %3u Devices, "
|
||||
"%3u Regions, %4u Methods (%u/%u/%u Serial/Non/Cvt)\n",
|
||||
table->signature, table->oem_table_id, owner_id,
|
||||
info.object_count, info.device_count,
|
||||
info.op_region_count, info.method_count,
|
||||
info.serial_method_count,
|
||||
info.non_serial_method_count,
|
||||
info.serialized_method_count));
|
||||
|
||||
|
||||
@@ -46,11 +46,9 @@
|
||||
#include "acdispat.h"
|
||||
#include "acinterp.h"
|
||||
#include "acnamesp.h"
|
||||
#ifdef ACPI_DISASSEMBLER
|
||||
#include "acdisasm.h"
|
||||
#endif
|
||||
#include "acparser.h"
|
||||
#include "amlcode.h"
|
||||
#include "acdebug.h"
|
||||
|
||||
#define _COMPONENT ACPI_DISPATCHER
|
||||
ACPI_MODULE_NAME("dsmethod")
|
||||
@@ -103,7 +101,7 @@ acpi_ds_auto_serialize_method(struct acpi_namespace_node *node,
|
||||
|
||||
/* Create/Init a root op for the method parse tree */
|
||||
|
||||
op = acpi_ps_alloc_op(AML_METHOD_OP);
|
||||
op = acpi_ps_alloc_op(AML_METHOD_OP, obj_desc->method.aml_start);
|
||||
if (!op) {
|
||||
return_ACPI_STATUS(AE_NO_MEMORY);
|
||||
}
|
||||
@@ -205,7 +203,7 @@ acpi_ds_detect_named_opcodes(struct acpi_walk_state *walk_state,
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Called on method error. Invoke the global exception handler if
|
||||
* present, dump the method data if the disassembler is configured
|
||||
* present, dump the method data if the debugger is configured
|
||||
*
|
||||
* Note: Allows the exception handler to change the status code
|
||||
*
|
||||
@@ -214,6 +212,8 @@ acpi_ds_detect_named_opcodes(struct acpi_walk_state *walk_state,
|
||||
acpi_status
|
||||
acpi_ds_method_error(acpi_status status, struct acpi_walk_state * walk_state)
|
||||
{
|
||||
u32 aml_offset;
|
||||
|
||||
ACPI_FUNCTION_ENTRY();
|
||||
|
||||
/* Ignore AE_OK and control exception codes */
|
||||
@@ -234,26 +234,30 @@ acpi_ds_method_error(acpi_status status, struct acpi_walk_state * walk_state)
|
||||
* Handler can map the exception code to anything it wants, including
|
||||
* AE_OK, in which case the executing method will not be aborted.
|
||||
*/
|
||||
aml_offset = (u32)ACPI_PTR_DIFF(walk_state->aml,
|
||||
walk_state->parser_state.
|
||||
aml_start);
|
||||
|
||||
status = acpi_gbl_exception_handler(status,
|
||||
walk_state->method_node ?
|
||||
walk_state->method_node->
|
||||
name.integer : 0,
|
||||
walk_state->opcode,
|
||||
walk_state->aml_offset,
|
||||
NULL);
|
||||
aml_offset, NULL);
|
||||
acpi_ex_enter_interpreter();
|
||||
}
|
||||
|
||||
acpi_ds_clear_implicit_return(walk_state);
|
||||
|
||||
#ifdef ACPI_DISASSEMBLER
|
||||
if (ACPI_FAILURE(status)) {
|
||||
acpi_ds_dump_method_stack(status, walk_state, walk_state->op);
|
||||
|
||||
/* Display method locals/args if disassembler is present */
|
||||
/* Display method locals/args if debugger is present */
|
||||
|
||||
acpi_dm_dump_method_info(status, walk_state, walk_state->op);
|
||||
}
|
||||
#ifdef ACPI_DEBUGGER
|
||||
acpi_db_dump_method_info(status, walk_state);
|
||||
#endif
|
||||
}
|
||||
|
||||
return (status);
|
||||
}
|
||||
@@ -328,6 +332,8 @@ acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node,
|
||||
return_ACPI_STATUS(AE_NULL_ENTRY);
|
||||
}
|
||||
|
||||
acpi_ex_start_trace_method(method_node, obj_desc, walk_state);
|
||||
|
||||
/* Prevent wraparound of thread count */
|
||||
|
||||
if (obj_desc->method.thread_count == ACPI_UINT8_MAX) {
|
||||
@@ -574,9 +580,7 @@ cleanup:
|
||||
/* On error, we must terminate the method properly */
|
||||
|
||||
acpi_ds_terminate_control_method(obj_desc, next_walk_state);
|
||||
if (next_walk_state) {
|
||||
acpi_ds_delete_walk_state(next_walk_state);
|
||||
}
|
||||
acpi_ds_delete_walk_state(next_walk_state);
|
||||
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
@@ -826,5 +830,8 @@ acpi_ds_terminate_control_method(union acpi_operand_object *method_desc,
|
||||
}
|
||||
}
|
||||
|
||||
acpi_ex_stop_trace_method((struct acpi_namespace_node *)method_desc->
|
||||
method.node, method_desc, walk_state);
|
||||
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
@@ -480,8 +480,8 @@ acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state,
|
||||
union acpi_operand_object **operand;
|
||||
struct acpi_namespace_node *node;
|
||||
union acpi_parse_object *next_op;
|
||||
u32 table_index;
|
||||
struct acpi_table_header *table;
|
||||
u32 table_index;
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR(ds_eval_table_region_operands, op);
|
||||
|
||||
@@ -504,6 +504,8 @@ acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state,
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
operand = &walk_state->operands[0];
|
||||
|
||||
/*
|
||||
* Resolve the Signature string, oem_id string,
|
||||
* and oem_table_id string operands
|
||||
@@ -511,32 +513,34 @@ acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state,
|
||||
status = acpi_ex_resolve_operands(op->common.aml_opcode,
|
||||
ACPI_WALK_OPERANDS, walk_state);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return_ACPI_STATUS(status);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
operand = &walk_state->operands[0];
|
||||
|
||||
/* Find the ACPI table */
|
||||
|
||||
status = acpi_tb_find_table(operand[0]->string.pointer,
|
||||
operand[1]->string.pointer,
|
||||
operand[2]->string.pointer, &table_index);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return_ACPI_STATUS(status);
|
||||
if (status == AE_NOT_FOUND) {
|
||||
ACPI_ERROR((AE_INFO,
|
||||
"ACPI Table [%4.4s] OEM:(%s, %s) not found in RSDT/XSDT",
|
||||
operand[0]->string.pointer,
|
||||
operand[1]->string.pointer,
|
||||
operand[2]->string.pointer));
|
||||
}
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
acpi_ut_remove_reference(operand[0]);
|
||||
acpi_ut_remove_reference(operand[1]);
|
||||
acpi_ut_remove_reference(operand[2]);
|
||||
|
||||
status = acpi_get_table_by_index(table_index, &table);
|
||||
if (ACPI_FAILURE(status)) {
|
||||
return_ACPI_STATUS(status);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
obj_desc = acpi_ns_get_attached_object(node);
|
||||
if (!obj_desc) {
|
||||
return_ACPI_STATUS(AE_NOT_EXIST);
|
||||
status = AE_NOT_EXIST;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
obj_desc->region.address = ACPI_PTR_TO_PHYSADDR(table);
|
||||
@@ -551,6 +555,11 @@ acpi_ds_eval_table_region_operands(struct acpi_walk_state *walk_state,
|
||||
|
||||
obj_desc->region.flags |= AOPOBJ_DATA_VALID;
|
||||
|
||||
cleanup:
|
||||
acpi_ut_remove_reference(operand[0]);
|
||||
acpi_ut_remove_reference(operand[1]);
|
||||
acpi_ut_remove_reference(operand[2]);
|
||||
|
||||
return_ACPI_STATUS(status);
|
||||
}
|
||||
|
||||
|
||||
@@ -388,7 +388,7 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
|
||||
|
||||
/* Create a new op */
|
||||
|
||||
op = acpi_ps_alloc_op(walk_state->opcode);
|
||||
op = acpi_ps_alloc_op(walk_state->opcode, walk_state->aml);
|
||||
if (!op) {
|
||||
return_ACPI_STATUS(AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user