Skip to content

Commit f13c274

Browse files
acpibobrafaeljw
authored andcommitted
ACPICA: Convert more ACPI errors to firmware errors
ACPICA commit f3198c12f2df9d170b3da891a180b774cfe01e59 Also adds a new firmware error function, acpi_bios_exception. Link: acpica/acpica@f3198c12 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Erik Schmauss <erik.schmauss@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 1c7fc5c commit f13c274

File tree

5 files changed

+64
-11
lines changed

5 files changed

+64
-11
lines changed

drivers/acpi/acpica/dsopcode.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ acpi_ds_init_buffer_field(u16 aml_opcode,
130130
/* Must have a valid (>0) bit count */
131131

132132
if (bit_count == 0) {
133-
ACPI_ERROR((AE_INFO,
134-
"Attempt to CreateField of length zero"));
133+
ACPI_BIOS_ERROR((AE_INFO,
134+
"Attempt to CreateField of length zero"));
135135
status = AE_AML_OPERAND_VALUE;
136136
goto cleanup;
137137
}
@@ -194,12 +194,13 @@ acpi_ds_init_buffer_field(u16 aml_opcode,
194194
/* Entire field must fit within the current length of the buffer */
195195

196196
if ((bit_offset + bit_count) > (8 * (u32)buffer_desc->buffer.length)) {
197-
ACPI_ERROR((AE_INFO,
198-
"Field [%4.4s] at bit offset/length %u/%u "
199-
"exceeds size of target Buffer (%u bits)",
200-
acpi_ut_get_node_name(result_desc), bit_offset,
201-
bit_count, 8 * (u32)buffer_desc->buffer.length));
202197
status = AE_AML_BUFFER_LIMIT;
198+
ACPI_BIOS_EXCEPTION((AE_INFO, status,
199+
"Field [%4.4s] at bit offset/length %u/%u "
200+
"exceeds size of target Buffer (%u bits)",
201+
acpi_ut_get_node_name(result_desc),
202+
bit_offset, bit_count,
203+
8 * (u32)buffer_desc->buffer.length));
203204
goto cleanup;
204205
}
205206

drivers/acpi/acpica/exoparg2.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,10 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
390390
/* Failure means that the Index was beyond the end of the object */
391391

392392
if (ACPI_FAILURE(status)) {
393-
ACPI_EXCEPTION((AE_INFO, status,
394-
"Index (0x%X%8.8X) is beyond end of object (length 0x%X)",
395-
ACPI_FORMAT_UINT64(index),
396-
(u32)length));
393+
ACPI_BIOS_EXCEPTION((AE_INFO, status,
394+
"Index (0x%X%8.8X) is beyond end of object (length 0x%X)",
395+
ACPI_FORMAT_UINT64(index),
396+
(u32)length));
397397
goto cleanup;
398398
}
399399

drivers/acpi/acpica/utxferror.c

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,50 @@ acpi_bios_error(const char *module_name,
185185

186186
ACPI_EXPORT_SYMBOL(acpi_bios_error)
187187

188+
/*******************************************************************************
189+
*
190+
* FUNCTION: acpi_bios_exception
191+
*
192+
* PARAMETERS: module_name - Caller's module name (for error output)
193+
* line_number - Caller's line number (for error output)
194+
* status - Status value to be decoded/formatted
195+
* format - Printf format string + additional args
196+
*
197+
* RETURN: None
198+
*
199+
* DESCRIPTION: Print an "ACPI Firmware Error" message with module/line/version
200+
* info as well as decoded acpi_status.
201+
*
202+
******************************************************************************/
203+
void ACPI_INTERNAL_VAR_XFACE
204+
acpi_bios_exception(const char *module_name,
205+
u32 line_number,
206+
acpi_status status, const char *format, ...)
207+
{
208+
va_list arg_list;
209+
210+
ACPI_MSG_REDIRECT_BEGIN;
211+
212+
/* For AE_OK, just print the message */
213+
214+
if (ACPI_SUCCESS(status)) {
215+
acpi_os_printf(ACPI_MSG_BIOS_ERROR);
216+
217+
} else {
218+
acpi_os_printf(ACPI_MSG_BIOS_ERROR "%s, ",
219+
acpi_format_exception(status));
220+
}
221+
222+
va_start(arg_list, format);
223+
acpi_os_vprintf(format, arg_list);
224+
ACPI_MSG_SUFFIX;
225+
va_end(arg_list);
226+
227+
ACPI_MSG_REDIRECT_END;
228+
}
229+
230+
ACPI_EXPORT_SYMBOL(acpi_bios_exception)
231+
188232
/*******************************************************************************
189233
*
190234
* FUNCTION: acpi_bios_warning

include/acpi/acoutput.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@
201201
#define ACPI_EXCEPTION(plist) acpi_exception plist
202202
#define ACPI_ERROR(plist) acpi_error plist
203203
#define ACPI_BIOS_WARNING(plist) acpi_bios_warning plist
204+
#define ACPI_BIOS_EXCEPTION(plist) acpi_bios_exception plist
204205
#define ACPI_BIOS_ERROR(plist) acpi_bios_error plist
205206
#define ACPI_DEBUG_OBJECT(obj,l,i) acpi_ex_do_debug_object(obj,l,i)
206207

@@ -213,6 +214,7 @@
213214
#define ACPI_EXCEPTION(plist)
214215
#define ACPI_ERROR(plist)
215216
#define ACPI_BIOS_WARNING(plist)
217+
#define ACPI_BIOS_EXCEPTION(plist)
216218
#define ACPI_BIOS_ERROR(plist)
217219
#define ACPI_DEBUG_OBJECT(obj,l,i)
218220

include/acpi/acpixf.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,12 @@ ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
903903
acpi_bios_error(const char *module_name,
904904
u32 line_number,
905905
const char *format, ...))
906+
ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(4)
907+
void ACPI_INTERNAL_VAR_XFACE
908+
acpi_bios_exception(const char *module_name,
909+
u32 line_number,
910+
acpi_status status,
911+
const char *format, ...))
906912
ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
907913
void ACPI_INTERNAL_VAR_XFACE
908914
acpi_bios_warning(const char *module_name,

0 commit comments

Comments
 (0)