build_header(GArray *linker, GArray *table_data,

             AcpiTableHeader *h, const char *sig, int len, uint8_t rev,

             const char *oem_table_id)

{

    memcpy(&h->signature, sig, 4);

    h->length = cpu_to_le32(len);

    h->revision = rev;

    memcpy(h->oem_id, ACPI_BUILD_APPNAME6, 6);



    if (oem_table_id) {

        strncpy((char *)h->oem_table_id, oem_table_id, sizeof(h->oem_table_id));

    } else {

        memcpy(h->oem_table_id, ACPI_BUILD_APPNAME4, 4);

        memcpy(h->oem_table_id + 4, sig, 4);

    }



    h->oem_revision = cpu_to_le32(1);

    memcpy(h->asl_compiler_id, ACPI_BUILD_APPNAME4, 4);

    h->asl_compiler_revision = cpu_to_le32(1);

    h->checksum = 0;

    /* Checksum to be filled in by Guest linker */

    bios_linker_loader_add_checksum(linker, ACPI_BUILD_TABLE_FILE,

                                    table_data->data, h, len, &h->checksum);

}

build_header(GArray *linker, GArray *table_data,

             AcpiTableHeader *h, const char *sig, int len, uint8_t rev,

             const char *oem_table_id)

{

    memcpy(&h->signature, sig, 4);

    h->length = cpu_to_le32(len);

    h->revision = rev;

    memcpy(h->oem_id, ACPI_BUILD_APPNAME6, 6);



    if (oem_table_id) {

        strncpy((char *)h->oem_table_id, oem_table_id, sizeof(h->oem_table_id));

    } else {

        memcpy(h->oem_table_id, ACPI_BUILD_APPNAME4, 4);

        memcpy(h->oem_table_id + 4, sig, 4);

    }



    h->oem_revision = cpu_to_le32(1);

    memcpy(h->asl_compiler_id, ACPI_BUILD_APPNAME4, 4);

    h->asl_compiler_revision = cpu_to_le32(1);

    h->checksum = 0;

    

    bios_linker_loader_add_checksum(linker, ACPI_BUILD_TABLE_FILE,

                                    table_data->data, h, len, &h->checksum);

}

FUNC_0(GArray *VAR_0, GArray *VAR_1,

             AcpiTableHeader *VAR_2, const char *VAR_3, int VAR_4, uint8_t VAR_5,

             const char *VAR_6)

{

    memcpy(&VAR_2->signature, VAR_3, 4);

    VAR_2->length = cpu_to_le32(VAR_4);

    VAR_2->revision = VAR_5;

    memcpy(VAR_2->oem_id, ACPI_BUILD_APPNAME6, 6);



    if (VAR_6) {

        strncpy((char *)VAR_2->VAR_6, VAR_6, sizeof(VAR_2->VAR_6));

    } else {

        memcpy(VAR_2->VAR_6, ACPI_BUILD_APPNAME4, 4);

        memcpy(VAR_2->VAR_6 + 4, VAR_3, 4);

    }



    VAR_2->oem_revision = cpu_to_le32(1);

    memcpy(VAR_2->asl_compiler_id, ACPI_BUILD_APPNAME4, 4);

    VAR_2->asl_compiler_revision = cpu_to_le32(1);

    VAR_2->checksum = 0;

    

    bios_linker_loader_add_checksum(VAR_0, ACPI_BUILD_TABLE_FILE,

                                    VAR_1->data, VAR_2, VAR_4, &VAR_2->checksum);

}

FUNC_0(GArray *VAR_0, GArray *VAR_1,
AcpiTableHeader *VAR_2, const char *VAR_3, int VAR_4, uint8_t VAR_5,
const char *VAR_6)
{ memcpy(&VAR_2->signature, VAR_3, 4); VAR_2->length = cpu_to_le32(VAR_4); VAR_2->revision = VAR_5; memcpy(VAR_2->oem_id, ACPI_BUILD_APPNAME6, 6); if (VAR_6) { strncpy((char *)VAR_2->VAR_6, VAR_6, sizeof(VAR_2->VAR_6)); } else { memcpy(VAR_2->VAR_6, ACPI_BUILD_APPNAME4, 4); memcpy(VAR_2->VAR_6 + 4, VAR_3, 4); } VAR_2->oem_revision = cpu_to_le32(1); memcpy(VAR_2->asl_compiler_id, ACPI_BUILD_APPNAME4, 4); VAR_2->asl_compiler_revision = cpu_to_le32(1); VAR_2->checksum = 0; bios_linker_loader_add_checksum(VAR_0, ACPI_BUILD_TABLE_FILE,
VAR_1->data, VAR_2, VAR_4, &VAR_2->checksum); }