diff options
author | Bob Moore <robert.moore@intel.com> | 2009-11-12 09:49:50 +0800 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-11-24 21:31:10 -0500 |
commit | 502f7efa6ae7c3f6d93dac417af521af1f56bcc7 (patch) | |
tree | 551750609fe3d9b3f5717d061cb98a02a5fc0e3f /drivers/acpi/acpica/utobject.c | |
parent | ad5babeed8d3082406c5b67ae558b95a479ddb6f (diff) |
ACPICA: New internal utility function to create Integer objects
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>
Diffstat (limited to 'drivers/acpi/acpica/utobject.c')
-rw-r--r-- | drivers/acpi/acpica/utobject.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/acpi/acpica/utobject.c b/drivers/acpi/acpica/utobject.c index 0207b625274a..42e658b543f1 100644 --- a/drivers/acpi/acpica/utobject.c +++ b/drivers/acpi/acpica/utobject.c @@ -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 |