mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
Kernel: Make Syscalls/ptrace.cpp buildable for aarch64
This commit is contained in:
parent
cab725cdfb
commit
a146a19636
Notes:
sideshowbarker
2024-07-18 03:23:00 +09:00
Author: https://github.com/FireFox317 Commit: https://github.com/SerenityOS/serenity/commit/a146a19636 Pull-request: https://github.com/SerenityOS/serenity/pull/17183 Reviewed-by: https://github.com/kleinesfilmroellchen ✅ Reviewed-by: https://github.com/nico ✅
3 changed files with 17 additions and 7 deletions
|
@ -16,11 +16,6 @@ namespace Kernel {
|
|||
|
||||
ProcessID g_init_pid { 0 };
|
||||
|
||||
bool Process::has_tracee_thread(ProcessID)
|
||||
{
|
||||
TODO_AARCH64();
|
||||
}
|
||||
|
||||
ErrorOr<void> Process::exec(NonnullOwnPtr<KString>, NonnullOwnPtrVector<KString>, NonnullOwnPtrVector<KString>, Thread*&, u32&, int)
|
||||
{
|
||||
TODO_AARCH64();
|
||||
|
|
|
@ -301,6 +301,7 @@ set(KERNEL_SOURCES
|
|||
Syscalls/prctl.cpp
|
||||
Syscalls/process.cpp
|
||||
Syscalls/profiling.cpp
|
||||
Syscalls/ptrace.cpp
|
||||
Syscalls/purge.cpp
|
||||
Syscalls/read.cpp
|
||||
Syscalls/readlink.cpp
|
||||
|
@ -401,7 +402,6 @@ if ("${SERENITY_ARCH}" STREQUAL "x86_64")
|
|||
Syscalls/execve.cpp
|
||||
Syscalls/fork.cpp
|
||||
Syscalls/mmap.cpp
|
||||
Syscalls/ptrace.cpp
|
||||
Syscalls/sigaction.cpp
|
||||
)
|
||||
|
||||
|
|
|
@ -107,7 +107,7 @@ static ErrorOr<FlatPtr> handle_ptrace(Kernel::Syscall::SC_ptrace_params const& p
|
|||
|
||||
auto& peer_saved_registers = peer->get_register_dump_from_stack();
|
||||
// Verify that the saved registers are in usermode context
|
||||
if ((peer_saved_registers.cs & 0x03) != 3)
|
||||
if (peer_saved_registers.previous_mode() == ExecutionMode::User)
|
||||
return EFAULT;
|
||||
|
||||
tracer->set_regs(regs);
|
||||
|
@ -229,6 +229,7 @@ ErrorOr<void> Process::poke_user_data(Userspace<FlatPtr*> address, FlatPtr data)
|
|||
|
||||
ErrorOr<FlatPtr> Thread::peek_debug_register(u32 register_index)
|
||||
{
|
||||
#if ARCH(X86_64)
|
||||
FlatPtr data;
|
||||
switch (register_index) {
|
||||
case 0:
|
||||
|
@ -253,10 +254,17 @@ ErrorOr<FlatPtr> Thread::peek_debug_register(u32 register_index)
|
|||
return EINVAL;
|
||||
}
|
||||
return data;
|
||||
#elif ARCH(AARCH64)
|
||||
(void)register_index;
|
||||
TODO_AARCH64();
|
||||
#else
|
||||
# error "Unknown architecture"
|
||||
#endif
|
||||
}
|
||||
|
||||
ErrorOr<void> Thread::poke_debug_register(u32 register_index, FlatPtr data)
|
||||
{
|
||||
#if ARCH(X86_64)
|
||||
switch (register_index) {
|
||||
case 0:
|
||||
m_debug_register_state.dr0 = data;
|
||||
|
@ -277,6 +285,13 @@ ErrorOr<void> Thread::poke_debug_register(u32 register_index, FlatPtr data)
|
|||
return EINVAL;
|
||||
}
|
||||
return {};
|
||||
#elif ARCH(AARCH64)
|
||||
(void)register_index;
|
||||
(void)data;
|
||||
TODO_AARCH64();
|
||||
#else
|
||||
# error "Unknown architecture"
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue