Add minimal realtime sig constants.

This commit is contained in:
4lDO2
2024-07-25 21:12:50 +02:00
parent e4cc6bfcd5
commit 7b834cb3d5
2 changed files with 16 additions and 1 deletions
+1
View File
@@ -77,6 +77,7 @@ pub const SYS_GETPPID: usize = 64;
pub const SYS_GETUID: usize = 199;
pub const SYS_IOPL: usize = 110;
pub const SYS_KILL: usize = 37;
pub const SYS_SIGQUEUE: usize = 101;
pub const SYS_MPROTECT: usize = 125;
pub const SYS_MKNS: usize = 984;
pub const SYS_NANOSLEEP: usize = 162;
+15 -1
View File
@@ -1,11 +1,20 @@
use core::sync::atomic::{AtomicUsize, Ordering};
use core::sync::atomic::{AtomicU8, AtomicUsize, Ordering};
/// Signal runtime struct for the entire process
#[derive(Debug)]
#[repr(C, align(4096))]
pub struct SigProcControl {
pub pending: AtomicU64,
pub qhead: AtomicU8,
pub _rsvd: [u8; 7],
pub actions: [RawAction; 64],
pub queue: [RealtimeSig; 32],
pub qtail: AtomicU8,
}
#[derive(Debug)]
#[repr(transparent)]
pub struct RealtimeSig {
pub arg: NonatomicUsize,
}
#[derive(Debug)]
#[repr(C, align(16))]
@@ -86,6 +95,11 @@ impl SigatomicUsize {
pub struct NonatomicUsize(AtomicUsize);
impl NonatomicUsize {
#[inline]
pub const fn new(a: usize) -> Self {
Self(AtomicUsize::new(a))
}
#[inline]
pub fn get(&self) -> usize {
self.0.load(Ordering::Relaxed)