arm64: Add signal handling and forking

Change-Id: I8fd41bf5c540bcb2b9347aae47ad8bb86a6a6964
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10605
Reviewed-by: waddlesplash <[email protected]>
Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
Sam Roberts
2026-03-30 22:16:51 +00:00
committed by waddlesplash
parent 7981c1d1c7
commit 1b4044fde1
7 changed files with 163 additions and 37 deletions
@@ -119,34 +119,6 @@ ADDRESS_TRANSLATE_FUNC(s1e1r)
ADDRESS_TRANSLATE_FUNC(s1e1w)
struct aarch64_fpu_state
{
uint64 regs[32 * 2];
uint64 fpsr;
uint64 fpcr;
};
/* raw exception frames */
struct iframe {
// return info
uint64 elr;
uint64 spsr;
uint64 x[29];
uint64 fp;
uint64 lr;
uint64 sp;
uint64 tpidr;
// exception info
uint64 esr;
uint64 far;
// fpu
struct aarch64_fpu_state fpu;
};
#ifdef __cplusplus
namespace BKernel {
struct Thread;
@@ -11,6 +11,35 @@
#define IFRAME_TRACE_DEPTH 4
struct aarch64_fpu_state
{
uint64 regs[32 * 2];
uint64 fpsr;
uint64 fpcr;
};
/* raw exception frames */
struct iframe {
// return info
uint64 elr;
uint64 spsr;
uint64 x[29];
uint64 fp;
uint64 lr;
uint64 sp;
uint64 tpidr;
// exception info
uint64 esr;
uint64 far;
// fpu
struct aarch64_fpu_state fpu;
};
struct iframe_stack {
struct iframe *frames[IFRAME_TRACE_DEPTH];
int32 index;
@@ -20,17 +49,21 @@ struct iframe_stack {
struct arch_thread {
uint64 regs[14]; // x19-x30, sp, tpidr_el0
uint64 fp_regs[8]; // d8-d15
uint64 old_x0;
// used to track interrupts on this thread
struct iframe_stack iframes;
};
struct arch_team {
int dummy;
};
struct arch_fork_arg {
int dummy;
struct iframe frame;
};
#endif /* _KERNEL_ARCH_ARM64_ARCH_THREAD_TYPES_H_ */
@@ -11,5 +11,6 @@
#endif
#define COMMPAGE_ENTRY_ARM64_THREAD_EXIT (COMMPAGE_ENTRY_FIRST_ARCH_SPECIFIC + 0)
#define COMMPAGE_ENTRY_ARM64_SIGNAL_HANDLER (COMMPAGE_ENTRY_FIRST_ARCH_SPECIFIC + 1)
#endif /* _SYSTEM_ARCH_ARM64_COMMPAGE_DEFS_H */