aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2012-10-30 22:28:11 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-11-14 18:31:29 -0500
commit97171c6be3088a68b403c7285d34c151f7dbfb18 (patch)
tree0aebf4710463ea8698c7c03058aa082ef1c1a2e6 /drivers/acpi/acpica
parenteed9525ac445f446a5dabd70d32938044f04fad5 (diff)
ACPICA: Add starting offset parameter to common dump buffer routine
Rename the dump buffer routines. Offset parameter can specify the buffer starting offset that is used when displaying each line of the buffer. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpica')
-rw-r--r--drivers/acpi/acpica/acmacros.h2
-rw-r--r--drivers/acpi/acpica/acutils.h5
-rw-r--r--drivers/acpi/acpica/exdebug.c8
-rw-r--r--drivers/acpi/acpica/exdump.c9
-rw-r--r--drivers/acpi/acpica/psloop.c22
-rw-r--r--drivers/acpi/acpica/utdebug.c13
6 files changed, 34 insertions, 25 deletions
diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h
index da8062d91eeb..5efad99f2169 100644
--- a/drivers/acpi/acpica/acmacros.h
+++ b/drivers/acpi/acpica/acmacros.h
@@ -460,7 +460,7 @@
460#define ACPI_DUMP_OPERANDS(a, b ,c) acpi_ex_dump_operands(a, b, c) 460#define ACPI_DUMP_OPERANDS(a, b ,c) acpi_ex_dump_operands(a, b, c)
461#define ACPI_DUMP_ENTRY(a, b) acpi_ns_dump_entry (a, b) 461#define ACPI_DUMP_ENTRY(a, b) acpi_ns_dump_entry (a, b)
462#define ACPI_DUMP_PATHNAME(a, b, c, d) acpi_ns_dump_pathname(a, b, c, d) 462#define ACPI_DUMP_PATHNAME(a, b, c, d) acpi_ns_dump_pathname(a, b, c, d)
463#define ACPI_DUMP_BUFFER(a, b) acpi_ut_dump_buffer((u8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT) 463#define ACPI_DUMP_BUFFER(a, b) acpi_ut_debug_dump_buffer((u8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT)
464 464
465#else 465#else
466/* 466/*
diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h
index d94b41776575..5a6aa581e244 100644
--- a/drivers/acpi/acpica/acutils.h
+++ b/drivers/acpi/acpica/acutils.h
@@ -305,9 +305,10 @@ acpi_ut_ptr_exit(u32 line_number,
305 const char *function_name, 305 const char *function_name,
306 const char *module_name, u32 component_id, u8 *ptr); 306 const char *module_name, u32 component_id, u8 *ptr);
307 307
308void acpi_ut_dump_buffer(u8 *buffer, u32 count, u32 display, u32 component_id); 308void
309acpi_ut_debug_dump_buffer(u8 *buffer, u32 count, u32 display, u32 component_id);
309 310
310void acpi_ut_dump_buffer2(u8 *buffer, u32 count, u32 display); 311void acpi_ut_dump_buffer(u8 *buffer, u32 count, u32 display, u32 offset);
311 312
312void acpi_ut_report_error(char *module_name, u32 line_number); 313void acpi_ut_report_error(char *module_name, u32 line_number);
313 314
diff --git a/drivers/acpi/acpica/exdebug.c b/drivers/acpi/acpica/exdebug.c
index e0c905095ed1..d7c9f51608a7 100644
--- a/drivers/acpi/acpica/exdebug.c
+++ b/drivers/acpi/acpica/exdebug.c
@@ -145,10 +145,10 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
145 case ACPI_TYPE_BUFFER: 145 case ACPI_TYPE_BUFFER:
146 146
147 acpi_os_printf("[0x%.2X]\n", (u32)source_desc->buffer.length); 147 acpi_os_printf("[0x%.2X]\n", (u32)source_desc->buffer.length);
148 acpi_ut_dump_buffer2(source_desc->buffer.pointer, 148 acpi_ut_dump_buffer(source_desc->buffer.pointer,
149 (source_desc->buffer.length < 256) ? 149 (source_desc->buffer.length < 256) ?
150 source_desc->buffer.length : 256, 150 source_desc->buffer.length : 256,
151 DB_BYTE_DISPLAY); 151 DB_BYTE_DISPLAY, 0);
152 break; 152 break;
153 153
154 case ACPI_TYPE_STRING: 154 case ACPI_TYPE_STRING:
diff --git a/drivers/acpi/acpica/exdump.c b/drivers/acpi/acpica/exdump.c
index 3157f3bb8de7..858b43a7dcf6 100644
--- a/drivers/acpi/acpica/exdump.c
+++ b/drivers/acpi/acpica/exdump.c
@@ -942,10 +942,11 @@ acpi_ex_dump_package_obj(union acpi_operand_object *obj_desc,
942 acpi_os_printf("[Buffer] Length %.2X = ", 942 acpi_os_printf("[Buffer] Length %.2X = ",
943 obj_desc->buffer.length); 943 obj_desc->buffer.length);
944 if (obj_desc->buffer.length) { 944 if (obj_desc->buffer.length) {
945 acpi_ut_dump_buffer(ACPI_CAST_PTR 945 acpi_ut_debug_dump_buffer(ACPI_CAST_PTR
946 (u8, obj_desc->buffer.pointer), 946 (u8,
947 obj_desc->buffer.length, 947 obj_desc->buffer.pointer),
948 DB_DWORD_DISPLAY, _COMPONENT); 948 obj_desc->buffer.length,
949 DB_DWORD_DISPLAY, _COMPONENT);
949 } else { 950 } else {
950 acpi_os_printf("\n"); 951 acpi_os_printf("\n");
951 } 952 }
diff --git a/drivers/acpi/acpica/psloop.c b/drivers/acpi/acpica/psloop.c
index e8b6dc0c51ca..d48c8fc0e729 100644
--- a/drivers/acpi/acpica/psloop.c
+++ b/drivers/acpi/acpica/psloop.c
@@ -133,7 +133,7 @@ static acpi_status acpi_ps_get_aml_opcode(struct acpi_walk_state *walk_state)
133 133
134 case AML_CLASS_UNKNOWN: 134 case AML_CLASS_UNKNOWN:
135 135
136 /* The opcode is unrecognized. Just skip unknown opcodes */ 136 /* The opcode is unrecognized. Complain and skip unknown opcodes */
137 137
138 if (walk_state->pass_number == 2) { 138 if (walk_state->pass_number == 2) {
139 ACPI_ERROR((AE_INFO, 139 ACPI_ERROR((AE_INFO,
@@ -142,28 +142,34 @@ static acpi_status acpi_ps_get_aml_opcode(struct acpi_walk_state *walk_state)
142 walk_state->aml_offset + 142 walk_state->aml_offset +
143 sizeof(struct acpi_table_header))); 143 sizeof(struct acpi_table_header)));
144 144
145 ACPI_DUMP_BUFFER(walk_state->parser_state.aml, 128); 145 ACPI_DUMP_BUFFER(walk_state->parser_state.aml - 16, 48);
146 146
147#ifdef ACPI_ASL_COMPILER 147#ifdef ACPI_ASL_COMPILER
148 148 /*
149 * This is executed for the disassembler only. Output goes
150 * to the disassembled ASL output file.
151 */
149 acpi_os_printf 152 acpi_os_printf
150 ("/*\nError: Unknown opcode 0x%.2X at table offset 0x%.4X, context:\n", 153 ("/*\nError: Unknown opcode 0x%.2X at table offset 0x%.4X, context:\n",
151 walk_state->opcode, 154 walk_state->opcode,
152 walk_state->aml_offset + 155 walk_state->aml_offset +
153 sizeof(struct acpi_table_header)); 156 sizeof(struct acpi_table_header));
154 157
155 /* TBD: Pass current offset to dump_buffer */ 158 /* Dump the context surrounding the invalid opcode */
156 159
157 acpi_ut_dump_buffer2(((u8 *)walk_state->parser_state. 160 acpi_ut_dump_buffer(((u8 *)walk_state->parser_state.
158 aml - 16), 48, DB_BYTE_DISPLAY); 161 aml - 16), 48, DB_BYTE_DISPLAY,
162 walk_state->aml_offset +
163 sizeof(struct acpi_table_header) -
164 16);
159 acpi_os_printf(" */\n"); 165 acpi_os_printf(" */\n");
160#endif 166#endif
161 } 167 }
162 168
163 /* Increment past one or two-byte opcode */ 169 /* Increment past one-byte or two-byte opcode */
164 170
165 walk_state->parser_state.aml++; 171 walk_state->parser_state.aml++;
166 if (walk_state->opcode > 0xFF) { 172 if (walk_state->opcode > 0xFF) { /* Can only happen if first byte is 0x5B */
167 walk_state->parser_state.aml++; 173 walk_state->parser_state.aml++;
168 } 174 }
169 175
diff --git a/drivers/acpi/acpica/utdebug.c b/drivers/acpi/acpica/utdebug.c
index 7a3327067f20..5d95166245ae 100644
--- a/drivers/acpi/acpica/utdebug.c
+++ b/drivers/acpi/acpica/utdebug.c
@@ -513,7 +513,7 @@ acpi_ut_ptr_exit(u32 line_number,
513 * PARAMETERS: buffer - Buffer to dump 513 * PARAMETERS: buffer - Buffer to dump
514 * count - Amount to dump, in bytes 514 * count - Amount to dump, in bytes
515 * display - BYTE, WORD, DWORD, or QWORD display 515 * display - BYTE, WORD, DWORD, or QWORD display
516 * component_ID - Caller's component ID 516 * offset - Beginning buffer offset (display only)
517 * 517 *
518 * RETURN: None 518 * RETURN: None
519 * 519 *
@@ -521,7 +521,7 @@ acpi_ut_ptr_exit(u32 line_number,
521 * 521 *
522 ******************************************************************************/ 522 ******************************************************************************/
523 523
524void acpi_ut_dump_buffer2(u8 *buffer, u32 count, u32 display) 524void acpi_ut_dump_buffer(u8 *buffer, u32 count, u32 display, u32 base_offset)
525{ 525{
526 u32 i = 0; 526 u32 i = 0;
527 u32 j; 527 u32 j;
@@ -543,7 +543,7 @@ void acpi_ut_dump_buffer2(u8 *buffer, u32 count, u32 display)
543 543
544 /* Print current offset */ 544 /* Print current offset */
545 545
546 acpi_os_printf("%6.4X: ", i); 546 acpi_os_printf("%6.4X: ", (base_offset + i));
547 547
548 /* Print 16 hex chars */ 548 /* Print 16 hex chars */
549 549
@@ -625,7 +625,7 @@ void acpi_ut_dump_buffer2(u8 *buffer, u32 count, u32 display)
625 625
626/******************************************************************************* 626/*******************************************************************************
627 * 627 *
628 * FUNCTION: acpi_ut_dump_buffer 628 * FUNCTION: acpi_ut_debug_dump_buffer
629 * 629 *
630 * PARAMETERS: buffer - Buffer to dump 630 * PARAMETERS: buffer - Buffer to dump
631 * count - Amount to dump, in bytes 631 * count - Amount to dump, in bytes
@@ -638,7 +638,8 @@ void acpi_ut_dump_buffer2(u8 *buffer, u32 count, u32 display)
638 * 638 *
639 ******************************************************************************/ 639 ******************************************************************************/
640 640
641void acpi_ut_dump_buffer(u8 *buffer, u32 count, u32 display, u32 component_id) 641void
642acpi_ut_debug_dump_buffer(u8 *buffer, u32 count, u32 display, u32 component_id)
642{ 643{
643 644
644 /* Only dump the buffer if tracing is enabled */ 645 /* Only dump the buffer if tracing is enabled */
@@ -648,5 +649,5 @@ void acpi_ut_dump_buffer(u8 *buffer, u32 count, u32 display, u32 component_id)
648 return; 649 return;
649 } 650 }
650 651
651 acpi_ut_dump_buffer2(buffer, count, display); 652 acpi_ut_dump_buffer(buffer, count, display, 0);
652} 653}