diff options
author | Robert Moore <robert.moore@intel.com> | 2005-04-18 22:49:35 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2005-07-12 00:08:52 -0400 |
commit | 44f6c01242da4e162f28d8e1216a8c7a91174605 (patch) | |
tree | 53f724764f1bd9036dfb049a643d198125cc9edc /drivers/acpi/tables/tbutils.c | |
parent | ebb6e1a6122fd6b7c96470cfd4ce0f04150e5084 (diff) |
ACPICA 20050408 from Bob Moore
Fixed three cases in the interpreter where an "index"
argument to an ASL function was still (internally) 32
bits instead of the required 64 bits. This was the Index
argument to the Index, Mid, and Match operators.
The "strupr" function is now permanently local
(acpi_ut_strupr), since this is not a POSIX-defined
function and not present in most kernel-level C
libraries. References to the C library strupr function
have been removed from the headers.
Completed the deployment of static
functions/prototypes. All prototypes with the static
attribute have been moved from the headers to the owning
C file.
ACPICA 20050329 from Bob Moore
An error is now generated if an attempt is made to create
a Buffer Field of length zero (A CreateField with a length
operand of zero.)
The interpreter now issues a warning whenever executable
code at the module level is detected during ACPI table
load. This will give some idea of the prevalence of this
type of code.
Implemented support for references to named objects (other
than control methods) within package objects.
Enhanced package object output for the debug
object. Package objects are now completely dumped, showing
all elements.
Enhanced miscellaneous object output for the debug
object. Any object can now be written to the debug object
(for example, a device object can be written, and the type
of the object will be displayed.)
The "static" qualifier has been added to all local
functions across the core subsystem.
The number of "long" lines (> 80 chars) within the source
has been significantly reduced, by about 1/3.
Cleaned up all header files to ensure that all CA/iASL
functions are prototyped (even static functions) and the
formatting is consistent.
Two new header files have been added, acopcode.h and
acnames.h.
Removed several obsolete functions that were no longer
used.
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/tables/tbutils.c')
-rw-r--r-- | drivers/acpi/tables/tbutils.c | 97 |
1 files changed, 56 insertions, 41 deletions
diff --git a/drivers/acpi/tables/tbutils.c b/drivers/acpi/tables/tbutils.c index fede5804c78..e69d01d443d 100644 --- a/drivers/acpi/tables/tbutils.c +++ b/drivers/acpi/tables/tbutils.c @@ -49,48 +49,14 @@ #define _COMPONENT ACPI_TABLES ACPI_MODULE_NAME ("tbutils") +/* Local prototypes */ -/******************************************************************************* - * - * FUNCTION: acpi_tb_handle_to_object - * - * PARAMETERS: table_id - Id for which the function is searching - * table_desc - Pointer to return the matching table - * descriptor. - * - * RETURN: Search the tables to find one with a matching table_id and - * return a pointer to that table descriptor. - * - ******************************************************************************/ -#ifdef ACPI_FUTURE_USAGE +#ifdef ACPI_OBSOLETE_FUNCTIONS acpi_status acpi_tb_handle_to_object ( u16 table_id, - struct acpi_table_desc **return_table_desc) -{ - u32 i; - struct acpi_table_desc *table_desc; - - - ACPI_FUNCTION_NAME ("tb_handle_to_object"); - - - for (i = 0; i < ACPI_TABLE_MAX; i++) { - table_desc = acpi_gbl_table_lists[i].next; - while (table_desc) { - if (table_desc->table_id == table_id) { - *return_table_desc = table_desc; - return (AE_OK); - } - - table_desc = table_desc->next; - } - } - - ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "table_id=%X does not exist\n", table_id)); - return (AE_BAD_PARAMETER); -} -#endif /* ACPI_FUTURE_USAGE */ + struct acpi_table_desc **table_desc); +#endif /******************************************************************************* @@ -128,6 +94,7 @@ acpi_tb_validate_table_header ( if (!acpi_os_readable (table_header, sizeof (struct acpi_table_header))) { ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Cannot read table header at %p\n", table_header)); + return (AE_BAD_ADDRESS); } @@ -141,6 +108,7 @@ acpi_tb_validate_table_header ( ACPI_REPORT_WARNING (("Invalid table signature found: [%4.4s]\n", (char *) &signature)); + ACPI_DUMP_BUFFER (table_header, sizeof (struct acpi_table_header)); return (AE_BAD_SIGNATURE); } @@ -154,6 +122,7 @@ acpi_tb_validate_table_header ( ACPI_REPORT_WARNING (("Invalid table header length (0x%X) found\n", (u32) table_header->length)); + ACPI_DUMP_BUFFER (table_header, sizeof (struct acpi_table_header)); return (AE_BAD_HEADER); } @@ -193,8 +162,10 @@ acpi_tb_verify_table_checksum ( /* Return the appropriate exception */ if (checksum) { - ACPI_REPORT_WARNING (("Invalid checksum in table [%4.4s] (%02X, sum %02X is not zero)\n", - table_header->signature, (u32) table_header->checksum, (u32) checksum)); + ACPI_REPORT_WARNING (( + "Invalid checksum in table [%4.4s] (%02X, sum %02X is not zero)\n", + table_header->signature, (u32) table_header->checksum, + (u32) checksum)); status = AE_BAD_CHECKSUM; } @@ -209,7 +180,7 @@ acpi_tb_verify_table_checksum ( * PARAMETERS: Buffer - Buffer to checksum * Length - Size of the buffer * - * RETURNS 8 bit checksum of buffer + * RETURN: 8 bit checksum of buffer * * DESCRIPTION: Computes an 8 bit checksum of the buffer(length) and returns it. * @@ -238,3 +209,47 @@ acpi_tb_checksum ( } +#ifdef ACPI_OBSOLETE_FUNCTIONS +/******************************************************************************* + * + * FUNCTION: acpi_tb_handle_to_object + * + * PARAMETERS: table_id - Id for which the function is searching + * table_desc - Pointer to return the matching table + * descriptor. + * + * RETURN: Search the tables to find one with a matching table_id and + * return a pointer to that table descriptor. + * + ******************************************************************************/ + +acpi_status +acpi_tb_handle_to_object ( + u16 table_id, + struct acpi_table_desc **return_table_desc) +{ + u32 i; + struct acpi_table_desc *table_desc; + + + ACPI_FUNCTION_NAME ("tb_handle_to_object"); + + + for (i = 0; i < ACPI_TABLE_MAX; i++) { + table_desc = acpi_gbl_table_lists[i].next; + while (table_desc) { + if (table_desc->table_id == table_id) { + *return_table_desc = table_desc; + return (AE_OK); + } + + table_desc = table_desc->next; + } + } + + ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "table_id=%X does not exist\n", table_id)); + return (AE_BAD_PARAMETER); +} +#endif + + |