Add futex, pipe, timeout subscribers

This commit is contained in:
Wildan M
2026-05-13 10:46:38 +07:00
parent bd44956e96
commit ff11f47404
5 changed files with 29 additions and 3 deletions
+11
View File
@@ -52,6 +52,17 @@ pub struct FutexEntry {
static FUTEXES: Mutex<L1, FutexList> =
Mutex::new(FutexList::with_hasher(DefaultHashBuilder::new()));
pub fn get_futex_stat(token: &mut CleanLockToken) -> (usize, usize) {
let mut regc = 0;
let mut regl = 0;
let registry = FUTEXES.lock(token.token());
for (k, v) in registry.iter() {
regl += v.len();
regc += 1;
}
(regc, regl)
}
fn validate_and_translate_virt(space: &AddrSpace, addr: VirtualAddress) -> Option<PhysicalAddress> {
// TODO: Move this elsewhere!
if addr.data().saturating_add(size_of::<usize>()) >= crate::USER_END_OFFSET {