diff --git a/target/ast10x0/tests/interrupts/user/target.rs b/target/ast10x0/tests/interrupts/user/target.rs index ebf027e18..83f54fb7a 100644 --- a/target/ast10x0/tests/interrupts/user/target.rs +++ b/target/ast10x0/tests/interrupts/user/target.rs @@ -4,6 +4,7 @@ #![no_std] #![no_main] +use arch_arm_cortex_m::Arch; use console_backend::console_backend_write_all; use entry as _; use target_common::{declare_target, TargetInterface}; @@ -15,8 +16,12 @@ impl TargetInterface for Target { fn main() -> ! { codegen::start(); - #[expect(clippy::empty_loop)] - loop {} + // The bootstrap thread has nothing left to do. Sleep rather than spin: a + // spinning thread at the same priority as the app threads takes a time + // slice at every scheduler tick and delays every wake-up behind it. + loop { + let _ = kernel::sleep_until(Arch, kernel::Instant::MAX); + } } fn shutdown(code: u32) -> ! { diff --git a/target/ast10x0/tests/ipc/user/target.rs b/target/ast10x0/tests/ipc/user/target.rs index 68b95716a..c1ba69aee 100644 --- a/target/ast10x0/tests/ipc/user/target.rs +++ b/target/ast10x0/tests/ipc/user/target.rs @@ -4,6 +4,7 @@ #![no_std] #![no_main] +use arch_arm_cortex_m::Arch; use console_backend::console_backend_write_all; use entry as _; use target_common::{declare_target, TargetInterface}; @@ -15,8 +16,12 @@ impl TargetInterface for Target { fn main() -> ! { codegen::start(); - #[expect(clippy::empty_loop)] - loop {} + // The bootstrap thread has nothing left to do. Sleep rather than spin: a + // spinning thread at the same priority as the app threads takes a time + // slice at every scheduler tick and delays every wake-up behind it. + loop { + let _ = kernel::sleep_until(Arch, kernel::Instant::MAX); + } } fn shutdown(code: u32) -> ! { diff --git a/target/ast10x0/tests/mctp/ipc_client/target.rs b/target/ast10x0/tests/mctp/ipc_client/target.rs index 850303c4a..66ecd02f6 100644 --- a/target/ast10x0/tests/mctp/ipc_client/target.rs +++ b/target/ast10x0/tests/mctp/ipc_client/target.rs @@ -10,6 +10,7 @@ #![no_std] #![no_main] +use arch_arm_cortex_m::Arch; use console_backend::console_backend_write_all; use entry as _; use target_common::{declare_target, TargetInterface}; @@ -21,8 +22,12 @@ impl TargetInterface for Target { fn main() -> ! { codegen::start(); - #[expect(clippy::empty_loop)] - loop {} + // The bootstrap thread has nothing left to do. Sleep rather than spin: a + // spinning thread at the same priority as the app threads takes a time + // slice at every scheduler tick and delays every wake-up behind it. + loop { + let _ = kernel::sleep_until(Arch, kernel::Instant::MAX); + } } fn shutdown(code: u32) -> ! { diff --git a/target/ast10x0/tests/mctp/server/target.rs b/target/ast10x0/tests/mctp/server/target.rs index ed4f0348e..cd3ad5fd9 100644 --- a/target/ast10x0/tests/mctp/server/target.rs +++ b/target/ast10x0/tests/mctp/server/target.rs @@ -4,6 +4,7 @@ #![no_std] #![no_main] +use arch_arm_cortex_m::Arch; use ast10x0_board::{Ast10x0Board, Ast10x0BoardDescriptor, I2cBusCfg}; use ast10x0_peripherals::i2c::{ClockConfig, I2cConfig, I2cSpeed, I2cXferMode}; use ast10x0_peripherals::scu::pinctrl; @@ -46,7 +47,9 @@ impl TargetInterface for Target { } codegen::start(); - loop {} + loop { + let _ = kernel::sleep_until(Arch, kernel::Instant::MAX); + } } fn shutdown(code: u32) -> ! { diff --git a/target/ast10x0/tests/orchestrator/runtime/target.rs b/target/ast10x0/tests/orchestrator/runtime/target.rs index 961db53ed..c96088b5e 100644 --- a/target/ast10x0/tests/orchestrator/runtime/target.rs +++ b/target/ast10x0/tests/orchestrator/runtime/target.rs @@ -4,6 +4,7 @@ #![no_std] #![no_main] +use arch_arm_cortex_m::Arch; use console_backend::console_backend_write_all; use entry as _; use target_common::{declare_target, TargetInterface}; @@ -15,8 +16,12 @@ impl TargetInterface for Target { fn main() -> ! { codegen::start(); - #[expect(clippy::empty_loop)] - loop {} + // The bootstrap thread has nothing left to do. Sleep rather than spin: a + // spinning thread at the same priority as the app threads takes a time + // slice at every scheduler tick and delays every wake-up behind it. + loop { + let _ = kernel::sleep_until(Arch, kernel::Instant::MAX); + } } fn shutdown(code: u32) -> ! { diff --git a/target/ast10x0/tests/orchestrator/timer/target.rs b/target/ast10x0/tests/orchestrator/timer/target.rs index 12fd4720b..411bdb1a0 100644 --- a/target/ast10x0/tests/orchestrator/timer/target.rs +++ b/target/ast10x0/tests/orchestrator/timer/target.rs @@ -4,6 +4,7 @@ #![no_std] #![no_main] +use arch_arm_cortex_m::Arch; use console_backend::console_backend_write_all; use entry as _; use target_common::{declare_target, TargetInterface}; @@ -15,8 +16,12 @@ impl TargetInterface for Target { fn main() -> ! { codegen::start(); - #[expect(clippy::empty_loop)] - loop {} + // The bootstrap thread has nothing left to do. Sleep rather than spin: a + // spinning thread at the same priority as the app threads takes a time + // slice at every scheduler tick and delays every wake-up behind it. + loop { + let _ = kernel::sleep_until(Arch, kernel::Instant::MAX); + } } fn shutdown(code: u32) -> ! { diff --git a/target/ast10x0/tests/peripherals/gpio/gpio_irq/target.rs b/target/ast10x0/tests/peripherals/gpio/gpio_irq/target.rs index 09133de81..cb8b234f4 100644 --- a/target/ast10x0/tests/peripherals/gpio/gpio_irq/target.rs +++ b/target/ast10x0/tests/peripherals/gpio/gpio_irq/target.rs @@ -6,6 +6,7 @@ #![no_std] #![no_main] +use arch_arm_cortex_m::Arch; use ast10x0_peripherals::scu::{pinctrl, ScuRegisters}; use console_backend::console_backend_write_all; use entry as _; @@ -24,8 +25,9 @@ impl TargetInterface for Target { } codegen::start(); - #[expect(clippy::empty_loop)] - loop {} + loop { + let _ = kernel::sleep_until(Arch, kernel::Instant::MAX); + } } fn shutdown(code: u32) -> ! { diff --git a/target/ast10x0/tests/peripherals/i2c/i2c_slave_rx_ipc/target.rs b/target/ast10x0/tests/peripherals/i2c/i2c_slave_rx_ipc/target.rs index 60163ddd6..e4c1e5cef 100644 --- a/target/ast10x0/tests/peripherals/i2c/i2c_slave_rx_ipc/target.rs +++ b/target/ast10x0/tests/peripherals/i2c/i2c_slave_rx_ipc/target.rs @@ -4,6 +4,7 @@ #![no_std] #![no_main] +use arch_arm_cortex_m::Arch; use ast10x0_peripherals::i2c; use ast10x0_peripherals::scu::pinctrl; use console_backend::console_backend_write_all; @@ -37,8 +38,9 @@ impl TargetInterface for Target { } codegen::start(); - #[expect(clippy::empty_loop)] - loop {} + loop { + let _ = kernel::sleep_until(Arch, kernel::Instant::MAX); + } } fn shutdown(code: u32) -> ! { diff --git a/target/ast10x0/tests/peripherals/sgpiom/sgpiom_irq/target.rs b/target/ast10x0/tests/peripherals/sgpiom/sgpiom_irq/target.rs index 6524fdcf6..7a491562e 100644 --- a/target/ast10x0/tests/peripherals/sgpiom/sgpiom_irq/target.rs +++ b/target/ast10x0/tests/peripherals/sgpiom/sgpiom_irq/target.rs @@ -15,6 +15,7 @@ #![no_std] #![no_main] +use arch_arm_cortex_m::Arch; use ast10x0_peripherals::scu::{pinctrl, ScuRegisters}; use console_backend::console_backend_write_all; use entry as _; @@ -33,8 +34,9 @@ impl TargetInterface for Target { } codegen::start(); - #[expect(clippy::empty_loop)] - loop {} + loop { + let _ = kernel::sleep_until(Arch, kernel::Instant::MAX); + } } fn shutdown(code: u32) -> ! { diff --git a/target/ast10x0/tests/spdm/auth/target.rs b/target/ast10x0/tests/spdm/auth/target.rs index 42dd70db1..93a0c49b0 100644 --- a/target/ast10x0/tests/spdm/auth/target.rs +++ b/target/ast10x0/tests/spdm/auth/target.rs @@ -4,6 +4,7 @@ #![no_std] #![no_main] +use arch_arm_cortex_m::Arch; use ast10x0_board::{Ast10x0Board, Ast10x0BoardDescriptor, I2cBusCfg}; use ast10x0_peripherals::i2c::{ClockConfig, I2cConfig, I2cSpeed, I2cXferMode}; use ast10x0_peripherals::scu::pinctrl; @@ -46,7 +47,9 @@ impl TargetInterface for Target { } codegen::start(); - loop {} + loop { + let _ = kernel::sleep_until(Arch, kernel::Instant::MAX); + } } fn shutdown(code: u32) -> ! { diff --git a/target/ast10x0/tests/spdm/responder/target.rs b/target/ast10x0/tests/spdm/responder/target.rs index b7b25c9e1..0d5b8c3a2 100644 --- a/target/ast10x0/tests/spdm/responder/target.rs +++ b/target/ast10x0/tests/spdm/responder/target.rs @@ -6,6 +6,7 @@ #![no_std] #![no_main] +use arch_arm_cortex_m::Arch; use console_backend::console_backend_write_all; use entry as _; use target_common::{declare_target, TargetInterface}; @@ -17,8 +18,12 @@ impl TargetInterface for Target { fn main() -> ! { codegen::start(); - #[expect(clippy::empty_loop)] - loop {} + // The bootstrap thread has nothing left to do. Sleep rather than spin: a + // spinning thread at the same priority as the app threads takes a time + // slice at every scheduler tick and delays every wake-up behind it. + loop { + let _ = kernel::sleep_until(Arch, kernel::Instant::MAX); + } } fn shutdown(code: u32) -> ! { diff --git a/target/ast10x0/tests/spdm/vca/target.rs b/target/ast10x0/tests/spdm/vca/target.rs index 665fd6556..f55a808e7 100644 --- a/target/ast10x0/tests/spdm/vca/target.rs +++ b/target/ast10x0/tests/spdm/vca/target.rs @@ -4,6 +4,7 @@ #![no_std] #![no_main] +use arch_arm_cortex_m::Arch; use ast10x0_board::{Ast10x0Board, Ast10x0BoardDescriptor, I2cBusCfg}; use ast10x0_peripherals::i2c::{ClockConfig, I2cConfig, I2cSpeed, I2cXferMode}; use ast10x0_peripherals::scu::pinctrl; @@ -46,7 +47,9 @@ impl TargetInterface for Target { } codegen::start(); - loop {} + loop { + let _ = kernel::sleep_until(Arch, kernel::Instant::MAX); + } } fn shutdown(code: u32) -> ! { diff --git a/target/ast10x0/tests/stress/ipc/user/target.rs b/target/ast10x0/tests/stress/ipc/user/target.rs index fd56688f5..f67e46e3e 100644 --- a/target/ast10x0/tests/stress/ipc/user/target.rs +++ b/target/ast10x0/tests/stress/ipc/user/target.rs @@ -4,6 +4,7 @@ #![no_std] #![no_main] +use arch_arm_cortex_m::Arch; use console_backend::console_backend_write_all; use entry as _; use target_common::{declare_target, TargetInterface}; @@ -15,8 +16,12 @@ impl TargetInterface for Target { fn main() -> ! { codegen::start(); - #[expect(clippy::empty_loop)] - loop {} + // The bootstrap thread has nothing left to do. Sleep rather than spin: a + // spinning thread at the same priority as the app threads takes a time + // slice at every scheduler tick and delays every wake-up behind it. + loop { + let _ = kernel::sleep_until(Arch, kernel::Instant::MAX); + } } fn shutdown(code: u32) -> ! { diff --git a/target/ast10x0/tests/stress/process_termination/user/target.rs b/target/ast10x0/tests/stress/process_termination/user/target.rs index 66657f16b..a733ff061 100644 --- a/target/ast10x0/tests/stress/process_termination/user/target.rs +++ b/target/ast10x0/tests/stress/process_termination/user/target.rs @@ -4,6 +4,7 @@ #![no_std] #![no_main] +use arch_arm_cortex_m::Arch; use console_backend::console_backend_write_all; use entry as _; use target_common::{declare_target, TargetInterface}; @@ -15,8 +16,12 @@ impl TargetInterface for Target { fn main() -> ! { codegen::start(); - #[expect(clippy::empty_loop)] - loop {} + // The bootstrap thread has nothing left to do. Sleep rather than spin: a + // spinning thread at the same priority as the app threads takes a time + // slice at every scheduler tick and delays every wake-up behind it. + loop { + let _ = kernel::sleep_until(Arch, kernel::Instant::MAX); + } } fn shutdown(code: u32) -> ! { diff --git a/target/ast10x0/tests/usart/target.rs b/target/ast10x0/tests/usart/target.rs index 2ab9dc6be..14b9bda3d 100644 --- a/target/ast10x0/tests/usart/target.rs +++ b/target/ast10x0/tests/usart/target.rs @@ -9,6 +9,7 @@ #![no_std] #![no_main] +use arch_arm_cortex_m::Arch; use cortex_m_semihosting::debug::{exit, EXIT_FAILURE, EXIT_SUCCESS}; use target_common::{declare_target, TargetInterface}; use {console_backend as _, entry as _}; @@ -20,8 +21,12 @@ impl TargetInterface for Target { fn main() -> ! { codegen::start(); - #[expect(clippy::empty_loop)] - loop {} + // The bootstrap thread has nothing left to do. Sleep rather than spin: a + // spinning thread at the same priority as the app threads takes a time + // slice at every scheduler tick and delays every wake-up behind it. + loop { + let _ = kernel::sleep_until(Arch, kernel::Instant::MAX); + } } fn shutdown(code: u32) -> ! { diff --git a/target/ast10x0/tests/util_ipc/async_transaction/target.rs b/target/ast10x0/tests/util_ipc/async_transaction/target.rs index 022a30193..6c82afb58 100644 --- a/target/ast10x0/tests/util_ipc/async_transaction/target.rs +++ b/target/ast10x0/tests/util_ipc/async_transaction/target.rs @@ -10,6 +10,7 @@ #![no_std] #![no_main] +use arch_arm_cortex_m::Arch; use console_backend::console_backend_write_all; use entry as _; use target_common::{declare_target, TargetInterface}; @@ -21,8 +22,12 @@ impl TargetInterface for Target { fn main() -> ! { codegen::start(); - #[expect(clippy::empty_loop)] - loop {} + // The bootstrap thread has nothing left to do. Sleep rather than spin: a + // spinning thread at the same priority as the app threads takes a time + // slice at every scheduler tick and delays every wake-up behind it. + loop { + let _ = kernel::sleep_until(Arch, kernel::Instant::MAX); + } } fn shutdown(code: u32) -> ! { diff --git a/target/earlgrey/syscall_latency/target.rs b/target/earlgrey/syscall_latency/target.rs index 0f76c1ab8..ce3f87c2f 100644 --- a/target/earlgrey/syscall_latency/target.rs +++ b/target/earlgrey/syscall_latency/target.rs @@ -3,6 +3,7 @@ #![no_std] #![no_main] +use arch_riscv::Arch; use target_common::{declare_target, TargetInterface}; use {console_backend as _, entry as _, kernel as _}; @@ -13,7 +14,12 @@ impl TargetInterface for Target { fn main() -> ! { codegen::start(); - loop {} + // The bootstrap thread has nothing left to do. Sleep rather than spin: a + // spinning thread at the same priority as the app threads takes a time + // slice at every scheduler tick and delays every wake-up behind it. + loop { + let _ = kernel::sleep_until(Arch, kernel::Instant::MAX); + } } fn shutdown(code: u32) -> ! { diff --git a/target/earlgrey/tests/drivers/gpio/target.rs b/target/earlgrey/tests/drivers/gpio/target.rs index 36a559e20..39d864ec5 100644 --- a/target/earlgrey/tests/drivers/gpio/target.rs +++ b/target/earlgrey/tests/drivers/gpio/target.rs @@ -3,6 +3,7 @@ #![no_std] #![no_main] +use arch_riscv::Arch; use target_common::{declare_target, TargetInterface}; use {console_backend as _, entry as _}; @@ -13,7 +14,12 @@ impl TargetInterface for Target { fn main() -> ! { codegen::start(); - loop {} + // The bootstrap thread has nothing left to do. Sleep rather than spin: a + // spinning thread at the same priority as the app threads takes a time + // slice at every scheduler tick and delays every wake-up behind it. + loop { + let _ = kernel::sleep_until(Arch, kernel::Instant::MAX); + } } } diff --git a/target/earlgrey/tests/ipc/user/target.rs b/target/earlgrey/tests/ipc/user/target.rs index 44a18258d..0cc2c03ba 100644 --- a/target/earlgrey/tests/ipc/user/target.rs +++ b/target/earlgrey/tests/ipc/user/target.rs @@ -3,6 +3,7 @@ #![no_std] #![no_main] +use arch_riscv::Arch; use target_common::{declare_target, TargetInterface}; use {console_backend as _, entry as _}; @@ -13,7 +14,12 @@ impl TargetInterface for Target { fn main() -> ! { codegen::start(); - loop {} + // The bootstrap thread has nothing left to do. Sleep rather than spin: a + // spinning thread at the same priority as the app threads takes a time + // slice at every scheduler tick and delays every wake-up behind it. + loop { + let _ = kernel::sleep_until(Arch, kernel::Instant::MAX); + } } fn shutdown(code: u32) -> ! { diff --git a/target/earlgrey/tests/uart/target.rs b/target/earlgrey/tests/uart/target.rs index 2e253d37f..6900744a7 100644 --- a/target/earlgrey/tests/uart/target.rs +++ b/target/earlgrey/tests/uart/target.rs @@ -3,6 +3,7 @@ #![no_std] #![no_main] +use arch_riscv::Arch; use target_common::{declare_target, TargetInterface}; use {console_backend as _, entry as _}; @@ -13,7 +14,12 @@ impl TargetInterface for Target { fn main() -> ! { codegen::start(); - loop {} + // The bootstrap thread has nothing left to do. Sleep rather than spin: a + // spinning thread at the same priority as the app threads takes a time + // slice at every scheduler tick and delays every wake-up behind it. + loop { + let _ = kernel::sleep_until(Arch, kernel::Instant::MAX); + } } fn shutdown(code: u32) -> ! { diff --git a/target/veer/ipc/user/target.rs b/target/veer/ipc/user/target.rs index bf55cb397..62e1eb099 100644 --- a/target/veer/ipc/user/target.rs +++ b/target/veer/ipc/user/target.rs @@ -3,6 +3,7 @@ #![no_std] #![no_main] +use arch_riscv::Arch; use console_backend as _; use entry::exit; use target_common::{declare_target, TargetInterface}; @@ -14,7 +15,12 @@ impl TargetInterface for Target { fn main() -> ! { codegen::start(); - loop {} + // The bootstrap thread has nothing left to do. Sleep rather than spin: a + // spinning thread at the same priority as the app threads takes a time + // slice at every scheduler tick and delays every wake-up behind it. + loop { + let _ = kernel::sleep_until(Arch, kernel::Instant::MAX); + } } fn shutdown(code: u32) -> ! { diff --git a/target/veer/syscall_latency/target.rs b/target/veer/syscall_latency/target.rs index 5f4ddbf1b..8d27029b3 100644 --- a/target/veer/syscall_latency/target.rs +++ b/target/veer/syscall_latency/target.rs @@ -3,6 +3,7 @@ #![no_std] #![no_main] +use arch_riscv::Arch; use entry::exit; use target_common::{declare_target, TargetInterface}; use {console_backend as _, kernel as _}; @@ -14,7 +15,12 @@ impl TargetInterface for Target { fn main() -> ! { codegen::start(); - loop {} + // The bootstrap thread has nothing left to do. Sleep rather than spin: a + // spinning thread at the same priority as the app threads takes a time + // slice at every scheduler tick and delays every wake-up behind it. + loop { + let _ = kernel::sleep_until(Arch, kernel::Instant::MAX); + } } fn shutdown(code: u32) -> ! {