aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/utmisc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/acpica/utmisc.c')
-rw-r--r--drivers/acpi/acpica/utmisc.c85
1 files changed, 79 insertions, 6 deletions
diff --git a/drivers/acpi/acpica/utmisc.c b/drivers/acpi/acpica/utmisc.c
index fbe782348b0b..61f6315fce9f 100644
--- a/drivers/acpi/acpica/utmisc.c
+++ b/drivers/acpi/acpica/utmisc.c
@@ -50,6 +50,11 @@
50#define _COMPONENT ACPI_UTILITIES 50#define _COMPONENT ACPI_UTILITIES
51ACPI_MODULE_NAME("utmisc") 51ACPI_MODULE_NAME("utmisc")
52 52
53/*
54 * Common suffix for messages
55 */
56#define ACPI_COMMON_MSG_SUFFIX \
57 acpi_os_printf(" (%8.8X/%s-%u)\n", ACPI_CA_VERSION, module_name, line_number)
53/******************************************************************************* 58/*******************************************************************************
54 * 59 *
55 * FUNCTION: acpi_ut_validate_exception 60 * FUNCTION: acpi_ut_validate_exception
@@ -120,6 +125,34 @@ const char *acpi_ut_validate_exception(acpi_status status)
120 125
121/******************************************************************************* 126/*******************************************************************************
122 * 127 *
128 * FUNCTION: acpi_ut_is_pci_root_bridge
129 *
130 * PARAMETERS: Id - The HID/CID in string format
131 *
132 * RETURN: TRUE if the Id is a match for a PCI/PCI-Express Root Bridge
133 *
134 * DESCRIPTION: Determine if the input ID is a PCI Root Bridge ID.
135 *
136 ******************************************************************************/
137
138u8 acpi_ut_is_pci_root_bridge(char *id)
139{
140
141 /*
142 * Check if this is a PCI root bridge.
143 * ACPI 3.0+: check for a PCI Express root also.
144 */
145 if (!(ACPI_STRCMP(id,
146 PCI_ROOT_HID_STRING)) ||
147 !(ACPI_STRCMP(id, PCI_EXPRESS_ROOT_HID_STRING))) {
148 return (TRUE);
149 }
150
151 return (FALSE);
152}
153
154/*******************************************************************************
155 *
123 * FUNCTION: acpi_ut_is_aml_table 156 * FUNCTION: acpi_ut_is_aml_table
124 * 157 *
125 * PARAMETERS: Table - An ACPI table 158 * PARAMETERS: Table - An ACPI table
@@ -1037,8 +1070,7 @@ acpi_error(const char *module_name, u32 line_number, const char *format, ...)
1037 1070
1038 va_start(args, format); 1071 va_start(args, format);
1039 acpi_os_vprintf(format, args); 1072 acpi_os_vprintf(format, args);
1040 acpi_os_printf(" %8.8X %s-%u\n", ACPI_CA_VERSION, module_name, 1073 ACPI_COMMON_MSG_SUFFIX;
1041 line_number);
1042 va_end(args); 1074 va_end(args);
1043} 1075}
1044 1076
@@ -1052,8 +1084,7 @@ acpi_exception(const char *module_name,
1052 1084
1053 va_start(args, format); 1085 va_start(args, format);
1054 acpi_os_vprintf(format, args); 1086 acpi_os_vprintf(format, args);
1055 acpi_os_printf(" %8.8X %s-%u\n", ACPI_CA_VERSION, module_name, 1087 ACPI_COMMON_MSG_SUFFIX;
1056 line_number);
1057 va_end(args); 1088 va_end(args);
1058} 1089}
1059 1090
@@ -1066,8 +1097,7 @@ acpi_warning(const char *module_name, u32 line_number, const char *format, ...)
1066 1097
1067 va_start(args, format); 1098 va_start(args, format);
1068 acpi_os_vprintf(format, args); 1099 acpi_os_vprintf(format, args);
1069 acpi_os_printf(" %8.8X %s-%u\n", ACPI_CA_VERSION, module_name, 1100 ACPI_COMMON_MSG_SUFFIX;
1070 line_number);
1071 va_end(args); 1101 va_end(args);
1072} 1102}
1073 1103
@@ -1088,3 +1118,46 @@ ACPI_EXPORT_SYMBOL(acpi_error)
1088ACPI_EXPORT_SYMBOL(acpi_exception) 1118ACPI_EXPORT_SYMBOL(acpi_exception)
1089ACPI_EXPORT_SYMBOL(acpi_warning) 1119ACPI_EXPORT_SYMBOL(acpi_warning)
1090ACPI_EXPORT_SYMBOL(acpi_info) 1120ACPI_EXPORT_SYMBOL(acpi_info)
1121
1122/*******************************************************************************
1123 *
1124 * FUNCTION: acpi_ut_predefined_warning
1125 *
1126 * PARAMETERS: module_name - Caller's module name (for error output)
1127 * line_number - Caller's line number (for error output)
1128 * Pathname - Full pathname to the node
1129 * node_flags - From Namespace node for the method/object
1130 * Format - Printf format string + additional args
1131 *
1132 * RETURN: None
1133 *
1134 * DESCRIPTION: Warnings for the predefined validation module. Messages are
1135 * only emitted the first time a problem with a particular
1136 * method/object is detected. This prevents a flood of error
1137 * messages for methods that are repeatedly evaluated.
1138 *
1139******************************************************************************/
1140
1141void ACPI_INTERNAL_VAR_XFACE
1142acpi_ut_predefined_warning(const char *module_name,
1143 u32 line_number,
1144 char *pathname,
1145 u8 node_flags, const char *format, ...)
1146{
1147 va_list args;
1148
1149 /*
1150 * Warning messages for this method/object will be disabled after the
1151 * first time a validation fails or an object is successfully repaired.
1152 */
1153 if (node_flags & ANOBJ_EVALUATED) {
1154 return;
1155 }
1156
1157 acpi_os_printf("ACPI Warning for %s: ", pathname);
1158
1159 va_start(args, format);
1160 acpi_os_vprintf(format, args);
1161 ACPI_COMMON_MSG_SUFFIX;
1162 va_end(args);
1163}