From 50dfe060f6887afba103bc94ecb6fd2fae4274d4 Mon Sep 17 00:00:00 2001 From: Daniel Schaefer Date: Sun, 11 Aug 2024 11:39:55 +0800 Subject: [PATCH] Add some more useful functions Signed-off-by: Daniel Schaefer --- uefi/src/proto/shell/mod.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/uefi/src/proto/shell/mod.rs b/uefi/src/proto/shell/mod.rs index effb14a5b..cf20c0f4a 100644 --- a/uefi/src/proto/shell/mod.rs +++ b/uefi/src/proto/shell/mod.rs @@ -174,4 +174,19 @@ impl Shell { // will always be initialized and valid. .to_result_with_val(|| unsafe { file_size.assume_init() }) } + + /// Major version of the shell + pub fn major_version(&self) -> u32 { + self.0.major_version + } + + /// Minor version of the shell + pub fn minor_version(&self) -> u32 { + self.0.minor_version + } + + /// Event to check if the user has requested execution to be stopped (CTRL-C) + pub fn execution_break(&self) -> Option { + unsafe { Event::from_ptr(self.0.execution_break) } + } }