Skip to main content

guest_test_uefi/uefi/
mod.rs

1// Copyright (c) Microsoft Corporation.
2// Licensed under the MIT License.
3
4mod action;
5mod hibernate;
6mod rt;
7mod splash;
8mod tests;
9
10use core::num::NonZeroU8;
11use splash::Splashes;
12use uefi::Status;
13use uefi::entry;
14use uefi::println;
15use uefi::system;
16
17#[entry]
18fn uefi_main() -> Status {
19    println!("UEFI vendor = {}", system::firmware_vendor());
20    println!("UEFI revision = {:x}", system::firmware_revision());
21
22    // Attempt to draw a pretty splash screen. Not always possible (e.g: when
23    // running UEFI on a VM without a gfx adapter - such as in CI).
24    splash::draw_splash(Splashes(NonZeroU8::new(1).unwrap()));
25
26    match action::selected_action() {
27        action::GuestAction::Hibernate => hibernate::hibernate(),
28        action::GuestAction::RunTests => tests::run_tests(),
29    }
30
31    Status::SUCCESS
32}