X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=drivers%2Facpi%2Fparser%2Fpsutils.c;h=b3597cb19f88505ab4ee67bf6d483aeae2be4873;hb=6a77f38946aaee1cd85eeec6cf4229b204c15071;hp=e4b8a280e151f5b2123be7b46a1b6e36ba8637bf;hpb=5273a3df6485dc2ad6aa7ddd441b9a21970f003b;p=linux-2.6.git diff --git a/drivers/acpi/parser/psutils.c b/drivers/acpi/parser/psutils.c index e4b8a280e..b3597cb19 100644 --- a/drivers/acpi/parser/psutils.c +++ b/drivers/acpi/parser/psutils.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2004, R. Byron Moore + * Copyright (C) 2000 - 2005, R. Byron Moore * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -129,10 +129,9 @@ union acpi_parse_object* acpi_ps_alloc_op ( u16 opcode) { - union acpi_parse_object *op = NULL; - u32 size; - u8 flags; + union acpi_parse_object *op; const struct acpi_opcode_info *op_info; + u8 flags = ACPI_PARSEOP_GENERIC; ACPI_FUNCTION_ENTRY (); @@ -140,32 +139,28 @@ acpi_ps_alloc_op ( op_info = acpi_ps_get_opcode_info (opcode); - /* Allocate the minimum required size object */ + /* Determine type of parse_op required */ if (op_info->flags & AML_DEFER) { - size = sizeof (struct acpi_parse_obj_named); flags = ACPI_PARSEOP_DEFERRED; } else if (op_info->flags & AML_NAMED) { - size = sizeof (struct acpi_parse_obj_named); flags = ACPI_PARSEOP_NAMED; } else if (opcode == AML_INT_BYTELIST_OP) { - size = sizeof (struct acpi_parse_obj_named); flags = ACPI_PARSEOP_BYTELIST; } - else { - size = sizeof (struct acpi_parse_obj_common); - flags = ACPI_PARSEOP_GENERIC; - } - if (size == sizeof (struct acpi_parse_obj_common)) { - /* - * The generic op is by far the most common (16 to 1) - */ + /* Allocate the minimum required size object */ + + if (flags == ACPI_PARSEOP_GENERIC) { + /* The generic op (default) is by far the most common (16 to 1) */ + op = acpi_ut_acquire_from_cache (ACPI_MEM_LIST_PSNODE); } else { + /* Extended parseop */ + op = acpi_ut_acquire_from_cache (ACPI_MEM_LIST_PSNODE_EXT); } @@ -213,6 +208,7 @@ acpi_ps_free_op ( } +#ifdef ACPI_ENABLE_OBJECT_CACHE /******************************************************************************* * * FUNCTION: acpi_ps_delete_parse_cache @@ -236,6 +232,7 @@ acpi_ps_delete_parse_cache ( acpi_ut_delete_generic_cache (ACPI_MEM_LIST_PSNODE_EXT); return_VOID; } +#endif /******************************************************************************* @@ -272,6 +269,7 @@ acpi_ps_is_prefix_char ( /* * Get op's name (4-byte name segment) or 0 if unnamed */ +#ifdef ACPI_FUTURE_USAGE u32 acpi_ps_get_name ( union acpi_parse_object *op) @@ -288,6 +286,7 @@ acpi_ps_get_name ( return (op->named.name); } +#endif /* ACPI_FUTURE_USAGE */ /*