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

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

diff -u --recursive --new-file v2.4.9/linux/drivers/acpi/tables/tbxface.c linux/drivers/acpi/tables/tbxface.c
@@ -2,7 +2,7 @@
  *
  * Module Name: tbxface - Public interfaces to the ACPI subsystem
  *                         ACPI table oriented interfaces
- *              $Revision: 39 $
+ *              $Revision: 43 $
  *
  *****************************************************************************/
 
@@ -48,19 +48,33 @@
  *
  ******************************************************************************/
 
-ACPI_STATUS
-acpi_load_tables (
-	ACPI_PHYSICAL_ADDRESS   rsdp_physical_address)
+acpi_status
+acpi_load_tables (void)
 {
-	ACPI_STATUS             status;
+	ACPI_PHYSICAL_ADDRESS   rsdp_physical_address;
+	acpi_status             status;
 	u32                     number_of_tables = 0;
 
 
+	FUNCTION_TRACE ("Acpi_load_tables");
+
+
 	/* Ensure that ACPI has been initialized */
 
 	ACPI_IS_INITIALIZATION_COMPLETE (status);
 	if (ACPI_FAILURE (status)) {
-		return (status);
+		return_ACPI_STATUS (status);
+	}
+
+
+	/* Get the RSDP */
+
+	status = acpi_os_get_root_pointer (ACPI_LOGICAL_ADDRESSING,
+			  &rsdp_physical_address);
+	if (ACPI_FAILURE (status)) {
+		REPORT_ERROR (("Acpi_load_tables: Could not get RSDP, %s\n",
+				  acpi_format_exception (status)));
+		goto error_exit;
 	}
 
 	/* Map and validate the RSDP */
@@ -68,7 +82,7 @@
 	status = acpi_tb_verify_rsdp (rsdp_physical_address);
 	if (ACPI_FAILURE (status)) {
 		REPORT_ERROR (("Acpi_load_tables: RSDP Failed validation: %s\n",
-				  acpi_ut_format_exception (status)));
+				  acpi_format_exception (status)));
 		goto error_exit;
 	}
 
@@ -77,7 +91,7 @@
 	status = acpi_tb_get_table_rsdt (&number_of_tables);
 	if (ACPI_FAILURE (status)) {
 		REPORT_ERROR (("Acpi_load_tables: Could not load RSDT: %s\n",
-				  acpi_ut_format_exception (status)));
+				  acpi_format_exception (status)));
 		goto error_exit;
 	}
 
@@ -86,28 +100,30 @@
 	status = acpi_tb_get_all_tables (number_of_tables, NULL);
 	if (ACPI_FAILURE (status)) {
 		REPORT_ERROR (("Acpi_load_tables: Error getting required tables (DSDT/FADT/FACS): %s\n",
-				  acpi_ut_format_exception (status)));
+				  acpi_format_exception (status)));
 		goto error_exit;
 	}
 
+	ACPI_DEBUG_PRINT ((ACPI_DB_OK, "ACPI Tables successfully loaded\n"));
+
 
 	/* Load the namespace from the tables */
 
 	status = acpi_ns_load_namespace ();
 	if (ACPI_FAILURE (status)) {
 		REPORT_ERROR (("Acpi_load_tables: Could not load namespace: %s\n",
-				  acpi_ut_format_exception (status)));
+				  acpi_format_exception (status)));
 		goto error_exit;
 	}
 
-	return (AE_OK);
+	return_ACPI_STATUS (AE_OK);
 
 
 error_exit:
 	REPORT_ERROR (("Acpi_load_tables: Could not load tables: %s\n",
-			  acpi_ut_format_exception (status)));
+			  acpi_format_exception (status)));
 
-	return (status);
+	return_ACPI_STATUS (status);
 }
 
 
@@ -127,30 +143,33 @@
  *
  ******************************************************************************/
 
-ACPI_STATUS
+acpi_status
 acpi_load_table (
-	ACPI_TABLE_HEADER       *table_ptr)
+	acpi_table_header       *table_ptr)
 {
-	ACPI_STATUS             status;
-	ACPI_TABLE_DESC         table_info;
+	acpi_status             status;
+	acpi_table_desc         table_info;
+
+
+	FUNCTION_TRACE ("Acpi_load_table");
 
 
 	/* Ensure that ACPI has been initialized */
 
 	ACPI_IS_INITIALIZATION_COMPLETE (status);
 	if (ACPI_FAILURE (status)) {
-		return (status);
+		return_ACPI_STATUS (status);
 	}
 
 	if (!table_ptr) {
-		return (AE_BAD_PARAMETER);
+		return_ACPI_STATUS (AE_BAD_PARAMETER);
 	}
 
 	/* Copy the table to a local buffer */
 
 	status = acpi_tb_get_table (0, table_ptr, &table_info);
 	if (ACPI_FAILURE (status)) {
-		return (status);
+		return_ACPI_STATUS (status);
 	}
 
 	/* Install the new table into the local data structures */
@@ -160,7 +179,7 @@
 		/* Free table allocated by Acpi_tb_get_table */
 
 		acpi_tb_delete_single_table (&table_info);
-		return (status);
+		return_ACPI_STATUS (status);
 	}
 
 
@@ -169,11 +188,11 @@
 		/* Uninstall table and free the buffer */
 
 		acpi_tb_uninstall_table (table_info.installed_desc);
-		return (status);
+		return_ACPI_STATUS (status);
 	}
 
 
-	return (status);
+	return_ACPI_STATUS (status);
 }
 
 
@@ -189,25 +208,28 @@
  *
  ******************************************************************************/
 
-ACPI_STATUS
+acpi_status
 acpi_unload_table (
-	ACPI_TABLE_TYPE         table_type)
+	acpi_table_type         table_type)
 {
-	ACPI_TABLE_DESC         *list_head;
-	ACPI_STATUS             status;
+	acpi_table_desc         *list_head;
+	acpi_status             status;
+
+
+	FUNCTION_TRACE ("Acpi_unload_table");
 
 
 	/* Ensure that ACPI has been initialized */
 
 	ACPI_IS_INITIALIZATION_COMPLETE (status);
 	if (ACPI_FAILURE (status)) {
-		return (status);
+		return_ACPI_STATUS (status);
 	}
 
 	/* Parameter validation */
 
 	if (table_type > ACPI_TABLE_MAX) {
-		return (AE_BAD_PARAMETER);
+		return_ACPI_STATUS (AE_BAD_PARAMETER);
 	}
 
 
@@ -229,7 +251,7 @@
 
 	} while (list_head != &acpi_gbl_acpi_tables[table_type]);
 
-	return (AE_OK);
+	return_ACPI_STATUS (AE_OK);
 }
 
 
@@ -241,11 +263,11 @@
  *              Instance        - the non zero instance of the table, allows
  *                                support for multiple tables of the same type
  *                                see Acpi_gbl_Acpi_table_flag
- *              Out_table_header - pointer to the ACPI_TABLE_HEADER if successful
+ *              Out_table_header - pointer to the acpi_table_header if successful
  *
  * DESCRIPTION: This function is called to get an ACPI table header.  The caller
  *              supplies an pointer to a data area sufficient to contain an ACPI
- *              ACPI_TABLE_HEADER structure.
+ *              acpi_table_header structure.
  *
  *              The header contains a length field that can be used to determine
  *              the size of the buffer needed to contain the entire table.  This
@@ -254,27 +276,30 @@
  *
  ******************************************************************************/
 
-ACPI_STATUS
+acpi_status
 acpi_get_table_header (
-	ACPI_TABLE_TYPE         table_type,
+	acpi_table_type         table_type,
 	u32                     instance,
-	ACPI_TABLE_HEADER       *out_table_header)
+	acpi_table_header       *out_table_header)
 {
-	ACPI_TABLE_HEADER       *tbl_ptr;
-	ACPI_STATUS             status;
+	acpi_table_header       *tbl_ptr;
+	acpi_status             status;
+
+
+	FUNCTION_TRACE ("Acpi_get_table_header");
 
 
 	/* Ensure that ACPI has been initialized */
 
 	ACPI_IS_INITIALIZATION_COMPLETE (status);
 	if (ACPI_FAILURE (status)) {
-		return (status);
+		return_ACPI_STATUS (status);
 	}
 
 	if ((instance == 0)                 ||
 		(table_type == ACPI_TABLE_RSDP) ||
 		(!out_table_header)) {
-		return (AE_BAD_PARAMETER);
+		return_ACPI_STATUS (AE_BAD_PARAMETER);
 	}
 
 	/* Check the table type and instance */
@@ -282,7 +307,7 @@
 	if ((table_type > ACPI_TABLE_MAX)   ||
 		(IS_SINGLE_TABLE (acpi_gbl_acpi_table_data[table_type].flags) &&
 		 instance > 1)) {
-		return (AE_BAD_PARAMETER);
+		return_ACPI_STATUS (AE_BAD_PARAMETER);
 	}
 
 
@@ -290,23 +315,23 @@
 
 	status = acpi_tb_get_table_ptr (table_type, instance, &tbl_ptr);
 	if (ACPI_FAILURE (status)) {
-		return (status);
+		return_ACPI_STATUS (status);
 	}
 
 	/*
 	 * The function will return a NULL pointer if the table is not loaded
 	 */
 	if (tbl_ptr == NULL) {
-		return (AE_NOT_EXIST);
+		return_ACPI_STATUS (AE_NOT_EXIST);
 	}
 
 	/*
 	 * Copy the header to the caller's buffer
 	 */
 	MEMCPY ((void *) out_table_header, (void *) tbl_ptr,
-			 sizeof (ACPI_TABLE_HEADER));
+			 sizeof (acpi_table_header));
 
-	return (status);
+	return_ACPI_STATUS (status);
 }
 
 
@@ -333,22 +358,25 @@
  *
  ******************************************************************************/
 
-ACPI_STATUS
+acpi_status
 acpi_get_table (
-	ACPI_TABLE_TYPE         table_type,
+	acpi_table_type         table_type,
 	u32                     instance,
-	ACPI_BUFFER             *ret_buffer)
+	acpi_buffer             *ret_buffer)
 {
-	ACPI_TABLE_HEADER       *tbl_ptr;
-	ACPI_STATUS             status;
+	acpi_table_header       *tbl_ptr;
+	acpi_status             status;
 	u32                     ret_buf_len;
 
 
+	FUNCTION_TRACE ("Acpi_get_table");
+
+
 	/* Ensure that ACPI has been initialized */
 
 	ACPI_IS_INITIALIZATION_COMPLETE (status);
 	if (ACPI_FAILURE (status)) {
-		return (status);
+		return_ACPI_STATUS (status);
 	}
 
 	/*
@@ -357,7 +385,7 @@
 	if ((instance == 0)                 ||
 		(!ret_buffer)                   ||
 		((!ret_buffer->pointer) && (ret_buffer->length))) {
-		return (AE_BAD_PARAMETER);
+		return_ACPI_STATUS (AE_BAD_PARAMETER);
 	}
 
 	/* Check the table type and instance */
@@ -365,7 +393,7 @@
 	if ((table_type > ACPI_TABLE_MAX)   ||
 		(IS_SINGLE_TABLE (acpi_gbl_acpi_table_data[table_type].flags) &&
 		 instance > 1)) {
-		return (AE_BAD_PARAMETER);
+		return_ACPI_STATUS (AE_BAD_PARAMETER);
 	}
 
 
@@ -373,7 +401,7 @@
 
 	status = acpi_tb_get_table_ptr (table_type, instance, &tbl_ptr);
 	if (ACPI_FAILURE (status)) {
-		return (status);
+		return_ACPI_STATUS (status);
 	}
 
 	/*
@@ -381,7 +409,7 @@
 	 * table is not loaded.
 	 */
 	if (tbl_ptr == NULL) {
-		return (AE_NOT_EXIST);
+		return_ACPI_STATUS (AE_NOT_EXIST);
 	}
 
 	/*
@@ -402,14 +430,14 @@
 	 */
 	if (ret_buffer->length < ret_buf_len) {
 		ret_buffer->length = ret_buf_len;
-		return (AE_BUFFER_OVERFLOW);
+		return_ACPI_STATUS (AE_BUFFER_OVERFLOW);
 	}
 
 	ret_buffer->length = ret_buf_len;
 
 	MEMCPY ((void *) ret_buffer->pointer, (void *) tbl_ptr, ret_buf_len);
 
-	return (AE_OK);
+	return_ACPI_STATUS (AE_OK);
 }
 
 

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