forked from rust-osdev/uefi-rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
uefi-raw: Add SimpleTextInputProtocol and SimpleTextOutputProtocol
- Loading branch information
1 parent
50657ce
commit f064301
Showing
2 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
use crate::{guid, Char16, Event, Guid, Status}; | ||
|
||
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] | ||
#[repr(C)] | ||
pub struct InputKey { | ||
pub scan_code: u16, | ||
pub unicode_char: Char16, | ||
} | ||
|
||
#[repr(C)] | ||
pub struct SimpleTextInputProtocol { | ||
pub reset: unsafe extern "efiapi" fn(this: *mut Self, extended_verification: bool) -> Status, | ||
pub read_key_stroke: unsafe extern "efiapi" fn(this: *mut Self, key: *mut InputKey) -> Status, | ||
pub wait_for_key: Event, | ||
} | ||
|
||
impl SimpleTextInputProtocol { | ||
pub const GUID: Guid = guid!("387477c1-69c7-11d2-8e39-00a0c969723b"); | ||
} | ||
|
||
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)] | ||
#[repr(C)] | ||
pub struct SimpleTextOutputMode { | ||
pub max_mode: i32, | ||
pub mode: i32, | ||
pub attribute: i32, | ||
pub cursor_column: i32, | ||
pub cursor_row: i32, | ||
pub cursor_visible: bool, | ||
} | ||
|
||
#[repr(C)] | ||
pub struct SimpleTextOutputProtocol { | ||
pub reset: unsafe extern "efiapi" fn(this: *mut Self, extended: bool) -> Status, | ||
pub output_string: unsafe extern "efiapi" fn(this: *mut Self, string: *const Char16) -> Status, | ||
pub test_string: unsafe extern "efiapi" fn(this: *mut Self, string: *const Char16) -> Status, | ||
pub query_mode: unsafe extern "efiapi" fn( | ||
this: *mut Self, | ||
mode: usize, | ||
columns: *mut usize, | ||
rows: *mut usize, | ||
) -> Status, | ||
pub set_mode: unsafe extern "efiapi" fn(this: *mut Self, mode: usize) -> Status, | ||
pub set_attribute: unsafe extern "efiapi" fn(this: *mut Self, attribute: usize) -> Status, | ||
pub clear_screen: unsafe extern "efiapi" fn(this: *mut Self) -> Status, | ||
pub set_cursor_position: | ||
unsafe extern "efiapi" fn(this: *mut Self, column: usize, row: usize) -> Status, | ||
pub enable_cursor: unsafe extern "efiapi" fn(this: *mut Self, visible: bool) -> Status, | ||
pub mode: *mut SimpleTextOutputMode, | ||
} | ||
|
||
impl SimpleTextOutputProtocol { | ||
pub const GUID: Guid = guid!("387477c2-69c7-11d2-8e39-00a0c969723b"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters