MCPcopy Create free account
hub / github.com/FrameworkComputer/framework-system / get_shell_protocol

Function get_shell_protocol

framework_lib/src/fw_uefi/mod.rs:27–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

25}
26
27fn get_shell_protocol() -> &'static ShellProtocol {
28 let handle = boot::get_handle_for_protocol::<Shell>().expect("No Shell handles");
29
30 // Use GetProtocol instead of Exclusive since we're running inside the shell
31 let shell = unsafe {
32 boot::open_protocol::<Shell>(
33 OpenProtocolParams {
34 handle,
35 agent: boot::image_handle(),
36 controller: None,
37 },
38 OpenProtocolAttributes::GetProtocol,
39 )
40 .expect("Failed to open Shell protocol")
41 };
42
43 // SAFETY: The Shell wrapper contains the raw ShellProtocol
44 unsafe {
45 let proto: &ShellProtocol = core::mem::transmute(shell.get().unwrap());
46 // Leak to get 'static lifetime - protocol stays valid while shell is running
47 core::mem::forget(shell);
48 proto
49 }
50}
51
52/// Returns true when the execution break was requested, false otherwise
53pub fn shell_get_execution_break_flag() -> bool {

Callers 2

enable_page_breakFunction · 0.70

Calls 1

getMethod · 0.80

Tested by

no test coverage detected