projects
/
sdk
/
emulator
/
qemu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'v2.6.0' into develop
[sdk/emulator/qemu.git]
/
hw
/
input
/
ps2.c
diff --git
a/hw/input/ps2.c
b/hw/input/ps2.c
index
a8aa36f
..
984a263
100644
(file)
--- a/
hw/input/ps2.c
+++ b/
hw/input/ps2.c
@@
-27,9
+27,14
@@
#include "ui/console.h"
#include "ui/input.h"
#include "sysemu/sysemu.h"
#include "ui/console.h"
#include "ui/input.h"
#include "sysemu/sysemu.h"
-
#include "trace.h"
#include "trace.h"
+#ifdef CONFIG_MARU
+/* to guarantee safe serialization of input event by Munkyu Im */
+#include "qemu/thread.h"
+static QemuMutex mutex;
+#endif
+
/* debug PC keyboard */
//#define DEBUG_KBD
/* debug PC keyboard */
//#define DEBUG_KBD
@@
-438,7
+443,14
@@
static void ps2_mouse_sync(DeviceState *dev)
while (s->common.queue.count < PS2_QUEUE_SIZE - 4) {
/* if not remote, send event. Multiple events are sent if
too big deltas */
while (s->common.queue.count < PS2_QUEUE_SIZE - 4) {
/* if not remote, send event. Multiple events are sent if
too big deltas */
+#ifdef CONFIG_MARU
+/* to guarantee safe serialization of input event by Munkyu Im */
+ qemu_mutex_lock(&mutex);
ps2_mouse_send_packet(s);
ps2_mouse_send_packet(s);
+ qemu_mutex_unlock(&mutex);
+#else
+ ps2_mouse_send_packet(s);
+#endif
if (s->mouse_dx == 0 && s->mouse_dy == 0 && s->mouse_dz == 0)
break;
}
if (s->mouse_dx == 0 && s->mouse_dy == 0 && s->mouse_dz == 0)
break;
}
@@
-809,5
+821,9
@@
void *ps2_mouse_init(void (*update_irq)(void *, int), void *update_arg)
qemu_input_handler_register((DeviceState *)s,
&ps2_mouse_handler);
qemu_register_reset(ps2_mouse_reset, s);
qemu_input_handler_register((DeviceState *)s,
&ps2_mouse_handler);
qemu_register_reset(ps2_mouse_reset, s);
+#ifdef CONFIG_MARU
+ /* to guarantee safe serialization of input event by Munkyu Im */
+ qemu_mutex_init(&mutex);
+#endif
return s;
}
return s;
}