Skip to content

Commit

Permalink
kernel: remove global instances list
Browse files Browse the repository at this point in the history
  • Loading branch information
Qix- committed Jan 20, 2025
1 parent 199b49f commit 0c11584
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
5 changes: 0 additions & 5 deletions oro-kernel/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ impl<A: Arch> Instance<A> {

ring.lock().instances_mut().push(r.clone());
module.lock().instances.push(Arc::downgrade(&r));
Kernel::<A>::get()
.state()
.instances
.lock()
.push(Arc::downgrade(&r));

Ok(r)
}
Expand Down
9 changes: 3 additions & 6 deletions oro-kernel/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,11 @@ impl<A: Arch> Kernel<A> {
/// core boot/powerdown/bringup cycles.
pub struct KernelState<A: Arch> {
/// List of all modules.
modules: TicketMutex<Vec<Weak<ReentrantMutex<module::Module<A>>>>>,
modules: TicketMutex<Vec<Weak<ReentrantMutex<module::Module<A>>>>>,
/// List of all rings.
rings: TicketMutex<Vec<Weak<ReentrantMutex<ring::Ring<A>>>>>,
/// List of all instances.
instances: TicketMutex<Vec<Weak<ReentrantMutex<instance::Instance<A>>>>>,
rings: TicketMutex<Vec<Weak<ReentrantMutex<ring::Ring<A>>>>>,
/// List of all threads.
threads: TicketMutex<Vec<tab::Tab<thread::Thread<A>>>>,
threads: TicketMutex<Vec<tab::Tab<thread::Thread<A>>>>,

/// The root ring.
root_ring: Arc<ReentrantMutex<ring::Ring<A>>>,
Expand Down Expand Up @@ -281,7 +279,6 @@ impl<A: Arch> KernelState<A> {
root_ring,
modules: TicketMutex::default(),
rings: TicketMutex::new(vec![root_ring_weak]),
instances: TicketMutex::default(),
threads: TicketMutex::default(),
registry,
});
Expand Down
4 changes: 4 additions & 0 deletions oro-kernel/src/tab.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1102,3 +1102,7 @@ impl Slot {
impl<A: Arch> Tabbed for crate::thread::Thread<A> {
const TY: TabType = TabType::Thread;
}

impl<A: Arch> Tabbed for crate::instance::Instance<A> {
const TY: TabType = TabType::Instance;
}

0 comments on commit 0c11584

Please sign in to comment.