Skip to content

Commit c52c71e

Browse files
authored
Merge pull request #1296 from nicholasbishop/bishop-boot-stall
boot: Add freestanding stall
2 parents d4ae463 + 6ca1cfb commit c52c71e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

uefi/src/boot.rs

+12
Original file line numberDiff line numberDiff line change
@@ -521,6 +521,18 @@ pub unsafe fn exit(
521521
)
522522
}
523523

524+
/// Stalls execution for the given number of microseconds.
525+
pub fn stall(microseconds: usize) {
526+
let bt = boot_services_raw_panicking();
527+
let bt = unsafe { bt.as_ref() };
528+
529+
unsafe {
530+
// No error conditions are defined in the spec for this function, so
531+
// ignore the status.
532+
let _ = (bt.stall)(microseconds);
533+
}
534+
}
535+
524536
/// A buffer returned by [`locate_handle_buffer`] that contains an array of
525537
/// [`Handle`]s that support the requested protocol.
526538
#[derive(Debug, Eq, PartialEq)]

0 commit comments

Comments
 (0)