^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Module Name: uterror - Various internal error/warning output functions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #include <acpi/acpi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include "accommon.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include "acnamesp.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #define _COMPONENT ACPI_UTILITIES
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) ACPI_MODULE_NAME("uterror")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * This module contains internal error functions that may
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * be configured out.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #if !defined (ACPI_NO_ERROR_MESSAGES)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * FUNCTION: acpi_ut_predefined_warning
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) * PARAMETERS: module_name - Caller's module name (for error output)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) * line_number - Caller's line number (for error output)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) * pathname - Full pathname to the node
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) * node_flags - From Namespace node for the method/object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) * format - Printf format string + additional args
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) * RETURN: None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) * DESCRIPTION: Warnings for the predefined validation module. Messages are
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) * only emitted the first time a problem with a particular
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) * method/object is detected. This prevents a flood of error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) * messages for methods that are repeatedly evaluated.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) void ACPI_INTERNAL_VAR_XFACE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) acpi_ut_predefined_warning(const char *module_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) u32 line_number,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) char *pathname,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) u16 node_flags, const char *format, ...)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) va_list arg_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) * Warning messages for this method/object will be disabled after the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) * first time a validation fails or an object is successfully repaired.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) if (node_flags & ANOBJ_EVALUATED) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) acpi_os_printf(ACPI_MSG_WARNING "%s: ", pathname);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) va_start(arg_list, format);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) acpi_os_vprintf(format, arg_list);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) ACPI_MSG_SUFFIX;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) va_end(arg_list);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) * FUNCTION: acpi_ut_predefined_info
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) * PARAMETERS: module_name - Caller's module name (for error output)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) * line_number - Caller's line number (for error output)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) * pathname - Full pathname to the node
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) * node_flags - From Namespace node for the method/object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) * format - Printf format string + additional args
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) * RETURN: None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) * DESCRIPTION: Info messages for the predefined validation module. Messages
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) * are only emitted the first time a problem with a particular
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) * method/object is detected. This prevents a flood of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) * messages for methods that are repeatedly evaluated.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) void ACPI_INTERNAL_VAR_XFACE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) acpi_ut_predefined_info(const char *module_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) u32 line_number,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) char *pathname, u16 node_flags, const char *format, ...)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) va_list arg_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) * Warning messages for this method/object will be disabled after the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90) * first time a validation fails or an object is successfully repaired.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) if (node_flags & ANOBJ_EVALUATED) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) acpi_os_printf(ACPI_MSG_INFO "%s: ", pathname);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) va_start(arg_list, format);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99) acpi_os_vprintf(format, arg_list);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) ACPI_MSG_SUFFIX;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) va_end(arg_list);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) * FUNCTION: acpi_ut_predefined_bios_error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) * PARAMETERS: module_name - Caller's module name (for error output)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) * line_number - Caller's line number (for error output)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) * pathname - Full pathname to the node
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) * node_flags - From Namespace node for the method/object
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) * format - Printf format string + additional args
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) * RETURN: None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) * DESCRIPTION: BIOS error message for predefined names. Messages
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) * are only emitted the first time a problem with a particular
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118) * method/object is detected. This prevents a flood of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) * messages for methods that are repeatedly evaluated.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) void ACPI_INTERNAL_VAR_XFACE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) acpi_ut_predefined_bios_error(const char *module_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) u32 line_number,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) char *pathname,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) u16 node_flags, const char *format, ...)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) va_list arg_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) * Warning messages for this method/object will be disabled after the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133) * first time a validation fails or an object is successfully repaired.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) if (node_flags & ANOBJ_EVALUATED) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) return;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) acpi_os_printf(ACPI_MSG_BIOS_ERROR "%s: ", pathname);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) va_start(arg_list, format);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) acpi_os_vprintf(format, arg_list);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143) ACPI_MSG_SUFFIX;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) va_end(arg_list);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) * FUNCTION: acpi_ut_prefixed_namespace_error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) * PARAMETERS: module_name - Caller's module name (for error output)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) * line_number - Caller's line number (for error output)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) * prefix_scope - Scope/Path that prefixes the internal path
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) * internal_path - Name or path of the namespace node
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) * lookup_status - Exception code from NS lookup
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) * RETURN: None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) * DESCRIPTION: Print error message with the full pathname constructed this way:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) * prefix_scope_node_full_path.externalized_internal_path
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) * NOTE: 10/2017: Treat the major ns_lookup errors as firmware errors
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) acpi_ut_prefixed_namespace_error(const char *module_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) u32 line_number,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) union acpi_generic_state *prefix_scope,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) const char *internal_path,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) acpi_status lookup_status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) char *full_path;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175) const char *message;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) * Main cases:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) * 1) Object creation, object must not already exist
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) * 2) Object lookup, object must exist
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) switch (lookup_status) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183) case AE_ALREADY_EXISTS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185) acpi_os_printf(ACPI_MSG_BIOS_ERROR);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186) message = "Failure creating named object";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) case AE_NOT_FOUND:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) acpi_os_printf(ACPI_MSG_BIOS_ERROR);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) message = "Could not resolve symbol";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195) default:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197) acpi_os_printf(ACPI_MSG_ERROR);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198) message = "Failure resolving symbol";
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199) break;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) /* Concatenate the prefix path and the internal path */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) full_path =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) acpi_ns_build_prefixed_pathname(prefix_scope, internal_path);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) acpi_os_printf("%s [%s], %s", message,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) full_path ? full_path : "Could not get pathname",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) acpi_format_exception(lookup_status));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) if (full_path) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) ACPI_FREE(full_path);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) ACPI_MSG_SUFFIX;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) #ifdef __OBSOLETE_FUNCTION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) * FUNCTION: acpi_ut_namespace_error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) * PARAMETERS: module_name - Caller's module name (for error output)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) * line_number - Caller's line number (for error output)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) * internal_name - Name or path of the namespace node
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) * lookup_status - Exception code from NS lookup
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 228) * RETURN: None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 229) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 230) * DESCRIPTION: Print error message with the full pathname for the NS node.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 231) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 232) ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 233)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 234) void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 235) acpi_ut_namespace_error(const char *module_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 236) u32 line_number,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 237) const char *internal_name, acpi_status lookup_status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 238) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 239) acpi_status status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 240) u32 bad_name;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 241) char *name = NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 242)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 243) ACPI_MSG_REDIRECT_BEGIN;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 244) acpi_os_printf(ACPI_MSG_ERROR);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 245)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 246) if (lookup_status == AE_BAD_CHARACTER) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 247)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 248) /* There is a non-ascii character in the name */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 249)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 250) ACPI_MOVE_32_TO_32(&bad_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 251) ACPI_CAST_PTR(u32, internal_name));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 252) acpi_os_printf("[0x%.8X] (NON-ASCII)", bad_name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 253) } else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 254) /* Convert path to external format */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 255)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 256) status =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 257) acpi_ns_externalize_name(ACPI_UINT32_MAX, internal_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 258) NULL, &name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 259)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 260) /* Print target name */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 261)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 262) if (ACPI_SUCCESS(status)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 263) acpi_os_printf("[%s]", name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 264) } else {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 265) acpi_os_printf("[COULD NOT EXTERNALIZE NAME]");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 266) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 267)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 268) if (name) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 269) ACPI_FREE(name);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 270) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 271) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 272)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 273) acpi_os_printf(" Namespace lookup failure, %s",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 274) acpi_format_exception(lookup_status));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 275)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 276) ACPI_MSG_SUFFIX;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 277) ACPI_MSG_REDIRECT_END;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 278) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 279) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 280)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 281) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 282) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 283) * FUNCTION: acpi_ut_method_error
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 284) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 285) * PARAMETERS: module_name - Caller's module name (for error output)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 286) * line_number - Caller's line number (for error output)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 287) * message - Error message to use on failure
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 288) * prefix_node - Prefix relative to the path
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 289) * path - Path to the node (optional)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 290) * method_status - Execution status
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 291) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 292) * RETURN: None
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 293) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 294) * DESCRIPTION: Print error message with the full pathname for the method.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 295) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 296) ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 297)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 298) void
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 299) acpi_ut_method_error(const char *module_name,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 300) u32 line_number,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 301) const char *message,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 302) struct acpi_namespace_node *prefix_node,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 303) const char *path, acpi_status method_status)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 304) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 305) acpi_status status;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 306) struct acpi_namespace_node *node = prefix_node;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 307)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 308) ACPI_MSG_REDIRECT_BEGIN;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 309) acpi_os_printf(ACPI_MSG_ERROR);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 310)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 311) if (path) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 312) status = acpi_ns_get_node(prefix_node, path,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 313) ACPI_NS_NO_UPSEARCH, &node);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 314) if (ACPI_FAILURE(status)) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 315) acpi_os_printf("[Could not get node by pathname]");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 316) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 317) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 318)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 319) acpi_ns_print_node_pathname(node, message);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 320) acpi_os_printf(" due to previous error (%s)",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 321) acpi_format_exception(method_status));
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 322)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 323) ACPI_MSG_SUFFIX;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 324) ACPI_MSG_REDIRECT_END;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 325) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 326)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 327) #endif /* ACPI_NO_ERROR_MESSAGES */