diff options
Diffstat (limited to '')
| -rw-r--r-- | rsnix/src/uefi.rs | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/rsnix/src/uefi.rs b/rsnix/src/uefi.rs index 619739e..b1b5e48 100644 --- a/rsnix/src/uefi.rs +++ b/rsnix/src/uefi.rs | |||
| @@ -86,12 +86,42 @@ pub struct SimpleTextInput { | |||
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | // --------------------------------------------------------------------------- | 88 | // --------------------------------------------------------------------------- |
| 89 | // Runtime services (stub — we don't use them) | 89 | // Runtime services |
| 90 | // --------------------------------------------------------------------------- | 90 | // --------------------------------------------------------------------------- |
| 91 | |||
| 92 | /// `EFI_RESET_SYSTEM` — ResetType, ResetStatus, DataSize, ResetData. | ||
| 93 | /// ResetType: 0 cold, 1 warm, 2 shutdown, 3 platform-specific. | ||
| 94 | pub type EfiResetSystem = | ||
| 95 | unsafe extern "efiapi" fn(u32, u64, usize, *const u16) -> Status; | ||
| 96 | |||
| 97 | pub const RESET_COLD: u32 = 0; | ||
| 98 | #[allow(dead_code)] | ||
| 99 | pub const RESET_WARM: u32 = 1; | ||
| 100 | pub const RESET_SHUTDOWN: u32 = 2; | ||
| 101 | #[allow(dead_code)] | ||
| 102 | pub const RESET_PLATFORM_SPECIFIC: u32 = 3; | ||
| 103 | |||
| 104 | /// EFI_RUNTIME_SERVICES — function pointers in spec order after the header. | ||
| 105 | /// We only use ResetSystem; the rest stay opaque. The table remains | ||
| 106 | /// callable after ExitBootServices because we never call SetVirtualAddressMap, | ||
| 107 | /// so the pointers keep working with physical (identity) addresses. | ||
| 91 | #[repr(C)] | 108 | #[repr(C)] |
| 92 | pub struct RuntimeServices { | 109 | pub struct RuntimeServices { |
| 93 | _hdr: TableHeader, | 110 | _hdr: TableHeader, |
| 94 | _reserved: [*mut c_void; 30], | 111 | _get_time: *mut c_void, // 0 |
| 112 | _set_time: *mut c_void, // 1 | ||
| 113 | _get_wakeup_time: *mut c_void, // 2 | ||
| 114 | _set_wakeup_time: *mut c_void, // 3 | ||
| 115 | _set_virtual_address_map: *mut c_void, // 4 | ||
| 116 | _convert_pointer: *mut c_void, // 5 | ||
| 117 | _get_variable: *mut c_void, // 6 | ||
| 118 | _get_next_variable_name: *mut c_void, // 7 | ||
| 119 | _set_variable: *mut c_void, // 8 | ||
| 120 | _get_next_high_monotonic_count: *mut c_void, // 9 | ||
| 121 | pub reset_system: EfiResetSystem, // 10 | ||
| 122 | _update_capsule: *mut c_void, // 11 | ||
| 123 | _query_capsule_capabilities: *mut c_void, // 12 | ||
| 124 | _query_variable_info: *mut c_void, // 13 | ||
| 95 | } | 125 | } |
| 96 | 126 | ||
| 97 | // --------------------------------------------------------------------------- | 127 | // --------------------------------------------------------------------------- |
