Commit f13c274d authored by Bob Moore's avatar Bob Moore Committed by Rafael J. Wysocki

ACPICA: Convert more ACPI errors to firmware errors

ACPICA commit f3198c12f2df9d170b3da891a180b774cfe01e59

Also adds a new firmware error function, acpi_bios_exception.

Link: https://github.com/acpica/acpica/commit/f3198c12Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarErik Schmauss <erik.schmauss@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 1c7fc5cb
......@@ -130,8 +130,8 @@ acpi_ds_init_buffer_field(u16 aml_opcode,
/* Must have a valid (>0) bit count */
if (bit_count == 0) {
ACPI_ERROR((AE_INFO,
"Attempt to CreateField of length zero"));
ACPI_BIOS_ERROR((AE_INFO,
"Attempt to CreateField of length zero"));
status = AE_AML_OPERAND_VALUE;
goto cleanup;
}
......@@ -194,12 +194,13 @@ acpi_ds_init_buffer_field(u16 aml_opcode,
/* Entire field must fit within the current length of the buffer */
if ((bit_offset + bit_count) > (8 * (u32)buffer_desc->buffer.length)) {
ACPI_ERROR((AE_INFO,
"Field [%4.4s] at bit offset/length %u/%u "
"exceeds size of target Buffer (%u bits)",
acpi_ut_get_node_name(result_desc), bit_offset,
bit_count, 8 * (u32)buffer_desc->buffer.length));
status = AE_AML_BUFFER_LIMIT;
ACPI_BIOS_EXCEPTION((AE_INFO, status,
"Field [%4.4s] at bit offset/length %u/%u "
"exceeds size of target Buffer (%u bits)",
acpi_ut_get_node_name(result_desc),
bit_offset, bit_count,
8 * (u32)buffer_desc->buffer.length));
goto cleanup;
}
......
......@@ -390,10 +390,10 @@ acpi_status acpi_ex_opcode_2A_1T_1R(struct acpi_walk_state *walk_state)
/* Failure means that the Index was beyond the end of the object */
if (ACPI_FAILURE(status)) {
ACPI_EXCEPTION((AE_INFO, status,
"Index (0x%X%8.8X) is beyond end of object (length 0x%X)",
ACPI_FORMAT_UINT64(index),
(u32)length));
ACPI_BIOS_EXCEPTION((AE_INFO, status,
"Index (0x%X%8.8X) is beyond end of object (length 0x%X)",
ACPI_FORMAT_UINT64(index),
(u32)length));
goto cleanup;
}
......
......@@ -185,6 +185,50 @@ acpi_bios_error(const char *module_name,
ACPI_EXPORT_SYMBOL(acpi_bios_error)
/*******************************************************************************
*
* FUNCTION: acpi_bios_exception
*
* PARAMETERS: module_name - Caller's module name (for error output)
* line_number - Caller's line number (for error output)
* status - Status value to be decoded/formatted
* format - Printf format string + additional args
*
* RETURN: None
*
* DESCRIPTION: Print an "ACPI Firmware Error" message with module/line/version
* info as well as decoded acpi_status.
*
******************************************************************************/
void ACPI_INTERNAL_VAR_XFACE
acpi_bios_exception(const char *module_name,
u32 line_number,
acpi_status status, const char *format, ...)
{
va_list arg_list;
ACPI_MSG_REDIRECT_BEGIN;
/* For AE_OK, just print the message */
if (ACPI_SUCCESS(status)) {
acpi_os_printf(ACPI_MSG_BIOS_ERROR);
} else {
acpi_os_printf(ACPI_MSG_BIOS_ERROR "%s, ",
acpi_format_exception(status));
}
va_start(arg_list, format);
acpi_os_vprintf(format, arg_list);
ACPI_MSG_SUFFIX;
va_end(arg_list);
ACPI_MSG_REDIRECT_END;
}
ACPI_EXPORT_SYMBOL(acpi_bios_exception)
/*******************************************************************************
*
* FUNCTION: acpi_bios_warning
......
......@@ -201,6 +201,7 @@
#define ACPI_EXCEPTION(plist) acpi_exception plist
#define ACPI_ERROR(plist) acpi_error plist
#define ACPI_BIOS_WARNING(plist) acpi_bios_warning plist
#define ACPI_BIOS_EXCEPTION(plist) acpi_bios_exception plist
#define ACPI_BIOS_ERROR(plist) acpi_bios_error plist
#define ACPI_DEBUG_OBJECT(obj,l,i) acpi_ex_do_debug_object(obj,l,i)
......@@ -213,6 +214,7 @@
#define ACPI_EXCEPTION(plist)
#define ACPI_ERROR(plist)
#define ACPI_BIOS_WARNING(plist)
#define ACPI_BIOS_EXCEPTION(plist)
#define ACPI_BIOS_ERROR(plist)
#define ACPI_DEBUG_OBJECT(obj,l,i)
......
......@@ -903,6 +903,12 @@ ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
acpi_bios_error(const char *module_name,
u32 line_number,
const char *format, ...))
ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(4)
void ACPI_INTERNAL_VAR_XFACE
acpi_bios_exception(const char *module_name,
u32 line_number,
acpi_status status,
const char *format, ...))
ACPI_MSG_DEPENDENT_RETURN_VOID(ACPI_PRINTF_LIKE(3)
void ACPI_INTERNAL_VAR_XFACE
acpi_bios_warning(const char *module_name,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment