mirror of
https://review.haiku-os.org/haiku
synced 2025-02-01 03:06:08 +01:00
Add an x86-64 compatible _ExecuteCommand()
This implementation introduces the minimal changes necessary to support the existing VMWareTypes API on x86-64. If a more expansive set of guest additions are required, it may make sense to adopt a more general approach akin to the one used here: https://github.com/jcs/vmwh/blob/f177dd3cf/vmware.c#L49 Signed-off-by: Michael Lotz <mmlr@mlotz.ch>
This commit is contained in:
parent
054ec8a776
commit
297feca8e5
@ -104,6 +104,26 @@ VMWareMouseFilter::_ExecuteCommand(union packet_u &packet)
|
||||
packet.command.port = VMWARE_PORT_NUMBER;
|
||||
|
||||
int dummy;
|
||||
#ifdef __x86_64__
|
||||
asm volatile (
|
||||
"pushq %%rbx;"
|
||||
"pushq %%rax;"
|
||||
"movl 12(%%rax), %%edx;"
|
||||
"movl 8(%%rax), %%ecx;"
|
||||
"movl 4(%%rax), %%ebx;"
|
||||
"movl (%%rax), %%eax;"
|
||||
"inl %%dx, %%eax;"
|
||||
"xchgq %%rax, (%%rsp);"
|
||||
"movl %%edx, 12(%%rax);"
|
||||
"movl %%ecx, 8(%%rax);"
|
||||
"movl %%ebx, 4(%%rax);"
|
||||
"popq %%rbx;"
|
||||
"movl %%ebx, (%%rax);"
|
||||
"popq %%rbx;"
|
||||
: "=a"(dummy)
|
||||
: "0"(&packet)
|
||||
: "rcx", "rdx", "memory");
|
||||
#else
|
||||
asm volatile (
|
||||
"pushl %%ebx;"
|
||||
"pushl %%eax;"
|
||||
@ -121,6 +141,7 @@ VMWareMouseFilter::_ExecuteCommand(union packet_u &packet)
|
||||
: "=a"(dummy)
|
||||
: "0"(&packet)
|
||||
: "ecx", "edx", "memory");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user