diff options
author | John Keller <jpk@sgi.com> | 2006-12-19 15:56:19 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2006-12-20 01:51:14 -0500 |
commit | 0f0fe1a08aa421266060ac67e50453a06d9ceb63 (patch) | |
tree | adba2e86e815a35fc05b6fd5e5a55362974a444a /drivers/acpi/tables/tbxface.c | |
parent | f238085415c56618e042252894f2fcc971add645 (diff) |
ACPI: Add support for acpi_load_table/acpi_unload_table_id
Make acpi_load_table() available for use by removing it from the #ifdef
ACPI_FUTURE_USAGE.
Also add a new routine used to unload an ACPI table of a given type and "id" -
acpi_unload_table_id(). The implementation of this new routine was almost a
direct copy of existing routine acpi_unload_table() - only difference being
that it only removes a specific table id instead of ALL tables of a given
type. The SN hotplug driver (sgi_hotplug.c) now uses both of these interfaces
to dynamically load and unload SSDT ACPI tables.
Also, a few other ACPI routines now used by the SN hotplug driver are exported
(since the driver can be a loadable module):
acpi_ns_map_handle_to_node
acpi_ns_convert_entry_to_handle
acpi_ns_get_next_node
Signed-off-by: Aaron Young <ayoung@sgi.com>
Cc: Greg KH <greg@kroah.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/tables/tbxface.c')
-rw-r--r-- | drivers/acpi/tables/tbxface.c | 54 |
1 files changed, 53 insertions, 1 deletions
diff --git a/drivers/acpi/tables/tbxface.c b/drivers/acpi/tables/tbxface.c index 7767987be15a..5ba9303293ad 100644 --- a/drivers/acpi/tables/tbxface.c +++ b/drivers/acpi/tables/tbxface.c | |||
@@ -123,7 +123,6 @@ acpi_status acpi_load_tables(void) | |||
123 | 123 | ||
124 | ACPI_EXPORT_SYMBOL(acpi_load_tables) | 124 | ACPI_EXPORT_SYMBOL(acpi_load_tables) |
125 | 125 | ||
126 | #ifdef ACPI_FUTURE_USAGE | ||
127 | /******************************************************************************* | 126 | /******************************************************************************* |
128 | * | 127 | * |
129 | * FUNCTION: acpi_load_table | 128 | * FUNCTION: acpi_load_table |
@@ -221,6 +220,59 @@ ACPI_EXPORT_SYMBOL(acpi_load_table) | |||
221 | 220 | ||
222 | /******************************************************************************* | 221 | /******************************************************************************* |
223 | * | 222 | * |
223 | * FUNCTION: acpi_unload_table_id | ||
224 | * | ||
225 | * PARAMETERS: table_type - Type of table to be unloaded | ||
226 | * id - Owner ID of the table to be removed. | ||
227 | * | ||
228 | * RETURN: Status | ||
229 | * | ||
230 | * DESCRIPTION: This routine is used to force the unload of a table (by id) | ||
231 | * | ||
232 | ******************************************************************************/ | ||
233 | acpi_status acpi_unload_table_id(acpi_table_type table_type, acpi_owner_id id) | ||
234 | { | ||
235 | struct acpi_table_desc *table_desc; | ||
236 | acpi_status status; | ||
237 | |||
238 | ACPI_FUNCTION_TRACE(acpi_unload_table); | ||
239 | |||
240 | /* Parameter validation */ | ||
241 | if (table_type > ACPI_TABLE_ID_MAX) | ||
242 | return_ACPI_STATUS(AE_BAD_PARAMETER); | ||
243 | |||
244 | /* Find table from the requested type list */ | ||
245 | table_desc = acpi_gbl_table_lists[table_type].next; | ||
246 | while (table_desc && table_desc->owner_id != id) | ||
247 | table_desc = table_desc->next; | ||
248 | |||
249 | if (!table_desc) | ||
250 | return_ACPI_STATUS(AE_NOT_EXIST); | ||
251 | |||
252 | /* | ||
253 | * Delete all namespace objects owned by this table. Note that these | ||
254 | * objects can appear anywhere in the namespace by virtue of the AML | ||
255 | * "Scope" operator. Thus, we need to track ownership by an ID, not | ||
256 | * simply a position within the hierarchy | ||
257 | */ | ||
258 | acpi_ns_delete_namespace_by_owner(table_desc->owner_id); | ||
259 | |||
260 | status = acpi_ut_acquire_mutex(ACPI_MTX_TABLES); | ||
261 | if (ACPI_FAILURE(status)) | ||
262 | return_ACPI_STATUS(status); | ||
263 | |||
264 | (void)acpi_tb_uninstall_table(table_desc); | ||
265 | |||
266 | (void)acpi_ut_release_mutex(ACPI_MTX_TABLES); | ||
267 | |||
268 | return_ACPI_STATUS(AE_OK); | ||
269 | } | ||
270 | |||
271 | ACPI_EXPORT_SYMBOL(acpi_unload_table_id) | ||
272 | |||
273 | #ifdef ACPI_FUTURE_USAGE | ||
274 | /******************************************************************************* | ||
275 | * | ||
224 | * FUNCTION: acpi_unload_table | 276 | * FUNCTION: acpi_unload_table |
225 | * | 277 | * |
226 | * PARAMETERS: table_type - Type of table to be unloaded | 278 | * PARAMETERS: table_type - Type of table to be unloaded |