Skip to main content

r_efi/
system.rs

1//! UEFI System Integration
2//!
3//! This header defines the structures and types of the surrounding system of an UEFI application.
4//! It contains the definitions of the system table, the runtime and boot services, as well as
5//! common types.
6//!
7//! We do not document the behavior of each of these types and functions. They follow the UEFI
8//! specification, which does a well-enough job of documenting each. This file just provides you
9//! the rust definitions of each symbol and some limited hints on some pecularities.
10
11//
12// Time Management
13//
14// UEFI time management is modeled around the EFI_TIME structure, which represents any arbitrary
15// timestamp. The runtime and boot services provide helper functions to query and set the system
16// time.
17//
18
19pub const TIME_ADJUST_DAYLIGHT: u8 = 0x01u8;
20pub const TIME_IN_DAYLIGHT: u8 = 0x02u8;
21
22pub const UNSPECIFIED_TIMEZONE: i16 = 0x07ffi16;
23
24// Cannot derive `Eq` etc. due to uninitialized `pad2` field.
25#[repr(C)]
26#[derive(Clone, Copy, Debug, Default)]
27pub struct Time {
28    pub year: u16,
29    pub month: u8,
30    pub day: u8,
31    pub hour: u8,
32    pub minute: u8,
33    pub second: u8,
34    pub pad1: u8,
35    pub nanosecond: u32,
36    pub timezone: i16,
37    pub daylight: u8,
38    pub pad2: u8,
39}
40
41#[repr(C)]
42#[derive(Clone, Copy, Debug)]
43pub struct TimeCapabilities {
44    pub resolution: u32,
45    pub accuracy: u32,
46    pub sets_to_zero: crate::base::Boolean,
47}
48
49//
50// UEFI Variables
51//
52// UEFI systems provide a way to store global variables. These can be persistent or volatile. The
53// variable store must be provided by the platform, but persistent storage might not be available.
54//
55
56pub const VARIABLE_NON_VOLATILE: u32 = 0x00000001u32;
57pub const VARIABLE_BOOTSERVICE_ACCESS: u32 = 0x00000002u32;
58pub const VARIABLE_RUNTIME_ACCESS: u32 = 0x00000004u32;
59pub const VARIABLE_HARDWARE_ERROR_RECORD: u32 = 0x00000008u32;
60pub const VARIABLE_AUTHENTICATED_WRITE_ACCESS: u32 = 0x00000010u32;
61pub const VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS: u32 = 0x00000020u32;
62pub const VARIABLE_APPEND_WRITE: u32 = 0x00000040u32;
63pub const VARIABLE_ENHANCED_AUTHENTICATED_ACCESS: u32 = 0x00000080u32;
64
65pub const VARIABLE_AUTHENTICATION_3_CERT_ID_SHA256: u32 = 0x1u32;
66
67#[repr(C)]
68#[derive(Clone, Copy, Debug)]
69pub struct VariableAuthentication3CertId<const N: usize = 0> {
70    pub r#type: u8,
71    pub id_size: u32,
72    pub id: [u8; N],
73}
74
75#[repr(C)]
76#[derive(Clone, Copy, Debug)]
77pub struct VariableAuthentication<const N: usize = 0> {
78    pub monotonic_count: u64,
79    pub auth_info: [u8; N], // WIN_CERTIFICATE_UEFI_ID from PE/COFF
80}
81
82#[repr(C)]
83#[derive(Clone, Copy, Debug)]
84pub struct VariableAuthentication2<const N: usize = 0> {
85    pub timestamp: Time,
86    pub auth_info: [u8; N], // WIN_CERTIFICATE_UEFI_ID from PE/COFF
87}
88
89pub const VARIABLE_AUTHENTICATION_3_TIMESTAMP_TYPE: u32 = 0x1u32;
90pub const VARIABLE_AUTHENTICATION_3_NONCE_TYPE: u32 = 0x2u32;
91
92#[repr(C)]
93#[derive(Clone, Copy, Debug)]
94pub struct VariableAuthentication3 {
95    pub version: u8,
96    pub r#type: u8,
97    pub metadata_size: u32,
98    pub flags: u32,
99}
100
101#[repr(C)]
102#[derive(Clone, Copy, Debug)]
103pub struct VariableAuthentication3Nonce<const N: usize = 0> {
104    pub nonce_size: u32,
105    pub nonce: [u8; N],
106}
107
108pub const HARDWARE_ERROR_VARIABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
109    0x414E6BDD,
110    0xE47B,
111    0x47cc,
112    0xB2,
113    0x44,
114    &[0xBB, 0x61, 0x02, 0x0C, 0xF5, 0x16],
115);
116
117pub const GLOBAL_VARIABLE: crate::base::Guid = crate::base::Guid::from_fields(
118    0x8BE4DF61,
119    0x93CA,
120    0x11d2,
121    0xAA,
122    0x0D,
123    &[0x00, 0xE0, 0x98, 0x03, 0x2B, 0x8C],
124);
125
126//
127// Boot Manager
128//
129// The UEFI Boot Manager uses load options to describe boot and driver entries. Each load option
130// variable (Boot####, Driver####) contains an EFI_LOAD_OPTION descriptor with attributes that
131// control how the option is processed.
132//
133
134pub const LOAD_OPTION_ACTIVE: u32 = 0x00000001u32;
135pub const LOAD_OPTION_FORCE_RECONNECT: u32 = 0x00000002u32;
136pub const LOAD_OPTION_HIDDEN: u32 = 0x00000008u32;
137pub const LOAD_OPTION_CATEGORY: u32 = 0x00001F00u32;
138pub const LOAD_OPTION_CATEGORY_BOOT: u32 = 0x00000000u32;
139pub const LOAD_OPTION_CATEGORY_APP: u32 = 0x00000100u32;
140
141//
142// Virtual Mappings
143//
144// UEFI runs in an 1-to-1 mapping from virtual to physical addresses. But once you exit boot
145// services, you can apply any address mapping you want, as long as you inform UEFI about it (or,
146// alternatively, stop using the UEFI runtime services).
147//
148
149pub const OPTIONAL_POINTER: u32 = 0x00000001u32;
150
151//
152// System Reset
153//
154// UEFI provides access to firmware functions to reset the system. This includes a wide variety of
155// different possible resets.
156//
157
158pub type ResetType = u32;
159
160pub const RESET_COLD: ResetType = 0x00000000;
161pub const RESET_WARM: ResetType = 0x00000001;
162pub const RESET_SHUTDOWN: ResetType = 0x00000002;
163pub const RESET_PLATFORM_SPECIFIC: ResetType = 0x00000003;
164
165//
166// Update Capsules
167//
168// The process of firmware updates is generalized in UEFI. There are small blobs called capsules
169// that you can push into the firmware to be run either immediately or on next reboot.
170//
171
172#[repr(C)]
173#[derive(Clone, Copy)]
174pub union CapsuleBlockDescriptorUnion {
175    pub data_block: crate::base::PhysicalAddress,
176    pub continuation_pointer: crate::base::PhysicalAddress,
177}
178
179#[repr(C)]
180#[derive(Clone, Copy)]
181pub struct CapsuleBlockDescriptor {
182    pub length: u64,
183    pub data: CapsuleBlockDescriptorUnion,
184}
185
186pub const CAPSULE_FLAGS_PERSIST_ACROSS_RESET: u32 = 0x00010000u32;
187pub const CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE: u32 = 0x00020000u32;
188pub const CAPSULE_FLAGS_INITIATE_RESET: u32 = 0x00040000u32;
189
190#[repr(C)]
191#[derive(Clone, Copy, Debug)]
192pub struct CapsuleHeader {
193    pub capsule_guid: crate::base::Guid,
194    pub header_size: u32,
195    pub flags: u32,
196    pub capsule_image_size: u32,
197}
198
199pub const OS_INDICATIONS_BOOT_TO_FW_UI: u64 = 0x0000000000000001u64;
200pub const OS_INDICATIONS_TIMESTAMP_REVOCATION: u64 = 0x0000000000000002u64;
201pub const OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED: u64 = 0x0000000000000004u64;
202pub const OS_INDICATIONS_FMP_CAPSULE_SUPPORTED: u64 = 0x0000000000000008u64;
203pub const OS_INDICATIONS_CAPSULE_RESULT_VAR_SUPPORTED: u64 = 0x0000000000000010u64;
204pub const OS_INDICATIONS_START_OS_RECOVERY: u64 = 0x0000000000000020u64;
205pub const OS_INDICATIONS_START_PLATFORM_RECOVERY: u64 = 0x0000000000000040u64;
206
207pub const CAPSULE_REPORT_GUID: crate::base::Guid = crate::base::Guid::from_fields(
208    0x39b68c46,
209    0xf7fb,
210    0x441b,
211    0xb6,
212    0xec,
213    &[0x16, 0xb0, 0xf6, 0x98, 0x21, 0xf3],
214);
215
216#[repr(C)]
217#[derive(Clone, Copy, Debug)]
218pub struct CapsuleResultVariableHeader {
219    pub variable_total_size: u32,
220    pub reserved: u32,
221    pub capsule_guid: crate::base::Guid,
222    pub capsule_processed: Time,
223    pub capsule_status: crate::base::Status,
224}
225
226#[repr(C)]
227#[derive(Clone, Copy, Debug)]
228pub struct CapsuleResultVariableFMP<const N: usize = 0> {
229    pub version: u16,
230    pub payload_index: u8,
231    pub update_image_index: u8,
232    pub update_image_type_id: crate::base::Guid,
233    pub capsule_file_name_and_target: [crate::base::Char16; N],
234}
235
236//
237// Tasks
238//
239// UEFI uses a simplified task model, and only ever runs on a single CPU. Usually, there is only
240// one single task running on the system, which is the current execution. No interrupts are
241// supported, other than timer interrupts. That is, all device management must be reliant on
242// polling.
243//
244// You can, however, register callbacks to be run by the UEFI core. That is, either when execution
245// is returned to the UEFI core, or when a timer interrupt fires, the scheduler will run the
246// highest priority task next, interrupting the current task. You can use simple
247// task-priority-levels (TPL) to adjust the priority of your callbacks and current task.
248//
249
250pub const EVT_TIMER: u32 = 0x80000000u32;
251pub const EVT_RUNTIME: u32 = 0x40000000u32;
252pub const EVT_NOTIFY_WAIT: u32 = 0x00000100u32;
253pub const EVT_NOTIFY_SIGNAL: u32 = 0x00000200u32;
254pub const EVT_SIGNAL_EXIT_BOOT_SERVICES: u32 = 0x00000201u32;
255pub const EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE: u32 = 0x60000202u32;
256
257pub type EventNotify = unsafe extern "efiapi" fn(crate::base::Event, *mut core::ffi::c_void);
258
259pub const EVENT_GROUP_EXIT_BOOT_SERVICES: crate::base::Guid = crate::base::Guid::from_fields(
260    0x27abf055,
261    0xb1b8,
262    0x4c26,
263    0x80,
264    0x48,
265    &[0x74, 0x8f, 0x37, 0xba, 0xa2, 0xdf],
266);
267pub const EVENT_GROUP_BEFORE_EXIT_BOOT_SERVICES: crate::base::Guid = crate::base::Guid::from_fields(
268    0x8be0e274,
269    0x3970,
270    0x4b44,
271    0x80,
272    0xc5,
273    &[0x1a, 0xb9, 0x50, 0x2f, 0x3b, 0xfc],
274);
275pub const EVENT_GROUP_VIRTUAL_ADDRESS_CHANGE: crate::base::Guid = crate::base::Guid::from_fields(
276    0x13fa7698,
277    0xc831,
278    0x49c7,
279    0x87,
280    0xea,
281    &[0x8f, 0x43, 0xfc, 0xc2, 0x51, 0x96],
282);
283pub const EVENT_GROUP_MEMORY_MAP_CHANGE: crate::base::Guid = crate::base::Guid::from_fields(
284    0x78bee926,
285    0x692f,
286    0x48fd,
287    0x9e,
288    0xdb,
289    &[0x1, 0x42, 0x2e, 0xf0, 0xd7, 0xab],
290);
291pub const EVENT_GROUP_READY_TO_BOOT: crate::base::Guid = crate::base::Guid::from_fields(
292    0x7ce88fb3,
293    0x4bd7,
294    0x4679,
295    0x87,
296    0xa8,
297    &[0xa8, 0xd8, 0xde, 0xe5, 0x0d, 0x2b],
298);
299pub const EVENT_GROUP_AFTER_READY_TO_BOOT: crate::base::Guid = crate::base::Guid::from_fields(
300    0x3a2a00ad,
301    0x98b9,
302    0x4cdf,
303    0xa4,
304    0x78,
305    &[0x70, 0x27, 0x77, 0xf1, 0xc1, 0x0b],
306);
307pub const EVENT_GROUP_RESET_SYSTEM: crate::base::Guid = crate::base::Guid::from_fields(
308    0x62da6a56,
309    0x13fb,
310    0x485a,
311    0xa8,
312    0xda,
313    &[0xa3, 0xdd, 0x79, 0x12, 0xcb, 0x6b],
314);
315
316pub type TimerDelay = u32;
317
318pub const TIMER_CANCEL: TimerDelay = 0x00000000;
319pub const TIMER_PERIODIC: TimerDelay = 0x00000001;
320pub const TIMER_RELATIVE: TimerDelay = 0x00000002;
321
322pub const TPL_APPLICATION: crate::base::Tpl = 4;
323pub const TPL_CALLBACK: crate::base::Tpl = 8;
324pub const TPL_NOTIFY: crate::base::Tpl = 16;
325pub const TPL_HIGH_LEVEL: crate::base::Tpl = 31;
326
327//
328// Memory management
329//
330// The UEFI boot services provide you pool-allocation helpers to reserve memory. The region for
331// each allocation can be selected by the caller, allowing to reserve memory that even survives
332// beyond boot services. However, dynamic allocations can only performed via boot services, so no
333// dynamic modifications can be done once you exit boot services.
334//
335
336pub type AllocateType = u32;
337
338pub const ALLOCATE_ANY_PAGES: AllocateType = 0x00000000;
339pub const ALLOCATE_MAX_ADDRESS: AllocateType = 0x00000001;
340pub const ALLOCATE_ADDRESS: AllocateType = 0x00000002;
341
342pub type MemoryType = u32;
343
344pub const RESERVED_MEMORY_TYPE: MemoryType = 0x00000000;
345pub const LOADER_CODE: MemoryType = 0x00000001;
346pub const LOADER_DATA: MemoryType = 0x00000002;
347pub const BOOT_SERVICES_CODE: MemoryType = 0x00000003;
348pub const BOOT_SERVICES_DATA: MemoryType = 0x00000004;
349pub const RUNTIME_SERVICES_CODE: MemoryType = 0x00000005;
350pub const RUNTIME_SERVICES_DATA: MemoryType = 0x00000006;
351pub const CONVENTIONAL_MEMORY: MemoryType = 0x00000007;
352pub const UNUSABLE_MEMORY: MemoryType = 0x00000008;
353pub const ACPI_RECLAIM_MEMORY: MemoryType = 0x00000009;
354pub const ACPI_MEMORY_NVS: MemoryType = 0x0000000a;
355pub const MEMORY_MAPPED_IO: MemoryType = 0x0000000b;
356pub const MEMORY_MAPPED_IO_PORT_SPACE: MemoryType = 0x0000000c;
357pub const PAL_CODE: MemoryType = 0x0000000d;
358pub const PERSISTENT_MEMORY: MemoryType = 0x0000000e;
359pub const UNACCEPTED_MEMORY_TYPE: MemoryType = 0x0000000f;
360
361pub const MEMORY_UC: u64 = 0x0000000000000001u64;
362pub const MEMORY_WC: u64 = 0x0000000000000002u64;
363pub const MEMORY_WT: u64 = 0x0000000000000004u64;
364pub const MEMORY_WB: u64 = 0x0000000000000008u64;
365pub const MEMORY_UCE: u64 = 0x0000000000000010u64;
366pub const MEMORY_WP: u64 = 0x0000000000001000u64;
367pub const MEMORY_RP: u64 = 0x0000000000002000u64;
368pub const MEMORY_XP: u64 = 0x0000000000004000u64;
369pub const MEMORY_NV: u64 = 0x0000000000008000u64;
370pub const MEMORY_MORE_RELIABLE: u64 = 0x0000000000010000u64;
371pub const MEMORY_RO: u64 = 0x0000000000020000u64;
372pub const MEMORY_SP: u64 = 0x0000000000040000u64;
373pub const MEMORY_CPU_CRYPTO: u64 = 0x0000000000080000u64;
374pub const MEMORY_RUNTIME: u64 = 0x8000000000000000u64;
375pub const MEMORY_ISA_VALID: u64 = 0x4000000000000000u64;
376pub const MEMORY_ISA_MASK: u64 = 0x0FFFF00000000000u64;
377
378/// Mask of memory attributes that specify cacheability attributes. No symbol
379/// is defined by the spec, but the attributes are annotated in the spec. Note
380/// that `MEMORY_WP`, despite its name, is treated as cacheability attribute.
381/// Use `MEMORY_RO` as replacement access attribute (see the spec for details).
382pub const CACHE_ATTRIBUTE_MASK: u64 =
383    MEMORY_UC | MEMORY_WC | MEMORY_WT | MEMORY_WB | MEMORY_UCE | MEMORY_WP;
384
385/// Mask of memory attributes that specify access protection attributes. No
386/// symbol is defined by the spec, but the attributes are annotated in the
387/// spec. Note that `MEMORY_WP` is treated as cacheability attribute, and its
388/// access protection functionality is replaced by `MEMORY_RO`.
389pub const MEMORY_ACCESS_MASK: u64 = MEMORY_RP | MEMORY_XP | MEMORY_RO;
390
391/// Mask of memory attributes that specify properties of a memory region that
392/// can be managed via the CPU architecture protocol.
393pub const MEMORY_ATTRIBUTE_MASK: u64 = MEMORY_ACCESS_MASK | MEMORY_SP | MEMORY_CPU_CRYPTO;
394
395pub const MEMORY_DESCRIPTOR_VERSION: u32 = 0x00000001u32;
396
397#[repr(C)]
398#[derive(Clone, Copy, Debug)]
399pub struct MemoryDescriptor {
400    pub r#type: u32,
401    pub physical_start: crate::base::PhysicalAddress,
402    pub virtual_start: crate::base::VirtualAddress,
403    pub number_of_pages: u64,
404    pub attribute: u64,
405}
406
407//
408// Protocol Management
409//
410// The UEFI driver model provides ways to have bus-drivers, device-drivers, and applications as
411// separate, independent entities. They use protocols to communicate, and handles to refer to
412// common state. Drivers and devices can be registered dynamically at runtime, and can support
413// hotplugging.
414//
415
416pub type InterfaceType = u32;
417
418pub const NATIVE_INTERFACE: InterfaceType = 0x00000000;
419
420pub type LocateSearchType = u32;
421
422pub const ALL_HANDLES: LocateSearchType = 0x00000000;
423pub const BY_REGISTER_NOTIFY: LocateSearchType = 0x00000001;
424pub const BY_PROTOCOL: LocateSearchType = 0x00000002;
425
426pub const OPEN_PROTOCOL_BY_HANDLE_PROTOCOL: u32 = 0x00000001u32;
427pub const OPEN_PROTOCOL_GET_PROTOCOL: u32 = 0x00000002u32;
428pub const OPEN_PROTOCOL_TEST_PROTOCOL: u32 = 0x00000004u32;
429pub const OPEN_PROTOCOL_BY_CHILD_CONTROLLER: u32 = 0x00000008u32;
430pub const OPEN_PROTOCOL_BY_DRIVER: u32 = 0x00000010u32;
431pub const OPEN_PROTOCOL_EXCLUSIVE: u32 = 0x00000020u32;
432
433#[repr(C)]
434#[derive(Clone, Copy, Debug)]
435pub struct OpenProtocolInformationEntry {
436    pub agent_handle: crate::base::Handle,
437    pub controller_handle: crate::base::Handle,
438    pub attributes: u32,
439    pub open_count: u32,
440}
441
442//
443// Configuration Tables
444//
445// The system table contains an array of auxiliary tables, indexed by their GUID, called
446// configuration tables. Each table uses the generic ConfigurationTable structure as header.
447//
448
449#[repr(C)]
450#[derive(Clone, Copy, Debug)]
451pub struct ConfigurationTable {
452    pub vendor_guid: crate::base::Guid,
453    pub vendor_table: *mut core::ffi::c_void,
454}
455
456pub const RT_PROPERTIES_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
457    0xeb66918a,
458    0x7eef,
459    0x402a,
460    0x84,
461    0x2e,
462    &[0x93, 0x1d, 0x21, 0xc3, 0x8a, 0xe9],
463);
464
465pub const RT_PROPERTIES_TABLE_VERSION: u16 = 0x0001;
466
467pub const RT_SUPPORTED_GET_TIME: u32 = 0x0000001;
468pub const RT_SUPPORTED_SET_TIME: u32 = 0x0000002;
469pub const RT_SUPPORTED_GET_WAKEUP_TIME: u32 = 0x0000004;
470pub const RT_SUPPORTED_SET_WAKEUP_TIME: u32 = 0x0000008;
471pub const RT_SUPPORTED_GET_VARIABLE: u32 = 0x00000010;
472pub const RT_SUPPORTED_GET_NEXT_VARIABLE_NAME: u32 = 0x00000020;
473pub const RT_SUPPORTED_SET_VARIABLE: u32 = 0x00000040;
474pub const RT_SUPPORTED_SET_VIRTUAL_ADDRESS_MAP: u32 = 0x00000080;
475pub const RT_SUPPORTED_CONVERT_POINTER: u32 = 0x00000100;
476pub const RT_SUPPORTED_GET_NEXT_HIGH_MONOTONIC_COUNT: u32 = 0x00000200;
477pub const RT_SUPPORTED_RESET_SYSTEM: u32 = 0x00000400;
478pub const RT_SUPPORTED_UPDATE_CAPSULE: u32 = 0x00000800;
479pub const RT_SUPPORTED_QUERY_CAPSULE_CAPABILITIES: u32 = 0x00001000;
480pub const RT_SUPPORTED_QUERY_VARIABLE_INFO: u32 = 0x00002000;
481
482#[repr(C)]
483#[derive(Clone, Copy, Debug)]
484pub struct RtPropertiesTable {
485    pub version: u16,
486    pub length: u16,
487    pub runtime_services_supported: u32,
488}
489
490pub const PROPERTIES_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
491    0x880aaca3,
492    0x4adc,
493    0x4a04,
494    0x90,
495    0x79,
496    &[0xb7, 0x47, 0x34, 0x8, 0x25, 0xe5],
497);
498
499pub const PROPERTIES_TABLE_VERSION: u32 = 0x00010000u32;
500
501pub const PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA: u64 = 0x1u64;
502
503#[repr(C)]
504#[derive(Clone, Copy, Debug)]
505pub struct PropertiesTable {
506    pub version: u32,
507    pub length: u32,
508    pub memory_protection_attribute: u64,
509}
510
511pub const MEMORY_ATTRIBUTES_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
512    0xdcfa911d,
513    0x26eb,
514    0x469f,
515    0xa2,
516    0x20,
517    &[0x38, 0xb7, 0xdc, 0x46, 0x12, 0x20],
518);
519
520pub const MEMORY_ATTRIBUTES_TABLE_VERSION: u32 = 0x00000002u32;
521
522pub const MEMORY_ATTRIBUTES_FLAGS_RT_FORWARD_CONTROL_FLOW_GUARD: u32 = 0x00000001u32;
523
524#[repr(C)]
525#[derive(Clone, Copy, Debug)]
526pub struct MemoryAttributesTable<const N: usize = 0> {
527    pub version: u32,
528    pub number_of_entries: u32,
529    pub descriptor_size: u32,
530    pub flags: u32,
531    pub entry: [MemoryDescriptor; N],
532}
533
534pub const CONFORMANCE_PROFILES_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
535    0x36122546,
536    0xf7e7,
537    0x4c8f,
538    0xbd,
539    0x9b,
540    &[0xeb, 0x85, 0x25, 0xb5, 0x0c, 0x0b],
541);
542
543pub const CONFORMANCE_PROFILES_TABLE_VERSION: u16 = 0x0001;
544
545pub const CONFORMANCE_PROFILES_UEFI_SPEC_GUID: crate::base::Guid = crate::base::Guid::from_fields(
546    0x523c91af,
547    0xa195,
548    0x4382,
549    0x81,
550    0x8d,
551    &[0x29, 0x5f, 0xe4, 0x00, 0x64, 0x65],
552);
553
554#[repr(C)]
555#[derive(Clone, Copy, Debug)]
556pub struct ConformanceProfilesTable<const N: usize = 0> {
557    pub version: u16,
558    pub number_of_profiles: u16,
559    pub conformance_profiles: [crate::base::Guid; N],
560}
561
562pub const DEBUG_IMAGE_INFO_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
563    0x49152e77,
564    0x1ada,
565    0x4764,
566    0xb7,
567    0xa2,
568    &[0x7a, 0xfe, 0xfe, 0xd9, 0x5e, 0x8b],
569);
570
571pub const DEBUG_IMAGE_INFO_TYPE_NORMAL: u32 = 0x00000001;
572
573#[repr(C)]
574#[derive(Clone, Copy, Debug)]
575pub struct DebugImageInfoTableHeader {
576    // This is defined as volatile in the spec, but Rust does not have a
577    // concept of volatile fields. We use the `volatile_` prefix to indicate
578    // that the spec envisions this field being accessed via volatile reads and
579    // writes
580    pub volatile_update_status: u32,
581    pub table_size: u32,
582    pub debug_image_info_table: *mut DebugImageInfo,
583}
584
585pub const DEBUG_IMAGE_INFO_UPDATE_IN_PROGRESS: u32 = 0x00000001;
586pub const DEBUG_IMAGE_INFO_TABLE_MODIFIED: u32 = 0x00000002;
587
588#[repr(C)]
589#[derive(Clone, Copy, Debug)]
590pub struct DebugImageInfoNormal {
591    pub image_info_type: u32,
592    pub loaded_image_protocol_instance: *mut crate::protocols::loaded_image::Protocol,
593    pub image_handle: crate::base::Handle,
594}
595
596#[repr(C)]
597#[derive(Clone, Copy)]
598pub union DebugImageInfo {
599    pub image_info_type: *mut u32,
600    pub normal_image: *mut DebugImageInfoNormal,
601}
602
603#[repr(C)]
604#[derive(Clone, Copy, Debug)]
605pub struct SystemTablePointer {
606    pub signature: u64,
607    pub efi_system_table_base: crate::base::PhysicalAddress,
608    pub crc32: u32,
609}
610
611//
612// External Configuration Tables
613//
614// This lists the Guids of configuration tables of other industry standards, as listed in
615// the UEFI specification. See each standard for details on the data included in each table.
616//
617
618pub const ACPI_10_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
619    0xeb9d2d30,
620    0x2d88,
621    0x11d3,
622    0x9a,
623    0x16,
624    &[0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d],
625);
626
627pub const ACPI_20_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
628    0x8868e871,
629    0xe4f1,
630    0x11d3,
631    0xbc,
632    0x22,
633    &[0x00, 0x80, 0xc7, 0x3c, 0x88, 0x81],
634);
635
636pub const DTB_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
637    0xb1b621d5,
638    0xf19c,
639    0x41a5,
640    0x83,
641    0x0b,
642    &[0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0],
643);
644
645pub const JSON_CAPSULE_DATA_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
646    0x35e7a725,
647    0x8dd2,
648    0x4cac,
649    0x80,
650    0x11,
651    &[0x33, 0xcd, 0xa8, 0x10, 0x90, 0x56],
652);
653
654pub const JSON_CAPSULE_RESULT_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
655    0xdbc461c3,
656    0xb3de,
657    0x422a,
658    0xb9,
659    0xb4,
660    &[0x98, 0x86, 0xfd, 0x49, 0xa1, 0xe5],
661);
662
663pub const JSON_CONFIG_DATA_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
664    0x87367f87,
665    0x1119,
666    0x41ce,
667    0xaa,
668    0xec,
669    &[0x8b, 0xe0, 0x11, 0x1f, 0x55, 0x8a],
670);
671
672pub const MPS_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
673    0xeb9d2d2f,
674    0x2d88,
675    0x11d3,
676    0x9a,
677    0x16,
678    &[0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d],
679);
680
681pub const SAL_SYSTEM_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
682    0xeb9d2d32,
683    0x2d88,
684    0x11d3,
685    0x9a,
686    0x16,
687    &[0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d],
688);
689
690pub const SMBIOS_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
691    0xeb9d2d31,
692    0x2d88,
693    0x11d3,
694    0x9a,
695    0x16,
696    &[0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d],
697);
698
699pub const SMBIOS3_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
700    0xf2fd1544,
701    0x9794,
702    0x4a2c,
703    0x99,
704    0x2e,
705    &[0xe5, 0xbb, 0xcf, 0x20, 0xe3, 0x94],
706);
707
708//
709// Global Tables
710//
711// UEFI uses no global state, so all access to UEFI internal state is done through vtables you get
712// passed to your entry-point. The global entry is the system-table, which encorporates several
713// sub-tables, including the runtime and boot service tables, and configuration tables (including
714// vendor extensions).
715//
716
717pub const SPECIFICATION_REVISION: u32 = SYSTEM_TABLE_REVISION;
718
719#[repr(C)]
720#[derive(Clone, Copy, Debug)]
721pub struct TableHeader {
722    pub signature: u64,
723    pub revision: u32,
724    pub header_size: u32,
725    pub crc32: u32,
726    pub reserved: u32,
727}
728
729pub const RUNTIME_SERVICES_SIGNATURE: u64 = 0x56524553544e5552u64; // "RUNTSERV"
730pub const RUNTIME_SERVICES_REVISION: u32 = SPECIFICATION_REVISION;
731
732pub type RuntimeGetTime = unsafe extern "efiapi" fn(
733    *mut Time,
734    *mut TimeCapabilities,
735) -> crate::base::Status;
736
737pub type RuntimeSetTime = unsafe extern "efiapi" fn(
738    *mut Time,
739) -> crate::base::Status;
740
741pub type RuntimeGetWakeupTime = unsafe extern "efiapi" fn(
742    *mut crate::base::Boolean,
743    *mut crate::base::Boolean,
744    *mut Time,
745) -> crate::base::Status;
746
747pub type RuntimeSetWakeupTime = unsafe extern "efiapi" fn(
748    crate::base::Boolean,
749    *mut Time,
750) -> crate::base::Status;
751
752pub type RuntimeSetVirtualAddressMap = unsafe extern "efiapi" fn(
753    usize,
754    usize,
755    u32,
756    *mut MemoryDescriptor,
757) -> crate::base::Status;
758
759pub type RuntimeConvertPointer = unsafe extern "efiapi" fn(
760    usize,
761    *mut *mut core::ffi::c_void,
762) -> crate::base::Status;
763
764pub type RuntimeGetVariable = unsafe extern "efiapi" fn(
765    *mut crate::base::Char16,
766    *mut crate::base::Guid,
767    *mut u32,
768    *mut usize,
769    *mut core::ffi::c_void,
770) -> crate::base::Status;
771
772pub type RuntimeGetNextVariableName = unsafe extern "efiapi" fn(
773    *mut usize,
774    *mut crate::base::Char16,
775    *mut crate::base::Guid,
776) -> crate::base::Status;
777
778pub type RuntimeSetVariable = unsafe extern "efiapi" fn(
779    *mut crate::base::Char16,
780    *mut crate::base::Guid,
781    u32,
782    usize,
783    *mut core::ffi::c_void,
784) -> crate::base::Status;
785
786pub type RuntimeGetNextHighMonoCount = unsafe extern "efiapi" fn(
787    *mut u32,
788) -> crate::base::Status;
789
790pub type RuntimeResetSystem = unsafe extern "efiapi" fn(
791    ResetType,
792    crate::base::Status,
793    usize,
794    *mut core::ffi::c_void,
795);
796
797pub type RuntimeUpdateCapsule = unsafe extern "efiapi" fn(
798    *mut *mut CapsuleHeader,
799    usize,
800    crate::base::PhysicalAddress,
801) -> crate::base::Status;
802
803pub type RuntimeQueryCapsuleCapabilities = unsafe extern "efiapi" fn(
804    *mut *mut CapsuleHeader,
805    usize,
806    *mut u64,
807    *mut ResetType,
808) -> crate::base::Status;
809
810pub type RuntimeQueryVariableInfo = unsafe extern "efiapi" fn(
811    u32,
812    *mut u64,
813    *mut u64,
814    *mut u64,
815) -> crate::base::Status;
816
817#[repr(C)]
818pub struct RuntimeServices {
819    pub hdr: TableHeader,
820
821    pub get_time: RuntimeGetTime,
822    pub set_time: RuntimeSetTime,
823    pub get_wakeup_time: RuntimeGetWakeupTime,
824    pub set_wakeup_time: RuntimeSetWakeupTime,
825
826    pub set_virtual_address_map: RuntimeSetVirtualAddressMap,
827    pub convert_pointer: RuntimeConvertPointer,
828
829    pub get_variable: RuntimeGetVariable,
830    pub get_next_variable_name: RuntimeGetNextVariableName,
831    pub set_variable: RuntimeSetVariable,
832
833    pub get_next_high_mono_count: RuntimeGetNextHighMonoCount,
834    pub reset_system: RuntimeResetSystem,
835
836    pub update_capsule: RuntimeUpdateCapsule,
837    pub query_capsule_capabilities: RuntimeQueryCapsuleCapabilities,
838    pub query_variable_info: RuntimeQueryVariableInfo,
839}
840
841pub const BOOT_SERVICES_SIGNATURE: u64 = 0x56524553544f4f42u64; // "BOOTSERV"
842pub const BOOT_SERVICES_REVISION: u32 = SPECIFICATION_REVISION;
843
844pub type BootRaiseTpl = unsafe extern "efiapi" fn(
845    crate::base::Tpl,
846) -> crate::base::Tpl;
847
848pub type BootRestoreTpl = unsafe extern "efiapi" fn(
849    crate::base::Tpl,
850);
851
852pub type BootAllocatePages = unsafe extern "efiapi" fn(
853    AllocateType,
854    MemoryType,
855    usize,
856    *mut crate::base::PhysicalAddress,
857) -> crate::base::Status;
858
859pub type BootFreePages = unsafe extern "efiapi" fn(
860    crate::base::PhysicalAddress,
861    usize,
862) -> crate::base::Status;
863
864pub type BootGetMemoryMap = unsafe extern "efiapi" fn(
865    *mut usize,
866    *mut MemoryDescriptor,
867    *mut usize,
868    *mut usize,
869    *mut u32,
870) -> crate::base::Status;
871
872pub type BootAllocatePool = unsafe extern "efiapi" fn(
873    MemoryType,
874    usize,
875    *mut *mut core::ffi::c_void,
876) -> crate::base::Status;
877
878pub type BootFreePool = unsafe extern "efiapi" fn(
879    *mut core::ffi::c_void,
880) -> crate::base::Status;
881
882pub type BootCreateEvent = unsafe extern "efiapi" fn(
883    u32,
884    crate::base::Tpl,
885    Option<EventNotify>,
886    *mut core::ffi::c_void,
887    *mut crate::base::Event,
888) -> crate::base::Status;
889
890pub type BootSetTimer = unsafe extern "efiapi" fn(
891    crate::base::Event,
892    TimerDelay,
893    u64,
894) -> crate::base::Status;
895
896pub type BootWaitForEvent = unsafe extern "efiapi" fn(
897    usize,
898    *mut crate::base::Event,
899    *mut usize,
900) -> crate::base::Status;
901
902pub type BootSignalEvent = unsafe extern "efiapi" fn(
903    crate::base::Event,
904) -> crate::base::Status;
905
906pub type BootCloseEvent = unsafe extern "efiapi" fn(
907    crate::base::Event,
908) -> crate::base::Status;
909
910pub type BootCheckEvent = unsafe extern "efiapi" fn(
911    crate::base::Event,
912) -> crate::base::Status;
913
914pub type BootInstallProtocolInterface = unsafe extern "efiapi" fn(
915    *mut crate::base::Handle,
916    *mut crate::base::Guid,
917    InterfaceType,
918    *mut core::ffi::c_void,
919) -> crate::base::Status;
920
921pub type BootReinstallProtocolInterface = unsafe extern "efiapi" fn(
922    crate::base::Handle,
923    *mut crate::base::Guid,
924    *mut core::ffi::c_void,
925    *mut core::ffi::c_void,
926) -> crate::base::Status;
927
928pub type BootUninstallProtocolInterface = unsafe extern "efiapi" fn(
929    crate::base::Handle,
930    *mut crate::base::Guid,
931    *mut core::ffi::c_void,
932) -> crate::base::Status;
933
934pub type BootHandleProtocol = unsafe extern "efiapi" fn(
935    crate::base::Handle,
936    *mut crate::base::Guid,
937    *mut *mut core::ffi::c_void,
938) -> crate::base::Status;
939
940pub type BootRegisterProtocolNotify = unsafe extern "efiapi" fn(
941    *mut crate::base::Guid,
942    crate::base::Event,
943    *mut *mut core::ffi::c_void,
944) -> crate::base::Status;
945
946pub type BootLocateHandle = unsafe extern "efiapi" fn(
947    LocateSearchType,
948    *mut crate::base::Guid,
949    *mut core::ffi::c_void,
950    *mut usize,
951    *mut crate::base::Handle,
952) -> crate::base::Status;
953
954pub type BootLocateDevicePath = unsafe extern "efiapi" fn(
955    *mut crate::base::Guid,
956    *mut *mut crate::protocols::device_path::Protocol,
957    *mut crate::base::Handle,
958) -> crate::base::Status;
959
960pub type BootInstallConfigurationTable = unsafe extern "efiapi" fn(
961    *mut crate::base::Guid,
962    *mut core::ffi::c_void,
963) -> crate::base::Status;
964
965pub type BootLoadImage = unsafe extern "efiapi" fn(
966    crate::base::Boolean,
967    crate::base::Handle,
968    *mut crate::protocols::device_path::Protocol,
969    *mut core::ffi::c_void,
970    usize,
971    *mut crate::base::Handle,
972) -> crate::base::Status;
973
974pub type BootStartImage = unsafe extern "efiapi" fn(
975    crate::base::Handle,
976    *mut usize,
977    *mut *mut crate::base::Char16,
978) -> crate::base::Status;
979
980pub type BootExit = unsafe extern "efiapi" fn(
981    crate::base::Handle,
982    crate::base::Status,
983    usize,
984    *mut crate::base::Char16,
985) -> crate::base::Status;
986
987pub type BootUnloadImage = unsafe extern "efiapi" fn(
988    crate::base::Handle,
989) -> crate::base::Status;
990
991pub type BootExitBootServices = unsafe extern "efiapi" fn(
992    crate::base::Handle,
993    usize,
994) -> crate::base::Status;
995
996pub type BootGetNextMonotonicCount = unsafe extern "efiapi" fn(
997    *mut u64,
998) -> crate::base::Status;
999
1000pub type BootStall = unsafe extern "efiapi" fn(
1001    usize,
1002) -> crate::base::Status;
1003
1004pub type BootSetWatchdogTimer = unsafe extern "efiapi" fn(
1005    usize,
1006    u64,
1007    usize,
1008    *mut crate::base::Char16,
1009) -> crate::base::Status;
1010
1011pub type BootConnectController = unsafe extern "efiapi" fn(
1012    crate::base::Handle,
1013    *mut crate::base::Handle,
1014    *mut crate::protocols::device_path::Protocol,
1015    crate::base::Boolean,
1016) -> crate::base::Status;
1017
1018pub type BootDisconnectController = unsafe extern "efiapi" fn(
1019    crate::base::Handle,
1020    crate::base::Handle,
1021    crate::base::Handle,
1022) -> crate::base::Status;
1023
1024pub type BootOpenProtocol = unsafe extern "efiapi" fn(
1025    crate::base::Handle,
1026    *mut crate::base::Guid,
1027    *mut *mut core::ffi::c_void,
1028    crate::base::Handle,
1029    crate::base::Handle,
1030    u32,
1031) -> crate::base::Status;
1032
1033pub type BootCloseProtocol = unsafe extern "efiapi" fn(
1034    crate::base::Handle,
1035    *mut crate::base::Guid,
1036    crate::base::Handle,
1037    crate::base::Handle,
1038) -> crate::base::Status;
1039
1040pub type BootOpenProtocolInformation = unsafe extern "efiapi" fn(
1041    crate::base::Handle,
1042    *mut crate::base::Guid,
1043    *mut *mut OpenProtocolInformationEntry,
1044    *mut usize,
1045) -> crate::base::Status;
1046
1047pub type BootProtocolsPerHandle = unsafe extern "efiapi" fn(
1048    crate::base::Handle,
1049    *mut *mut *mut crate::base::Guid,
1050    *mut usize,
1051) -> crate::base::Status;
1052
1053pub type BootLocateHandleBuffer = unsafe extern "efiapi" fn(
1054    LocateSearchType,
1055    *mut crate::base::Guid,
1056    *mut core::ffi::c_void,
1057    *mut usize,
1058    *mut *mut crate::base::Handle,
1059) -> crate::base::Status;
1060
1061pub type BootLocateProtocol = unsafe extern "efiapi" fn(
1062    *mut crate::base::Guid,
1063    *mut core::ffi::c_void,
1064    *mut *mut core::ffi::c_void,
1065) -> crate::base::Status;
1066
1067pub type BootInstallMultipleProtocolInterfaces = unsafe extern "efiapi" fn(
1068    *mut crate::base::Handle,
1069    // XXX: Actual definition is variadic. See eficall!{} for details.
1070    *mut core::ffi::c_void,
1071    *mut core::ffi::c_void,
1072) -> crate::base::Status;
1073
1074pub type BootUninstallMultipleProtocolInterfaces = unsafe extern "efiapi" fn(
1075    crate::base::Handle,
1076    // XXX: Actual definition is variadic. See eficall!{} for details.
1077    *mut core::ffi::c_void,
1078    *mut core::ffi::c_void,
1079) -> crate::base::Status;
1080
1081pub type BootCalculateCrc32 = unsafe extern "efiapi" fn(
1082    *mut core::ffi::c_void,
1083    usize,
1084    *mut u32,
1085) -> crate::base::Status;
1086
1087pub type BootCopyMem = unsafe extern "efiapi" fn(
1088    *mut core::ffi::c_void,
1089    *mut core::ffi::c_void,
1090    usize,
1091);
1092
1093pub type BootSetMem = unsafe extern "efiapi" fn(
1094    *mut core::ffi::c_void,
1095    usize,
1096    u8,
1097);
1098
1099pub type BootCreateEventEx = unsafe extern "efiapi" fn(
1100    u32,
1101    crate::base::Tpl,
1102    Option<EventNotify>,
1103    *const core::ffi::c_void,
1104    *const crate::base::Guid,
1105    *mut crate::base::Event,
1106) -> crate::base::Status;
1107
1108#[repr(C)]
1109pub struct BootServices {
1110    pub hdr: TableHeader,
1111
1112    pub raise_tpl: BootRaiseTpl,
1113    pub restore_tpl: BootRestoreTpl,
1114
1115    pub allocate_pages: BootAllocatePages,
1116    pub free_pages: BootFreePages,
1117    pub get_memory_map: BootGetMemoryMap,
1118    pub allocate_pool: BootAllocatePool,
1119    pub free_pool: BootFreePool,
1120
1121    pub create_event: BootCreateEvent,
1122    pub set_timer: BootSetTimer,
1123    pub wait_for_event: BootWaitForEvent,
1124    pub signal_event: BootSignalEvent,
1125    pub close_event: BootCloseEvent,
1126    pub check_event: BootCheckEvent,
1127
1128    pub install_protocol_interface: BootInstallProtocolInterface,
1129    pub reinstall_protocol_interface: BootReinstallProtocolInterface,
1130    pub uninstall_protocol_interface: BootUninstallProtocolInterface,
1131    pub handle_protocol: BootHandleProtocol,
1132    pub reserved: *mut core::ffi::c_void,
1133    pub register_protocol_notify: BootRegisterProtocolNotify,
1134    pub locate_handle: BootLocateHandle,
1135    pub locate_device_path: BootLocateDevicePath,
1136
1137    pub install_configuration_table: BootInstallConfigurationTable,
1138
1139    pub load_image: BootLoadImage,
1140    pub start_image: BootStartImage,
1141    pub exit: BootExit,
1142    pub unload_image: BootUnloadImage,
1143    pub exit_boot_services: BootExitBootServices,
1144
1145    pub get_next_monotonic_count: BootGetNextMonotonicCount,
1146    pub stall: BootStall,
1147    pub set_watchdog_timer: BootSetWatchdogTimer,
1148
1149    // 1.1+
1150    pub connect_controller: BootConnectController,
1151    pub disconnect_controller: BootDisconnectController,
1152
1153    pub open_protocol: BootOpenProtocol,
1154    pub close_protocol: BootCloseProtocol,
1155    pub open_protocol_information: BootOpenProtocolInformation,
1156
1157    pub protocols_per_handle: BootProtocolsPerHandle,
1158    pub locate_handle_buffer: BootLocateHandleBuffer,
1159    pub locate_protocol: BootLocateProtocol,
1160    pub install_multiple_protocol_interfaces: BootInstallMultipleProtocolInterfaces,
1161    pub uninstall_multiple_protocol_interfaces: BootUninstallMultipleProtocolInterfaces,
1162
1163    pub calculate_crc32: BootCalculateCrc32,
1164
1165    pub copy_mem: BootCopyMem,
1166    pub set_mem: BootSetMem,
1167
1168    // 2.0+
1169    pub create_event_ex: BootCreateEventEx,
1170}
1171
1172pub const SYSTEM_TABLE_REVISION_2_70: u32 = (2 << 16) | (70);
1173pub const SYSTEM_TABLE_REVISION_2_60: u32 = (2 << 16) | (60);
1174pub const SYSTEM_TABLE_REVISION_2_50: u32 = (2 << 16) | (50);
1175pub const SYSTEM_TABLE_REVISION_2_40: u32 = (2 << 16) | (40);
1176pub const SYSTEM_TABLE_REVISION_2_31: u32 = (2 << 16) | (31);
1177pub const SYSTEM_TABLE_REVISION_2_30: u32 = (2 << 16) | (30);
1178pub const SYSTEM_TABLE_REVISION_2_20: u32 = (2 << 16) | (20);
1179pub const SYSTEM_TABLE_REVISION_2_10: u32 = (2 << 16) | (10);
1180pub const SYSTEM_TABLE_REVISION_2_00: u32 = (2 << 16) | (0);
1181pub const SYSTEM_TABLE_REVISION_1_10: u32 = (1 << 16) | (10);
1182pub const SYSTEM_TABLE_REVISION_1_02: u32 = (1 << 16) | (2);
1183
1184pub const SYSTEM_TABLE_SIGNATURE: u64 = 0x5453595320494249u64; // "IBI SYST"
1185pub const SYSTEM_TABLE_REVISION: u32 = SYSTEM_TABLE_REVISION_2_70;
1186
1187#[repr(C)]
1188pub struct SystemTable {
1189    pub hdr: TableHeader,
1190    pub firmware_vendor: *mut crate::base::Char16,
1191    pub firmware_revision: u32,
1192
1193    pub console_in_handle: crate::base::Handle,
1194    pub con_in: *mut crate::protocols::simple_text_input::Protocol,
1195    pub console_out_handle: crate::base::Handle,
1196    pub con_out: *mut crate::protocols::simple_text_output::Protocol,
1197    pub standard_error_handle: crate::base::Handle,
1198    pub std_err: *mut crate::protocols::simple_text_output::Protocol,
1199
1200    pub runtime_services: *mut RuntimeServices,
1201    pub boot_services: *mut BootServices,
1202
1203    pub number_of_table_entries: usize,
1204    pub configuration_table: *mut ConfigurationTable,
1205}