aienux
Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately.
Brought by drakestapleton
aienux / vendor / uefi-raw / src / protocol / hii / popup.rs
| 1 | // SPDX-License-Identifier: MIT OR Apache-2.0 |
| 2 | |
| 3 | //! Popup protocol |
| 4 | |
| 5 | use super::{HiiHandle, StringId}; |
| 6 | use crate::{Guid, Status, guid, newtype_enum}; |
| 7 | |
| 8 | newtype_enum! { |
| 9 | /// EFI_HII_POPUP_STYLE |
| 10 | pub enum HiiPopupStyle: u32 => { |
| 11 | INFO = 0, |
| 12 | WARNING = 1, |
| 13 | ERROR = 2, |
| 14 | } |
| 15 | } |
| 16 | |
| 17 | newtype_enum! { |
| 18 | /// EFI_HII_POPUP_TYPE |
| 19 | pub enum HiiPopupType: u32 => { |
| 20 | OK = 0, |
| 21 | OK_CANCEL = 1, |
| 22 | YES_NO = 2, |
| 23 | YES_NO_CANCEL = 3, |
| 24 | } |
| 25 | } |
| 26 | |
| 27 | newtype_enum! { |
| 28 | /// EFI_HII_POPUP_SELECTION |
| 29 | pub enum HiiPopupSelection: u32 => { |
| 30 | OK = 0, |
| 31 | CANCEL = 1, |
| 32 | YES = 2, |
| 33 | NO = 3, |
| 34 | } |
| 35 | } |
| 36 | |
| 37 | /// EFI_HII_POPUP_PROTOCOL |
| 38 | #[derive(Debug)] |
| 39 | #[repr(C)] |
| 40 | pub struct HiiPopupProtocol { |
| 41 | pub revision: u64, |
| 42 | pub create_popup: unsafe extern "efiapi" fn( |
| 43 | this: *const Self, |
| 44 | popup_style: HiiPopupStyle, |
| 45 | popup_type: HiiPopupType, |
| 46 | hii_handle: HiiHandle, |
| 47 | message: StringId, |
| 48 | user_selection: *mut HiiPopupSelection, |
| 49 | ) -> Status, |
| 50 | } |
| 51 | |
| 52 | impl HiiPopupProtocol { |
| 53 | pub const GUID: Guid = guid!("4311edc0-6054-46d4-9e40-893ea952fccc"); |
| 54 | pub const REVISION: u64 = 1; |
| 55 | } |