Ported ACPI CA (from the nice guys at Intel) to ReactOS (ACPI bus driver).
[reactos.git] / reactos / drivers / bus / acpi / executer / amxface.c
1
2 /******************************************************************************
3 *
4 * Module Name: amxface - External interpreter interfaces
5 * $Revision: 1.1 $
6 *
7 *****************************************************************************/
8
9 /*
10 * Copyright (C) 2000, 2001 R. Byron Moore
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
16 *
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
21 *
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 */
26
27
28 #include "acpi.h"
29 #include "acinterp.h"
30
31
32 #define _COMPONENT ACPI_EXECUTER
33 MODULE_NAME ("amxface")
34
35
36 /*
37 * DEFINE_AML_GLOBALS is tested in amlcode.h
38 * to determine whether certain global names should be "defined" or only
39 * "declared" in the current compilation. This enhances maintainability
40 * by enabling a single header file to embody all knowledge of the names
41 * in question.
42 *
43 * Exactly one module of any executable should #define DEFINE_GLOBALS
44 * before #including the header files which use this convention. The
45 * names in question will be defined and initialized in that module,
46 * and declared as extern in all other modules which #include those
47 * header files.
48 */
49
50 #define DEFINE_AML_GLOBALS
51 #include "amlcode.h"
52 #include "acparser.h"
53 #include "acnamesp.h"
54
55
56 /*******************************************************************************
57 *
58 * FUNCTION: Acpi_aml_execute_method
59 *
60 * PARAMETERS: Pcode - Pointer to the pcode stream
61 * Pcode_length - Length of pcode that comprises the method
62 * **Params - List of parameters to pass to method,
63 * terminated by NULL. Params itself may be
64 * NULL if no parameters are being passed.
65 *
66 * RETURN: Status
67 *
68 * DESCRIPTION: Execute a control method
69 *
70 ******************************************************************************/
71
72 ACPI_STATUS
73 acpi_aml_execute_method (
74 ACPI_NAMESPACE_NODE *method_node,
75 ACPI_OPERAND_OBJECT **params,
76 ACPI_OPERAND_OBJECT **return_obj_desc)
77 {
78 ACPI_STATUS status;
79
80
81 /*
82 * The point here is to lock the interpreter and call the low
83 * level execute.
84 */
85
86 status = acpi_aml_enter_interpreter ();
87 if (ACPI_FAILURE (status)) {
88 return (status);
89 }
90
91 status = acpi_psx_execute (method_node, params, return_obj_desc);
92
93 acpi_aml_exit_interpreter ();
94
95 return (status);
96 }
97
98