linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / acpi / executer / excreate.c
index 34eec82..6805754 100644 (file)
@@ -69,7 +69,7 @@ acpi_status acpi_ex_create_alias(struct acpi_walk_state *walk_state)
        struct acpi_namespace_node *alias_node;
        acpi_status status = AE_OK;
 
-       ACPI_FUNCTION_TRACE(ex_create_alias);
+       ACPI_FUNCTION_TRACE("ex_create_alias");
 
        /* Get the source/alias operands (both namespace nodes) */
 
@@ -164,7 +164,7 @@ acpi_status acpi_ex_create_event(struct acpi_walk_state *walk_state)
        acpi_status status;
        union acpi_operand_object *obj_desc;
 
-       ACPI_FUNCTION_TRACE(ex_create_event);
+       ACPI_FUNCTION_TRACE("ex_create_event");
 
        obj_desc = acpi_ut_create_internal_object(ACPI_TYPE_EVENT);
        if (!obj_desc) {
@@ -177,7 +177,7 @@ acpi_status acpi_ex_create_event(struct acpi_walk_state *walk_state)
         * that the event is created in an unsignalled state
         */
        status = acpi_os_create_semaphore(ACPI_NO_UNIT_LIMIT, 0,
-                                         &obj_desc->event.os_semaphore);
+                                         &obj_desc->event.semaphore);
        if (ACPI_FAILURE(status)) {
                goto cleanup;
        }
@@ -216,7 +216,7 @@ acpi_status acpi_ex_create_mutex(struct acpi_walk_state *walk_state)
        acpi_status status = AE_OK;
        union acpi_operand_object *obj_desc;
 
-       ACPI_FUNCTION_TRACE_PTR(ex_create_mutex, ACPI_WALK_OPERANDS);
+       ACPI_FUNCTION_TRACE_PTR("ex_create_mutex", ACPI_WALK_OPERANDS);
 
        /* Create the new mutex object */
 
@@ -226,9 +226,12 @@ acpi_status acpi_ex_create_mutex(struct acpi_walk_state *walk_state)
                goto cleanup;
        }
 
-       /* Create the actual OS Mutex */
-
-       status = acpi_os_create_mutex(&obj_desc->mutex.os_mutex);
+       /*
+        * Create the actual OS semaphore.
+        * One unit max to make it a mutex, with one initial unit to allow
+        * the mutex to be acquired.
+        */
+       status = acpi_os_create_semaphore(1, 1, &obj_desc->mutex.semaphore);
        if (ACPI_FAILURE(status)) {
                goto cleanup;
        }
@@ -240,9 +243,8 @@ acpi_status acpi_ex_create_mutex(struct acpi_walk_state *walk_state)
        obj_desc->mutex.node =
            (struct acpi_namespace_node *)walk_state->operands[0];
 
-       status =
-           acpi_ns_attach_object(obj_desc->mutex.node, obj_desc,
-                                 ACPI_TYPE_MUTEX);
+       status = acpi_ns_attach_object(obj_desc->mutex.node,
+                                      obj_desc, ACPI_TYPE_MUTEX);
 
       cleanup:
        /*
@@ -278,7 +280,7 @@ acpi_ex_create_region(u8 * aml_start,
        struct acpi_namespace_node *node;
        union acpi_operand_object *region_obj2;
 
-       ACPI_FUNCTION_TRACE(ex_create_region);
+       ACPI_FUNCTION_TRACE("ex_create_region");
 
        /* Get the Namespace Node */
 
@@ -298,7 +300,7 @@ acpi_ex_create_region(u8 * aml_start,
         */
        if ((region_space >= ACPI_NUM_PREDEFINED_REGIONS) &&
            (region_space < ACPI_USER_REGION_BEGIN)) {
-               ACPI_ERROR((AE_INFO, "Invalid AddressSpace type %X",
+               ACPI_ERROR((AE_INFO, "Invalid address_space type %X",
                            region_space));
                return_ACPI_STATUS(AE_AML_INVALID_SPACE_ID);
        }
@@ -362,7 +364,7 @@ acpi_status acpi_ex_create_table_region(struct acpi_walk_state *walk_state)
        struct acpi_table_header *table;
        union acpi_operand_object *region_obj2;
 
-       ACPI_FUNCTION_TRACE(ex_create_table_region);
+       ACPI_FUNCTION_TRACE("ex_create_table_region");
 
        /* Get the Node from the object stack  */
 
@@ -450,7 +452,7 @@ acpi_status acpi_ex_create_processor(struct acpi_walk_state *walk_state)
        union acpi_operand_object *obj_desc;
        acpi_status status;
 
-       ACPI_FUNCTION_TRACE_PTR(ex_create_processor, walk_state);
+       ACPI_FUNCTION_TRACE_PTR("ex_create_processor", walk_state);
 
        /* Create the processor object */
 
@@ -462,9 +464,9 @@ acpi_status acpi_ex_create_processor(struct acpi_walk_state *walk_state)
        /* Initialize the processor object from the operands */
 
        obj_desc->processor.proc_id = (u8) operand[1]->integer.value;
-       obj_desc->processor.length = (u8) operand[3]->integer.value;
        obj_desc->processor.address =
            (acpi_io_address) operand[2]->integer.value;
+       obj_desc->processor.length = (u8) operand[3]->integer.value;
 
        /* Install the processor object in the parent Node */
 
@@ -497,7 +499,7 @@ acpi_status acpi_ex_create_power_resource(struct acpi_walk_state *walk_state)
        acpi_status status;
        union acpi_operand_object *obj_desc;
 
-       ACPI_FUNCTION_TRACE_PTR(ex_create_power_resource, walk_state);
+       ACPI_FUNCTION_TRACE_PTR("ex_create_power_resource", walk_state);
 
        /* Create the power resource object */
 
@@ -547,7 +549,7 @@ acpi_ex_create_method(u8 * aml_start,
        acpi_status status;
        u8 method_flags;
 
-       ACPI_FUNCTION_TRACE_PTR(ex_create_method, walk_state);
+       ACPI_FUNCTION_TRACE_PTR("ex_create_method", walk_state);
 
        /* Create a new method object */
 
@@ -562,7 +564,7 @@ acpi_ex_create_method(u8 * aml_start,
        obj_desc->method.aml_length = aml_length;
 
        /*
-        * Disassemble the method flags. Split off the Arg Count
+        * Disassemble the method flags.  Split off the Arg Count
         * for efficiency
         */
        method_flags = (u8) operand[1]->integer.value;
@@ -573,19 +575,21 @@ acpi_ex_create_method(u8 * aml_start,
            (u8) (method_flags & AML_METHOD_ARG_COUNT);
 
        /*
-        * Get the sync_level. If method is serialized, a mutex will be
+        * Get the concurrency count.  If required, a semaphore will be
         * created for this method when it is parsed.
         */
        if (acpi_gbl_all_methods_serialized) {
-               obj_desc->method.sync_level = 0;
+               obj_desc->method.concurrency = 1;
                obj_desc->method.method_flags |= AML_METHOD_SERIALIZED;
        } else if (method_flags & AML_METHOD_SERIALIZED) {
                /*
-                * ACPI 1.0: sync_level = 0
-                * ACPI 2.0: sync_level = sync_level in method declaration
+                * ACPI 1.0: Concurrency = 1
+                * ACPI 2.0: Concurrency = (sync_level (in method declaration) + 1)
                 */
-               obj_desc->method.sync_level = (u8)
-                   ((method_flags & AML_METHOD_SYNCH_LEVEL) >> 4);
+               obj_desc->method.concurrency = (u8)
+                   (((method_flags & AML_METHOD_SYNCH_LEVEL) >> 4) + 1);
+       } else {
+               obj_desc->method.concurrency = ACPI_INFINITE_CONCURRENCY;
        }
 
        /* Attach the new object to the method Node */