1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:17:35 +00:00

Kernel: Add support for vmmouse

We add this feature together with the VMWareBackdoor class.
VMWareBackdoor class is responsible for enabling the vmmouse, and then
controlling it from the PS2 mouse IRQ handler.
This commit is contained in:
Liav A 2020-02-04 03:00:50 +02:00 committed by Andreas Kling
parent 44ddfd2bf5
commit 47978a5828
8 changed files with 328 additions and 3 deletions

View file

@ -27,6 +27,8 @@
#pragma once
#include <AK/Types.h>
#include <Kernel/Arch/i386/CPU.h>
#include <Kernel/Devices/VMWareBackdoor.h>
namespace IO {
@ -87,6 +89,16 @@ inline void repeated_out16(u16 port, const u8* data, int data_size)
: "d"(port));
}
inline void vmware_out(VMWareCommand& command)
{
command.magic = VMWARE_MAGIC;
command.port = VMWARE_PORT;
command.si = 0;
command.di = 0;
asm volatile("in %%dx, %0"
: "+a"(command.ax), "+b"(command.bx), "+c"(command.cx), "+d"(command.dx), "+S"(command.si), "+D"(command.di));
}
inline void delay()
{
// ~3 microsecs