mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 02:03:56 -06:00
Savevm/loadvm bits for ARM core, the PXA2xx peripherals and Spitz hardware.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@2857 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
parent
3f6c925f37
commit
aa941b9445
18 changed files with 1330 additions and 63 deletions
37
hw/ads7846.c
37
hw/ads7846.c
|
@ -104,10 +104,41 @@ static void ads7846_ts_event(void *opaque,
|
|||
if (s->pressure == !buttons_state) {
|
||||
s->pressure = !!buttons_state;
|
||||
|
||||
ads7846_int_update(s);
|
||||
ads7846_int_update(s);
|
||||
}
|
||||
}
|
||||
|
||||
static void ads7846_save(QEMUFile *f, void *opaque)
|
||||
{
|
||||
struct ads7846_state_s *s = (struct ads7846_state_s *) opaque;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; i ++)
|
||||
qemu_put_be32(f, s->input[i]);
|
||||
qemu_put_be32(f, s->noise);
|
||||
qemu_put_be32(f, s->cycle);
|
||||
qemu_put_be32(f, s->output);
|
||||
}
|
||||
|
||||
static int ads7846_load(QEMUFile *f, void *opaque, int version_id)
|
||||
{
|
||||
struct ads7846_state_s *s = (struct ads7846_state_s *) opaque;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 8; i ++)
|
||||
s->input[i] = qemu_get_be32(f);
|
||||
s->noise = qemu_get_be32(f);
|
||||
s->cycle = qemu_get_be32(f);
|
||||
s->output = qemu_get_be32(f);
|
||||
|
||||
s->pressure = 0;
|
||||
ads7846_int_update(s);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ads7846_iid = 0;
|
||||
|
||||
struct ads7846_state_s *ads7846_init(qemu_irq penirq)
|
||||
{
|
||||
struct ads7846_state_s *s;
|
||||
|
@ -127,5 +158,9 @@ struct ads7846_state_s *ads7846_init(qemu_irq penirq)
|
|||
"QEMU ADS7846-driven Touchscreen");
|
||||
|
||||
ads7846_int_update(s);
|
||||
|
||||
register_savevm("ads7846", ads7846_iid ++, 0,
|
||||
ads7846_save, ads7846_load, s);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue