aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/dispatcher/dsmethod.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/dispatcher/dsmethod.c')
-rw-r--r--drivers/acpi/dispatcher/dsmethod.c65
1 files changed, 62 insertions, 3 deletions
diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c
index 58ad00b31ee..e7ce86b8d95 100644
--- a/drivers/acpi/dispatcher/dsmethod.c
+++ b/drivers/acpi/dispatcher/dsmethod.c
@@ -47,12 +47,70 @@
47#include <acpi/acdispat.h> 47#include <acpi/acdispat.h>
48#include <acpi/acinterp.h> 48#include <acpi/acinterp.h>
49#include <acpi/acnamesp.h> 49#include <acpi/acnamesp.h>
50#include <acpi/acdisasm.h>
50 51
51#define _COMPONENT ACPI_DISPATCHER 52#define _COMPONENT ACPI_DISPATCHER
52ACPI_MODULE_NAME("dsmethod") 53ACPI_MODULE_NAME("dsmethod")
53 54
54/******************************************************************************* 55/*******************************************************************************
55 * 56 *
57 * FUNCTION: acpi_ds_method_error
58 *
59 * PARAMETERS: Status - Execution status
60 * walk_state - Current state
61 *
62 * RETURN: Status
63 *
64 * DESCRIPTION: Called on method error. Invoke the global exception handler if
65 * present, dump the method data if the disassembler is configured
66 *
67 * Note: Allows the exception handler to change the status code
68 *
69 ******************************************************************************/
70acpi_status
71acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state)
72{
73 ACPI_FUNCTION_ENTRY();
74
75 /* Ignore AE_OK and control exception codes */
76
77 if (ACPI_SUCCESS(status) || (status & AE_CODE_CONTROL)) {
78 return (status);
79 }
80
81 /* Invoke the global exception handler */
82
83 if (acpi_gbl_exception_handler) {
84 /* Exit the interpreter, allow handler to execute methods */
85
86 acpi_ex_exit_interpreter();
87
88 /*
89 * Handler can map the exception code to anything it wants, including
90 * AE_OK, in which case the executing method will not be aborted.
91 */
92 status = acpi_gbl_exception_handler(status,
93 walk_state->method_node ?
94 walk_state->method_node->
95 name.integer : 0,
96 walk_state->opcode,
97 walk_state->aml_offset,
98 NULL);
99 (void)acpi_ex_enter_interpreter();
100 }
101#ifdef ACPI_DISASSEMBLER
102 if (ACPI_FAILURE(status)) {
103 /* Display method locals/args if disassembler is present */
104
105 acpi_dm_dump_method_info(status, walk_state, walk_state->op);
106 }
107#endif
108
109 return (status);
110}
111
112/*******************************************************************************
113 *
56 * FUNCTION: acpi_ds_begin_method_execution 114 * FUNCTION: acpi_ds_begin_method_execution
57 * 115 *
58 * PARAMETERS: method_node - Node of the method 116 * PARAMETERS: method_node - Node of the method
@@ -66,10 +124,11 @@ ACPI_MODULE_NAME("dsmethod")
66 * for clearance to execute. 124 * for clearance to execute.
67 * 125 *
68 ******************************************************************************/ 126 ******************************************************************************/
127
69acpi_status 128acpi_status
70acpi_ds_begin_method_execution(struct acpi_namespace_node *method_node, 129acpi_ds_begin_method_execution(struct acpi_namespace_node * method_node,
71 union acpi_operand_object *obj_desc, 130 union acpi_operand_object * obj_desc,
72 struct acpi_namespace_node *calling_method_node) 131 struct acpi_namespace_node * calling_method_node)
73{ 132{
74 acpi_status status = AE_OK; 133 acpi_status status = AE_OK;
75 134