static void qxl_send_events(PCIQXLDevice *d, uint32_t events)

{

    uint32_t old_pending;

    uint32_t le_events = cpu_to_le32(events);



    trace_qxl_send_events(d->id, events);

    assert(qemu_spice_display_is_running(&d->ssd));

    old_pending = __sync_fetch_and_or(&d->ram->int_pending, le_events);

    if ((old_pending & le_events) == le_events) {

        return;

    }

    if (qemu_thread_is_self(&d->main)) {

        qxl_update_irq(d);

    } else {

        if (write(d->pipe[1], d, 1) != 1) {

            dprint(d, 1, "%s: write to pipe failed\n", __func__);

        }

    }

}

static void qxl_send_events(PCIQXLDevice *d, uint32_t events)

{

    uint32_t old_pending;

    uint32_t le_events = cpu_to_le32(events);



    trace_qxl_send_events(d->id, events);

    assert(qemu_spice_display_is_running(&d->ssd));

    old_pending = __sync_fetch_and_or(&d->ram->int_pending, le_events);

    if ((old_pending & le_events) == le_events) {

        return;

    }

    if (qemu_thread_is_self(&d->main)) {

        qxl_update_irq(d);

    } else {

        if (write(d->pipe[1], d, 1) != 1) {

            dprint(d, 1, "%s: write to pipe failed\n", __func__);

        }

    }

}

    assert(qemu_spice_display_is_running(&d->ssd));
static void FUNC_0(PCIQXLDevice *VAR_0, uint32_t VAR_1)

{

    uint32_t old_pending;

    uint32_t le_events = cpu_to_le32(VAR_1);



    trace_qxl_send_events(VAR_0->id, VAR_1);

    assert(qemu_spice_display_is_running(&VAR_0->ssd));

    old_pending = __sync_fetch_and_or(&VAR_0->ram->int_pending, le_events);

    if ((old_pending & le_events) == le_events) {

        return;

    }

    if (qemu_thread_is_self(&VAR_0->main)) {

        qxl_update_irq(VAR_0);

    } else {

        if (write(VAR_0->pipe[1], VAR_0, 1) != 1) {

            dprint(VAR_0, 1, "%s: write to pipe failed\n", __func__);

        }

    }

}

static void FUNC_0(PCIQXLDevice *VAR_0, uint32_t VAR_1)
{ uint32_t old_pending; uint32_t le_events = cpu_to_le32(VAR_1); trace_qxl_send_events(VAR_0->id, VAR_1); assert(qemu_spice_display_is_running(&VAR_0->ssd)); old_pending = __sync_fetch_and_or(&VAR_0->ram->int_pending, le_events); if ((old_pending & le_events) == le_events) { return; } if (qemu_thread_is_self(&VAR_0->main)) { qxl_update_irq(VAR_0); } else { if (write(VAR_0->pipe[1], VAR_0, 1) != 1) { dprint(VAR_0, 1, "%s: write to pipe failed\n", __func__); } } }