aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/psloop.c
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/psloop.c
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/psloop.c')
-rw-r--r--drivers/acpi/acpica/psloop.c22
1 files changed, 14 insertions, 8 deletions
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