qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v4 4/7] hw/acpi: export default ACPI headers usi


From: Laszlo Ersek
Subject: Re: [Qemu-devel] [PATCH v4 4/7] hw/acpi: export default ACPI headers using the type just introduced
Date: Fri, 26 Apr 2013 11:53:34 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

On 04/25/13 20:49, Anthony Liguori wrote:
> Laszlo Ersek <address@hidden> writes:
> 
>> This enables reuse when preparing per-table fw_cfg blobs later.
>>
>> Signed-off-by: Laszlo Ersek <address@hidden>
>> Acked-by: Michael S. Tsirkin <address@hidden>
>> ---
>>  include/hw/acpi/acpi.h |    2 ++
>>  hw/acpi/core.c         |   39 ++++++++++++++++++++++++---------------
>>  2 files changed, 26 insertions(+), 15 deletions(-)
>>
>> diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h
>> index 0e26f63..bc7e107 100644
>> --- a/include/hw/acpi/acpi.h
>> +++ b/include/hw/acpi/acpi.h
>> @@ -178,4 +178,6 @@ typedef struct acpi_table_std_header {
>>      char asl_compiler_id[4];  /* ASL compiler vendor ID */
>>      uint32_t asl_compiler_revision; /* ASL compiler revision number */
>>  } QEMU_PACKED AcpiTableStdHdr;
>> +
>> +extern const AcpiTableStdHdr acpi_dfl_hdr;
> 
> Can we do this without using a global variable?  I assume this gets
> memcpy()'d or referenced as a pointer later on or something like that?
> Can we make a function that does that?

The data itself is reused between acpi_table_install() -- ie. the
-acpitable switch -- and acpi_table_fill_hdr(), to be added in 7/7. The
latter uses it in a structure assignment.

I can make a function ("acpi_table_fill_dfl_hdr()") that takes a target
buffer and a size, checks the size, and if it fits, copies the default
header into it.

Thanks
Laszlo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]