use turkos_os_thread_wait::thread_wait as wait; /// # Safety /// `actual` reads trusted architecture CPU/DAIF/IRQ state without any owner /// loan. `raw` is the separately owned ingress with exclusive access only after /// the pure gate succeeds. No WaitSet/Queue/Table/allocator pointer is accepted. pub unsafe fn wait_guest_irq_poll( raw: *mut wait::Ingress, actual: impl FnOnce() -> wait::Execution, ) -> Result { let execution = actual(); wait::context(0, execution, wait::Operation::Produce)?; if !execution.in_irq { return Err(wait::Error::Context); } let ingress = unsafe { raw.as_mut() }.ok_or(wait::Error::State)?; ingress.poll() }