diff options
author | Lin Ming <ming.m.lin@intel.com> | 2008-04-10 11:06:38 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-04-22 14:29:24 -0400 |
commit | 3e08e2d2d6efb256aa035e300deb059bb333b6db (patch) | |
tree | 33a83f051ad4370f486f4e6d3e19615d5fc11b8b /drivers/acpi/executer/exconfig.c | |
parent | 698c0a0c299bd9389522e14dae1aff02070bac25 (diff) |
ACPICA: New interfaces for table event handlers
Designed and implemented new external interfaces to install and
remove handlers for ACPI table-related events. Current events that
are defined are LOAD and UNLOAD. These interfaces allow the host to
track ACPI tables as they are dynamically loaded and unloaded. See
AcpiInstallTableHandler and AcpiRemoveTableHandler.
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/executer/exconfig.c')
-rw-r--r-- | drivers/acpi/executer/exconfig.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/drivers/acpi/executer/exconfig.c b/drivers/acpi/executer/exconfig.c index 25802f302ffe..009aef5fcbfc 100644 --- a/drivers/acpi/executer/exconfig.c +++ b/drivers/acpi/executer/exconfig.c | |||
@@ -234,6 +234,13 @@ acpi_ex_load_table_op(struct acpi_walk_state *walk_state, | |||
234 | table->oem_table_id)); | 234 | table->oem_table_id)); |
235 | } | 235 | } |
236 | 236 | ||
237 | /* Invoke table handler if present */ | ||
238 | |||
239 | if (acpi_gbl_table_handler) { | ||
240 | (void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_LOAD, table, | ||
241 | acpi_gbl_table_handler_context); | ||
242 | } | ||
243 | |||
237 | *return_desc = ddb_handle; | 244 | *return_desc = ddb_handle; |
238 | return_ACPI_STATUS(status); | 245 | return_ACPI_STATUS(status); |
239 | } | 246 | } |
@@ -352,6 +359,14 @@ acpi_ex_load_op(union acpi_operand_object *obj_desc, | |||
352 | return_ACPI_STATUS(status); | 359 | return_ACPI_STATUS(status); |
353 | } | 360 | } |
354 | 361 | ||
362 | /* Invoke table handler if present */ | ||
363 | |||
364 | if (acpi_gbl_table_handler) { | ||
365 | (void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_LOAD, | ||
366 | table_desc.pointer, | ||
367 | acpi_gbl_table_handler_context); | ||
368 | } | ||
369 | |||
355 | cleanup: | 370 | cleanup: |
356 | if (ACPI_FAILURE(status)) { | 371 | if (ACPI_FAILURE(status)) { |
357 | acpi_tb_delete_table(&table_desc); | 372 | acpi_tb_delete_table(&table_desc); |
@@ -376,6 +391,7 @@ acpi_status acpi_ex_unload_table(union acpi_operand_object *ddb_handle) | |||
376 | acpi_status status = AE_OK; | 391 | acpi_status status = AE_OK; |
377 | union acpi_operand_object *table_desc = ddb_handle; | 392 | union acpi_operand_object *table_desc = ddb_handle; |
378 | acpi_native_uint table_index; | 393 | acpi_native_uint table_index; |
394 | struct acpi_table_header *table; | ||
379 | 395 | ||
380 | ACPI_FUNCTION_TRACE(ex_unload_table); | 396 | ACPI_FUNCTION_TRACE(ex_unload_table); |
381 | 397 | ||
@@ -395,6 +411,17 @@ acpi_status acpi_ex_unload_table(union acpi_operand_object *ddb_handle) | |||
395 | 411 | ||
396 | table_index = (acpi_native_uint) table_desc->reference.object; | 412 | table_index = (acpi_native_uint) table_desc->reference.object; |
397 | 413 | ||
414 | /* Invoke table handler if present */ | ||
415 | |||
416 | if (acpi_gbl_table_handler) { | ||
417 | status = acpi_get_table_by_index(table_index, &table); | ||
418 | if (ACPI_SUCCESS(status)) { | ||
419 | (void)acpi_gbl_table_handler(ACPI_TABLE_EVENT_UNLOAD, | ||
420 | table, | ||
421 | acpi_gbl_table_handler_context); | ||
422 | } | ||
423 | } | ||
424 | |||
398 | /* | 425 | /* |
399 | * Delete the entire namespace under this table Node | 426 | * Delete the entire namespace under this table Node |
400 | * (Offset contains the table_id) | 427 | * (Offset contains the table_id) |
@@ -407,5 +434,5 @@ acpi_status acpi_ex_unload_table(union acpi_operand_object *ddb_handle) | |||
407 | /* Delete the table descriptor (ddb_handle) */ | 434 | /* Delete the table descriptor (ddb_handle) */ |
408 | 435 | ||
409 | acpi_ut_remove_reference(table_desc); | 436 | acpi_ut_remove_reference(table_desc); |
410 | return_ACPI_STATUS(status); | 437 | return_ACPI_STATUS(AE_OK); |
411 | } | 438 | } |