From 5121e58d4a67e0d0a075501a60f6466798754f5a Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Thu, 12 Aug 2021 21:41:11 -0700 Subject: [PATCH] Kernel: Fix sys$dbgputstr(...) to take a char* instead of u8* We always attempt to print this as a string, and it's defined as such in LibC, so fix the signature to match. --- Kernel/Process.h | 2 +- Kernel/Syscalls/debug.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Kernel/Process.h b/Kernel/Process.h index fce09313ba..d28d0314b1 100644 --- a/Kernel/Process.h +++ b/Kernel/Process.h @@ -264,7 +264,7 @@ public: KResultOr sys$inode_watcher_add_watch(Userspace user_params); KResultOr sys$inode_watcher_remove_watch(int fd, int wd); KResultOr sys$dbgputch(u8); - KResultOr sys$dbgputstr(Userspace, size_t); + KResultOr sys$dbgputstr(Userspace, size_t); KResultOr sys$dump_backtrace(); KResultOr sys$gettid(); KResultOr sys$setsid(); diff --git a/Kernel/Syscalls/debug.cpp b/Kernel/Syscalls/debug.cpp index 7926da79bf..5f34084266 100644 --- a/Kernel/Syscalls/debug.cpp +++ b/Kernel/Syscalls/debug.cpp @@ -25,7 +25,7 @@ KResultOr Process::sys$dbgputch(u8 ch) return 0; } -KResultOr Process::sys$dbgputstr(Userspace characters, size_t size) +KResultOr Process::sys$dbgputstr(Userspace characters, size_t size) { VERIFY_NO_PROCESS_BIG_LOCK(this); if (size == 0) @@ -39,7 +39,7 @@ KResultOr Process::sys$dbgputstr(Userspace characters, size_ return size; } - auto result = try_copy_kstring_from_user(reinterpret_cast(characters.unsafe_userspace_ptr()), size); + auto result = try_copy_kstring_from_user(characters, size); if (result.is_error()) return result.error(); dbgputstr(result.value()->characters(), size);