Skip to main content

islet_rmm/realm/
registry.rs

1use crate::rmi::error::Error;
2use alloc::collections::BTreeSet;
3use spinning_top::Spinlock;
4
5pub static VMID_SET: Spinlock<BTreeSet<usize>> = Spinlock::new(BTreeSet::new());
6
7pub fn remove(id: usize) -> Result<(), Error> {
8    VMID_SET
9        .lock()
10        .remove(&id)
11        .then_some(())
12        .ok_or(Error::RmiErrorInput)
13}