[PATCH 2/6] ACPI: introduce new interface for inactive table management

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Introduce a new interface for inactive table management.
needed by the next patch, which creates sysfs I/F for inactive tables.

Signed-off-by: Zhang Rui <rui.zhang@xxxxxxxxx>
---
 drivers/acpi/tables/tbxface.c |   47 ++++++++++++++++++++++++++++++++++++++++++
 include/acpi/acpixf.h         |    4 +++
 2 files changed, 51 insertions(+)

Index: linux-acpi-2.6/drivers/acpi/tables/tbxface.c
===================================================================
--- linux-acpi-2.6.orig/drivers/acpi/tables/tbxface.c
+++ linux-acpi-2.6/drivers/acpi/tables/tbxface.c
@@ -608,6 +608,53 @@ ACPI_EXPORT_SYMBOL(acpi_get_table_by_ind
 
 /*******************************************************************************
  *
+ * FUNCTION:    acpi_get_inactive_table_by_index
+ *
+ * PARAMETERS:  table_index         - Table index
+ *              Table               - Where the pointer to the table is returned
+ *
+ * RETURN:      Status and pointer to the table
+ *
+ * DESCRIPTION: Obtain a table by an index into the global inactive table list.
+ *
+ ******************************************************************************/
+acpi_status
+acpi_get_inactive_table_by_index(u32 table_index,
+				 struct acpi_table_header **table)
+{
+	acpi_status status;
+
+	ACPI_FUNCTION_TRACE(acpi_get_inactive_table_by_index);
+
+	/* Parameter validation */
+
+	if (!table)
+		return_ACPI_STATUS(AE_BAD_PARAMETER);
+
+	/* Validate index */
+	if (table_index >= acpi_gbl_inactive_root_table_list.count)
+		return_ACPI_STATUS(AE_BAD_PARAMETER);
+
+	if (!acpi_gbl_inactive_root_table_list.tables[table_index].flags)
+		return_ACPI_STATUS(AE_TABLE_NOT_SUPPORTED);
+
+	if (!acpi_gbl_inactive_root_table_list.tables[table_index].pointer) {
+
+		/* Table is not mapped, map it */
+
+		status =
+		    acpi_tb_verify_table(&acpi_gbl_inactive_root_table_list.
+					 tables[table_index]);
+		if (ACPI_FAILURE(status))
+			return_ACPI_STATUS(status);
+	}
+
+	*table = acpi_gbl_inactive_root_table_list.tables[table_index].pointer;
+	return_ACPI_STATUS(AE_OK);
+}
+
+/*******************************************************************************
+ *
  * FUNCTION:    acpi_tb_load_namespace
  *
  * PARAMETERS:  None
Index: linux-acpi-2.6/include/acpi/acpixf.h
===================================================================
--- linux-acpi-2.6.orig/include/acpi/acpixf.h
+++ linux-acpi-2.6/include/acpi/acpixf.h
@@ -122,6 +122,10 @@ acpi_get_table_by_index(u32 table_index,
 			struct acpi_table_header **out_table);
 
 acpi_status
+acpi_get_inactive_table_by_index(u32 table_index,
+			struct acpi_table_header **out_table);
+
+acpi_status
 acpi_install_table_handler(acpi_tbl_handler handler, void *context);
 
 acpi_status acpi_remove_table_handler(acpi_tbl_handler handler);


--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux