patch-2.4.10 linux/drivers/acpi/tables/tbutils.c

Next file: linux/drivers/acpi/tables/tbxface.c
Previous file: linux/drivers/acpi/tables/tbinstal.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.9/linux/drivers/acpi/tables/tbutils.c linux/drivers/acpi/tables/tbutils.c
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Module Name: tbutils - Table manipulation utilities
- *              $Revision: 38 $
+ *              $Revision: 40 $
  *
  *****************************************************************************/
 
@@ -46,13 +46,16 @@
  *
  ******************************************************************************/
 
-ACPI_STATUS
+acpi_status
 acpi_tb_handle_to_object (
 	u16                     table_id,
-	ACPI_TABLE_DESC         **table_desc)
+	acpi_table_desc         **table_desc)
 {
 	u32                     i;
-	ACPI_TABLE_DESC         *list_head;
+	acpi_table_desc         *list_head;
+
+
+	PROC_NAME ("Tb_handle_to_object");
 
 
 	for (i = 0; i < ACPI_TABLE_MAX; i++) {
@@ -69,6 +72,7 @@
 	}
 
 
+	ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "Table_id=%X does not exist\n", table_id));
 	return (AE_BAD_PARAMETER);
 }
 
@@ -90,8 +94,8 @@
 	void                    *where)
 {
 	u32                     i;
-	ACPI_TABLE_DESC         *table_desc;
-	ACPI_TABLE_HEADER       *table;
+	acpi_table_desc         *table_desc;
+	acpi_table_header       *table;
 
 
 	/* No function trace, called too often! */
@@ -168,11 +172,11 @@
  *
  ******************************************************************************/
 
-ACPI_STATUS
+acpi_status
 acpi_tb_validate_table_header (
-	ACPI_TABLE_HEADER       *table_header)
+	acpi_table_header       *table_header)
 {
-	ACPI_NAME               signature;
+	acpi_name               signature;
 
 
 	PROC_NAME ("Tb_validate_table_header");
@@ -180,7 +184,9 @@
 
 	/* Verify that this is a valid address */
 
-	if (!acpi_os_readable (table_header, sizeof (ACPI_TABLE_HEADER))) {
+	if (!acpi_os_readable (table_header, sizeof (acpi_table_header))) {
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+			"Cannot read table header at %p\n", table_header));
 		return (AE_BAD_ADDRESS);
 	}
 
@@ -189,15 +195,25 @@
 
 	MOVE_UNALIGNED32_TO_32 (&signature, &table_header->signature);
 	if (!acpi_ut_valid_acpi_name (signature)) {
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+			"Table signature at %p [%X] has invalid characters\n",
+			table_header, &signature));
+
 		REPORT_WARNING (("Invalid table signature %4.4s found\n", &signature));
+		DUMP_BUFFER (table_header, sizeof (acpi_table_header));
 		return (AE_BAD_SIGNATURE);
 	}
 
 
 	/* Validate the table length */
 
-	if (table_header->length < sizeof (ACPI_TABLE_HEADER)) {
+	if (table_header->length < sizeof (acpi_table_header)) {
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+			"Invalid length in table header %p name %4.4s\n",
+			table_header, &signature));
+
 		REPORT_WARNING (("Invalid table header length found\n"));
+		DUMP_BUFFER (table_header, sizeof (acpi_table_header));
 		return (AE_BAD_HEADER);
 	}
 
@@ -221,15 +237,18 @@
  *
  ******************************************************************************/
 
-ACPI_STATUS
+acpi_status
 acpi_tb_map_acpi_table (
 	ACPI_PHYSICAL_ADDRESS   physical_address,
 	u32                     *size,
-	ACPI_TABLE_HEADER       **logical_address)
+	acpi_table_header       **logical_address)
 {
-	ACPI_TABLE_HEADER       *table;
+	acpi_table_header       *table;
 	u32                     table_size = *size;
-	ACPI_STATUS             status = AE_OK;
+	acpi_status             status = AE_OK;
+
+
+	PROC_NAME ("Tb_map_acpi_table");
 
 
 	/* If size is zero, look at the table header to get the actual size */
@@ -237,7 +256,7 @@
 	if ((*size) == 0) {
 		/* Get the table header so we can extract the table length */
 
-		status = acpi_os_map_memory (physical_address, sizeof (ACPI_TABLE_HEADER),
+		status = acpi_os_map_memory (physical_address, sizeof (acpi_table_header),
 				  (void **) &table);
 		if (ACPI_FAILURE (status)) {
 			return (status);
@@ -251,12 +270,11 @@
 		 * Validate the header and delete the mapping.
 		 * We will create a mapping for the full table below.
 		 */
-
 		status = acpi_tb_validate_table_header (table);
 
 		/* Always unmap the memory for the header */
 
-		acpi_os_unmap_memory (table, sizeof (ACPI_TABLE_HEADER));
+		acpi_os_unmap_memory (table, sizeof (acpi_table_header));
 
 		/* Exit if header invalid */
 
@@ -273,6 +291,10 @@
 		return (status);
 	}
 
+	ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+		"Mapped memory for ACPI table, length=%d(%X) at %p\n",
+		table_size, table_size, table));
+
 	*size = table_size;
 	*logical_address = table;
 
@@ -293,12 +315,15 @@
  *
  ******************************************************************************/
 
-ACPI_STATUS
+acpi_status
 acpi_tb_verify_table_checksum (
-	ACPI_TABLE_HEADER       *table_header)
+	acpi_table_header       *table_header)
 {
 	u8                      checksum;
-	ACPI_STATUS             status = AE_OK;
+	acpi_status             status = AE_OK;
+
+
+	FUNCTION_TRACE ("Tb_verify_table_checksum");
 
 
 	/* Compute the checksum on the table */
@@ -315,7 +340,7 @@
 	}
 
 
-	return (status);
+	return_ACPI_STATUS (status);
 }
 
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)