123456789101112131415161718192021222324252627 |
- use core::sync::atomic::AtomicUsize;
- use alloc::{collections::BTreeMap, sync::Arc};
- use crate::{driver::net::Iface, libs::rwlock::RwLock};
- pub mod event_poll;
- pub mod net_core;
- pub mod socket;
- pub mod syscall;
- pub mod posix;
- lazy_static! {
-
-
- pub static ref NET_DEVICES: RwLock<BTreeMap<usize, Arc<dyn Iface>>> = RwLock::new(BTreeMap::new());
- }
- pub fn generate_iface_id() -> usize {
- static IFACE_ID: AtomicUsize = AtomicUsize::new(0);
- return IFACE_ID.fetch_add(1, core::sync::atomic::Ordering::SeqCst);
- }
|