2 /******************************************************************************
4 * Module Name: psxface - Parser external interfaces
6 *****************************************************************************/
9 * Copyright (C) 2000 R. Byron Moore
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
35 #define _COMPONENT PARSER
36 MODULE_NAME ("psxface");
39 char *acpi_gbl_parser_id
= "Non-recursive AML Parser";
42 /*****************************************************************************
44 * FUNCTION: Acpi_psx_execute
46 * PARAMETERS: Obj_desc - A method object containing both the AML
48 * **Params - List of parameters to pass to method,
49 * terminated by NULL. Params itself may be
50 * NULL if no parameters are being passed.
54 * DESCRIPTION: Execute a control method
56 ****************************************************************************/
60 ACPI_NAMED_OBJECT
*method_entry
,
61 ACPI_OBJECT_INTERNAL
**params
,
62 ACPI_OBJECT_INTERNAL
**return_obj_desc
)
65 ACPI_OBJECT_INTERNAL
*obj_desc
;
69 /* Validate the NTE and get the attached object */
72 return (AE_NULL_ENTRY
);
75 obj_desc
= acpi_ns_get_attached_object (method_entry
);
77 return (AE_NULL_OBJECT
);
80 /* Parse method if necessary, wait on concurrency semaphore */
82 status
= acpi_ds_begin_method_execution (method_entry
, obj_desc
);
83 if (ACPI_FAILURE (status
)) {
89 * The caller "owns" the parameters, so give each one an extra
93 for (i
= 0; params
[i
]; i
++) {
94 acpi_cm_add_reference (params
[i
]);
99 * Method is parsed and ready to execute
100 * The walk of the parse tree is where we actually execute the method
103 status
= acpi_ps_walk_parsed_aml (obj_desc
->method
.parser_op
,
104 obj_desc
->method
.parser_op
, obj_desc
,
105 method_entry
->child_table
, params
, return_obj_desc
,
106 obj_desc
->method
.owning_id
, acpi_ds_exec_begin_op
,
107 acpi_ds_exec_end_op
);
110 /* Take away the extra reference that we gave the parameters above */
112 for (i
= 0; params
[i
]; i
++) {
113 acpi_cm_update_object_reference (params
[i
], REF_DECREMENT
);
119 * Normal exit is with Status == AE_RETURN_VALUE when a Return_op has been
120 * executed, or with Status == AE_PENDING at end of AML block (end of
124 if (*return_obj_desc
) {
125 status
= AE_CTRL_RETURN_VALUE
;