]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/acpi/parser/psutils.c
[ACPI] ACPICA 20050729 from Bob Moore
[mv-sheeva.git] / drivers / acpi / parser / psutils.c
index b3597cb19f88505ab4ee67bf6d483aeae2be4873..4221b41ae1a6ac4117ac2331c270eaee0b2eda40 100644 (file)
@@ -45,7 +45,6 @@
 #include <acpi/acpi.h>
 #include <acpi/acparser.h>
 #include <acpi/amlcode.h>
-#include <acpi/acnamesp.h>
 
 #define _COMPONENT          ACPI_PARSER
         ACPI_MODULE_NAME    ("psutils")
@@ -57,7 +56,7 @@
  *
  * PARAMETERS:  None
  *
- * RETURN:      scope_op
+ * RETURN:      A new Scope object, null on failure
  *
  * DESCRIPTION: Create a Scope and associated namepath op with the root name
  *
@@ -75,7 +74,6 @@ acpi_ps_create_scope_op (
                return (NULL);
        }
 
-
        scope_op->named.name = ACPI_ROOT_NAME;
        return (scope_op);
 }
@@ -88,10 +86,9 @@ acpi_ps_create_scope_op (
  * PARAMETERS:  Op              - A newly allocated Op object
  *              Opcode          - Opcode to store in the Op
  *
- * RETURN:      Status
+ * RETURN:      None
  *
- * DESCRIPTION: Allocate an acpi_op, choose op type (and thus size) based on
- *              opcode
+ * DESCRIPTION: Initialize a parse (Op) object
  *
  ******************************************************************************/
 
@@ -107,7 +104,8 @@ acpi_ps_init_op (
        op->common.aml_opcode = opcode;
 
        ACPI_DISASM_ONLY_MEMBERS (ACPI_STRNCPY (op->common.aml_op_name,
-                       (acpi_ps_get_opcode_info (opcode))->name, sizeof (op->common.aml_op_name)));
+                       (acpi_ps_get_opcode_info (opcode))->name,
+                               sizeof (op->common.aml_op_name)));
 }
 
 
@@ -117,7 +115,7 @@ acpi_ps_init_op (
  *
  * PARAMETERS:  Opcode          - Opcode that will be stored in the new Op
  *
- * RETURN:      Pointer to the new Op.
+ * RETURN:      Pointer to the new Op, null on failure
  *
  * DESCRIPTION: Allocate an acpi_op, choose op type (and thus size) based on
  *              opcode.  A cache of opcodes is available for the pure
@@ -156,12 +154,14 @@ acpi_ps_alloc_op (
        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);
+               op = acpi_os_acquire_object (acpi_gbl_ps_node_cache);
+               memset(op, 0, sizeof(struct acpi_parse_obj_common));
        }
        else {
                /* Extended parseop */
 
-               op = acpi_ut_acquire_from_cache (ACPI_MEM_LIST_PSNODE_EXT);
+               op = acpi_os_acquire_object (acpi_gbl_ps_node_ext_cache);
+               memset(op, 0, sizeof(struct acpi_parse_obj_named));
        }
 
        /* Initialize the Op */
@@ -200,41 +200,14 @@ acpi_ps_free_op (
        }
 
        if (op->common.flags & ACPI_PARSEOP_GENERIC) {
-               acpi_ut_release_to_cache (ACPI_MEM_LIST_PSNODE, op);
+               (void) acpi_os_release_object (acpi_gbl_ps_node_cache, op);
        }
        else {
-               acpi_ut_release_to_cache (ACPI_MEM_LIST_PSNODE_EXT, op);
+               (void) acpi_os_release_object (acpi_gbl_ps_node_ext_cache, op);
        }
 }
 
 
-#ifdef ACPI_ENABLE_OBJECT_CACHE
-/*******************************************************************************
- *
- * FUNCTION:    acpi_ps_delete_parse_cache
- *
- * PARAMETERS:  None
- *
- * RETURN:      None
- *
- * DESCRIPTION: Free all objects that are on the parse cache list.
- *
- ******************************************************************************/
-
-void
-acpi_ps_delete_parse_cache (
-       void)
-{
-       ACPI_FUNCTION_TRACE ("ps_delete_parse_cache");
-
-
-       acpi_ut_delete_generic_cache (ACPI_MEM_LIST_PSNODE);
-       acpi_ut_delete_generic_cache (ACPI_MEM_LIST_PSNODE_EXT);
-       return_VOID;
-}
-#endif
-
-
 /*******************************************************************************
  *
  * FUNCTION:    Utility functions
@@ -275,7 +248,6 @@ acpi_ps_get_name (
        union acpi_parse_object         *op)
 {
 
-
        /* The "generic" object has no name associated with it */
 
        if (op->common.flags & ACPI_PARSEOP_GENERIC) {