// NEW checked service bridge after generated frozen Context sources. It never // returns a mutable backend or private binding, and never branches to assembly. /// # Safety /// Captures and ticks are actual independently retained ingress/assembly /// observations. Tick read/consume touch only bounded dedicated metadata, not /// Table/allocator/Runtime/heap. CPU/root/current-thread/slice/sequence bind the /// same actual main safe point. No mutable bank/backend loan is held in IRQ. pub unsafe trait QueueServices: CompletionBackend { type QueueTick; fn queue_capture(&self) -> Option; fn queue_tick( &self, tick: &Self::QueueTick, ) -> Result; fn queue_consume_tick(&mut self, tick: Self::QueueTick); } impl CompletionBank { fn os_k1060_queue_gate(&self) -> Result<(), Error> { let bank = &self.handoff.bank; let e = bank.backend.execution(); if e.cpu != bank.cpu || e.daif & IRQ == 0 || e.daif & !0x3c0 != 0 || e.in_irq || !e.fp_enabled || e.critical_depth != 0 || !e.safe_point { return Err(Error::Context); } Ok(()) } pub fn os_k1060_observe_member( &self, h: Handle, ) -> Result { self.os_k1060_queue_gate()?; let bank = &self.handoff.bank; let i = bank.index(h)?; let thread = bank.validate(i)?; let stack = bank.backend.stack(bank.binding(i)?)?; ContextBank::::stack_observation(stack, thread)?; Ok(crate::runtime::runqueue::Observation { thread, context: bank.record(h)?, stack, }) } pub fn os_k1060_capture(&self) -> Result { self.os_k1060_queue_gate()?; self.handoff .bank .backend .queue_capture() .ok_or(Error::Capture) } pub fn os_k1060_tick( &self, tick: &B::QueueTick, ) -> Result { self.os_k1060_queue_gate() .map_err(|_| crate::runtime::runqueue::Error::Context)?; self.handoff.bank.backend.queue_tick(tick) } pub fn os_k1060_consume_tick( &mut self, tick: B::QueueTick, ) -> Result<(), (crate::runtime::runqueue::Error, B::QueueTick)> { if self.os_k1060_queue_gate().is_err() { return Err((crate::runtime::runqueue::Error::Context, tick)); } self.handoff.bank.backend.queue_consume_tick(tick); Ok(()) } }