diff options
author | Len Brown | 2007-06-02 00:48:48 -0400 |
---|---|---|
committer | Len Brown | 2007-06-02 00:48:48 -0400 |
commit | fcf75356e9cf0460ef47a5b756bc3b0951ecab59 (patch) | |
tree | 5d5cb365b3e17a452c23a50eb9903a90578a146a /drivers/acpi/utilities/utobject.c | |
parent | f285e3d329ce68cc355fadf4ab2c8f34d7f264cb (diff) | |
parent | 6287ee32952b502c23d54f12895c3895ddbe5013 (diff) |
Pull now into release branch
Diffstat (limited to 'drivers/acpi/utilities/utobject.c')
-rw-r--r-- | drivers/acpi/utilities/utobject.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/drivers/acpi/utilities/utobject.c b/drivers/acpi/utilities/utobject.c index 4696124759e1..db0b9bac7945 100644 --- a/drivers/acpi/utilities/utobject.c +++ b/drivers/acpi/utilities/utobject.c @@ -146,6 +146,48 @@ union acpi_operand_object *acpi_ut_create_internal_object_dbg(char *module_name, /******************************************************************************* * + * FUNCTION: acpi_ut_create_package_object + * + * PARAMETERS: Count - Number of package elements + * + * RETURN: Pointer to a new Package object, null on failure + * + * DESCRIPTION: Create a fully initialized package object + * + ******************************************************************************/ + +union acpi_operand_object *acpi_ut_create_package_object(u32 count) +{ + union acpi_operand_object *package_desc; + union acpi_operand_object **package_elements; + + ACPI_FUNCTION_TRACE_U32(ut_create_package_object, count); + + /* Create a new Package object */ + + package_desc = acpi_ut_create_internal_object(ACPI_TYPE_PACKAGE); + if (!package_desc) { + return_PTR(NULL); + } + + /* + * Create the element array. Count+1 allows the array to be null + * terminated. + */ + package_elements = ACPI_ALLOCATE_ZEROED((acpi_size) + (count + 1) * sizeof(void *)); + if (!package_elements) { + ACPI_FREE(package_desc); + return_PTR(NULL); + } + + package_desc->package.count = count; + package_desc->package.elements = package_elements; + return_PTR(package_desc); +} + +/******************************************************************************* + * * FUNCTION: acpi_ut_create_buffer_object * * PARAMETERS: buffer_size - Size of buffer to be created |