Example #1
0
File: ps2.c Project: hackndev/qemu
static int ps2_kbd_load(QEMUFile* f, void* opaque, int version_id)
{
    PS2KbdState *s = (PS2KbdState*)opaque;

    if (version_id != 2)
        return -EINVAL;

    ps2_common_load (f, &s->common);
    qemu_get_be32s(f, &s->scan_enabled);
    qemu_get_be32s(f, &s->translate);
    return 0;
}
Example #2
0
static int ps2_kbd_load(QEMUFile* f, void* opaque, int version_id)
{
    PS2KbdState *s = (PS2KbdState*)opaque;

    if (version_id != 2 && version_id != 3)
        return -EINVAL;

    ps2_common_load (f, &s->common);
    s->scan_enabled=qemu_get_be32(f);
    s->translate=qemu_get_be32(f);
    if (version_id == 3)
        s->scancode_set=qemu_get_be32(f);
    else
        s->scancode_set=2;
    return 0;
}
Example #3
0
static int ps2_mouse_load(QEMUFile* f, void* opaque, int version_id)
{
    PS2MouseState *s = (PS2MouseState*)opaque;

    if (version_id != 2)
        return -EINVAL;

    ps2_common_load (f, &s->common);
    qemu_get_8s(f, &s->mouse_status);
    qemu_get_8s(f, &s->mouse_resolution);
    qemu_get_8s(f, &s->mouse_sample_rate);
    qemu_get_8s(f, &s->mouse_wrap);
    qemu_get_8s(f, &s->mouse_type);
    qemu_get_8s(f, &s->mouse_detect_state);
    s->mouse_dx=qemu_get_be32(f);
    s->mouse_dy=qemu_get_be32(f);
    s->mouse_dz=qemu_get_be32(f);
    qemu_get_8s(f, &s->mouse_buttons);
    return 0;
}