2005-04-17 06:20:36 +08:00
|
|
|
/******************************************************************************
|
|
|
|
*
|
|
|
|
* Name: acdebug.h - ACPI/AML debugger
|
|
|
|
*
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
/*
|
2006-01-14 05:22:00 +08:00
|
|
|
* Copyright (C) 2000 - 2006, R. Byron Moore
|
2005-04-17 06:20:36 +08:00
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __ACDEBUG_H__
|
|
|
|
#define __ACDEBUG_H__
|
|
|
|
|
|
|
|
#define ACPI_DEBUG_BUFFER_SIZE 4196
|
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
struct command_info {
|
|
|
|
char *name; /* Command Name */
|
|
|
|
u8 min_args; /* Minimum arguments required */
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
struct argument_info {
|
|
|
|
char *name; /* Argument Name */
|
2005-04-17 06:20:36 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#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
|
|
|
|
|
|
|
|
/*
|
|
|
|
* dbxface - external debugger interfaces
|
|
|
|
*/
|
2005-08-05 12:44:28 +08:00
|
|
|
acpi_status acpi_db_initialize(void);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_terminate(void);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
acpi_status
|
2005-08-05 12:44:28 +08:00
|
|
|
acpi_db_single_step(struct acpi_walk_state *walk_state,
|
|
|
|
union acpi_parse_object *op, u32 op_type);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* dbcmds - debug commands and output routines
|
|
|
|
*/
|
2005-08-05 12:44:28 +08:00
|
|
|
acpi_status acpi_db_disassemble_method(char *name);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_display_table_info(char *table_arg);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_unload_acpi_table(char *table_arg, char *instance_arg);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
void
|
2005-08-05 12:44:28 +08:00
|
|
|
acpi_db_set_method_breakpoint(char *location,
|
|
|
|
struct acpi_walk_state *walk_state,
|
|
|
|
union acpi_parse_object *op);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_set_method_call_breakpoint(union acpi_parse_object *op);
|
ACPICA 20050617-0624 from Bob Moore <robert.moore@intel.com>
ACPICA 20050617:
Moved the object cache operations into the OS interface
layer (OSL) to allow the host OS to handle these operations
if desired (for example, the Linux OSL will invoke the
slab allocator). This support is optional; the compile
time define ACPI_USE_LOCAL_CACHE may be used to utilize
the original cache code in the ACPI CA core. The new OSL
interfaces are shown below. See utalloc.c for an example
implementation, and acpiosxf.h for the exact interface
definitions. Thanks to Alexey Starikovskiy.
acpi_os_create_cache
acpi_os_delete_cache
acpi_os_purge_cache
acpi_os_acquire_object
acpi_os_release_object
Modified the interfaces to acpi_os_acquire_lock and
acpi_os_release_lock to return and restore a flags
parameter. This fits better with many OS lock models.
Note: the current execution state (interrupt handler
or not) is no longer passed to these interfaces. If
necessary, the OSL must determine this state by itself, a
simple and fast operation. Thanks to Alexey Starikovskiy.
Fixed a problem in the ACPI table handling where a valid
XSDT was assumed present if the revision of the RSDP
was 2 or greater. According to the ACPI specification,
the XSDT is optional in all cases, and the table manager
therefore now checks for both an RSDP >=2 and a valid
XSDT pointer. Otherwise, the RSDT pointer is used.
Some ACPI 2.0 compliant BIOSs contain only the RSDT.
Fixed an interpreter problem with the Mid() operator in the
case of an input string where the resulting output string
is of zero length. It now correctly returns a valid,
null terminated string object instead of a string object
with a null pointer.
Fixed a problem with the control method argument handling
to allow a store to an Arg object that already contains an
object of type Device. The Device object is now correctly
overwritten. Previously, an error was returned.
ACPICA 20050624:
Modified the new OSL cache interfaces to use ACPI_CACHE_T
as the type for the host-defined cache object. This allows
the OSL implementation to define and type this object in
any manner desired, simplifying the OSL implementation.
For example, ACPI_CACHE_T is defined as kmem_cache_t for
Linux, and should be defined in the OS-specific header
file for other operating systems as required.
Changed the interface to AcpiOsAcquireObject to directly
return the requested object as the function return (instead
of ACPI_STATUS.) This change was made for performance
reasons, since this is the purpose of the interface in the
first place. acpi_os_acquire_object is now similar to the
acpi_os_allocate interface. Thanks to Alexey Starikovskiy.
Modified the initialization sequence in
acpi_initialize_subsystem to call the OSL interface
acpi_osl_initialize first, before any local initialization.
This change was required because the global initialization
now calls OSL interfaces.
Restructured the code base to split some files because
of size and/or because the code logically belonged in a
separate file. New files are listed below.
utilities/utcache.c /* Local cache interfaces */
utilities/utmutex.c /* Local mutex support */
utilities/utstate.c /* State object support */
parser/psloop.c /* Main AML parse loop */
Signed-off-by: Len Brown <len.brown@intel.com>
2005-06-24 12:00:00 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_get_bus_info(void);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_disassemble_aml(char *statements, union acpi_parse_object *op);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_dump_namespace(char *start_arg, char *depth_arg);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_dump_namespace_by_owner(char *owner_arg, char *depth_arg);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_send_notify(char *name, u32 value);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_set_method_data(char *type_arg, char *index_arg, char *value_arg);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
acpi_status
|
2005-08-05 12:44:28 +08:00
|
|
|
acpi_db_display_objects(char *obj_type_arg, char *display_count_arg);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
acpi_status acpi_db_find_name_in_namespace(char *name_arg);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_set_scope(char *name);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
acpi_status acpi_db_sleep(char *object_arg);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_find_references(char *object_arg);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_display_locks(void);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_display_resources(char *object_arg);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_display_gpes(void);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_check_integrity(void);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_generate_gpe(char *gpe_arg, char *block_arg);
|
2005-04-19 10:49:35 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/*
|
|
|
|
* dbdisply - debug display commands
|
|
|
|
*/
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_display_method_info(union acpi_parse_object *op);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_decode_and_display_object(char *target, char *output_type);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
void
|
2005-08-05 12:44:28 +08:00
|
|
|
acpi_db_display_result_object(union acpi_operand_object *obj_desc,
|
|
|
|
struct acpi_walk_state *walk_state);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
acpi_status acpi_db_display_all_methods(char *display_count_arg);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_display_arguments(void);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_display_locals(void);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_display_results(void);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_display_calling_tree(void);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_display_object_type(char *object_arg);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
void
|
2005-08-05 12:44:28 +08:00
|
|
|
acpi_db_display_argument_object(union acpi_operand_object *obj_desc,
|
|
|
|
struct acpi_walk_state *walk_state);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* dbexec - debugger control method execution
|
|
|
|
*/
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_execute(char *name, char **args, u32 flags);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
void
|
2005-08-05 12:44:28 +08:00
|
|
|
acpi_db_create_execution_threads(char *num_threads_arg,
|
|
|
|
char *num_loops_arg, char *method_name_arg);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* dbfileio - Debugger file I/O commands
|
|
|
|
*/
|
|
|
|
acpi_object_type
|
2005-08-05 12:44:28 +08:00
|
|
|
acpi_db_match_argument(char *user_argument, struct argument_info *arguments);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_close_debug_file(void);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_open_debug_file(char *name);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
acpi_status acpi_db_load_acpi_table(char *filename);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
acpi_status
|
2005-08-05 12:44:28 +08:00
|
|
|
acpi_db_get_table_from_file(char *filename, struct acpi_table_header **table);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
acpi_status
|
2005-08-05 12:44:28 +08:00
|
|
|
acpi_db_read_table_from_file(char *filename, struct acpi_table_header **table);
|
2005-04-19 10:49:35 +08:00
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
/*
|
|
|
|
* dbhistry - debugger HISTORY command
|
|
|
|
*/
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_add_to_history(char *command_line);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_display_history(void);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
char *acpi_db_get_from_history(char *command_num_arg);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* dbinput - user front-end to the AML debugger
|
|
|
|
*/
|
|
|
|
acpi_status
|
2005-08-05 12:44:28 +08:00
|
|
|
acpi_db_command_dispatch(char *input_buffer,
|
|
|
|
struct acpi_walk_state *walk_state,
|
|
|
|
union acpi_parse_object *op);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void ACPI_SYSTEM_XFACE acpi_db_execute_thread(void *context);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* dbstats - Generation and display of ACPI table statistics
|
|
|
|
*/
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_generate_statistics(union acpi_parse_object *root, u8 is_method);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
acpi_status acpi_db_display_statistics(char *type_arg);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* dbutils - AML debugger utilities
|
|
|
|
*/
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_set_output_destination(u32 where);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_dump_external_object(union acpi_object *obj_desc, u32 level);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
void acpi_db_prep_namestring(char *name);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
struct acpi_namespace_node *acpi_db_local_ns_lookup(char *name);
|
2005-04-17 06:20:36 +08:00
|
|
|
|
2005-08-05 12:44:28 +08:00
|
|
|
#endif /* __ACDEBUG_H__ */
|