diff options
author | Bob Moore <robert.moore@intel.com> | 2008-11-12 20:45:35 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-12-29 22:38:37 -0500 |
commit | a8fadc923d1659f1a322194d420808d5b255883c (patch) | |
tree | b8afd36cc4217400efb0e71c550c69bfc8822352 /drivers/acpi | |
parent | 9f15fc666ef54afc7aff31dfa31edecf00e0d81a (diff) |
ACPICA: Add support to externally execute _OSI method
The current implemenation of _OSI within ACPICA only allows other
control methods to execute _OSI. This change allows the host
OS to execute _OSI via the AcpiEvaluateObject interface. _OSI
is a special method -- it does not exist in the AML code, it is
implemented within ACPICA.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/dispatcher/dsmethod.c | 3 | ||||
-rw-r--r-- | drivers/acpi/parser/psparse.c | 4 | ||||
-rw-r--r-- | drivers/acpi/parser/psxface.c | 17 | ||||
-rw-r--r-- | drivers/acpi/utilities/uteval.c | 6 |
4 files changed, 27 insertions, 3 deletions
diff --git a/drivers/acpi/dispatcher/dsmethod.c b/drivers/acpi/dispatcher/dsmethod.c index 279a5a60a0dd..77b7039a26e4 100644 --- a/drivers/acpi/dispatcher/dsmethod.c +++ b/drivers/acpi/dispatcher/dsmethod.c | |||
@@ -412,6 +412,9 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread, | |||
412 | 412 | ||
413 | if (obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY) { | 413 | if (obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY) { |
414 | status = obj_desc->method.implementation(next_walk_state); | 414 | status = obj_desc->method.implementation(next_walk_state); |
415 | if (status == AE_OK) { | ||
416 | status = AE_CTRL_TERMINATE; | ||
417 | } | ||
415 | } | 418 | } |
416 | 419 | ||
417 | return_ACPI_STATUS(status); | 420 | return_ACPI_STATUS(status); |
diff --git a/drivers/acpi/parser/psparse.c b/drivers/acpi/parser/psparse.c index dfd3d9028018..5156203883d7 100644 --- a/drivers/acpi/parser/psparse.c +++ b/drivers/acpi/parser/psparse.c | |||
@@ -447,6 +447,10 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state) | |||
447 | walk_state, walk_state->parser_state.aml, | 447 | walk_state, walk_state->parser_state.aml, |
448 | walk_state->parser_state.aml_size)); | 448 | walk_state->parser_state.aml_size)); |
449 | 449 | ||
450 | if (!walk_state->parser_state.aml) { | ||
451 | return_ACPI_STATUS(AE_NULL_OBJECT); | ||
452 | } | ||
453 | |||
450 | /* Create and initialize a new thread state */ | 454 | /* Create and initialize a new thread state */ |
451 | 455 | ||
452 | thread = acpi_ut_create_thread_state(); | 456 | thread = acpi_ut_create_thread_state(); |
diff --git a/drivers/acpi/parser/psxface.c b/drivers/acpi/parser/psxface.c index 270469aae842..4985ce58c024 100644 --- a/drivers/acpi/parser/psxface.c +++ b/drivers/acpi/parser/psxface.c | |||
@@ -45,6 +45,7 @@ | |||
45 | #include <acpi/acparser.h> | 45 | #include <acpi/acparser.h> |
46 | #include <acpi/acdispat.h> | 46 | #include <acpi/acdispat.h> |
47 | #include <acpi/acinterp.h> | 47 | #include <acpi/acinterp.h> |
48 | #include <acpi/amlcode.h> | ||
48 | 49 | ||
49 | #define _COMPONENT ACPI_PARSER | 50 | #define _COMPONENT ACPI_PARSER |
50 | ACPI_MODULE_NAME("psxface") | 51 | ACPI_MODULE_NAME("psxface") |
@@ -278,6 +279,22 @@ acpi_status acpi_ps_execute_method(struct acpi_evaluate_info *info) | |||
278 | goto cleanup; | 279 | goto cleanup; |
279 | } | 280 | } |
280 | 281 | ||
282 | /* Invoke an internal method if necessary */ | ||
283 | |||
284 | if (info->obj_desc->method.method_flags & AML_METHOD_INTERNAL_ONLY) { | ||
285 | status = info->obj_desc->method.implementation(walk_state); | ||
286 | info->return_object = walk_state->return_desc; | ||
287 | |||
288 | /* Cleanup states */ | ||
289 | |||
290 | acpi_ds_scope_stack_clear(walk_state); | ||
291 | acpi_ps_cleanup_scope(&walk_state->parser_state); | ||
292 | acpi_ds_terminate_control_method(walk_state->method_desc, | ||
293 | walk_state); | ||
294 | acpi_ds_delete_walk_state(walk_state); | ||
295 | goto cleanup; | ||
296 | } | ||
297 | |||
281 | /* Parse the AML */ | 298 | /* Parse the AML */ |
282 | 299 | ||
283 | status = acpi_ps_parse_aml(walk_state); | 300 | status = acpi_ps_parse_aml(walk_state); |
diff --git a/drivers/acpi/utilities/uteval.c b/drivers/acpi/utilities/uteval.c index 352747e49c7a..df2b511b595a 100644 --- a/drivers/acpi/utilities/uteval.c +++ b/drivers/acpi/utilities/uteval.c | |||
@@ -129,7 +129,7 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state) | |||
129 | 129 | ||
130 | /* The interface is supported */ | 130 | /* The interface is supported */ |
131 | 131 | ||
132 | return_ACPI_STATUS(AE_CTRL_TERMINATE); | 132 | return_ACPI_STATUS(AE_OK); |
133 | } | 133 | } |
134 | } | 134 | } |
135 | 135 | ||
@@ -143,13 +143,13 @@ acpi_status acpi_ut_osi_implementation(struct acpi_walk_state *walk_state) | |||
143 | 143 | ||
144 | /* The interface is supported */ | 144 | /* The interface is supported */ |
145 | 145 | ||
146 | return_ACPI_STATUS(AE_CTRL_TERMINATE); | 146 | return_ACPI_STATUS(AE_OK); |
147 | } | 147 | } |
148 | 148 | ||
149 | /* The interface is not supported */ | 149 | /* The interface is not supported */ |
150 | 150 | ||
151 | return_desc->integer.value = 0; | 151 | return_desc->integer.value = 0; |
152 | return_ACPI_STATUS(AE_CTRL_TERMINATE); | 152 | return_ACPI_STATUS(AE_OK); |
153 | } | 153 | } |
154 | 154 | ||
155 | /******************************************************************************* | 155 | /******************************************************************************* |