summaryrefslogtreecommitdiff
path: root/Kernel/Devices/VMWareBackdoor.h
diff options
context:
space:
mode:
authorJelle Raaijmakers <jelle@gmta.nl>2021-11-04 15:34:26 +0100
committerAndreas Kling <kling@serenityos.org>2021-11-04 18:53:37 +0100
commita4b1c0fd0cad4cdfa24d05c724b711fd9db6bda5 (patch)
tree765183be679d928b24550461f5c497164930bda3 /Kernel/Devices/VMWareBackdoor.h
parent8a65a9c30f7655fe27828d5eb1fdcf40d8fbe097 (diff)
downloadserenity-a4b1c0fd0cad4cdfa24d05c724b711fd9db6bda5.zip
Kernel: Process available VMWare mouse events immediately
The Qemu I8042 controller does not send one IRQ per event, it sends over four since it will not stop trying to emulate the PS/2 mouse. If the VMWare backdoor is active, a fake I8042 mouse event will be sent that we can then use to check if there are VMWare mouse events present. However, we were only processing one mouse event at a time, even though multiple events could have been queued up. Luckily this does not often lead to issues, since after the first IRQ we would still get three additional interrupts that would then empty the queue. This change makes sure we always empty the event queue immediately, instead of waiting on the next interrupt to happen. Functionally this changes nothing - it could merely improve latency by not waiting for new interrupts to come in. Coincidently, this brings our implementation closer to how Linux deals with the VMMouse.
Diffstat (limited to 'Kernel/Devices/VMWareBackdoor.h')
-rw-r--r--Kernel/Devices/VMWareBackdoor.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Kernel/Devices/VMWareBackdoor.h b/Kernel/Devices/VMWareBackdoor.h
index c7a3d0db8f..c8fd80bf35 100644
--- a/Kernel/Devices/VMWareBackdoor.h
+++ b/Kernel/Devices/VMWareBackdoor.h
@@ -6,7 +6,6 @@
#pragma once
-#include <AK/Optional.h>
#include <AK/Types.h>
#include <AK/kmalloc.h>
#include <Kernel/API/MousePacket.h>
@@ -51,7 +50,8 @@ public:
void disable_absolute_vmmouse();
void send(VMWareCommand& command);
- Optional<MousePacket> receive_mouse_packet();
+ u16 read_mouse_status_queue_size();
+ MousePacket receive_mouse_packet();
private:
void send_high_bandwidth(VMWareCommand& command);