feat: add Rust userspace support; fix TLS layout for p_align < 16; kill whole process on sibling-thread faults
This commit is contained in:
1 parent
a81298fb24
commit
f8b8f9610f
31 files changed
+1076
-38
No files matched your search
+11
-1
@@ -177,7 +177,17 @@ namespace Hal {
|
||||
if (i == 0x00) sig = 8; /* #DE -> SIGFPE */
|
||||
else if (i == 0x06) sig = 4; /* #UD -> SIGILL */
|
||||
else if (i == 0x10 || i == 0x13) sig = 8; /* x87/SIMD FP */
|
||||
Sched::SetProcessExitCode(proc->pid, 256 + sig);
|
||||
|
||||
// ExitProcess from a sibling thread ends only that thread,
|
||||
// which would leave the process running with the crash
|
||||
// swallowed. Flag the whole process (main thread and every
|
||||
// sibling) first, carrying the crash code rather than
|
||||
// KillProcess's default SIGKILL, so waiters see the fault.
|
||||
if (Sched::GetCurrentThreadPtr() != proc) {
|
||||
Sched::KillProcess(proc->pid, 256 + sig);
|
||||
} else {
|
||||
Sched::SetProcessExitCode(proc->pid, 256 + sig);
|
||||
}
|
||||
}
|
||||
|
||||
Sched::ExitProcess();
|
||||
|
||||
Reference in new issue
Block a user