📄 dbdisply.c
字号:
case AML_ONE_OP: acpi_os_printf ("[Const] One (1)"); break; case AML_REVISION_OP: acpi_os_printf ("[Const] Revision (%X)", ACPI_CA_SUPPORT_LEVEL); break; case AML_LOCAL_OP: acpi_os_printf ("[Local%d]", obj_desc->reference.offset); if (walk_state) { obj_desc = walk_state->local_variables[obj_desc->reference.offset].object; acpi_os_printf (" %p", obj_desc); acpi_db_decode_internal_object (obj_desc); } break; case AML_ARG_OP: acpi_os_printf ("[Arg%d] ", obj_desc->reference.offset); if (walk_state) { obj_desc = walk_state->arguments[obj_desc->reference.offset].object; acpi_os_printf (" %p", obj_desc); acpi_db_decode_internal_object (obj_desc); } break; case AML_DEBUG_OP: acpi_os_printf ("[Debug] "); break; case AML_INDEX_OP: acpi_os_printf ("[Index] "); acpi_db_decode_internal_object (obj_desc->reference.object); break; default: break; } break; default: acpi_os_printf ("<Obj> "); acpi_os_printf (" "); acpi_db_decode_internal_object (obj_desc); break; } } else { acpi_os_printf ("<Not a valid ACPI Object Descriptor> "); } acpi_os_printf ("\n");}/******************************************************************************* * * FUNCTION: Acpi_db_display_method_info * * PARAMETERS: Start_op - Root of the control method parse tree * * RETURN: None * * DESCRIPTION: Display information about the current method * ******************************************************************************/voidacpi_db_display_method_info ( acpi_parse_object *start_op){ acpi_walk_state *walk_state; acpi_operand_object *obj_desc; acpi_namespace_node *node; acpi_parse_object *root_op; acpi_parse_object *op; const acpi_opcode_info *op_info; u32 num_ops = 0; u32 num_operands = 0; u32 num_operators = 0; u32 num_remaining_ops = 0; u32 num_remaining_operands = 0; u32 num_remaining_operators = 0; u32 num_args; u32 concurrency; u8 count_remaining = FALSE; walk_state = acpi_ds_get_current_walk_state (acpi_gbl_current_walk_list); if (!walk_state) { acpi_os_printf ("There is no method currently executing\n"); return; } obj_desc = walk_state->method_desc; node = walk_state->method_node; num_args = obj_desc->method.param_count; concurrency = obj_desc->method.concurrency; acpi_os_printf ("Currently executing control method is [%4.4s]\n", &node->name); acpi_os_printf ("%X arguments, max concurrency = %X\n", num_args, concurrency); root_op = start_op; while (root_op->parent) { root_op = root_op->parent; } op = root_op; while (op) { if (op == start_op) { count_remaining = TRUE; } num_ops++; if (count_remaining) { num_remaining_ops++; } /* Decode the opcode */ op_info = acpi_ps_get_opcode_info (op->opcode); switch (op_info->class) { case AML_CLASS_ARGUMENT: if (count_remaining) { num_remaining_operands++; } num_operands++; break; case AML_CLASS_UNKNOWN: /* Bad opcode or ASCII character */ continue; default: if (count_remaining) { num_remaining_operators++; } num_operators++; break; } op = acpi_ps_get_depth_next (start_op, op); } acpi_os_printf ("Method contains: %X AML Opcodes - %X Operators, %X Operands\n", num_ops, num_operators, num_operands); acpi_os_printf ("Remaining to execute: %X AML Opcodes - %X Operators, %X Operands\n", num_remaining_ops, num_remaining_operators, num_remaining_operands);}/******************************************************************************* * * FUNCTION: Acpi_db_display_locals * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Display all locals for the currently running control method * ******************************************************************************/voidacpi_db_display_locals (void){ u32 i; acpi_walk_state *walk_state; acpi_operand_object *obj_desc; acpi_namespace_node *node; walk_state = acpi_ds_get_current_walk_state (acpi_gbl_current_walk_list); if (!walk_state) { acpi_os_printf ("There is no method currently executing\n"); return; } obj_desc = walk_state->method_desc; node = walk_state->method_node; acpi_os_printf ("Local Variables for method [%4.4s]:\n", &node->name); for (i = 0; i < MTH_NUM_LOCALS; i++) { obj_desc = walk_state->local_variables[i].object; acpi_os_printf ("Local%d: ", i); acpi_db_display_internal_object (obj_desc, walk_state); }}/******************************************************************************* * * FUNCTION: Acpi_db_display_arguments * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Display all arguments for the currently running control method * ******************************************************************************/voidacpi_db_display_arguments (void){ u32 i; acpi_walk_state *walk_state; acpi_operand_object *obj_desc; u32 num_args; u32 concurrency; acpi_namespace_node *node; walk_state = acpi_ds_get_current_walk_state (acpi_gbl_current_walk_list); if (!walk_state) { acpi_os_printf ("There is no method currently executing\n"); return; } obj_desc = walk_state->method_desc; node = walk_state->method_node; num_args = obj_desc->method.param_count; concurrency = obj_desc->method.concurrency; acpi_os_printf ("Method [%4.4s] has %X arguments, max concurrency = %X\n", &node->name, num_args, concurrency); for (i = 0; i < num_args; i++) { obj_desc = walk_state->arguments[i].object; acpi_os_printf ("Arg%d: ", i); acpi_db_display_internal_object (obj_desc, walk_state); }}/******************************************************************************* * * FUNCTION: Acpi_db_display_results * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Display current contents of a method result stack * ******************************************************************************/voidacpi_db_display_results (void){ u32 i; acpi_walk_state *walk_state; acpi_operand_object *obj_desc; u32 num_results = 0; acpi_namespace_node *node; walk_state = acpi_ds_get_current_walk_state (acpi_gbl_current_walk_list); if (!walk_state) { acpi_os_printf ("There is no method currently executing\n"); return; } obj_desc = walk_state->method_desc; node = walk_state->method_node; if (walk_state->results) { num_results = walk_state->results->results.num_results; } acpi_os_printf ("Method [%4.4s] has %X stacked result objects\n", &node->name, num_results); for (i = 0; i < num_results; i++) { obj_desc = walk_state->results->results.obj_desc[i]; acpi_os_printf ("Result%d: ", i); acpi_db_display_internal_object (obj_desc, walk_state); }}/******************************************************************************* * * FUNCTION: Acpi_db_display_calling_tree * * PARAMETERS: None * * RETURN: None * * DESCRIPTION: Display current calling tree of nested control methods * ******************************************************************************/voidacpi_db_display_calling_tree (void){ u32 i; acpi_walk_state *walk_state; acpi_namespace_node *node; walk_state = acpi_ds_get_current_walk_state (acpi_gbl_current_walk_list); if (!walk_state) { acpi_os_printf ("There is no method currently executing\n"); return; } node = walk_state->method_node; acpi_os_printf ("Current Control Method Call Tree\n"); for (i = 0; walk_state; i++) { node = walk_state->method_node; acpi_os_printf (" [%4.4s]\n", &node->name); walk_state = walk_state->next; }}/******************************************************************************* * * FUNCTION: Acpi_db_display_result_object * * PARAMETERS: Obj_desc - Object to be displayed * Walk_state - Current walk state * * RETURN: None * * DESCRIPTION: Display the result of an AML opcode * ******************************************************************************/voidacpi_db_display_result_object ( acpi_operand_object *obj_desc, acpi_walk_state *walk_state){ /* TBD: [Future] We don't always want to display the result. * For now, only display if single stepping * however, this output is very useful in other contexts also */ if (!acpi_gbl_cm_single_step) { return; } acpi_os_printf ("Result_obj: "); acpi_db_display_internal_object (obj_desc, walk_state); acpi_os_printf ("\n");}/******************************************************************************* * * FUNCTION: Acpi_db_display_argument_object * * PARAMETERS: Obj_desc - Object to be displayed * Walk_state - Current walk state * * RETURN: None * * DESCRIPTION: Display the result of an AML opcode * ******************************************************************************/voidacpi_db_display_argument_object ( acpi_operand_object *obj_desc, acpi_walk_state *walk_state){ if (!acpi_gbl_cm_single_step) { return; } acpi_os_printf ("Arg_obj: "); acpi_db_display_internal_object (obj_desc, walk_state);}#endif /* ENABLE_DEBUGGER */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -