diff options
author | Bob Moore <robert.moore@intel.com> | 2009-11-11 20:49:50 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2009-11-24 21:31:10 -0500 |
commit | 502f7efa6ae7c3f6d93dac417af521af1f56bcc7 (patch) | |
tree | 551750609fe3d9b3f5717d061cb98a02a5fc0e3f /drivers/acpi/acpica | |
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')
-rw-r--r-- | drivers/acpi/acpica/acutils.h | 2 | ||||
-rw-r--r-- | drivers/acpi/acpica/utobject.c | 29 |
2 files changed, 31 insertions, 0 deletions
diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h index f920d89b3b15..3a451a21a3f9 100644 --- a/drivers/acpi/acpica/acutils.h +++ b/drivers/acpi/acpica/acutils.h | |||
@@ -386,6 +386,8 @@ u8 acpi_ut_valid_internal_object(void *object); | |||
386 | 386 | ||
387 | union acpi_operand_object *acpi_ut_create_package_object(u32 count); | 387 | union acpi_operand_object *acpi_ut_create_package_object(u32 count); |
388 | 388 | ||
389 | union acpi_operand_object *acpi_ut_create_integer_object(u64 value); | ||
390 | |||
389 | union acpi_operand_object *acpi_ut_create_buffer_object(acpi_size buffer_size); | 391 | union acpi_operand_object *acpi_ut_create_buffer_object(acpi_size buffer_size); |
390 | 392 | ||
391 | union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size); | 393 | union acpi_operand_object *acpi_ut_create_string_object(acpi_size string_size); |
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) | |||
190 | 190 | ||
191 | /******************************************************************************* | 191 | /******************************************************************************* |
192 | * | 192 | * |
193 | * FUNCTION: acpi_ut_create_integer_object | ||
194 | * | ||
195 | * PARAMETERS: initial_value - Initial value for the integer | ||
196 | * | ||
197 | * RETURN: Pointer to a new Integer object, null on failure | ||
198 | * | ||
199 | * DESCRIPTION: Create an initialized integer object | ||
200 | * | ||
201 | ******************************************************************************/ | ||
202 | |||
203 | union acpi_operand_object *acpi_ut_create_integer_object(u64 initial_value) | ||
204 | { | ||
205 | union acpi_operand_object *integer_desc; | ||
206 | |||
207 | ACPI_FUNCTION_TRACE(ut_create_integer_object); | ||
208 | |||
209 | /* Create and initialize a new integer object */ | ||
210 | |||
211 | integer_desc = acpi_ut_create_internal_object(ACPI_TYPE_INTEGER); | ||
212 | if (!integer_desc) { | ||
213 | return_PTR(NULL); | ||
214 | } | ||
215 | |||
216 | integer_desc->integer.value = initial_value; | ||
217 | return_PTR(integer_desc); | ||
218 | } | ||
219 | |||
220 | /******************************************************************************* | ||
221 | * | ||
193 | * FUNCTION: acpi_ut_create_buffer_object | 222 | * FUNCTION: acpi_ut_create_buffer_object |
194 | * | 223 | * |
195 | * PARAMETERS: buffer_size - Size of buffer to be created | 224 | * PARAMETERS: buffer_size - Size of buffer to be created |