Skip to content

Commit

Permalink
ACPICA: New internal utility function to create Integer objects
Browse files Browse the repository at this point in the history
acpi_ut_create_integer_object. This function (when deployed) should
simplify some of the object creation code.  ACPICA BZ 823.

http://www.acpica.org/bugzilla/show_bug.cgi?id=823

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Bob Moore authored and Len Brown committed Nov 25, 2009
1 parent ad5babe commit 502f7ef
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/acpi/acpica/acutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,8 @@ u8 acpi_ut_valid_internal_object(void *object);

union acpi_operand_object *acpi_ut_create_package_object(u32 count);

union acpi_operand_object *acpi_ut_create_integer_object(u64 value);

union acpi_operand_object *acpi_ut_create_buffer_object(acpi_size buffer_size);

union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size);
Expand Down
29 changes: 29 additions & 0 deletions drivers/acpi/acpica/utobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,35 @@ union acpi_operand_object *acpi_ut_create_package_object(u32 count)
return_PTR(package_desc);
}

/*******************************************************************************
*
* 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
Expand Down

0 comments on commit 502f7ef

Please sign in to comment.