aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/tables/tbxface.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2006-07-07 20:44:38 -0400
committerLen Brown <len.brown@intel.com>2006-07-09 15:15:40 -0400
commitf6dd9221dddb3550e60d32aee688588ec208312c (patch)
treedbde18df728775aaf5be5c4526fbfd4c3f398cd5 /drivers/acpi/tables/tbxface.c
parent120bda20c6f64b32e8bfbdd7b34feafaa5f5332e (diff)
ACPI: ACPICA 20060707
Added the ACPI_PACKED_POINTERS_NOT_SUPPORTED macro to support C compilers that do not allow the initialization of address pointers within packed structures - even though the hardware itself may support misaligned transfers. Some of the debug data structures are packed by default to minimize size. Added an error message for the case where acpi_os_get_thread_id() returns zero. A non-zero value is required by the core ACPICA code to ensure the proper operation of AML mutexes and recursive control methods. The DSDT is now the only ACPI table that determines whether the AML interpreter is in 32-bit or 64-bit mode. Not really a functional change, but the hooks for per-table 32/64 switching have been removed from the code. A clarification to the ACPI specification is forthcoming in ACPI 3.0B. Fixed a possible leak of an Owner ID in the error path of tbinstal.c acpi_tb_init_table_descriptor() and migrated all table OwnerID deletion to a single place in acpi_tb_uninstall_table() to correct possible leaks when using the acpi_tb_delete_tables_by_type() interface (with assistance from Lance Ortiz.) Fixed a problem with Serialized control methods where the semaphore associated with the method could be over-signaled after multiple method invocations. Fixed two issues with the locking of the internal namespace data structure. Both the Unload() operator and acpi_unload_table() interface now lock the namespace during the namespace deletion associated with the table unload (with assistance from Linn Crosetto.) Fixed problem reports (Valery Podrezov) integrated: - Eliminate unnecessary memory allocation for CreateXxxxField http://bugzilla.kernel.org/show_bug.cgi?id=5426 Fixed problem reports (Fiodor Suietov) integrated: - Incomplete cleanup branches in AcpiTbGetTableRsdt (BZ 369) - On Address Space handler deletion, needless deactivation call (BZ 374) - AcpiRemoveAddressSpaceHandler: validate Device handle parameter (BZ 375) - Possible memory leak, Notify sub-objects of Processor, Power, ThermalZone (BZ 376) - AcpiRemoveAddressSpaceHandler: validate Handler parameter (BZ 378) - Minimum Length of RSDT should be validated (BZ 379) - AcpiRemoveNotifyHandler: return AE_NOT_EXIST if Processor Obj has no Handler (BZ (380) - AcpiUnloadTable: return AE_NOT_EXIST if no table of specified type loaded (BZ 381) Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/tables/tbxface.c')
-rw-r--r--drivers/acpi/tables/tbxface.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/drivers/acpi/tables/tbxface.c b/drivers/acpi/tables/tbxface.c
index 4e91f2984815..7767987be15a 100644
--- a/drivers/acpi/tables/tbxface.c
+++ b/drivers/acpi/tables/tbxface.c
@@ -134,8 +134,8 @@ ACPI_EXPORT_SYMBOL(acpi_load_tables)
134 * RETURN: Status 134 * RETURN: Status
135 * 135 *
136 * DESCRIPTION: This function is called to load a table from the caller's 136 * DESCRIPTION: This function is called to load a table from the caller's
137 * buffer. The buffer must contain an entire ACPI Table including 137 * buffer. The buffer must contain an entire ACPI Table including
138 * a valid header. The header fields will be verified, and if it 138 * a valid header. The header fields will be verified, and if it
139 * is determined that the table is invalid, the call will fail. 139 * is determined that the table is invalid, the call will fail.
140 * 140 *
141 ******************************************************************************/ 141 ******************************************************************************/
@@ -245,15 +245,18 @@ acpi_status acpi_unload_table(acpi_table_type table_type)
245 /* Find all tables of the requested type */ 245 /* Find all tables of the requested type */
246 246
247 table_desc = acpi_gbl_table_lists[table_type].next; 247 table_desc = acpi_gbl_table_lists[table_type].next;
248 if (!table_desc) {
249 return_ACPI_STATUS(AE_NOT_EXIST);
250 }
251
248 while (table_desc) { 252 while (table_desc) {
249 /* 253 /*
250 * Delete all namespace entries owned by this table. Note that these 254 * Delete all namespace objects owned by this table. Note that these
251 * entries can appear anywhere in the namespace by virtue of the AML 255 * objects can appear anywhere in the namespace by virtue of the AML
252 * "Scope" operator. Thus, we need to track ownership by an ID, not 256 * "Scope" operator. Thus, we need to track ownership by an ID, not
253 * simply a position within the hierarchy 257 * simply a position within the hierarchy
254 */ 258 */
255 acpi_ns_delete_namespace_by_owner(table_desc->owner_id); 259 acpi_ns_delete_namespace_by_owner(table_desc->owner_id);
256 acpi_ut_release_owner_id(&table_desc->owner_id);
257 table_desc = table_desc->next; 260 table_desc = table_desc->next;
258 } 261 }
259 262
@@ -275,12 +278,12 @@ ACPI_EXPORT_SYMBOL(acpi_unload_table)
275 * see acpi_gbl_acpi_table_flag 278 * see acpi_gbl_acpi_table_flag
276 * out_table_header - pointer to the struct acpi_table_header if successful 279 * out_table_header - pointer to the struct acpi_table_header if successful
277 * 280 *
278 * DESCRIPTION: This function is called to get an ACPI table header. The caller 281 * DESCRIPTION: This function is called to get an ACPI table header. The caller
279 * supplies an pointer to a data area sufficient to contain an ACPI 282 * supplies an pointer to a data area sufficient to contain an ACPI
280 * struct acpi_table_header structure. 283 * struct acpi_table_header structure.
281 * 284 *
282 * The header contains a length field that can be used to determine 285 * The header contains a length field that can be used to determine
283 * the size of the buffer needed to contain the entire table. This 286 * the size of the buffer needed to contain the entire table. This
284 * function is not valid for the RSD PTR table since it does not 287 * function is not valid for the RSD PTR table since it does not
285 * have a standard header and is fixed length. 288 * have a standard header and is fixed length.
286 * 289 *
@@ -322,7 +325,8 @@ acpi_get_table_header(acpi_table_type table_type,
322 325
323 /* Copy the header to the caller's buffer */ 326 /* Copy the header to the caller's buffer */
324 327
325 ACPI_MEMCPY((void *)out_table_header, (void *)tbl_ptr, 328 ACPI_MEMCPY(ACPI_CAST_PTR(void, out_table_header),
329 ACPI_CAST_PTR(void, tbl_ptr),
326 sizeof(struct acpi_table_header)); 330 sizeof(struct acpi_table_header));
327 331
328 return_ACPI_STATUS(status); 332 return_ACPI_STATUS(status);
@@ -344,10 +348,10 @@ ACPI_EXPORT_SYMBOL(acpi_get_table_header)
344 * 348 *
345 * RETURN: Status 349 * RETURN: Status
346 * 350 *
347 * DESCRIPTION: This function is called to get an ACPI table. The caller 351 * DESCRIPTION: This function is called to get an ACPI table. The caller
348 * supplies an out_buffer large enough to contain the entire ACPI 352 * supplies an out_buffer large enough to contain the entire ACPI
349 * table. The caller should call the acpi_get_table_header function 353 * table. The caller should call the acpi_get_table_header function
350 * first to determine the buffer size needed. Upon completion 354 * first to determine the buffer size needed. Upon completion
351 * the out_buffer->Length field will indicate the number of bytes 355 * the out_buffer->Length field will indicate the number of bytes
352 * copied into the out_buffer->buf_ptr buffer. This table will be 356 * copied into the out_buffer->buf_ptr buffer. This table will be
353 * a complete table including the header. 357 * a complete table including the header.
@@ -417,7 +421,9 @@ acpi_get_table(acpi_table_type table_type,
417 421
418 /* Copy the table to the buffer */ 422 /* Copy the table to the buffer */
419 423
420 ACPI_MEMCPY((void *)ret_buffer->pointer, (void *)tbl_ptr, table_length); 424 ACPI_MEMCPY(ACPI_CAST_PTR(void, ret_buffer->pointer),
425 ACPI_CAST_PTR(void, tbl_ptr), table_length);
426
421 return_ACPI_STATUS(AE_OK); 427 return_ACPI_STATUS(AE_OK);
422} 428}
423 429