static void *qemu_dummy_cpu_thread_fn(void *arg)

{

#ifdef _WIN32

    fprintf(stderr, "qtest is not supported under Windows\n");

    exit(1);

#else

    CPUState *cpu = arg;

    sigset_t waitset;

    int r;



    rcu_register_thread();



    qemu_mutex_lock_iothread();

    qemu_thread_get_self(cpu->thread);

    cpu->thread_id = qemu_get_thread_id();

    cpu->can_do_io = 1;



    sigemptyset(&waitset);

    sigaddset(&waitset, SIG_IPI);



    /* signal CPU creation */

    cpu->created = true;

    qemu_cond_signal(&qemu_cpu_cond);



    current_cpu = cpu;

    while (1) {

        current_cpu = NULL;

        qemu_mutex_unlock_iothread();

        do {

            int sig;

            r = sigwait(&waitset, &sig);

        } while (r == -1 && (errno == EAGAIN || errno == EINTR));

        if (r == -1) {

            perror("sigwait");

            exit(1);

        }

        qemu_mutex_lock_iothread();

        current_cpu = cpu;

        qemu_wait_io_event_common(cpu);

    }



    return NULL;

#endif

}

static void *qemu_dummy_cpu_thread_fn(void *arg)

{

#ifdef _WIN32

    fprintf(stderr, "qtest is not supported under Windows\n");

    exit(1);

#else

    CPUState *cpu = arg;

    sigset_t waitset;

    int r;



    rcu_register_thread();



    qemu_mutex_lock_iothread();

    qemu_thread_get_self(cpu->thread);

    cpu->thread_id = qemu_get_thread_id();

    cpu->can_do_io = 1;



    sigemptyset(&waitset);

    sigaddset(&waitset, SIG_IPI);



    

    cpu->created = true;

    qemu_cond_signal(&qemu_cpu_cond);



    current_cpu = cpu;

    while (1) {

        current_cpu = NULL;

        qemu_mutex_unlock_iothread();

        do {

            int sig;

            r = sigwait(&waitset, &sig);

        } while (r == -1 && (errno == EAGAIN || errno == EINTR));

        if (r == -1) {

            perror("sigwait");

            exit(1);

        }

        qemu_mutex_lock_iothread();

        current_cpu = cpu;

        qemu_wait_io_event_common(cpu);

    }



    return NULL;

#endif

}

        qemu_wait_io_event_common(cpu);     current_cpu = cpu;         current_cpu = NULL;         current_cpu = cpu;
static void *FUNC_0(void *VAR_0)

{

#ifdef _WIN32

    fprintf(stderr, "qtest is not supported under Windows\n");

    exit(1);

#else

    CPUState *cpu = VAR_0;

    sigset_t waitset;

    int VAR_1;



    rcu_register_thread();



    qemu_mutex_lock_iothread();

    qemu_thread_get_self(cpu->thread);

    cpu->thread_id = qemu_get_thread_id();

    cpu->can_do_io = 1;



    sigemptyset(&waitset);

    sigaddset(&waitset, SIG_IPI);



    

    cpu->created = true;

    qemu_cond_signal(&qemu_cpu_cond);



    current_cpu = cpu;

    while (1) {

        current_cpu = NULL;

        qemu_mutex_unlock_iothread();

        do {

            int VAR_2;

            VAR_1 = sigwait(&waitset, &VAR_2);

        } while (VAR_1 == -1 && (errno == EAGAIN || errno == EINTR));

        if (VAR_1 == -1) {

            perror("sigwait");

            exit(1);

        }

        qemu_mutex_lock_iothread();

        current_cpu = cpu;

        qemu_wait_io_event_common(cpu);

    }



    return NULL;

#endif

}

static void *FUNC_0(void *VAR_0)
{ #ifdef _WIN32
fprintf(stderr, "qtest is not supported under Windows\n"); exit(1); #else
CPUState *cpu = VAR_0; sigset_t waitset; int VAR_1; rcu_register_thread(); qemu_mutex_lock_iothread(); qemu_thread_get_self(cpu->thread); cpu->thread_id = qemu_get_thread_id(); cpu->can_do_io = 1; sigemptyset(&waitset); sigaddset(&waitset, SIG_IPI); cpu->created = true; qemu_cond_signal(&qemu_cpu_cond); current_cpu = cpu; while (1) { current_cpu = NULL; qemu_mutex_unlock_iothread(); do { int VAR_2; VAR_1 = sigwait(&waitset, &VAR_2); } while (VAR_1 == -1 && (errno == EAGAIN || errno == EINTR)); if (VAR_1 == -1) { perror("sigwait"); exit(1); } qemu_mutex_lock_iothread(); current_cpu = cpu; qemu_wait_io_event_common(cpu); } return NULL; #endif
}