On 04/25/13 20:49, Anthony Liguori wrote:
> Laszlo Ersek <[email protected]> writes:
> 
>> This enables reuse when preparing per-table fw_cfg blobs later.
>>
>> Signed-off-by: Laszlo Ersek <[email protected]>
>> Acked-by: Michael S. Tsirkin <[email protected]>
>> ---
>>  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