Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 336638
b: refs/heads/master
c: f540fad
h: refs/heads/master
v: v3
  • Loading branch information
Lv Zheng authored and Rafael J. Wysocki committed Nov 14, 2012
1 parent 4112037 commit 072e4fe
Show file tree
Hide file tree
Showing 5 changed files with 102 additions and 66 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6d33b6be17dd6a0934396704f969ceb7f3206347
refs/heads/master: f540fadf29a6987efbfa7daf10976935fd59ae7c
94 changes: 62 additions & 32 deletions trunk/drivers/acpi/acpica/acdebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,17 +44,28 @@
#ifndef __ACDEBUG_H__
#define __ACDEBUG_H__

#define ACPI_DEBUG_BUFFER_SIZE 4196
#define ACPI_DEBUG_BUFFER_SIZE 0x4000 /* 16K buffer for return objects */

struct command_info {
struct acpi_db_command_info {
char *name; /* Command Name */
u8 min_args; /* Minimum arguments required */
};

struct argument_info {
struct acpi_db_command_help {
u8 line_count; /* Number of help lines */
char *invocation; /* Command Invocation */
char *description; /* Command Description */
};

struct acpi_db_argument_info {
char *name; /* Argument Name */
};

struct acpi_db_execute_walk {
u32 count;
u32 max_count;
};

#define PARAM_LIST(pl) pl
#define DBTEST_OUTPUT_LEVEL(lvl) if (acpi_gbl_db_opt_verbose)
#define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\
Expand All @@ -77,59 +88,71 @@ acpi_db_single_step(struct acpi_walk_state *walk_state,
/*
* dbcmds - debug commands and output routines
*/
acpi_status acpi_db_disassemble_method(char *name);
struct acpi_namespace_node *acpi_db_convert_to_node(char *in_string);

void acpi_db_display_table_info(char *table_arg);

void acpi_db_unload_acpi_table(char *table_arg, char *instance_arg);
void acpi_db_display_template(char *buffer_arg);

void
acpi_db_set_method_breakpoint(char *location,
struct acpi_walk_state *walk_state,
union acpi_parse_object *op);
void acpi_db_unload_acpi_table(char *name);

void acpi_db_set_method_call_breakpoint(union acpi_parse_object *op);
void acpi_db_send_notify(char *name, u32 value);

void acpi_db_get_bus_info(void);
void acpi_db_display_interfaces(char *action_arg, char *interface_name_arg);

void acpi_db_disassemble_aml(char *statements, union acpi_parse_object *op);
acpi_status acpi_db_sleep(char *object_arg);

void acpi_db_dump_namespace(char *start_arg, char *depth_arg);
void acpi_db_display_locks(void);

void acpi_db_dump_namespace_by_owner(char *owner_arg, char *depth_arg);
void acpi_db_display_resources(char *object_arg);

void acpi_db_send_notify(char *name, u32 value);
ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_db_display_gpes(void))

void acpi_db_display_handlers(void);

ACPI_HW_DEPENDENT_RETURN_VOID(void
acpi_db_generate_gpe(char *gpe_arg,
char *block_arg))

/*
* dbmethod - control method commands
*/
void
acpi_db_set_method_breakpoint(char *location,
struct acpi_walk_state *walk_state,
union acpi_parse_object *op);

void acpi_db_set_method_call_breakpoint(union acpi_parse_object *op);

void acpi_db_set_method_data(char *type_arg, char *index_arg, char *value_arg);

acpi_status
acpi_db_display_objects(char *obj_type_arg, char *display_count_arg);
acpi_status acpi_db_disassemble_method(char *name);

void acpi_db_display_interfaces(char *action_arg, char *interface_name_arg);
void acpi_db_disassemble_aml(char *statements, union acpi_parse_object *op);

acpi_status acpi_db_find_name_in_namespace(char *name_arg);
void acpi_db_batch_execute(char *count_arg);

/*
* dbnames - namespace commands
*/
void acpi_db_set_scope(char *name);

ACPI_HW_DEPENDENT_RETURN_OK(acpi_status acpi_db_sleep(char *object_arg))
void acpi_db_dump_namespace(char *start_arg, char *depth_arg);

void acpi_db_find_references(char *object_arg);
void acpi_db_dump_namespace_by_owner(char *owner_arg, char *depth_arg);

void acpi_db_display_locks(void);
acpi_status acpi_db_find_name_in_namespace(char *name_arg);

void acpi_db_display_resources(char *object_arg);
void acpi_db_check_predefined_names(void);

ACPI_HW_DEPENDENT_RETURN_VOID(void acpi_db_display_gpes(void))
acpi_status
acpi_db_display_objects(char *obj_type_arg, char *display_count_arg);

void acpi_db_check_integrity(void);

ACPI_HW_DEPENDENT_RETURN_VOID(void
acpi_db_generate_gpe(char *gpe_arg,
char *block_arg))

void acpi_db_check_predefined_names(void);
void acpi_db_find_references(char *object_arg);

void acpi_db_batch_execute(void);
void acpi_db_get_bus_info(void);

/*
* dbdisply - debug display commands
Expand Down Expand Up @@ -161,7 +184,8 @@ acpi_db_display_argument_object(union acpi_operand_object *obj_desc,
/*
* dbexec - debugger control method execution
*/
void acpi_db_execute(char *name, char **args, u32 flags);
void
acpi_db_execute(char *name, char **args, acpi_object_type * types, u32 flags);

void
acpi_db_create_execution_threads(char *num_threads_arg,
Expand All @@ -175,7 +199,8 @@ u32 acpi_db_get_cache_info(struct acpi_memory_list *cache);
* dbfileio - Debugger file I/O commands
*/
acpi_object_type
acpi_db_match_argument(char *user_argument, struct argument_info *arguments);
acpi_db_match_argument(char *user_argument,
struct acpi_db_argument_info *arguments);

void acpi_db_close_debug_file(void);

Expand Down Expand Up @@ -208,6 +233,11 @@ acpi_db_command_dispatch(char *input_buffer,

void ACPI_SYSTEM_XFACE acpi_db_execute_thread(void *context);

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);

/*
* dbstats - Generation and display of ACPI table statistics
*/
Expand Down
69 changes: 36 additions & 33 deletions trunk/drivers/acpi/acpica/acglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,26 +153,6 @@ u8 acpi_gbl_reduced_hardware;

ACPI_EXTERN u8 ACPI_INIT_GLOBAL(acpi_gbl_no_resource_disassembly, FALSE);

/*****************************************************************************
*
* Debug support
*
****************************************************************************/

/* Procedure nesting level for debug output */

extern u32 acpi_gbl_nesting_level;

ACPI_EXTERN u32 acpi_gpe_count;
ACPI_EXTERN u32 acpi_fixed_event_count[ACPI_NUM_FIXED_EVENTS];

/* Support for dynamic control method tracing mechanism */

ACPI_EXTERN u32 acpi_gbl_original_dbg_level;
ACPI_EXTERN u32 acpi_gbl_original_dbg_layer;
ACPI_EXTERN u32 acpi_gbl_trace_dbg_level;
ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer;

/*****************************************************************************
*
* ACPI Table globals
Expand Down Expand Up @@ -259,15 +239,6 @@ ACPI_EXTERN acpi_spinlock acpi_gbl_hardware_lock; /* For ACPI H/W except GPE reg
*
****************************************************************************/

#ifdef ACPI_DBG_TRACK_ALLOCATIONS

/* Lists for tracking memory allocations */

ACPI_EXTERN struct acpi_memory_list *acpi_gbl_global_list;
ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list;
ACPI_EXTERN u8 acpi_gbl_display_final_mem_stats;
#endif

/* Object caches */

ACPI_EXTERN acpi_cache_t *acpi_gbl_namespace_cache;
Expand Down Expand Up @@ -326,6 +297,15 @@ extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS];

#endif

#ifdef ACPI_DBG_TRACK_ALLOCATIONS

/* Lists for tracking memory allocations */

ACPI_EXTERN struct acpi_memory_list *acpi_gbl_global_list;
ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list;
ACPI_EXTERN u8 acpi_gbl_display_final_mem_stats;
#endif

/*****************************************************************************
*
* Namespace globals
Expand Down Expand Up @@ -401,6 +381,28 @@ ACPI_EXTERN void *acpi_gbl_global_event_handler_context;

#endif /* !ACPI_REDUCED_HARDWARE */

/*****************************************************************************
*
* Debug support
*
****************************************************************************/

/* Procedure nesting level for debug output */

extern u32 acpi_gbl_nesting_level;

/* Event counters */

ACPI_EXTERN u32 acpi_gpe_count;
ACPI_EXTERN u32 acpi_fixed_event_count[ACPI_NUM_FIXED_EVENTS];

/* Support for dynamic control method tracing mechanism */

ACPI_EXTERN u32 acpi_gbl_original_dbg_level;
ACPI_EXTERN u32 acpi_gbl_original_dbg_layer;
ACPI_EXTERN u32 acpi_gbl_trace_dbg_level;
ACPI_EXTERN u32 acpi_gbl_trace_dbg_layer;

/*****************************************************************************
*
* Debugger globals
Expand All @@ -426,10 +428,11 @@ ACPI_EXTERN u8 acpi_gbl_db_opt_stats;
ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods;

ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS];
ACPI_EXTERN char acpi_gbl_db_line_buf[80];
ACPI_EXTERN char acpi_gbl_db_parsed_buf[80];
ACPI_EXTERN char acpi_gbl_db_scope_buf[40];
ACPI_EXTERN char acpi_gbl_db_debug_filename[40];
ACPI_EXTERN acpi_object_type acpi_gbl_db_arg_types[ACPI_DEBUGGER_MAX_ARGS];
ACPI_EXTERN char acpi_gbl_db_line_buf[ACPI_DB_LINE_BUFFER_SIZE];
ACPI_EXTERN char acpi_gbl_db_parsed_buf[ACPI_DB_LINE_BUFFER_SIZE];
ACPI_EXTERN char acpi_gbl_db_scope_buf[80];
ACPI_EXTERN char acpi_gbl_db_debug_filename[80];
ACPI_EXTERN u8 acpi_gbl_db_output_to_file;
ACPI_EXTERN char *acpi_gbl_db_buffer;
ACPI_EXTERN char *acpi_gbl_db_filename;
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/acpi/acpica/aclocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,7 @@ struct acpi_db_method_info {
acpi_handle method;
acpi_handle main_thread_gate;
acpi_handle thread_complete_gate;
acpi_handle info_gate;
acpi_thread_id *threads;
u32 num_threads;
u32 num_created;
Expand All @@ -1041,6 +1042,7 @@ struct acpi_db_method_info {
u32 num_loops;
char pathname[128];
char **args;
acpi_object_type *types;

/*
* Arguments to be passed to method for the command
Expand Down
1 change: 1 addition & 0 deletions trunk/include/acpi/acconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@
*****************************************************************************/

#define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */
#define ACPI_DB_LINE_BUFFER_SIZE 512

#define ACPI_DEBUGGER_COMMAND_PROMPT '-'
#define ACPI_DEBUGGER_EXECUTE_PROMPT '%'
Expand Down

0 comments on commit 072e4fe

Please sign in to comment.