Add saved_rflags, some other unrelated flags.

This commit is contained in:
4lDO2
2024-06-20 16:53:55 +02:00
parent 2f944328e5
commit b7d65e6b9d
2 changed files with 17 additions and 1 deletions
+2 -1
View File
@@ -356,7 +356,7 @@ impl DerefMut for SetSighandlerData {
}
}
#[derive(Debug)]
#[derive(Debug, Default)]
pub struct Sigcontrol {
// composed of [lo pend|lo mask, hi pend|hi mask]
pub word: [AtomicU64; 2],
@@ -365,6 +365,7 @@ pub struct Sigcontrol {
pub saved_scratch_a: SyncUnsafeCell<usize>,
pub saved_scratch_b: SyncUnsafeCell<usize>,
pub saved_flags: SyncUnsafeCell<usize>,
pub saved_ip: SyncUnsafeCell<usize>,
pub saved_sp: SyncUnsafeCell<usize>,
}
+15
View File
@@ -333,3 +333,18 @@ bitflags! {
const INHIBIT_DELIVERY = 1;
}
}
// SIGKILL and SIGSTOP are not considered regular signals, and are merely special codes for
// force-killing and stopping a process or individual thread, respectively. Thus, we use 3 of those
// 4 unused bits (those intended for [SIGKILL, SIGSTOP] x ["pending", "masked"]) to store whether
// SIGTSTP, SIGTTOU, and SIGTTOU, should act as SIG_DFL ("stop"). While this "stop" bit is set,
// neither the regular pending nor the mask bits are meaningful.
//
// Since it's also not meaningful for individual threads to store anything sigaction related, as
// sigaction is process-level, these bits are only used in the process sigcontrol structure (TODO).
const SIGW0_TSTP_IS_STOP_BIT: u64 = 1 << (SIGKILL - 1);
const SIGW0_TTIN_IS_STOP_BIT: u64 = 1 << (SIGSTOP - 1);
const SIGW0_TTOU_IS_STOP_BIT: u64 = 1 << (SIGKILL + 31);
const SIGW0_UNUSED1: u64 = 1 << (SIGSTOP + 31);
const SIGW0_UNUSED2: u64 = 1 << 31;
const SIGW0_UNUSED3: u64 = 1 << 63;