mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
Kernel: Make Syscalls/ptrace.cpp buildable for aarch64
This commit is contained in:
parent
06e4dbd45f
commit
b2f7ccf090
|
@ -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