Staging: b3dfg: remove check for pci bus master
[safe/jmp/linux-2.6] / drivers / acpi / acpica / utobject.c
index 964b23c..42e658b 100644 (file)
@@ -42,8 +42,8 @@
  */
 
 #include <acpi/acpi.h>
-#include <acpi/accommon.h>
-#include <acpi/acnamesp.h>
+#include "accommon.h"
+#include "acnamesp.h"
 
 #define _COMPONENT          ACPI_UTILITIES
 ACPI_MODULE_NAME("utobject")
@@ -190,6 +190,35 @@ union acpi_operand_object *acpi_ut_create_package_object(u32 count)
 
 /*******************************************************************************
  *
+ * FUNCTION:    acpi_ut_create_integer_object
+ *
+ * PARAMETERS:  initial_value       - Initial value for the integer
+ *
+ * RETURN:      Pointer to a new Integer object, null on failure
+ *
+ * DESCRIPTION: Create an initialized integer object
+ *
+ ******************************************************************************/
+
+union acpi_operand_object *acpi_ut_create_integer_object(u64 initial_value)
+{
+       union acpi_operand_object *integer_desc;
+
+       ACPI_FUNCTION_TRACE(ut_create_integer_object);
+
+       /* Create and initialize a new integer object */
+
+       integer_desc = acpi_ut_create_internal_object(ACPI_TYPE_INTEGER);
+       if (!integer_desc) {
+               return_PTR(NULL);
+       }
+
+       integer_desc->integer.value = initial_value;
+       return_PTR(integer_desc);
+}
+
+/*******************************************************************************
+ *
  * FUNCTION:    acpi_ut_create_buffer_object
  *
  * PARAMETERS:  buffer_size            - Size of buffer to be created
@@ -298,7 +327,7 @@ union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size)
  *
  * RETURN:      TRUE if object is valid, FALSE otherwise
  *
- * DESCRIPTION: Validate a pointer to be an union acpi_operand_object
+ * DESCRIPTION: Validate a pointer to be a union acpi_operand_object
  *
  ******************************************************************************/
 
@@ -310,7 +339,7 @@ u8 acpi_ut_valid_internal_object(void *object)
        /* Check for a null pointer */
 
        if (!object) {
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO, "**** Null Object Ptr\n"));
+               ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "**** Null Object Ptr\n"));
                return (FALSE);
        }
 
@@ -324,7 +353,7 @@ u8 acpi_ut_valid_internal_object(void *object)
                return (TRUE);
 
        default:
-               ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+               ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
                                  "%p is not not an ACPI operand obj [%s]\n",
                                  object, acpi_ut_get_descriptor_name(object)));
                break;
@@ -390,7 +419,7 @@ void acpi_ut_delete_object_desc(union acpi_operand_object *object)
 {
        ACPI_FUNCTION_TRACE_PTR(ut_delete_object_desc, object);
 
-       /* Object must be an union acpi_operand_object    */
+       /* Object must be a union acpi_operand_object    */
 
        if (ACPI_GET_DESCRIPTOR_TYPE(object) != ACPI_DESC_TYPE_OPERAND) {
                ACPI_ERROR((AE_INFO,
@@ -457,7 +486,7 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
         * must be accessed bytewise or there may be alignment problems on
         * certain processors
         */
-       switch (ACPI_GET_OBJECT_TYPE(internal_object)) {
+       switch (internal_object->common.type) {
        case ACPI_TYPE_STRING:
 
                length += (acpi_size) internal_object->string.length + 1;
@@ -518,8 +547,7 @@ acpi_ut_get_simple_object_size(union acpi_operand_object *internal_object,
                ACPI_ERROR((AE_INFO, "Cannot convert to external object - "
                            "unsupported type [%s] %X in object %p",
                            acpi_ut_get_object_type_name(internal_object),
-                           ACPI_GET_OBJECT_TYPE(internal_object),
-                           internal_object));
+                           internal_object->common.type, internal_object));
                status = AE_TYPE;
                break;
        }
@@ -664,7 +692,7 @@ acpi_ut_get_object_size(union acpi_operand_object *internal_object,
 
        if ((ACPI_GET_DESCRIPTOR_TYPE(internal_object) ==
             ACPI_DESC_TYPE_OPERAND)
-           && (ACPI_GET_OBJECT_TYPE(internal_object) == ACPI_TYPE_PACKAGE)) {
+           && (internal_object->common.type == ACPI_TYPE_PACKAGE)) {
                status =
                    acpi_ut_get_package_object_size(internal_object,
                                                    obj_length);