ACPICA: Add write support for DataTable operation regions
authorBob Moore <robert.moore@intel.com>
Thu, 1 Apr 2010 03:09:00 +0000 (11:09 +0800)
committerLen Brown <len.brown@intel.com>
Tue, 20 Apr 2010 14:43:15 +0000 (10:43 -0400)
The original implementation only supported reading from a DataTable
region. However, some machines have been seen that actually write
to the ACPI table contained in such a region. This change adds
support for writing to a DataTable region.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/acpica/exregion.c

index a8703cc20ad18c5644a0dbcd97c2742c057a87db..531000fc77d2e15afb4a97107ab00dadab3b6a47 100644 (file)
@@ -491,8 +491,10 @@ acpi_ex_data_table_space_handler(u32 function,
 {
        ACPI_FUNCTION_TRACE(ex_data_table_space_handler);
 
-       /* Perform the memory read or write */
-
+       /*
+        * Perform the memory read or write. The bit_width was already
+        * validated.
+        */
        switch (function) {
        case ACPI_READ:
 
@@ -502,9 +504,14 @@ acpi_ex_data_table_space_handler(u32 function,
                break;
 
        case ACPI_WRITE:
+
+               ACPI_MEMCPY(ACPI_PHYSADDR_TO_PTR(address),
+                           ACPI_CAST_PTR(char, value), ACPI_DIV_8(bit_width));
+               break;
+
        default:
 
-               return_ACPI_STATUS(AE_SUPPORT);
+               return_ACPI_STATUS(AE_BAD_PARAMETER);
        }
 
        return_ACPI_STATUS(AE_OK);