]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ACPI: add ACPI_TYPE_LOCAL_REFERENCE support to acpi_extract_package()
authorZhang Rui <rui.zhang@intel.com>
Sun, 16 Mar 2014 13:34:16 +0000 (21:34 +0800)
committerZhang Rui <rui.zhang@intel.com>
Fri, 10 Oct 2014 05:57:08 +0000 (13:57 +0800)
Add ACPI_TYPE_LOCAL_REFERENCE support to acpi_extract_package(),
so that we can use this helper for more cases like _ART/_TRT.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
drivers/acpi/utils.c

index 07c8c5a5ee95cfec11ae94114a22398cd99273f6..1ed7aba99d8dfce7136f22619054a9f1ee5a5bd4 100644 (file)
@@ -149,6 +149,21 @@ acpi_extract_package(union acpi_object *package,
                                break;
                        }
                        break;
+               case ACPI_TYPE_LOCAL_REFERENCE:
+                       switch (format_string[i]) {
+                       case 'R':
+                               size_required += sizeof(void *);
+                               tail_offset += sizeof(void *);
+                               break;
+                       default:
+                               printk(KERN_WARNING PREFIX "Invalid package element"
+                                             " [%d] got reference,"
+                                             " expecting [%c]\n",
+                                             i, format_string[i]);
+                               return AE_BAD_DATA;
+                               break;
+                       }
+                       break;
 
                case ACPI_TYPE_PACKAGE:
                default:
@@ -247,7 +262,18 @@ acpi_extract_package(union acpi_object *package,
                                break;
                        }
                        break;
-
+               case ACPI_TYPE_LOCAL_REFERENCE:
+                       switch (format_string[i]) {
+                       case 'R':
+                               *(void **)head =
+                                   (void *)element->reference.handle;
+                               head += sizeof(void *);
+                               break;
+                       default:
+                               /* Should never get here */
+                               break;
+                       }
+                       break;
                case ACPI_TYPE_PACKAGE:
                        /* TBD: handle nested packages... */
                default: