mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 04:38:11 +00:00
Kernel: Fix the return type for syscalls
The Process::Handler type has KResultOr<FlatPtr> as its return type. Using a different return type with an equally-sized template parameter sort of works but breaks once that condition is no longer true, e.g. for KResultOr<int> on x86_64. Ideally the syscall handlers would also take FlatPtrs as their args so we can get rid of the reinterpret_cast for the function pointer but I didn't quite feel like cleaning that up as well.
This commit is contained in:
parent
b6435372cc
commit
2a78bf8596
71 changed files with 313 additions and 301 deletions
|
@ -16,7 +16,7 @@
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
KResultOr<int> Process::sys$create_thread(void* (*entry)(void*), Userspace<const Syscall::SC_create_thread_params*> user_params)
|
||||
KResultOr<FlatPtr> Process::sys$create_thread(void* (*entry)(void*), Userspace<const Syscall::SC_create_thread_params*> user_params)
|
||||
{
|
||||
REQUIRE_PROMISE(thread);
|
||||
|
||||
|
@ -108,7 +108,7 @@ void Process::sys$exit_thread(Userspace<void*> exit_value, Userspace<void*> stac
|
|||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
KResultOr<int> Process::sys$detach_thread(pid_t tid)
|
||||
KResultOr<FlatPtr> Process::sys$detach_thread(pid_t tid)
|
||||
{
|
||||
REQUIRE_PROMISE(thread);
|
||||
auto thread = Thread::from_tid(tid);
|
||||
|
@ -122,7 +122,7 @@ KResultOr<int> Process::sys$detach_thread(pid_t tid)
|
|||
return 0;
|
||||
}
|
||||
|
||||
KResultOr<int> Process::sys$join_thread(pid_t tid, Userspace<void**> exit_value)
|
||||
KResultOr<FlatPtr> Process::sys$join_thread(pid_t tid, Userspace<void**> exit_value)
|
||||
{
|
||||
REQUIRE_PROMISE(thread);
|
||||
|
||||
|
@ -155,7 +155,7 @@ KResultOr<int> Process::sys$join_thread(pid_t tid, Userspace<void**> exit_value)
|
|||
return 0;
|
||||
}
|
||||
|
||||
KResultOr<int> Process::sys$set_thread_name(pid_t tid, Userspace<const char*> user_name, size_t user_name_length)
|
||||
KResultOr<FlatPtr> Process::sys$set_thread_name(pid_t tid, Userspace<const char*> user_name, size_t user_name_length)
|
||||
{
|
||||
REQUIRE_PROMISE(stdio);
|
||||
auto name = copy_string_from_user(user_name, user_name_length);
|
||||
|
@ -174,7 +174,7 @@ KResultOr<int> Process::sys$set_thread_name(pid_t tid, Userspace<const char*> us
|
|||
return 0;
|
||||
}
|
||||
|
||||
KResultOr<int> Process::sys$get_thread_name(pid_t tid, Userspace<char*> buffer, size_t buffer_size)
|
||||
KResultOr<FlatPtr> Process::sys$get_thread_name(pid_t tid, Userspace<char*> buffer, size_t buffer_size)
|
||||
{
|
||||
REQUIRE_PROMISE(thread);
|
||||
if (buffer_size == 0)
|
||||
|
@ -194,7 +194,7 @@ KResultOr<int> Process::sys$get_thread_name(pid_t tid, Userspace<char*> buffer,
|
|||
return 0;
|
||||
}
|
||||
|
||||
KResultOr<int> Process::sys$gettid()
|
||||
KResultOr<FlatPtr> Process::sys$gettid()
|
||||
{
|
||||
REQUIRE_PROMISE(stdio);
|
||||
return Thread::current()->tid().value();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue