]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/utilities/utglobal.c
[ACPI] ACPICA 20060127
[linux-2.6-omap-h63xx.git] / drivers / acpi / utilities / utglobal.c
index d6813d88a104daa4f8a6fc3b3a178a44be6782bc..ffd13383a325ecae8ed8ae884187860b6566ce33 100644 (file)
@@ -5,7 +5,7 @@
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2005, R. Byron Moore
+ * Copyright (C) 2000 - 2006, R. Byron Moore
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -67,8 +67,11 @@ const char *acpi_format_exception(acpi_status status)
        acpi_status sub_status;
        const char *exception = NULL;
 
-       ACPI_FUNCTION_NAME("format_exception");
+       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) {
@@ -118,13 +121,13 @@ const char *acpi_format_exception(acpi_status status)
        if (!exception) {
                /* Exception code was not recognized */
 
-               ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
-                                 "Unknown exception code: 0x%8.8X\n", status));
+               ACPI_ERROR((AE_INFO,
+                           "Unknown exception code: 0x%8.8X", status));
 
-               return ((const char *)"UNKNOWN_STATUS_CODE");
+               exception = "UNKNOWN_STATUS_CODE";
        }
 
-       return ((const char *)exception);
+       return (ACPI_CAST_PTR(const char, exception));
 }
 
 /*******************************************************************************
@@ -485,7 +488,7 @@ char *acpi_ut_get_region_name(u8 space_id)
                return ("invalid_space_id");
        }
 
-       return ((char *)acpi_gbl_region_types[space_id]);
+       return (ACPI_CAST_PTR(char, acpi_gbl_region_types[space_id]));
 }
 
 /*******************************************************************************
@@ -519,7 +522,7 @@ char *acpi_ut_get_event_name(u32 event_id)
                return ("invalid_event_iD");
        }
 
-       return ((char *)acpi_gbl_event_types[event_id]);
+       return (ACPI_CAST_PTR(char, acpi_gbl_event_types[event_id]));
 }
 
 /*******************************************************************************
@@ -586,10 +589,10 @@ char *acpi_ut_get_type_name(acpi_object_type type)
 {
 
        if (type > ACPI_TYPE_INVALID) {
-               return ((char *)acpi_gbl_bad_type);
+               return (ACPI_CAST_PTR(char, acpi_gbl_bad_type));
        }
 
-       return ((char *)acpi_gbl_ns_type_names[type]);
+       return (ACPI_CAST_PTR(char, acpi_gbl_ns_type_names[type]));
 }
 
 char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc)
@@ -690,11 +693,12 @@ char *acpi_ut_get_descriptor_name(void *object)
        }
 
        if (ACPI_GET_DESCRIPTOR_TYPE(object) > ACPI_DESC_TYPE_MAX) {
-               return ((char *)acpi_gbl_bad_type);
+               return (ACPI_CAST_PTR(char, acpi_gbl_bad_type));
        }
 
-       return ((char *)
-               acpi_gbl_desc_type_names[ACPI_GET_DESCRIPTOR_TYPE(object)]);
+       return (ACPI_CAST_PTR(char,
+                             acpi_gbl_desc_type_names[ACPI_GET_DESCRIPTOR_TYPE
+                                                      (object)]));
 
 }
 
@@ -793,6 +797,11 @@ void acpi_ut_init_globals(void)
                acpi_gbl_mutex_info[i].use_count = 0;
        }
 
+       for (i = 0; i < ACPI_NUM_OWNERID_MASKS; i++) {
+               acpi_gbl_owner_id_mask[i] = 0;
+       }
+       acpi_gbl_owner_id_mask[ACPI_NUM_OWNERID_MASKS - 1] = 0x80000000;        /* Last ID is never valid */
+
        /* GPE support */
 
        acpi_gbl_gpe_xrupt_list_head = NULL;
@@ -830,8 +839,8 @@ void acpi_ut_init_globals(void)
        acpi_gbl_ns_lookup_count = 0;
        acpi_gbl_ps_find_count = 0;
        acpi_gbl_acpi_hardware_present = TRUE;
-       acpi_gbl_owner_id_mask = 0;
-       acpi_gbl_last_owner_id = 0;
+       acpi_gbl_last_owner_id_index = 0;
+       acpi_gbl_next_owner_id_offset = 0;
        acpi_gbl_trace_method_name = 0;
        acpi_gbl_trace_dbg_level = 0;
        acpi_gbl_trace_dbg_layer = 0;