1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 23:27:35 +00:00

Kernel: Add support for SA_SIGINFO

We currently don't really populate most of the fields, but that can
wait :^)
This commit is contained in:
Ali Mohammad Pur 2022-02-26 00:58:06 +03:30 committed by Andreas Kling
parent 585054d68b
commit 4bd01b7fe9
12 changed files with 408 additions and 195 deletions

View file

@ -7,6 +7,7 @@
#pragma once
#include <Kernel/API/POSIX/signal.h>
#include <Kernel/API/POSIX/ucontext.h>
#include <bits/sighow.h>
#include <signal_numbers.h>
#include <sys/types.h>

View file

@ -14,80 +14,49 @@
# include <sys/types.h>
#endif
struct [[gnu::packed]] PtraceRegisters {
#if ARCH(I386)
uint32_t eax;
uint32_t ecx;
uint32_t edx;
uint32_t ebx;
uint32_t esp;
uint32_t ebp;
uint32_t esi;
uint32_t edi;
uint32_t eip;
uint32_t eflags;
#else
uint64_t rax;
uint64_t rcx;
uint64_t rdx;
uint64_t rbx;
uint64_t rsp;
uint64_t rbp;
uint64_t rsi;
uint64_t rdi;
uint64_t rip;
uint64_t r8;
uint64_t r9;
uint64_t r10;
uint64_t r11;
uint64_t r12;
uint64_t r13;
uint64_t r14;
uint64_t r15;
uint64_t rflags;
#endif
uint32_t cs;
uint32_t ss;
uint32_t ds;
uint32_t es;
uint32_t fs;
uint32_t gs;
#include <Kernel/Arch/mcontext.h>
#if defined(__cplusplus) && defined(__cpp_concepts)
#ifdef __cplusplus
struct [[gnu::packed]] PtraceRegisters : public __mcontext {
# if defined(__cplusplus) && defined(__cpp_concepts)
FlatPtr ip() const
{
# if ARCH(I386)
# if ARCH(I386)
return eip;
# else
# else
return rip;
# endif
# endif
}
void set_ip(FlatPtr ip)
{
# if ARCH(I386)
# if ARCH(I386)
eip = ip;
# else
# else
rip = ip;
# endif
# endif
}
FlatPtr bp() const
{
# if ARCH(I386)
# if ARCH(I386)
return ebp;
# else
# else
return rbp;
# endif
# endif
}
void set_bp(FlatPtr bp)
{
# if ARCH(I386)
# if ARCH(I386)
ebp = bp;
# else
# else
rbp = bp;
# endif
# endif
}
#endif
# endif
};
#else
typedef struct __mcontext PthreadRegisters;
#endif