From 547aac50567640a02c495b0673718d46a79dfe65 Mon Sep 17 00:00:00 2001 From: bunnie Date: Thu, 20 Feb 2025 15:49:05 +0800 Subject: [PATCH 1/2] fix lifetime issue on irq handler binding using scoping for feature flags is tricky. also this is like, all totally unsafe code. --- services/bao-video/src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/bao-video/src/main.rs b/services/bao-video/src/main.rs index afbe2d944..59a3c42c6 100644 --- a/services/bao-video/src/main.rs +++ b/services/bao-video/src/main.rs @@ -170,6 +170,8 @@ pub fn wrapped_main(main_thread_token: MainThreadToken) -> ! { let cid = xous::connect(sid).unwrap(); // self-connection always succeeds // register interrupt handler #[cfg(not(feature = "hosted-baosec"))] + let cam_irq; // this binding has to out-live the temporaries below + #[cfg(not(feature = "hosted-baosec"))] { let irq = xous::syscall::map_memory( xous::MemoryAddress::new(utra::irqarray8::HW_IRQARRAY8_BASE), @@ -181,9 +183,9 @@ pub fn wrapped_main(main_thread_token: MainThreadToken) -> ! { let mut irq_csr = utralib::CSR::new(irq.as_mut_ptr() as *mut u32); irq_csr.wo(utra::irqarray8::EV_PENDING, 0xFFFF); // clear any pending interrupts - let cam_irq = CamIrq { csr: utralib::CSR::new(irq.as_mut_ptr() as *mut u32), cid }; + cam_irq = CamIrq { csr: utralib::CSR::new(irq.as_mut_ptr() as *mut u32), cid }; let irq_arg = &cam_irq as *const CamIrq as *mut usize; - log::debug!("irq_arg: {:x}", irq_arg as usize); + log::info!("irq_arg: {:x}", irq_arg as usize); xous::claim_interrupt(utra::irqarray8::IRQARRAY8_IRQ, handle_irq, irq_arg) .expect("couldn't claim IRQ8"); // enable camera Rx IRQ From f798f5cf3db996c1ca1e91fe06791ec8c84f9a55 Mon Sep 17 00:00:00 2001 From: bunnie Date: Thu, 20 Feb 2025 18:37:58 +0800 Subject: [PATCH 2/2] fix doc-deps configuration --- services/modals/src/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/services/modals/src/lib.rs b/services/modals/src/lib.rs index 7750d9487..999614426 100644 --- a/services/modals/src/lib.rs +++ b/services/modals/src/lib.rs @@ -189,6 +189,7 @@ impl Modals { REFCOUNT.fetch_add(1, Ordering::Relaxed); let conn = xns.request_connection_blocking(api::SERVER_NAME_MODALS).expect("Can't connect to Modals server"); + #[cfg(not(feature = "doc-deps"))] let trng = Trng::new(&xns).unwrap(); #[allow(unused_mut)] let mut token = [0u32; 4];