aboutsummaryrefslogtreecommitdiff
path: root/hw/input
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2017-06-06 13:21:04 +0200
committerGerd Hoffmann <kraxel@redhat.com>2017-06-23 11:51:50 +0200
commit954ee55bd528a97347f19f815e00f1e375f82f0a (patch)
treee475074ba6434abec2c1f5893acb16afb808e7a8 /hw/input
parent8498bb8d2e19f5c280aaac6be772fad5980e7519 (diff)
downloadqemu-954ee55bd528a97347f19f815e00f1e375f82f0a.zip
qemu-954ee55bd528a97347f19f815e00f1e375f82f0a.tar.gz
qemu-954ee55bd528a97347f19f815e00f1e375f82f0a.tar.bz2
ps2: add ps2_reset_queue
Factor out ps2 queue reset to a separate function. No functional change. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Message-id: 20170606112105.13331-3-kraxel@redhat.com
Diffstat (limited to 'hw/input')
-rw-r--r--hw/input/ps2.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/hw/input/ps2.c b/hw/input/ps2.c
index 37f8cb8..2416b58 100644
--- a/hw/input/ps2.c
+++ b/hw/input/ps2.c
@@ -551,6 +551,15 @@ static uint8_t translate_table[256] = {
0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff,
};
+static void ps2_reset_queue(PS2State *s)
+{
+ PS2Queue *q = &s->queue;
+
+ q->rptr = 0;
+ q->wptr = 0;
+ q->count = 0;
+}
+
void ps2_queue(PS2State *s, int b)
{
PS2Queue *q = &s->queue;
@@ -1079,12 +1088,8 @@ void ps2_write_mouse(void *opaque, int val)
static void ps2_common_reset(PS2State *s)
{
- PS2Queue *q;
s->write_cmd = -1;
- q = &s->queue;
- q->rptr = 0;
- q->wptr = 0;
- q->count = 0;
+ ps2_reset_queue(s);
s->update_irq(s->update_arg, 0);
}