summaryrefslogtreecommitdiff
path: root/Kernel/Devices/VMWareBackdoor.cpp
diff options
context:
space:
mode:
authorasynts <asynts@gmail.com>2021-01-13 23:59:42 +0100
committerAndreas Kling <kling@serenityos.org>2021-01-22 22:14:30 +0100
commit78b2be5a2a9e7dffa60f4600116412be824fb397 (patch)
tree7873a2555047a7498813e8b641647629a96403b0 /Kernel/Devices/VMWareBackdoor.cpp
parent9d588cc9cc6684be7f8908b44bb85a58b6f59051 (diff)
downloadserenity-78b2be5a2a9e7dffa60f4600116412be824fb397.zip
Everywhere: Replace a bundle of dbg with dbgln.
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
Diffstat (limited to 'Kernel/Devices/VMWareBackdoor.cpp')
-rw-r--r--Kernel/Devices/VMWareBackdoor.cpp37
1 files changed, 24 insertions, 13 deletions
diff --git a/Kernel/Devices/VMWareBackdoor.cpp b/Kernel/Devices/VMWareBackdoor.cpp
index 45d7f6dd88..a8c698b26e 100644
--- a/Kernel/Devices/VMWareBackdoor.cpp
+++ b/Kernel/Devices/VMWareBackdoor.cpp
@@ -25,6 +25,7 @@
*/
#include <AK/Assertions.h>
+#include <AK/Debug.h>
#include <AK/OwnPtr.h>
#include <AK/Singleton.h>
#include <AK/String.h>
@@ -177,25 +178,34 @@ void VMWareBackdoor::disable_absolute_vmmouse()
void VMWareBackdoor::send_high_bandwidth(VMWareCommand& command)
{
vmware_high_bandwidth_send(command);
-#ifdef VMWAREBACKDOOR_DEBUG
- dbg() << "VMWareBackdoor Command High bandwidth Send Results: EAX " << String::format("%x", command.ax) << " EBX " << String::format("%x", command.bx) << " ECX " << String::format("%x", command.cx) << " EDX " << String::format("%x", command.dx);
-#endif
+
+ dbgln<debug_vmware_backdoor>("VMWareBackdoor Command High bandwidth Send Results: EAX {:#x} EBX {:#x} ECX {:#x} EDX {:#x}",
+ command.ax,
+ command.bx,
+ command.cx,
+ command.dx);
}
void VMWareBackdoor::get_high_bandwidth(VMWareCommand& command)
{
vmware_high_bandwidth_get(command);
-#ifdef VMWAREBACKDOOR_DEBUG
- dbg() << "VMWareBackdoor Command High bandwidth Get Results: EAX " << String::format("%x", command.ax) << " EBX " << String::format("%x", command.bx) << " ECX " << String::format("%x", command.cx) << " EDX " << String::format("%x", command.dx);
-#endif
+
+ dbgln<debug_vmware_backdoor>("VMWareBackdoor Command High bandwidth Get Results: EAX {:#x} EBX {:#x} ECX {:#x} EDX {:#x}",
+ command.ax,
+ command.bx,
+ command.cx,
+ command.dx);
}
void VMWareBackdoor::send(VMWareCommand& command)
{
vmware_out(command);
-#ifdef VMWAREBACKDOOR_DEBUG
- dbg() << "VMWareBackdoor Command Send Results: EAX " << String::format("%x", command.ax) << " EBX " << String::format("%x", command.bx) << " ECX " << String::format("%x", command.cx) << " EDX " << String::format("%x", command.dx);
-#endif
+
+ dbgln<debug_vmware_backdoor>("VMWareBackdoor Command Send Results: EAX {:#x} EBX {:#x} ECX {:#x} EDX {:#x}",
+ command.ax,
+ command.bx,
+ command.cx,
+ command.dx);
}
Optional<MousePacket> VMWareBackdoor::receive_mouse_packet()
@@ -225,10 +235,11 @@ Optional<MousePacket> VMWareBackdoor::receive_mouse_packet()
int y = (command.cx);
int z = (command.dx);
-#ifdef PS2MOUSE_DEBUG
- dbg() << "Absolute Mouse: Buttons " << String::format("%x", buttons);
- dbg() << "Mouse: X " << x << ", Y " << y << ", Z " << z;
-#endif
+ if constexpr (debug_ps2mouse) {
+ dbgln("Absolute Mouse: Buttons {:x}", buttons);
+ dbgln("Mouse: x={}, y={}, z={}", x, y, z);
+ }
+
MousePacket packet;
packet.x = x;
packet.y = y;