pckbd.c (f9d9fff72eed03acde97ea2d66104748dc474b2e) | pckbd.c (af0f07dfc7ce56a944c38d872b7d4502178e6948) |
---|---|
1/* 2 * QEMU PC keyboard emulation 3 * 4 * Copyright (c) 2003 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 496 unchanged lines hidden (view full) --- 505} 506 507static const VMStateDescription vmstate_kbd_outport = { 508 .name = "pckbd_outport", 509 .version_id = 1, 510 .minimum_version_id = 1, 511 .post_load = kbd_outport_post_load, 512 .needed = kbd_outport_needed, | 1/* 2 * QEMU PC keyboard emulation 3 * 4 * Copyright (c) 2003 Fabrice Bellard 5 * 6 * Permission is hereby granted, free of charge, to any person obtaining a copy 7 * of this software and associated documentation files (the "Software"), to deal 8 * in the Software without restriction, including without limitation the rights --- 496 unchanged lines hidden (view full) --- 505} 506 507static const VMStateDescription vmstate_kbd_outport = { 508 .name = "pckbd_outport", 509 .version_id = 1, 510 .minimum_version_id = 1, 511 .post_load = kbd_outport_post_load, 512 .needed = kbd_outport_needed, |
513 .fields = (VMStateField[]) { | 513 .fields = (const VMStateField[]) { |
514 VMSTATE_UINT8(outport, KBDState), 515 VMSTATE_END_OF_LIST() 516 } 517}; 518 519static int kbd_extended_state_pre_save(void *opaque) 520{ 521 KBDState *s = opaque; --- 25 unchanged lines hidden (view full) --- 547 return s->extended_state; 548} 549 550static const VMStateDescription vmstate_kbd_extended_state = { 551 .name = "pckbd/extended_state", 552 .post_load = kbd_extended_state_post_load, 553 .pre_save = kbd_extended_state_pre_save, 554 .needed = kbd_extended_state_needed, | 514 VMSTATE_UINT8(outport, KBDState), 515 VMSTATE_END_OF_LIST() 516 } 517}; 518 519static int kbd_extended_state_pre_save(void *opaque) 520{ 521 KBDState *s = opaque; --- 25 unchanged lines hidden (view full) --- 547 return s->extended_state; 548} 549 550static const VMStateDescription vmstate_kbd_extended_state = { 551 .name = "pckbd/extended_state", 552 .post_load = kbd_extended_state_post_load, 553 .pre_save = kbd_extended_state_pre_save, 554 .needed = kbd_extended_state_needed, |
555 .fields = (VMStateField[]) { | 555 .fields = (const VMStateField[]) { |
556 VMSTATE_UINT32(migration_flags, KBDState), 557 VMSTATE_UINT32(obsrc, KBDState), 558 VMSTATE_UINT8(obdata, KBDState), 559 VMSTATE_UINT8(cbdata, KBDState), 560 VMSTATE_END_OF_LIST() 561 } 562}; 563 --- 50 unchanged lines hidden (view full) --- 614 615static const VMStateDescription vmstate_kbd = { 616 .name = "pckbd", 617 .version_id = 3, 618 .minimum_version_id = 3, 619 .pre_load = kbd_pre_load, 620 .post_load = kbd_post_load, 621 .pre_save = kbd_pre_save, | 556 VMSTATE_UINT32(migration_flags, KBDState), 557 VMSTATE_UINT32(obsrc, KBDState), 558 VMSTATE_UINT8(obdata, KBDState), 559 VMSTATE_UINT8(cbdata, KBDState), 560 VMSTATE_END_OF_LIST() 561 } 562}; 563 --- 50 unchanged lines hidden (view full) --- 614 615static const VMStateDescription vmstate_kbd = { 616 .name = "pckbd", 617 .version_id = 3, 618 .minimum_version_id = 3, 619 .pre_load = kbd_pre_load, 620 .post_load = kbd_post_load, 621 .pre_save = kbd_pre_save, |
622 .fields = (VMStateField[]) { | 622 .fields = (const VMStateField[]) { |
623 VMSTATE_UINT8(write_cmd, KBDState), 624 VMSTATE_UINT8(status, KBDState), 625 VMSTATE_UINT8(mode, KBDState), 626 VMSTATE_UINT8(pending_tmp, KBDState), 627 VMSTATE_END_OF_LIST() 628 }, | 623 VMSTATE_UINT8(write_cmd, KBDState), 624 VMSTATE_UINT8(status, KBDState), 625 VMSTATE_UINT8(mode, KBDState), 626 VMSTATE_UINT8(pending_tmp, KBDState), 627 VMSTATE_END_OF_LIST() 628 }, |
629 .subsections = (const VMStateDescription * []) { | 629 .subsections = (const VMStateDescription * const []) { |
630 &vmstate_kbd_outport, 631 &vmstate_kbd_extended_state, 632 NULL 633 } 634}; 635 636/* Memory mapped interface */ 637static uint64_t kbd_mm_readfn(void *opaque, hwaddr addr, unsigned size) --- 102 unchanged lines hidden (view full) --- 740 DEFINE_PROP_UINT32("size", MMIOKBDState, size, -1), 741 DEFINE_PROP_END_OF_LIST(), 742}; 743 744static const VMStateDescription vmstate_kbd_mmio = { 745 .name = "pckbd-mmio", 746 .version_id = 1, 747 .minimum_version_id = 1, | 630 &vmstate_kbd_outport, 631 &vmstate_kbd_extended_state, 632 NULL 633 } 634}; 635 636/* Memory mapped interface */ 637static uint64_t kbd_mm_readfn(void *opaque, hwaddr addr, unsigned size) --- 102 unchanged lines hidden (view full) --- 740 DEFINE_PROP_UINT32("size", MMIOKBDState, size, -1), 741 DEFINE_PROP_END_OF_LIST(), 742}; 743 744static const VMStateDescription vmstate_kbd_mmio = { 745 .name = "pckbd-mmio", 746 .version_id = 1, 747 .minimum_version_id = 1, |
748 .fields = (VMStateField[]) { | 748 .fields = (const VMStateField[]) { |
749 VMSTATE_STRUCT(kbd, MMIOKBDState, 0, vmstate_kbd, KBDState), 750 VMSTATE_END_OF_LIST() 751 } 752}; 753 754static void i8042_mmio_class_init(ObjectClass *klass, void *data) 755{ 756 DeviceClass *dc = DEVICE_CLASS(klass); --- 24 unchanged lines hidden (view full) --- 781{ 782 qdev_connect_gpio_out_named(DEVICE(dev), I8042_A20_LINE, 0, a20_out); 783} 784 785static const VMStateDescription vmstate_kbd_isa = { 786 .name = "pckbd", 787 .version_id = 3, 788 .minimum_version_id = 3, | 749 VMSTATE_STRUCT(kbd, MMIOKBDState, 0, vmstate_kbd, KBDState), 750 VMSTATE_END_OF_LIST() 751 } 752}; 753 754static void i8042_mmio_class_init(ObjectClass *klass, void *data) 755{ 756 DeviceClass *dc = DEVICE_CLASS(klass); --- 24 unchanged lines hidden (view full) --- 781{ 782 qdev_connect_gpio_out_named(DEVICE(dev), I8042_A20_LINE, 0, a20_out); 783} 784 785static const VMStateDescription vmstate_kbd_isa = { 786 .name = "pckbd", 787 .version_id = 3, 788 .minimum_version_id = 3, |
789 .fields = (VMStateField[]) { | 789 .fields = (const VMStateField[]) { |
790 VMSTATE_STRUCT(kbd, ISAKBDState, 0, vmstate_kbd, KBDState), 791 VMSTATE_END_OF_LIST() 792 } 793}; 794 795static const MemoryRegionOps i8042_data_ops = { 796 .read = kbd_read_data, 797 .write = kbd_write_data, --- 183 unchanged lines hidden --- | 790 VMSTATE_STRUCT(kbd, ISAKBDState, 0, vmstate_kbd, KBDState), 791 VMSTATE_END_OF_LIST() 792 } 793}; 794 795static const MemoryRegionOps i8042_data_ops = { 796 .read = kbd_read_data, 797 .write = kbd_write_data, --- 183 unchanged lines hidden --- |