static void test_acpi_one(const char *params, test_data *data)

{

    char *args;

    uint8_t signature_low;

    uint8_t signature_high;

    uint16_t signature;

    int i;

    const char *device = "";



    if (!g_strcmp0(data->machine, MACHINE_Q35)) {

        device = ",id=hd -device ide-hd,drive=hd";

    }



    args = g_strdup_printf("-net none -display none %s -drive file=%s%s,",

                           params ? params : "", disk, device);

    qtest_start(args);



   /* Wait at most 1 minute */

#define TEST_DELAY (1 * G_USEC_PER_SEC / 10)

#define TEST_CYCLES MAX((60 * G_USEC_PER_SEC / TEST_DELAY), 1)



    /* Poll until code has run and modified memory.  Once it has we know BIOS

     * initialization is done.  TODO: check that IP reached the halt

     * instruction.

     */

    for (i = 0; i < TEST_CYCLES; ++i) {

        signature_low = readb(BOOT_SECTOR_ADDRESS + SIGNATURE_OFFSET);

        signature_high = readb(BOOT_SECTOR_ADDRESS + SIGNATURE_OFFSET + 1);

        signature = (signature_high << 8) | signature_low;

        if (signature == SIGNATURE) {

            break;

        }

        g_usleep(TEST_DELAY);

    }

    g_assert_cmphex(signature, ==, SIGNATURE);



    test_acpi_rsdp_address(data);

    test_acpi_rsdp_table(data);

    test_acpi_rsdt_table(data);

    test_acpi_fadt_table(data);

    test_acpi_facs_table(data);

    test_acpi_dsdt_table(data);

    test_acpi_ssdt_tables(data);



    if (iasl) {

        test_acpi_asl(data);

    }



    qtest_quit(global_qtest);

    g_free(args);

}

static void test_acpi_one(const char *params, test_data *data)

{

    char *args;

    uint8_t signature_low;

    uint8_t signature_high;

    uint16_t signature;

    int i;

    const char *device = "";



    if (!g_strcmp0(data->machine, MACHINE_Q35)) {

        device = ",id=hd -device ide-hd,drive=hd";

    }



    args = g_strdup_printf("-net none -display none %s -drive file=%s%s,",

                           params ? params : "", disk, device);

    qtest_start(args);



   

#define TEST_DELAY (1 * G_USEC_PER_SEC / 10)

#define TEST_CYCLES MAX((60 * G_USEC_PER_SEC / TEST_DELAY), 1)



    







    for (i = 0; i < TEST_CYCLES; ++i) {

        signature_low = readb(BOOT_SECTOR_ADDRESS + SIGNATURE_OFFSET);

        signature_high = readb(BOOT_SECTOR_ADDRESS + SIGNATURE_OFFSET + 1);

        signature = (signature_high << 8) | signature_low;

        if (signature == SIGNATURE) {

            break;

        }

        g_usleep(TEST_DELAY);

    }

    g_assert_cmphex(signature, ==, SIGNATURE);



    test_acpi_rsdp_address(data);

    test_acpi_rsdp_table(data);

    test_acpi_rsdt_table(data);

    test_acpi_fadt_table(data);

    test_acpi_facs_table(data);

    test_acpi_dsdt_table(data);

    test_acpi_ssdt_tables(data);



    if (iasl) {

        test_acpi_asl(data);

    }



    qtest_quit(global_qtest);

    g_free(args);

}

static void FUNC_0(const char *VAR_0, test_data *VAR_1)

{

    char *VAR_2;

    uint8_t signature_low;

    uint8_t signature_high;

    uint16_t signature;

    int VAR_3;

    const char *VAR_4 = "";



    if (!g_strcmp0(VAR_1->machine, MACHINE_Q35)) {

        VAR_4 = ",id=hd -VAR_4 ide-hd,drive=hd";

    }



    VAR_2 = g_strdup_printf("-net none -display none %s -drive file=%s%s,",

                           VAR_0 ? VAR_0 : "", disk, VAR_4);

    qtest_start(VAR_2);



   

#define TEST_DELAY (1 * G_USEC_PER_SEC / 10)

#define TEST_CYCLES MAX((60 * G_USEC_PER_SEC / TEST_DELAY), 1)



    







    for (VAR_3 = 0; VAR_3 < TEST_CYCLES; ++VAR_3) {

        signature_low = readb(BOOT_SECTOR_ADDRESS + SIGNATURE_OFFSET);

        signature_high = readb(BOOT_SECTOR_ADDRESS + SIGNATURE_OFFSET + 1);

        signature = (signature_high << 8) | signature_low;

        if (signature == SIGNATURE) {

            break;

        }

        g_usleep(TEST_DELAY);

    }

    g_assert_cmphex(signature, ==, SIGNATURE);



    test_acpi_rsdp_address(VAR_1);

    test_acpi_rsdp_table(VAR_1);

    test_acpi_rsdt_table(VAR_1);

    test_acpi_fadt_table(VAR_1);

    test_acpi_facs_table(VAR_1);

    test_acpi_dsdt_table(VAR_1);

    test_acpi_ssdt_tables(VAR_1);



    if (iasl) {

        test_acpi_asl(VAR_1);

    }



    qtest_quit(global_qtest);

    g_free(VAR_2);

}

static void FUNC_0(const char *VAR_0, test_data *VAR_1)
{ char *VAR_2; uint8_t signature_low; uint8_t signature_high; uint16_t signature; int VAR_3; const char *VAR_4 = ""; if (!g_strcmp0(VAR_1->machine, MACHINE_Q35)) { VAR_4 = ",id=hd -VAR_4 ide-hd,drive=hd"; } VAR_2 = g_strdup_printf("-net none -display none %s -drive file=%s%s,",
VAR_0 ? VAR_0 : "", disk, VAR_4); qtest_start(VAR_2); #define TEST_DELAY (1 * G_USEC_PER_SEC / 10)
#define TEST_CYCLES MAX((60 * G_USEC_PER_SEC / TEST_DELAY), 1)
for (VAR_3 = 0; VAR_3 < TEST_CYCLES; ++VAR_3) { signature_low = readb(BOOT_SECTOR_ADDRESS + SIGNATURE_OFFSET); signature_high = readb(BOOT_SECTOR_ADDRESS + SIGNATURE_OFFSET + 1); signature = (signature_high << 8) | signature_low; if (signature == SIGNATURE) { break; } g_usleep(TEST_DELAY); } g_assert_cmphex(signature, ==, SIGNATURE); test_acpi_rsdp_address(VAR_1); test_acpi_rsdp_table(VAR_1); test_acpi_rsdt_table(VAR_1); test_acpi_fadt_table(VAR_1); test_acpi_facs_table(VAR_1); test_acpi_dsdt_table(VAR_1); test_acpi_ssdt_tables(VAR_1); if (iasl) { test_acpi_asl(VAR_1); } qtest_quit(global_qtest); g_free(VAR_2); }