Skip to content

Commit cf3e60a

Browse files
committed
uefi: Fix shell_get_execution_break_flag() to check execution_break event
get_page_break only returns whether page break mode is enabled, not whether the user requested an execution break (e.g. by pressing 'q' during pagination or Ctrl+C). Use boot::check_event on the execution_break Event instead, matching the edk2 ShellGetExecutionBreakFlag implementation. Signed-off-by: Daniel Schaefer <dhs@frame.work>
1 parent 74245be commit cf3e60a

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • framework_lib/src/fw_uefi

framework_lib/src/fw_uefi/mod.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,13 @@ fn get_shell_protocol() -> &'static ShellProtocol {
3939
/// Returns true when the execution break was requested, false otherwise
4040
pub fn shell_get_execution_break_flag() -> bool {
4141
let shell = get_shell_protocol();
42-
unsafe { (shell.get_page_break)().into() }
42+
let raw_event = shell.execution_break;
43+
// SAFETY: The execution_break event is created by the shell and remains valid
44+
if let Some(event) = unsafe { uefi::Event::from_ptr(raw_event) } {
45+
boot::check_event(event).unwrap_or(false)
46+
} else {
47+
false
48+
}
4349
}
4450

4551
/// Enable pagination in UEFI shell

0 commit comments

Comments
 (0)