Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aienux/blob/main/vendor/uefi-raw/src/protocol/hii/config.rs # aienux Aienux, the AienOS kernel: boot, scheduling, IPC and capability boundaries. Pre-alpha; host, emulator and physical evidence are labelled separately. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `aienux / vendor / uefi-raw / src / protocol / hii / config.rs` 147 lines ยท 5596 bytes Raw Blame History 1 // SPDX-License-Identifier: MIT OR Apache-2.0 2 3 //! Bindings for HII protocols relating to system configuration. 4 5 use super::QuestionId; 6 use super::form_browser::BrowserActionRequest; 7 use super::ifr::IfrTypeValue; 8 use crate::protocol::device_path::DevicePathProtocol; 9 use crate::{Char16, Guid, Status, guid, newtype_enum}; 10 11 /// EFI_CONFIG_KEYWORD_HANDLER_PROTOCOL 12 #[derive(Debug)] 13 #[repr(C)] 14 pub struct ConfigKeywordHandlerProtocol { 15 pub set_data: unsafe extern "efiapi" fn( 16 this: *mut Self, 17 keyword_string: *const Char16, 18 progress: *mut *const Char16, 19 progress_err: *mut u32, 20 ) -> Status, 21 pub get_data: unsafe extern "efiapi" fn( 22 this: *const Self, 23 namespace_id: *const Char16, 24 keyword_string: *const Char16, 25 progress: *mut *const Char16, 26 progress_err: *mut u32, 27 results: *mut *mut Char16, 28 ) -> Status, 29 } 30 31 impl ConfigKeywordHandlerProtocol { 32 pub const GUID: Guid = guid!("`0a8badd5`-03b8-4d19-b128-`7b8f0edaa596`"); 33 } 34 35 newtype_enum! { 36 /// Type of action taken by the form browser 37 #[derive(Default)] 38 pub enum BrowserAction: usize => { 39 /// Called before the browser changes the value in the display (for questions which have a value) 40 /// or takes an action (in the case of an action button or cross-reference). 41 /// If EFI_SUCCESS is returned, the browser uses the value returned by Callback(). 42 CHANGING = 0, 43 /// Called after the browser has changed its internal copy of the question value and displayed it (if appropriate). 44 /// For action buttons, this is called after processing. Errors are ignored. 45 CHANGED = 1, 46 /// Called after the browser has read the current question value but before displaying it. 47 /// If EFI_SUCCESS is returned, the updated value is used. 48 RETRIEVE = 2, 49 /// Called for each question on a form prior to its value being retrieved or displayed. 50 /// If a question appears on more than one form, this may be called more than once. 51 FORM_OPEN = 3, 52 /// Called for each question on a form after processing any submit actions for that form. 53 /// If a question appears on multiple forms, this will be called more than once. 54 FORM_CLOSE = 4, 55 /// Called after the browser submits the modified question value. 56 /// ActionRequest is ignored. 57 SUBMITTED = 5, 58 /// Represents the standard default action, selecting a default value based on lower-priority methods. 59 DEFAULT_STANDARD = 0x1000, 60 /// Represents the manufacturing default action, selecting a default value relevant to manufacturing. 61 DEFAULT_MANUFACTURING = 0x1001, 62 /// Represents the safe default action, selecting the safest possible default value. 63 DEFAULT_SAFE = 0x1002, 64 /// Represents platform-defined default values within a range of possible store identifiers. 65 DEFAULT_PLATFORM = 0x2000, 66 /// Represents hardware-defined default values within a range of possible store identifiers. 67 DEFAULT_HARDWARE = 0x3000, 68 /// Represents firmware-defined default values within a range of possible store identifiers. 69 DEFAULT_FIRMWARE = 0x4000, 70 } 71 } 72 73 /// EFI_HII_CONFIG_ACCESS_PROTOCOL 74 #[derive(Debug)] 75 #[repr(C)] 76 pub struct HiiConfigAccessProtocol { 77 pub extract_config: unsafe extern "efiapi" fn( 78 this: *const Self, 79 request: *const Char16, 80 progress: *mut *const Char16, 81 results: *mut *mut Char16, 82 ) -> Status, 83 pub route_config: unsafe extern "efiapi" fn( 84 this: *const Self, 85 configuration: *const Char16, 86 progress: *mut *const Char16, 87 ) -> Status, 88 pub callback: unsafe extern "efiapi" fn( 89 this: *const Self, 90 action: BrowserAction, 91 question_id: QuestionId, 92 value_type: u8, 93 value: *mut IfrTypeValue, 94 action_request: *mut BrowserActionRequest, 95 ) -> Status, 96 } 97 98 impl HiiConfigAccessProtocol { 99 pub const GUID: Guid = guid!("`330d4706`-f2a0-4e4f-a369-`b66fa8d54385`"); 100 } 101 102 /// EFI_HII_CONFIG_ROUTING_PROTOCOL 103 #[derive(Debug)] 104 #[repr(C)] 105 pub struct HiiConfigRoutingProtocol { 106 pub extract_config: unsafe extern "efiapi" fn( 107 this: *const Self, 108 config_request: *const Char16, 109 progress: *mut *const Char16, 110 results: *mut *mut Char16, 111 ) -> Status, 112 pub export_config: 113 unsafe extern "efiapi" fn(this: *const Self, results: *mut *mut Char16) -> Status, 114 pub route_config: unsafe extern "efiapi" fn( 115 this: *const Self, 116 configuration: *const Char16, 117 progress: *mut *const Char16, 118 ) -> Status, 119 pub block_to_config: unsafe extern "efiapi" fn( 120 this: *const Self, 121 config_request: *const Char16, 122 block: *const u8, 123 block_size: usize, 124 config: *mut *mut Char16, 125 progress: *mut *const Char16, 126 ) -> Status, 127 pub config_to_block: unsafe extern "efiapi" fn( 128 this: *const Self, 129 config_resp: *const Char16, 130 block: *mut u8, 131 block_size: *mut usize, 132 progress: *mut *const Char16, 133 ) -> Status, 134 pub get_alt_cfg: unsafe extern "efiapi" fn( 135 this: *const Self, 136 config_resp: *const Char16, 137 guid: *const Guid, 138 name: *const Char16, 139 device_path: *const DevicePathProtocol, 140 alt_cfg_id: *const Char16, 141 alt_cfg_resp: *mut *mut Char16, 142 ) -> Status, 143 } 144 145 impl HiiConfigRoutingProtocol { 146 pub const GUID: Guid = guid!("`587e72d7`-cc50-4f79-8209-`ca291fc1a10f`"); 147 }