diff options
author | Zhang Rui <rui.zhang@intel.com> | 2014-03-16 09:34:16 -0400 |
---|---|---|
committer | Zhang Rui <rui.zhang@intel.com> | 2014-10-10 01:57:08 -0400 |
commit | e3ec483a7e24c6ebb5eb763ee56c65c239701066 (patch) | |
tree | 77f1e5067ae9d51672f3ab5b10c9695acb8fdc9f /drivers/acpi/utils.c | |
parent | 083bf668cb70e47b84db64856606e94beac87f01 (diff) |
ACPI: add ACPI_TYPE_LOCAL_REFERENCE support to acpi_extract_package()
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>
Diffstat (limited to 'drivers/acpi/utils.c')
-rw-r--r-- | drivers/acpi/utils.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index 07c8c5a5ee95..1ed7aba99d8d 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c | |||
@@ -149,6 +149,21 @@ acpi_extract_package(union acpi_object *package, | |||
149 | break; | 149 | break; |
150 | } | 150 | } |
151 | break; | 151 | break; |
152 | case ACPI_TYPE_LOCAL_REFERENCE: | ||
153 | switch (format_string[i]) { | ||
154 | case 'R': | ||
155 | size_required += sizeof(void *); | ||
156 | tail_offset += sizeof(void *); | ||
157 | break; | ||
158 | default: | ||
159 | printk(KERN_WARNING PREFIX "Invalid package element" | ||
160 | " [%d] got reference," | ||
161 | " expecting [%c]\n", | ||
162 | i, format_string[i]); | ||
163 | return AE_BAD_DATA; | ||
164 | break; | ||
165 | } | ||
166 | break; | ||
152 | 167 | ||
153 | case ACPI_TYPE_PACKAGE: | 168 | case ACPI_TYPE_PACKAGE: |
154 | default: | 169 | default: |
@@ -247,7 +262,18 @@ acpi_extract_package(union acpi_object *package, | |||
247 | break; | 262 | break; |
248 | } | 263 | } |
249 | break; | 264 | break; |
250 | 265 | case ACPI_TYPE_LOCAL_REFERENCE: | |
266 | switch (format_string[i]) { | ||
267 | case 'R': | ||
268 | *(void **)head = | ||
269 | (void *)element->reference.handle; | ||
270 | head += sizeof(void *); | ||
271 | break; | ||
272 | default: | ||
273 | /* Should never get here */ | ||
274 | break; | ||
275 | } | ||
276 | break; | ||
251 | case ACPI_TYPE_PACKAGE: | 277 | case ACPI_TYPE_PACKAGE: |
252 | /* TBD: handle nested packages... */ | 278 | /* TBD: handle nested packages... */ |
253 | default: | 279 | default: |