diff options
author | Bob Moore <robert.moore@intel.com> | 2008-09-28 03:26:17 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-10-22 23:14:49 -0400 |
commit | e8707b340fb5b6313cde784b944a568dfd770ddd (patch) | |
tree | 949c7a254309d22e962140305cc06cef2a580ad1 /drivers/acpi/namespace/nseval.c | |
parent | b9d1312ad4246e467f333dfe2ac4dc7a79608d59 (diff) |
ACPICA: New: Validation for predefined ACPI methods/objects
Validates predefined ACPI objects that appear in the namespace,
at the time they are evaluated. The argument count and the type of
the returned object are validated. The purpose of this validation
is to detect problems with the BIOS-exposed predefined ACPI objects
before the results are returned to the ACPI-related drivers.
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/namespace/nseval.c')
-rw-r--r-- | drivers/acpi/namespace/nseval.c | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/drivers/acpi/namespace/nseval.c b/drivers/acpi/namespace/nseval.c index 42dae12f2ef8..4cdf03ac2b46 100644 --- a/drivers/acpi/namespace/nseval.c +++ b/drivers/acpi/namespace/nseval.c | |||
@@ -78,6 +78,7 @@ ACPI_MODULE_NAME("nseval") | |||
78 | acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info) | 78 | acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info) |
79 | { | 79 | { |
80 | acpi_status status; | 80 | acpi_status status; |
81 | struct acpi_namespace_node *node; | ||
81 | 82 | ||
82 | ACPI_FUNCTION_TRACE(ns_evaluate); | 83 | ACPI_FUNCTION_TRACE(ns_evaluate); |
83 | 84 | ||
@@ -117,6 +118,8 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info) | |||
117 | info->resolved_node, | 118 | info->resolved_node, |
118 | acpi_ns_get_attached_object(info->resolved_node))); | 119 | acpi_ns_get_attached_object(info->resolved_node))); |
119 | 120 | ||
121 | node = info->resolved_node; | ||
122 | |||
120 | /* | 123 | /* |
121 | * Two major cases here: | 124 | * Two major cases here: |
122 | * | 125 | * |
@@ -261,9 +264,35 @@ acpi_status acpi_ns_evaluate(struct acpi_evaluate_info * info) | |||
261 | } | 264 | } |
262 | } | 265 | } |
263 | 266 | ||
264 | /* | 267 | /* Validation of return values for ACPI-predefined methods and objects */ |
265 | * Check if there is a return value that must be dealt with | 268 | |
266 | */ | 269 | if ((status == AE_OK) || (status == AE_CTRL_RETURN_VALUE)) { |
270 | /* | ||
271 | * If this is the first evaluation, check the return value. This | ||
272 | * ensures that any warnings will only be emitted during the very | ||
273 | * first evaluation of the object. | ||
274 | */ | ||
275 | if (!(node->flags & ANOBJ_EVALUATED)) { | ||
276 | /* | ||
277 | * Check for a predefined ACPI name. If found, validate the | ||
278 | * returned object. | ||
279 | * | ||
280 | * Note: Ignore return status for now, emit warnings if there are | ||
281 | * problems with the returned object. May change later to abort | ||
282 | * the method on invalid return object. | ||
283 | */ | ||
284 | (void)acpi_ns_check_predefined_names(node, | ||
285 | info-> | ||
286 | return_object); | ||
287 | } | ||
288 | |||
289 | /* Mark the node as having been evaluated */ | ||
290 | |||
291 | node->flags |= ANOBJ_EVALUATED; | ||
292 | } | ||
293 | |||
294 | /* Check if there is a return value that must be dealt with */ | ||
295 | |||
267 | if (status == AE_CTRL_RETURN_VALUE) { | 296 | if (status == AE_CTRL_RETURN_VALUE) { |
268 | 297 | ||
269 | /* If caller does not want the return value, delete it */ | 298 | /* If caller does not want the return value, delete it */ |