]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/utilities/utglobal.c
Merge branch 'fixes-2.6.23' of master.kernel.org:/pub/scm/linux/kernel/git/galak...
[linux-2.6-omap-h63xx.git] / drivers / acpi / utilities / utglobal.c
index 5b83f86470d7acda5845b741b6cdd576547549f7..1621655d6e2b331e23bd9beaf56e59fab7298e8d 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2006, R. Byron Moore
+ * Copyright (C) 2000 - 2007, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -50,98 +50,15 @@ ACPI_EXPORT_SYMBOL(acpi_gbl_FADT)
 #define _COMPONENT          ACPI_UTILITIES
     ACPI_MODULE_NAME("utglobal")
 
-/*******************************************************************************
- *
- * FUNCTION:    acpi_format_exception
- *
- * PARAMETERS:  Status       - The acpi_status code to be formatted
- *
- * RETURN:      A string containing the exception text. A valid pointer is
- *              always returned.
- *
- * DESCRIPTION: This function translates an ACPI exception into an ASCII string.
- *
- ******************************************************************************/
-const char *acpi_format_exception(acpi_status status)
-{
-       acpi_status sub_status;
-       const char *exception = NULL;
-
-       ACPI_FUNCTION_ENTRY();
-
-       /*
-        * Status is composed of two parts, a "type" and an actual code
-        */
-       sub_status = (status & ~AE_CODE_MASK);
-
-       switch (status & AE_CODE_MASK) {
-       case AE_CODE_ENVIRONMENTAL:
-
-               if (sub_status <= AE_CODE_ENV_MAX) {
-                       exception = acpi_gbl_exception_names_env[sub_status];
-               }
-               break;
-
-       case AE_CODE_PROGRAMMER:
-
-               if (sub_status <= AE_CODE_PGM_MAX) {
-                       exception =
-                           acpi_gbl_exception_names_pgm[sub_status - 1];
-               }
-               break;
-
-       case AE_CODE_ACPI_TABLES:
-
-               if (sub_status <= AE_CODE_TBL_MAX) {
-                       exception =
-                           acpi_gbl_exception_names_tbl[sub_status - 1];
-               }
-               break;
-
-       case AE_CODE_AML:
-
-               if (sub_status <= AE_CODE_AML_MAX) {
-                       exception =
-                           acpi_gbl_exception_names_aml[sub_status - 1];
-               }
-               break;
-
-       case AE_CODE_CONTROL:
-
-               if (sub_status <= AE_CODE_CTRL_MAX) {
-                       exception =
-                           acpi_gbl_exception_names_ctrl[sub_status - 1];
-               }
-               break;
-
-       default:
-               break;
-       }
-
-       if (!exception) {
-
-               /* Exception code was not recognized */
-
-               ACPI_ERROR((AE_INFO,
-                           "Unknown exception code: 0x%8.8X", status));
-
-               exception = "UNKNOWN_STATUS_CODE";
-       }
-
-       return (ACPI_CAST_PTR(const char, exception));
-}
-
 /*******************************************************************************
  *
  * Static global variable initialization.
  *
  ******************************************************************************/
-
 /*
  * We want the debug switches statically initialized so they
  * are already set when the debugger is entered.
  */
-
 /* Debug switch - level and trace mask */
 u32 acpi_dbg_level = ACPI_DEBUG_DEFAULT;
 
@@ -182,10 +99,45 @@ const char *acpi_gbl_highest_dstate_names[4] = {
 
 /*******************************************************************************
  *
- * Namespace globals
+ * FUNCTION:    acpi_format_exception
+ *
+ * PARAMETERS:  Status       - The acpi_status code to be formatted
+ *
+ * RETURN:      A string containing the exception text. A valid pointer is
+ *              always returned.
+ *
+ * DESCRIPTION: This function translates an ACPI exception into an ASCII string
+ *              It is here instead of utxface.c so it is always present.
  *
  ******************************************************************************/
 
+const char *acpi_format_exception(acpi_status status)
+{
+       const char *exception = NULL;
+
+       ACPI_FUNCTION_ENTRY();
+
+       exception = acpi_ut_validate_exception(status);
+       if (!exception) {
+
+               /* Exception code was not recognized */
+
+               ACPI_ERROR((AE_INFO,
+                           "Unknown exception code: 0x%8.8X", status));
+
+               exception = "UNKNOWN_STATUS_CODE";
+       }
+
+       return (ACPI_CAST_PTR(const char, exception));
+}
+
+ACPI_EXPORT_SYMBOL(acpi_format_exception)
+
+/*******************************************************************************
+ *
+ * Namespace globals
+ *
+ ******************************************************************************/
 /*
  * Predefined ACPI Names (Built-in to the Interpreter)
  *
@@ -773,9 +725,13 @@ void acpi_ut_init_globals(void)
        acpi_gbl_lowest_stack_pointer = ACPI_SIZE_MAX;
 #endif
 
+#ifdef ACPI_DBG_TRACK_ALLOCATIONS
+       acpi_gbl_display_final_mem_stats = FALSE;
+#endif
+
        return_VOID;
 }
 
 ACPI_EXPORT_SYMBOL(acpi_dbg_level)
-ACPI_EXPORT_SYMBOL(acpi_dbg_layer)
-ACPI_EXPORT_SYMBOL(acpi_gpe_count)
+    ACPI_EXPORT_SYMBOL(acpi_dbg_layer)
+    ACPI_EXPORT_SYMBOL(acpi_gpe_count)