build_rsdt(GArray *table_data, GArray *linker, GArray *table_offsets)

{

    AcpiRsdtDescriptorRev1 *rsdt;

    size_t rsdt_len;

    int i;

    const int table_data_len = (sizeof(uint32_t) * table_offsets->len);



    rsdt_len = sizeof(*rsdt) + table_data_len;

    rsdt = acpi_data_push(table_data, rsdt_len);

    memcpy(rsdt->table_offset_entry, table_offsets->data, table_data_len);

    for (i = 0; i < table_offsets->len; ++i) {

        /* rsdt->table_offset_entry to be filled by Guest linker */

        bios_linker_loader_add_pointer(linker,

                                       ACPI_BUILD_TABLE_FILE,

                                       ACPI_BUILD_TABLE_FILE,

                                       table_data, &rsdt->table_offset_entry[i],

                                       sizeof(uint32_t));

    }

    build_header(linker, table_data,

                 (void *)rsdt, "RSDT", rsdt_len, 1, NULL, NULL);

}

build_rsdt(GArray *table_data, GArray *linker, GArray *table_offsets)

{

    AcpiRsdtDescriptorRev1 *rsdt;

    size_t rsdt_len;

    int i;

    const int table_data_len = (sizeof(uint32_t) * table_offsets->len);



    rsdt_len = sizeof(*rsdt) + table_data_len;

    rsdt = acpi_data_push(table_data, rsdt_len);

    memcpy(rsdt->table_offset_entry, table_offsets->data, table_data_len);

    for (i = 0; i < table_offsets->len; ++i) {

        

        bios_linker_loader_add_pointer(linker,

                                       ACPI_BUILD_TABLE_FILE,

                                       ACPI_BUILD_TABLE_FILE,

                                       table_data, &rsdt->table_offset_entry[i],

                                       sizeof(uint32_t));

    }

    build_header(linker, table_data,

                 (void *)rsdt, "RSDT", rsdt_len, 1, NULL, NULL);

}

FUNC_0(GArray *VAR_0, GArray *VAR_1, GArray *VAR_2)

{

    AcpiRsdtDescriptorRev1 *rsdt;

    size_t rsdt_len;

    int VAR_3;

    const int VAR_4 = (sizeof(uint32_t) * VAR_2->len);



    rsdt_len = sizeof(*rsdt) + VAR_4;

    rsdt = acpi_data_push(VAR_0, rsdt_len);

    memcpy(rsdt->table_offset_entry, VAR_2->data, VAR_4);

    for (VAR_3 = 0; VAR_3 < VAR_2->len; ++VAR_3) {

        

        bios_linker_loader_add_pointer(VAR_1,

                                       ACPI_BUILD_TABLE_FILE,

                                       ACPI_BUILD_TABLE_FILE,

                                       VAR_0, &rsdt->table_offset_entry[VAR_3],

                                       sizeof(uint32_t));

    }

    build_header(VAR_1, VAR_0,

                 (void *)rsdt, "RSDT", rsdt_len, 1, NULL, NULL);

}

FUNC_0(GArray *VAR_0, GArray *VAR_1, GArray *VAR_2)
{ AcpiRsdtDescriptorRev1 *rsdt; size_t rsdt_len; int VAR_3; const int VAR_4 = (sizeof(uint32_t) * VAR_2->len); rsdt_len = sizeof(*rsdt) + VAR_4; rsdt = acpi_data_push(VAR_0, rsdt_len); memcpy(rsdt->table_offset_entry, VAR_2->data, VAR_4); for (VAR_3 = 0; VAR_3 < VAR_2->len; ++VAR_3) { bios_linker_loader_add_pointer(VAR_1,
ACPI_BUILD_TABLE_FILE,
ACPI_BUILD_TABLE_FILE,
VAR_0, &rsdt->table_offset_entry[VAR_3],
sizeof(uint32_t)); } build_header(VAR_1, VAR_0,
(void *)rsdt, "RSDT", rsdt_len, 1, NULL, NULL); }