aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/utilities/utmisc.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2006-01-27 16:43:00 -0500
committerLen Brown <len.brown@intel.com>2006-01-31 03:25:09 -0500
commitb8e4d89357fc434618a59c1047cac72641191805 (patch)
treeac97fcc6fdc277c682365900663872c96f2420bd /drivers/acpi/utilities/utmisc.c
parent292dd876ee765c478b27c93cc51e93a558ed58bf (diff)
[ACPI] ACPICA 20060127
Implemented support in the Resource Manager to allow unresolved namestring references within resource package objects for the _PRT method. This support is in addition to the previously implemented unresolved reference support within the AML parser. If the interpreter slack mode is enabled (true on Linux unless acpi=strict), these unresolved references will be passed through to the caller as a NULL package entry. http://bugzilla.kernel.org/show_bug.cgi?id=5741 Implemented and deployed new macros and functions for error and warning messages across the subsystem. These macros are simpler and generate less code than their predecessors. The new macros ACPI_ERROR, ACPI_EXCEPTION, ACPI_WARNING, and ACPI_INFO replace the ACPI_REPORT_* macros. Implemented the acpi_cpu_flags type to simplify host OS integration of the Acquire/Release Lock OSL interfaces. Suggested by Steven Rostedt and Andrew Morton. Fixed a problem where Alias ASL operators are sometimes not correctly resolved. causing AE_AML_INTERNAL http://bugzilla.kernel.org/show_bug.cgi?id=5189 http://bugzilla.kernel.org/show_bug.cgi?id=5674 Fixed several problems with the implementation of the ConcatenateResTemplate ASL operator. As per the ACPI specification, zero length buffers are now treated as a single EndTag. One-length buffers always cause a fatal exception. Non-zero length buffers that do not end with a full 2-byte EndTag cause a fatal exception. Fixed a possible structure overwrite in the AcpiGetObjectInfo external interface. (With assistance from Thomas Renninger) Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/utilities/utmisc.c')
-rw-r--r--drivers/acpi/utilities/utmisc.c90
1 files changed, 66 insertions, 24 deletions
diff --git a/drivers/acpi/utilities/utmisc.c b/drivers/acpi/utilities/utmisc.c
index a77ffcd5570f..7364f5f8c9cd 100644
--- a/drivers/acpi/utilities/utmisc.c
+++ b/drivers/acpi/utilities/utmisc.c
@@ -72,8 +72,8 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id)
72 /* Guard against multiple allocations of ID to the same location */ 72 /* Guard against multiple allocations of ID to the same location */
73 73
74 if (*owner_id) { 74 if (*owner_id) {
75 ACPI_REPORT_ERROR(("Owner ID [%2.2X] already exists\n", 75 ACPI_ERROR((AE_INFO, "Owner ID [%2.2X] already exists",
76 *owner_id)); 76 *owner_id));
77 return_ACPI_STATUS(AE_ALREADY_EXISTS); 77 return_ACPI_STATUS(AE_ALREADY_EXISTS);
78 } 78 }
79 79
@@ -143,7 +143,8 @@ acpi_status acpi_ut_allocate_owner_id(acpi_owner_id * owner_id)
143 * methods, or there may be a bug where the IDs are not released. 143 * methods, or there may be a bug where the IDs are not released.
144 */ 144 */
145 status = AE_OWNER_ID_LIMIT; 145 status = AE_OWNER_ID_LIMIT;
146 ACPI_REPORT_ERROR(("Could not allocate new owner_id (255 max), AE_OWNER_ID_LIMIT\n")); 146 ACPI_ERROR((AE_INFO,
147 "Could not allocate new owner_id (255 max), AE_OWNER_ID_LIMIT"));
147 148
148 exit: 149 exit:
149 (void)acpi_ut_release_mutex(ACPI_MTX_CACHES); 150 (void)acpi_ut_release_mutex(ACPI_MTX_CACHES);
@@ -180,7 +181,7 @@ void acpi_ut_release_owner_id(acpi_owner_id * owner_id_ptr)
180 /* Zero is not a valid owner_iD */ 181 /* Zero is not a valid owner_iD */
181 182
182 if (owner_id == 0) { 183 if (owner_id == 0) {
183 ACPI_REPORT_ERROR(("Invalid owner_id: %2.2X\n", owner_id)); 184 ACPI_ERROR((AE_INFO, "Invalid owner_id: %2.2X", owner_id));
184 return_VOID; 185 return_VOID;
185 } 186 }
186 187
@@ -205,8 +206,9 @@ void acpi_ut_release_owner_id(acpi_owner_id * owner_id_ptr)
205 if (acpi_gbl_owner_id_mask[index] & bit) { 206 if (acpi_gbl_owner_id_mask[index] & bit) {
206 acpi_gbl_owner_id_mask[index] ^= bit; 207 acpi_gbl_owner_id_mask[index] ^= bit;
207 } else { 208 } else {
208 ACPI_REPORT_ERROR(("Release of non-allocated owner_id: %2.2X\n", 209 ACPI_ERROR((AE_INFO,
209 owner_id + 1)); 210 "Release of non-allocated owner_id: %2.2X",
211 owner_id + 1));
210 } 212 }
211 213
212 (void)acpi_ut_release_mutex(ACPI_MTX_CACHES); 214 (void)acpi_ut_release_mutex(ACPI_MTX_CACHES);
@@ -837,55 +839,95 @@ u8 acpi_ut_generate_checksum(u8 * buffer, u32 length)
837 839
838/******************************************************************************* 840/*******************************************************************************
839 * 841 *
840 * FUNCTION: acpi_ut_report_error 842 * FUNCTION: acpi_ut_error, acpi_ut_warning, acpi_ut_info
841 * 843 *
842 * PARAMETERS: module_name - Caller's module name (for error output) 844 * PARAMETERS: module_name - Caller's module name (for error output)
843 * line_number - Caller's line number (for error output) 845 * line_number - Caller's line number (for error output)
846 * Format - Printf format string + additional args
844 * 847 *
845 * RETURN: None 848 * RETURN: None
846 * 849 *
847 * DESCRIPTION: Print error message 850 * DESCRIPTION: Print message with module/line/version info
848 * 851 *
849 ******************************************************************************/ 852 ******************************************************************************/
850 853
851void acpi_ut_report_error(char *module_name, u32 line_number) 854void ACPI_INTERNAL_VAR_XFACE
855acpi_ut_error(char *module_name, u32 line_number, char *format, ...)
852{ 856{
857 va_list args;
853 858
854 acpi_os_printf("ACPI Error (%s-%04d): ", module_name, line_number); 859 acpi_os_printf("ACPI Error (%s-%04d): ", module_name, line_number);
860
861 va_start(args, format);
862 acpi_os_vprintf(format, args);
863 acpi_os_printf(" [%X]\n", ACPI_CA_VERSION);
855} 864}
856 865
857/******************************************************************************* 866void ACPI_INTERNAL_VAR_XFACE
858 * 867acpi_ut_exception(char *module_name,
859 * FUNCTION: acpi_ut_report_warning 868 u32 line_number, acpi_status status, char *format, ...)
860 * 869{
861 * PARAMETERS: module_name - Caller's module name (for error output) 870 va_list args;
862 * line_number - Caller's line number (for error output)
863 *
864 * RETURN: None
865 *
866 * DESCRIPTION: Print warning message
867 *
868 ******************************************************************************/
869 871
870void acpi_ut_report_warning(char *module_name, u32 line_number) 872 acpi_os_printf("ACPI Exception (%s-%04d): %s, ", module_name,
873 line_number, acpi_format_exception(status));
874
875 va_start(args, format);
876 acpi_os_vprintf(format, args);
877 acpi_os_printf(" [%X]\n", ACPI_CA_VERSION);
878}
879
880void ACPI_INTERNAL_VAR_XFACE
881acpi_ut_warning(char *module_name, u32 line_number, char *format, ...)
871{ 882{
883 va_list args;
872 884
873 acpi_os_printf("ACPI Warning (%s-%04d): ", module_name, line_number); 885 acpi_os_printf("ACPI Warning (%s-%04d): ", module_name, line_number);
886
887 va_start(args, format);
888 acpi_os_vprintf(format, args);
889 acpi_os_printf(" [%X]\n", ACPI_CA_VERSION);
890}
891
892void ACPI_INTERNAL_VAR_XFACE
893acpi_ut_info(char *module_name, u32 line_number, char *format, ...)
894{
895 va_list args;
896
897 acpi_os_printf("ACPI (%s-%04d): ", module_name, line_number);
898
899 va_start(args, format);
900 acpi_os_vprintf(format, args);
901 acpi_os_printf(" [%X]\n", ACPI_CA_VERSION);
874} 902}
875 903
876/******************************************************************************* 904/*******************************************************************************
877 * 905 *
878 * FUNCTION: acpi_ut_report_info 906 * FUNCTION: acpi_ut_report_error, Warning, Info
879 * 907 *
880 * PARAMETERS: module_name - Caller's module name (for error output) 908 * PARAMETERS: module_name - Caller's module name (for error output)
881 * line_number - Caller's line number (for error output) 909 * line_number - Caller's line number (for error output)
882 * 910 *
883 * RETURN: None 911 * RETURN: None
884 * 912 *
885 * DESCRIPTION: Print information message 913 * DESCRIPTION: Print error message
914 *
915 * Note: Legacy only, should be removed when no longer used by drivers.
886 * 916 *
887 ******************************************************************************/ 917 ******************************************************************************/
888 918
919void acpi_ut_report_error(char *module_name, u32 line_number)
920{
921
922 acpi_os_printf("ACPI Error (%s-%04d): ", module_name, line_number);
923}
924
925void acpi_ut_report_warning(char *module_name, u32 line_number)
926{
927
928 acpi_os_printf("ACPI Warning (%s-%04d): ", module_name, line_number);
929}
930
889void acpi_ut_report_info(char *module_name, u32 line_number) 931void acpi_ut_report_info(char *module_name, u32 line_number)
890{ 932{
891 933