Re: [PATCH 03/19] ACPI: add ACPI_TYPE_LOCAL_REFERENCE support to acpi_extract_package()

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

 



On Thursday, September 18, 2014 09:53:34 AM Zhang Rui wrote:
> 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@xxxxxxxxx>

ACK

> ---
>  drivers/acpi/utils.c | 28 +++++++++++++++++++++++++++-
>  1 file changed, 27 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c
> index 07c8c5a..1ed7aba 100644
> --- a/drivers/acpi/utils.c
> +++ b/drivers/acpi/utils.c
> @@ -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:
> 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.
--
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