kernel/arm: implement signals, fork, restart syscall

Change-Id: I24219b83d90710ef719190183ba6f069f82dae61
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6198
Tested-by: Automation <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
David Karoly
2023-03-20 17:28:20 +00:00
parent 5865e68ef2
commit 60b19d7eac
8 changed files with 209 additions and 39 deletions
+3 -1
View File
@@ -30,7 +30,9 @@ struct vregs
ulong r14; /* link register */
ulong r15; /* program counter */
ulong cpsr;
// TODO: ARM: fix floats in vregs, add missing stuff.
double d[32];
ulong fpscr;
};
#endif /* defined(__arm__) */
@@ -24,30 +24,6 @@
#include <arch/arm/arch_thread_types.h>
#include <kernel.h>
/* raw exception frames */
struct iframe {
uint32 spsr;
uint32 r0;
uint32 r1;
uint32 r2;
uint32 r3;
uint32 r4;
uint32 r5;
uint32 r6;
uint32 r7;
uint32 r8;
uint32 r9;
uint32 r10;
uint32 r11;
uint32 r12;
uint32 usr_sp;
uint32 usr_lr;
uint32 svc_sp;
uint32 svc_lr;
uint32 pc;
} _PACKED;
/**! Values for arch_cpu_info.arch */
enum {
ARCH_ARM_PRE_ARM7,
@@ -7,6 +7,30 @@
#include <kernel.h>
/* raw exception frames */
struct iframe {
uint32 spsr;
uint32 r0;
uint32 r1;
uint32 r2;
uint32 r3;
uint32 r4;
uint32 r5;
uint32 r6;
uint32 r7;
uint32 r8;
uint32 r9;
uint32 r10;
uint32 r11;
uint32 r12;
uint32 usr_sp;
uint32 usr_lr;
uint32 svc_sp;
uint32 svc_lr;
uint32 pc;
} _PACKED;
#define IFRAME_TRACE_DEPTH 4
struct iframe_stack {
@@ -26,6 +50,9 @@ struct arch_thread {
// used to track interrupts on this thread
struct iframe_stack iframes;
struct iframe* userFrame;
uint32 oldR0;
};
struct arch_team {
@@ -36,10 +63,7 @@ struct arch_team {
};
struct arch_fork_arg {
// gcc treats empty structures as zero-length in C, but as if they contain
// a char in C++. So we have to put a dummy in to be able to use the struct
// from both in a consistent way.
char dummy;
struct iframe frame;
};
@@ -1,5 +1,5 @@
/*
* Copyright 2022, Haiku Inc. All rights reserved.
* Copyright 2022-2023, Haiku Inc. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Copyright 2007, Travis Geiselbrecht. All rights reserved.
@@ -12,6 +12,7 @@
# error Must not be included directly. Include <commpage_defs.h> instead!
#endif
#define COMMPAGE_ENTRY_ARM_THREAD_EXIT (COMMPAGE_ENTRY_FIRST_ARCH_SPECIFIC + 0)
#define COMMPAGE_ENTRY_ARM_SIGNAL_HANDLER (COMMPAGE_ENTRY_FIRST_ARCH_SPECIFIC + 0)
#define COMMPAGE_ENTRY_ARM_THREAD_EXIT (COMMPAGE_ENTRY_FIRST_ARCH_SPECIFIC + 1)
#endif /* _SYSTEM_ARCH_ARM_COMMPAGE_DEFS_H */