mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-20 17:58:18 +03:00
Kernel: Add support for high bandwidth IO communication with VMWare
This commit is contained in:
parent
0c20f98c1c
commit
6070fe581b
Notes:
sideshowbarker
2024-07-19 09:36:21 +09:00
Author: https://github.com/supercomputer7 Commit: https://github.com/SerenityOS/serenity/commit/6070fe581bb Pull-request: https://github.com/SerenityOS/serenity/pull/1182 Reviewed-by: https://github.com/awesomekling
@ -142,6 +142,18 @@ void VMWareBackdoor::disable_absolute_vmmouse()
|
|||||||
m_vmmouse_absolute = false;
|
m_vmmouse_absolute = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void VMWareBackdoor::send_highbandwidth(VMWareCommand& command)
|
||||||
|
{
|
||||||
|
if (supported())
|
||||||
|
IO::vmware_highbandwidth_send(command);
|
||||||
|
}
|
||||||
|
|
||||||
|
void VMWareBackdoor::get_highbandwidth(VMWareCommand& command)
|
||||||
|
{
|
||||||
|
if (supported())
|
||||||
|
IO::vmware_highbandwidth_get(command);
|
||||||
|
}
|
||||||
|
|
||||||
void VMWareBackdoor::send(VMWareCommand& command)
|
void VMWareBackdoor::send(VMWareCommand& command)
|
||||||
{
|
{
|
||||||
if (supported())
|
if (supported())
|
||||||
|
@ -69,6 +69,8 @@ public:
|
|||||||
void send(VMWareCommand& command);
|
void send(VMWareCommand& command);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void send_highbandwidth(VMWareCommand& command);
|
||||||
|
void get_highbandwidth(VMWareCommand& command);
|
||||||
VMWareBackdoor();
|
VMWareBackdoor();
|
||||||
bool detect_presence();
|
bool detect_presence();
|
||||||
bool detect_vmmouse();
|
bool detect_vmmouse();
|
||||||
|
14
Kernel/IO.h
14
Kernel/IO.h
@ -99,6 +99,20 @@ inline void vmware_out(VMWareCommand& command)
|
|||||||
: "+a"(command.ax), "+b"(command.bx), "+c"(command.cx), "+d"(command.dx), "+S"(command.si), "+D"(command.di));
|
: "+a"(command.ax), "+b"(command.bx), "+c"(command.cx), "+d"(command.dx), "+S"(command.si), "+D"(command.di));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline void vmware_highbandwidth_send(VMWareCommand& command) {
|
||||||
|
|
||||||
|
command.magic = VMWARE_MAGIC;
|
||||||
|
command.port = VMWARE_PORT_HIGHBANDWIDTH;
|
||||||
|
|
||||||
|
asm volatile("cld; rep; outsb" : "+a"(command.ax), "+b"(command.bx), "+c"(command.cx), "+d"(command.dx), "+S"(command.si), "+D"(command.di));
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void vmware_highbandwidth_get(VMWareCommand& command) {
|
||||||
|
command.magic = VMWARE_MAGIC;
|
||||||
|
command.port = VMWARE_PORT_HIGHBANDWIDTH;
|
||||||
|
asm volatile("cld; rep; insb" : "+a"(command.ax), "+b"(command.bx), "+c"(command.cx), "+d"(command.dx), "+S"(command.si), "+D"(command.di));
|
||||||
|
}
|
||||||
|
|
||||||
inline void delay()
|
inline void delay()
|
||||||
{
|
{
|
||||||
// ~3 microsecs
|
// ~3 microsecs
|
||||||
|
Loading…
Reference in New Issue
Block a user