1pub const TIME_ADJUST_DAYLIGHT: u8 = 0x01u8;
20pub const TIME_IN_DAYLIGHT: u8 = 0x02u8;
21
22pub const UNSPECIFIED_TIMEZONE: i16 = 0x07ffi16;
23
24#[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
49pub 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], }
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], }
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 OPTIONAL_POINTER: u32 = 0x00000001u32;
126
127pub type ResetType = u32;
135
136pub const RESET_COLD: ResetType = 0x00000000;
137pub const RESET_WARM: ResetType = 0x00000001;
138pub const RESET_SHUTDOWN: ResetType = 0x00000002;
139pub const RESET_PLATFORM_SPECIFIC: ResetType = 0x00000003;
140
141#[repr(C)]
149#[derive(Clone, Copy)]
150pub union CapsuleBlockDescriptorUnion {
151 pub data_block: crate::base::PhysicalAddress,
152 pub continuation_pointer: crate::base::PhysicalAddress,
153}
154
155#[repr(C)]
156#[derive(Clone, Copy)]
157pub struct CapsuleBlockDescriptor {
158 pub length: u64,
159 pub data: CapsuleBlockDescriptorUnion,
160}
161
162pub const CAPSULE_FLAGS_PERSIST_ACROSS_RESET: u32 = 0x00010000u32;
163pub const CAPSULE_FLAGS_POPULATE_SYSTEM_TABLE: u32 = 0x00020000u32;
164pub const CAPSULE_FLAGS_INITIATE_RESET: u32 = 0x00040000u32;
165
166#[repr(C)]
167#[derive(Clone, Copy, Debug)]
168pub struct CapsuleHeader {
169 pub capsule_guid: crate::base::Guid,
170 pub header_size: u32,
171 pub flags: u32,
172 pub capsule_image_size: u32,
173}
174
175pub const OS_INDICATIONS_BOOT_TO_FW_UI: u64 = 0x0000000000000001u64;
176pub const OS_INDICATIONS_TIMESTAMP_REVOCATION: u64 = 0x0000000000000002u64;
177pub const OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED: u64 = 0x0000000000000004u64;
178pub const OS_INDICATIONS_FMP_CAPSULE_SUPPORTED: u64 = 0x0000000000000008u64;
179pub const OS_INDICATIONS_CAPSULE_RESULT_VAR_SUPPORTED: u64 = 0x0000000000000010u64;
180pub const OS_INDICATIONS_START_OS_RECOVERY: u64 = 0x0000000000000020u64;
181pub const OS_INDICATIONS_START_PLATFORM_RECOVERY: u64 = 0x0000000000000040u64;
182
183pub const CAPSULE_REPORT_GUID: crate::base::Guid = crate::base::Guid::from_fields(
184 0x39b68c46,
185 0xf7fb,
186 0x441b,
187 0xb6,
188 0xec,
189 &[0x16, 0xb0, 0xf6, 0x98, 0x21, 0xf3],
190);
191
192#[repr(C)]
193#[derive(Clone, Copy, Debug)]
194pub struct CapsuleResultVariableHeader {
195 pub variable_total_size: u32,
196 pub reserved: u32,
197 pub capsule_guid: crate::base::Guid,
198 pub capsule_processed: Time,
199 pub capsule_status: crate::base::Status,
200}
201
202#[repr(C)]
203#[derive(Clone, Copy, Debug)]
204pub struct CapsuleResultVariableFMP<const N: usize = 0> {
205 pub version: u16,
206 pub payload_index: u8,
207 pub update_image_index: u8,
208 pub update_image_type_id: crate::base::Guid,
209 pub capsule_file_name_and_target: [crate::base::Char16; N],
210}
211
212pub const EVT_TIMER: u32 = 0x80000000u32;
227pub const EVT_RUNTIME: u32 = 0x40000000u32;
228pub const EVT_NOTIFY_WAIT: u32 = 0x00000100u32;
229pub const EVT_NOTIFY_SIGNAL: u32 = 0x00000200u32;
230pub const EVT_SIGNAL_EXIT_BOOT_SERVICES: u32 = 0x00000201u32;
231pub const EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE: u32 = 0x60000202u32;
232
233pub type EventNotify = eficall! {fn(crate::base::Event, *mut core::ffi::c_void)};
234
235pub const EVENT_GROUP_EXIT_BOOT_SERVICES: crate::base::Guid = crate::base::Guid::from_fields(
236 0x27abf055,
237 0xb1b8,
238 0x4c26,
239 0x80,
240 0x48,
241 &[0x74, 0x8f, 0x37, 0xba, 0xa2, 0xdf],
242);
243pub const EVENT_GROUP_BEFORE_EXIT_BOOT_SERVICES: crate::base::Guid = crate::base::Guid::from_fields(
244 0x8be0e274,
245 0x3970,
246 0x4b44,
247 0x80,
248 0xc5,
249 &[0x1a, 0xb9, 0x50, 0x2f, 0x3b, 0xfc],
250);
251pub const EVENT_GROUP_VIRTUAL_ADDRESS_CHANGE: crate::base::Guid = crate::base::Guid::from_fields(
252 0x13fa7698,
253 0xc831,
254 0x49c7,
255 0x87,
256 0xea,
257 &[0x8f, 0x43, 0xfc, 0xc2, 0x51, 0x96],
258);
259pub const EVENT_GROUP_MEMORY_MAP_CHANGE: crate::base::Guid = crate::base::Guid::from_fields(
260 0x78bee926,
261 0x692f,
262 0x48fd,
263 0x9e,
264 0xdb,
265 &[0x1, 0x42, 0x2e, 0xf0, 0xd7, 0xab],
266);
267pub const EVENT_GROUP_READY_TO_BOOT: crate::base::Guid = crate::base::Guid::from_fields(
268 0x7ce88fb3,
269 0x4bd7,
270 0x4679,
271 0x87,
272 0xa8,
273 &[0xa8, 0xd8, 0xde, 0xe5, 0x0d, 0x2b],
274);
275pub const EVENT_GROUP_AFTER_READY_TO_BOOT: crate::base::Guid = crate::base::Guid::from_fields(
276 0x3a2a00ad,
277 0x98b9,
278 0x4cdf,
279 0xa4,
280 0x78,
281 &[0x70, 0x27, 0x77, 0xf1, 0xc1, 0x0b],
282);
283pub const EVENT_GROUP_RESET_SYSTEM: crate::base::Guid = crate::base::Guid::from_fields(
284 0x62da6a56,
285 0x13fb,
286 0x485a,
287 0xa8,
288 0xda,
289 &[0xa3, 0xdd, 0x79, 0x12, 0xcb, 0x6b],
290);
291
292pub type TimerDelay = u32;
293
294pub const TIMER_CANCEL: TimerDelay = 0x00000000;
295pub const TIMER_PERIODIC: TimerDelay = 0x00000001;
296pub const TIMER_RELATIVE: TimerDelay = 0x00000002;
297
298pub const TPL_APPLICATION: crate::base::Tpl = 4;
299pub const TPL_CALLBACK: crate::base::Tpl = 8;
300pub const TPL_NOTIFY: crate::base::Tpl = 16;
301pub const TPL_HIGH_LEVEL: crate::base::Tpl = 31;
302
303pub type AllocateType = u32;
313
314pub const ALLOCATE_ANY_PAGES: AllocateType = 0x00000000;
315pub const ALLOCATE_MAX_ADDRESS: AllocateType = 0x00000001;
316pub const ALLOCATE_ADDRESS: AllocateType = 0x00000002;
317
318pub type MemoryType = u32;
319
320pub const RESERVED_MEMORY_TYPE: MemoryType = 0x00000000;
321pub const LOADER_CODE: MemoryType = 0x00000001;
322pub const LOADER_DATA: MemoryType = 0x00000002;
323pub const BOOT_SERVICES_CODE: MemoryType = 0x00000003;
324pub const BOOT_SERVICES_DATA: MemoryType = 0x00000004;
325pub const RUNTIME_SERVICES_CODE: MemoryType = 0x00000005;
326pub const RUNTIME_SERVICES_DATA: MemoryType = 0x00000006;
327pub const CONVENTIONAL_MEMORY: MemoryType = 0x00000007;
328pub const UNUSABLE_MEMORY: MemoryType = 0x00000008;
329pub const ACPI_RECLAIM_MEMORY: MemoryType = 0x00000009;
330pub const ACPI_MEMORY_NVS: MemoryType = 0x0000000a;
331pub const MEMORY_MAPPED_IO: MemoryType = 0x0000000b;
332pub const MEMORY_MAPPED_IO_PORT_SPACE: MemoryType = 0x0000000c;
333pub const PAL_CODE: MemoryType = 0x0000000d;
334pub const PERSISTENT_MEMORY: MemoryType = 0x0000000e;
335pub const UNACCEPTED_MEMORY_TYPE: MemoryType = 0x0000000f;
336
337pub const MEMORY_UC: u64 = 0x0000000000000001u64;
338pub const MEMORY_WC: u64 = 0x0000000000000002u64;
339pub const MEMORY_WT: u64 = 0x0000000000000004u64;
340pub const MEMORY_WB: u64 = 0x0000000000000008u64;
341pub const MEMORY_UCE: u64 = 0x0000000000000010u64;
342pub const MEMORY_WP: u64 = 0x0000000000001000u64;
343pub const MEMORY_RP: u64 = 0x0000000000002000u64;
344pub const MEMORY_XP: u64 = 0x0000000000004000u64;
345pub const MEMORY_NV: u64 = 0x0000000000008000u64;
346pub const MEMORY_MORE_RELIABLE: u64 = 0x0000000000010000u64;
347pub const MEMORY_RO: u64 = 0x0000000000020000u64;
348pub const MEMORY_SP: u64 = 0x0000000000040000u64;
349pub const MEMORY_CPU_CRYPTO: u64 = 0x0000000000080000u64;
350pub const MEMORY_RUNTIME: u64 = 0x8000000000000000u64;
351pub const MEMORY_ISA_VALID: u64 = 0x4000000000000000u64;
352pub const MEMORY_ISA_MASK: u64 = 0x0FFFF00000000000u64;
353
354pub const CACHE_ATTRIBUTE_MASK: u64 =
359 MEMORY_UC | MEMORY_WC | MEMORY_WT | MEMORY_WB | MEMORY_UCE | MEMORY_WP;
360
361pub const MEMORY_ACCESS_MASK: u64 = MEMORY_RP | MEMORY_XP | MEMORY_RO;
366
367pub const MEMORY_ATTRIBUTE_MASK: u64 = MEMORY_ACCESS_MASK | MEMORY_SP | MEMORY_CPU_CRYPTO;
370
371pub const MEMORY_DESCRIPTOR_VERSION: u32 = 0x00000001u32;
372
373#[repr(C)]
374#[derive(Clone, Copy, Debug)]
375pub struct MemoryDescriptor {
376 pub r#type: u32,
377 pub physical_start: crate::base::PhysicalAddress,
378 pub virtual_start: crate::base::VirtualAddress,
379 pub number_of_pages: u64,
380 pub attribute: u64,
381}
382
383pub type InterfaceType = u32;
393
394pub const NATIVE_INTERFACE: InterfaceType = 0x00000000;
395
396pub type LocateSearchType = u32;
397
398pub const ALL_HANDLES: LocateSearchType = 0x00000000;
399pub const BY_REGISTER_NOTIFY: LocateSearchType = 0x00000001;
400pub const BY_PROTOCOL: LocateSearchType = 0x00000002;
401
402pub const OPEN_PROTOCOL_BY_HANDLE_PROTOCOL: u32 = 0x00000001u32;
403pub const OPEN_PROTOCOL_GET_PROTOCOL: u32 = 0x00000002u32;
404pub const OPEN_PROTOCOL_TEST_PROTOCOL: u32 = 0x00000004u32;
405pub const OPEN_PROTOCOL_BY_CHILD_CONTROLLER: u32 = 0x00000008u32;
406pub const OPEN_PROTOCOL_BY_DRIVER: u32 = 0x00000010u32;
407pub const OPEN_PROTOCOL_EXCLUSIVE: u32 = 0x00000020u32;
408
409#[repr(C)]
410#[derive(Clone, Copy, Debug)]
411pub struct OpenProtocolInformationEntry {
412 pub agent_handle: crate::base::Handle,
413 pub controller_handle: crate::base::Handle,
414 pub attributes: u32,
415 pub open_count: u32,
416}
417
418#[repr(C)]
426#[derive(Clone, Copy, Debug)]
427pub struct ConfigurationTable {
428 pub vendor_guid: crate::base::Guid,
429 pub vendor_table: *mut core::ffi::c_void,
430}
431
432pub const RT_PROPERTIES_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
433 0xeb66918a,
434 0x7eef,
435 0x402a,
436 0x84,
437 0x2e,
438 &[0x93, 0x1d, 0x21, 0xc3, 0x8a, 0xe9],
439);
440
441pub const RT_PROPERTIES_TABLE_VERSION: u16 = 0x0001;
442
443pub const RT_SUPPORTED_GET_TIME: u32 = 0x0000001;
444pub const RT_SUPPORTED_SET_TIME: u32 = 0x0000002;
445pub const RT_SUPPORTED_GET_WAKEUP_TIME: u32 = 0x0000004;
446pub const RT_SUPPORTED_SET_WAKEUP_TIME: u32 = 0x0000008;
447pub const RT_SUPPORTED_GET_VARIABLE: u32 = 0x00000010;
448pub const RT_SUPPORTED_GET_NEXT_VARIABLE_NAME: u32 = 0x00000020;
449pub const RT_SUPPORTED_SET_VARIABLE: u32 = 0x00000040;
450pub const RT_SUPPORTED_SET_VIRTUAL_ADDRESS_MAP: u32 = 0x00000080;
451pub const RT_SUPPORTED_CONVERT_POINTER: u32 = 0x00000100;
452pub const RT_SUPPORTED_GET_NEXT_HIGH_MONOTONIC_COUNT: u32 = 0x00000200;
453pub const RT_SUPPORTED_RESET_SYSTEM: u32 = 0x00000400;
454pub const RT_SUPPORTED_UPDATE_CAPSULE: u32 = 0x00000800;
455pub const RT_SUPPORTED_QUERY_CAPSULE_CAPABILITIES: u32 = 0x00001000;
456pub const RT_SUPPORTED_QUERY_VARIABLE_INFO: u32 = 0x00002000;
457
458#[repr(C)]
459#[derive(Clone, Copy, Debug)]
460pub struct RtPropertiesTable {
461 pub version: u16,
462 pub length: u16,
463 pub runtime_services_supported: u32,
464}
465
466pub const PROPERTIES_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
467 0x880aaca3,
468 0x4adc,
469 0x4a04,
470 0x90,
471 0x79,
472 &[0xb7, 0x47, 0x34, 0x8, 0x25, 0xe5],
473);
474
475pub const PROPERTIES_TABLE_VERSION: u32 = 0x00010000u32;
476
477pub const PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA: u64 = 0x1u64;
478
479#[repr(C)]
480#[derive(Clone, Copy, Debug)]
481pub struct PropertiesTable {
482 pub version: u32,
483 pub length: u32,
484 pub memory_protection_attribute: u64,
485}
486
487pub const MEMORY_ATTRIBUTES_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
488 0xdcfa911d,
489 0x26eb,
490 0x469f,
491 0xa2,
492 0x20,
493 &[0x38, 0xb7, 0xdc, 0x46, 0x12, 0x20],
494);
495
496pub const MEMORY_ATTRIBUTES_TABLE_VERSION: u32 = 0x00000001u32;
497
498#[repr(C)]
499#[derive(Clone, Copy, Debug)]
500pub struct MemoryAttributesTable<const N: usize = 0> {
501 pub version: u32,
502 pub number_of_entries: u32,
503 pub descriptor_size: u32,
504 pub reserved: u32,
505 pub entry: [MemoryDescriptor; N],
506}
507
508pub const CONFORMANCE_PROFILES_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
509 0x36122546,
510 0xf7e7,
511 0x4c8f,
512 0xbd,
513 0x9b,
514 &[0xeb, 0x85, 0x25, 0xb5, 0x0c, 0x0b],
515);
516
517pub const CONFORMANCE_PROFILES_TABLE_VERSION: u16 = 0x0001;
518
519pub const CONFORMANCE_PROFILES_UEFI_SPEC_GUID: crate::base::Guid = crate::base::Guid::from_fields(
520 0x523c91af,
521 0xa195,
522 0x4382,
523 0x81,
524 0x8d,
525 &[0x29, 0x5f, 0xe4, 0x00, 0x64, 0x65],
526);
527
528#[repr(C)]
529#[derive(Clone, Copy, Debug)]
530pub struct ConformanceProfilesTable<const N: usize = 0> {
531 pub version: u16,
532 pub number_of_profiles: u16,
533 pub conformance_profiles: [crate::base::Guid; N],
534}
535
536pub const ACPI_10_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
544 0xeb9d2d30,
545 0x2d88,
546 0x11d3,
547 0x9a,
548 0x16,
549 &[0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d],
550);
551
552pub const ACPI_20_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
553 0x8868e871,
554 0xe4f1,
555 0x11d3,
556 0xbc,
557 0x22,
558 &[0x00, 0x80, 0xc7, 0x3c, 0x88, 0x81],
559);
560
561pub const DTB_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
562 0xb1b621d5,
563 0xf19c,
564 0x41a5,
565 0x83,
566 0x0b,
567 &[0xd9, 0x15, 0x2c, 0x69, 0xaa, 0xe0],
568);
569
570pub const JSON_CAPSULE_DATA_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
571 0x35e7a725,
572 0x8dd2,
573 0x4cac,
574 0x80,
575 0x11,
576 &[0x33, 0xcd, 0xa8, 0x10, 0x90, 0x56],
577);
578
579pub const JSON_CAPSULE_RESULT_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
580 0xdbc461c3,
581 0xb3de,
582 0x422a,
583 0xb9,
584 0xb4,
585 &[0x98, 0x86, 0xfd, 0x49, 0xa1, 0xe5],
586);
587
588pub const JSON_CONFIG_DATA_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
589 0x87367f87,
590 0x1119,
591 0x41ce,
592 0xaa,
593 0xec,
594 &[0x8b, 0xe0, 0x11, 0x1f, 0x55, 0x8a],
595);
596
597pub const MPS_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
598 0xeb9d2d2f,
599 0x2d88,
600 0x11d3,
601 0x9a,
602 0x16,
603 &[0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d],
604);
605
606pub const SAL_SYSTEM_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
607 0xeb9d2d32,
608 0x2d88,
609 0x11d3,
610 0x9a,
611 0x16,
612 &[0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d],
613);
614
615pub const SMBIOS_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
616 0xeb9d2d31,
617 0x2d88,
618 0x11d3,
619 0x9a,
620 0x16,
621 &[0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d],
622);
623
624pub const SMBIOS3_TABLE_GUID: crate::base::Guid = crate::base::Guid::from_fields(
625 0xf2fd1544,
626 0x9794,
627 0x4a2c,
628 0x99,
629 0x2e,
630 &[0xe5, 0xbb, 0xcf, 0x20, 0xe3, 0x94],
631);
632
633pub const SPECIFICATION_REVISION: u32 = SYSTEM_TABLE_REVISION;
643
644#[repr(C)]
645#[derive(Clone, Copy, Debug)]
646pub struct TableHeader {
647 pub signature: u64,
648 pub revision: u32,
649 pub header_size: u32,
650 pub crc32: u32,
651 pub reserved: u32,
652}
653
654pub const RUNTIME_SERVICES_SIGNATURE: u64 = 0x56524553544e5552u64; pub const RUNTIME_SERVICES_REVISION: u32 = SPECIFICATION_REVISION;
656
657pub type RuntimeGetTime = eficall! {fn(
658 *mut Time,
659 *mut TimeCapabilities,
660) -> crate::base::Status};
661
662pub type RuntimeSetTime = eficall! {fn(
663 *mut Time,
664) -> crate::base::Status};
665
666pub type RuntimeGetWakeupTime = eficall! {fn(
667 *mut crate::base::Boolean,
668 *mut crate::base::Boolean,
669 *mut Time,
670) -> crate::base::Status};
671
672pub type RuntimeSetWakeupTime = eficall! {fn(
673 crate::base::Boolean,
674 *mut Time,
675) -> crate::base::Status};
676
677pub type RuntimeSetVirtualAddressMap = eficall! {fn(
678 usize,
679 usize,
680 u32,
681 *mut MemoryDescriptor,
682) -> crate::base::Status};
683
684pub type RuntimeConvertPointer = eficall! {fn(
685 usize,
686 *mut *mut core::ffi::c_void,
687) -> crate::base::Status};
688
689pub type RuntimeGetVariable = eficall! {fn(
690 *mut crate::base::Char16,
691 *mut crate::base::Guid,
692 *mut u32,
693 *mut usize,
694 *mut core::ffi::c_void,
695) -> crate::base::Status};
696
697pub type RuntimeGetNextVariableName = eficall! {fn(
698 *mut usize,
699 *mut crate::base::Char16,
700 *mut crate::base::Guid,
701) -> crate::base::Status};
702
703pub type RuntimeSetVariable = eficall! {fn(
704 *mut crate::base::Char16,
705 *mut crate::base::Guid,
706 u32,
707 usize,
708 *mut core::ffi::c_void,
709) -> crate::base::Status};
710
711pub type RuntimeGetNextHighMonoCount = eficall! {fn(
712 *mut u32,
713) -> crate::base::Status};
714
715pub type RuntimeResetSystem = eficall! {fn(
716 ResetType,
717 crate::base::Status,
718 usize,
719 *mut core::ffi::c_void,
720)};
721
722pub type RuntimeUpdateCapsule = eficall! {fn(
723 *mut *mut CapsuleHeader,
724 usize,
725 crate::base::PhysicalAddress,
726) -> crate::base::Status};
727
728pub type RuntimeQueryCapsuleCapabilities = eficall! {fn(
729 *mut *mut CapsuleHeader,
730 usize,
731 *mut u64,
732 *mut ResetType,
733) -> crate::base::Status};
734
735pub type RuntimeQueryVariableInfo = eficall! {fn(
736 u32,
737 *mut u64,
738 *mut u64,
739 *mut u64,
740) -> crate::base::Status};
741
742#[repr(C)]
743pub struct RuntimeServices {
744 pub hdr: TableHeader,
745
746 pub get_time: RuntimeGetTime,
747 pub set_time: RuntimeSetTime,
748 pub get_wakeup_time: RuntimeGetWakeupTime,
749 pub set_wakeup_time: RuntimeSetWakeupTime,
750
751 pub set_virtual_address_map: RuntimeSetVirtualAddressMap,
752 pub convert_pointer: RuntimeConvertPointer,
753
754 pub get_variable: RuntimeGetVariable,
755 pub get_next_variable_name: RuntimeGetNextVariableName,
756 pub set_variable: RuntimeSetVariable,
757
758 pub get_next_high_mono_count: RuntimeGetNextHighMonoCount,
759 pub reset_system: RuntimeResetSystem,
760
761 pub update_capsule: RuntimeUpdateCapsule,
762 pub query_capsule_capabilities: RuntimeQueryCapsuleCapabilities,
763 pub query_variable_info: RuntimeQueryVariableInfo,
764}
765
766pub const BOOT_SERVICES_SIGNATURE: u64 = 0x56524553544f4f42u64; pub const BOOT_SERVICES_REVISION: u32 = SPECIFICATION_REVISION;
768
769pub type BootRaiseTpl = eficall! {fn(
770 crate::base::Tpl,
771) -> crate::base::Tpl};
772
773pub type BootRestoreTpl = eficall! {fn(
774 crate::base::Tpl,
775)};
776
777pub type BootAllocatePages = eficall! {fn(
778 AllocateType,
779 MemoryType,
780 usize,
781 *mut crate::base::PhysicalAddress,
782) -> crate::base::Status};
783
784pub type BootFreePages = eficall! {fn(
785 crate::base::PhysicalAddress,
786 usize,
787) -> crate::base::Status};
788
789pub type BootGetMemoryMap = eficall! {fn(
790 *mut usize,
791 *mut MemoryDescriptor,
792 *mut usize,
793 *mut usize,
794 *mut u32,
795) -> crate::base::Status};
796
797pub type BootAllocatePool = eficall! {fn(
798 MemoryType,
799 usize,
800 *mut *mut core::ffi::c_void,
801) -> crate::base::Status};
802
803pub type BootFreePool = eficall! {fn(
804 *mut core::ffi::c_void,
805) -> crate::base::Status};
806
807pub type BootCreateEvent = eficall! {fn(
808 u32,
809 crate::base::Tpl,
810 Option<EventNotify>,
811 *mut core::ffi::c_void,
812 *mut crate::base::Event,
813) -> crate::base::Status};
814
815pub type BootSetTimer = eficall! {fn(
816 crate::base::Event,
817 TimerDelay,
818 u64,
819) -> crate::base::Status};
820
821pub type BootWaitForEvent = eficall! {fn(
822 usize,
823 *mut crate::base::Event,
824 *mut usize,
825) -> crate::base::Status};
826
827pub type BootSignalEvent = eficall! {fn(
828 crate::base::Event,
829) -> crate::base::Status};
830
831pub type BootCloseEvent = eficall! {fn(
832 crate::base::Event,
833) -> crate::base::Status};
834
835pub type BootCheckEvent = eficall! {fn(
836 crate::base::Event,
837) -> crate::base::Status};
838
839pub type BootInstallProtocolInterface = eficall! {fn(
840 *mut crate::base::Handle,
841 *mut crate::base::Guid,
842 InterfaceType,
843 *mut core::ffi::c_void,
844) -> crate::base::Status};
845
846pub type BootReinstallProtocolInterface = eficall! {fn(
847 crate::base::Handle,
848 *mut crate::base::Guid,
849 *mut core::ffi::c_void,
850 *mut core::ffi::c_void,
851) -> crate::base::Status};
852
853pub type BootUninstallProtocolInterface = eficall! {fn(
854 crate::base::Handle,
855 *mut crate::base::Guid,
856 *mut core::ffi::c_void,
857) -> crate::base::Status};
858
859pub type BootHandleProtocol = eficall! {fn(
860 crate::base::Handle,
861 *mut crate::base::Guid,
862 *mut *mut core::ffi::c_void,
863) -> crate::base::Status};
864
865pub type BootRegisterProtocolNotify = eficall! {fn(
866 *mut crate::base::Guid,
867 crate::base::Event,
868 *mut *mut core::ffi::c_void,
869) -> crate::base::Status};
870
871pub type BootLocateHandle = eficall! {fn(
872 LocateSearchType,
873 *mut crate::base::Guid,
874 *mut core::ffi::c_void,
875 *mut usize,
876 *mut crate::base::Handle,
877) -> crate::base::Status};
878
879pub type BootLocateDevicePath = eficall! {fn(
880 *mut crate::base::Guid,
881 *mut *mut crate::protocols::device_path::Protocol,
882 *mut crate::base::Handle,
883) -> crate::base::Status};
884
885pub type BootInstallConfigurationTable = eficall! {fn(
886 *mut crate::base::Guid,
887 *mut core::ffi::c_void,
888) -> crate::base::Status};
889
890pub type BootLoadImage = eficall! {fn(
891 crate::base::Boolean,
892 crate::base::Handle,
893 *mut crate::protocols::device_path::Protocol,
894 *mut core::ffi::c_void,
895 usize,
896 *mut crate::base::Handle,
897) -> crate::base::Status};
898
899pub type BootStartImage = eficall! {fn(
900 crate::base::Handle,
901 *mut usize,
902 *mut *mut crate::base::Char16,
903) -> crate::base::Status};
904
905pub type BootExit = eficall! {fn(
906 crate::base::Handle,
907 crate::base::Status,
908 usize,
909 *mut crate::base::Char16,
910) -> crate::base::Status};
911
912pub type BootUnloadImage = eficall! {fn(
913 crate::base::Handle,
914) -> crate::base::Status};
915
916pub type BootExitBootServices = eficall! {fn(
917 crate::base::Handle,
918 usize,
919) -> crate::base::Status};
920
921pub type BootGetNextMonotonicCount = eficall! {fn(
922 *mut u64,
923) -> crate::base::Status};
924
925pub type BootStall = eficall! {fn(
926 usize,
927) -> crate::base::Status};
928
929pub type BootSetWatchdogTimer = eficall! {fn(
930 usize,
931 u64,
932 usize,
933 *mut crate::base::Char16,
934) -> crate::base::Status};
935
936pub type BootConnectController = eficall! {fn(
937 crate::base::Handle,
938 *mut crate::base::Handle,
939 *mut crate::protocols::device_path::Protocol,
940 crate::base::Boolean,
941) -> crate::base::Status};
942
943pub type BootDisconnectController = eficall! {fn(
944 crate::base::Handle,
945 crate::base::Handle,
946 crate::base::Handle,
947) -> crate::base::Status};
948
949pub type BootOpenProtocol = eficall! {fn(
950 crate::base::Handle,
951 *mut crate::base::Guid,
952 *mut *mut core::ffi::c_void,
953 crate::base::Handle,
954 crate::base::Handle,
955 u32,
956) -> crate::base::Status};
957
958pub type BootCloseProtocol = eficall! {fn(
959 crate::base::Handle,
960 *mut crate::base::Guid,
961 crate::base::Handle,
962 crate::base::Handle,
963) -> crate::base::Status};
964
965pub type BootOpenProtocolInformation = eficall! {fn(
966 crate::base::Handle,
967 *mut crate::base::Guid,
968 *mut *mut OpenProtocolInformationEntry,
969 *mut usize,
970) -> crate::base::Status};
971
972pub type BootProtocolsPerHandle = eficall! {fn(
973 crate::base::Handle,
974 *mut *mut *mut crate::base::Guid,
975 *mut usize,
976) -> crate::base::Status};
977
978pub type BootLocateHandleBuffer = eficall! {fn(
979 LocateSearchType,
980 *mut crate::base::Guid,
981 *mut core::ffi::c_void,
982 *mut usize,
983 *mut *mut crate::base::Handle,
984) -> crate::base::Status};
985
986pub type BootLocateProtocol = eficall! {fn(
987 *mut crate::base::Guid,
988 *mut core::ffi::c_void,
989 *mut *mut core::ffi::c_void,
990) -> crate::base::Status};
991
992pub type BootInstallMultipleProtocolInterfaces = eficall! {fn(
993 *mut crate::base::Handle,
994 *mut core::ffi::c_void,
996 *mut core::ffi::c_void,
997) -> crate::base::Status};
998
999pub type BootUninstallMultipleProtocolInterfaces = eficall! {fn(
1000 crate::base::Handle,
1001 *mut core::ffi::c_void,
1003 *mut core::ffi::c_void,
1004) -> crate::base::Status};
1005
1006pub type BootCalculateCrc32 = eficall! {fn(
1007 *mut core::ffi::c_void,
1008 usize,
1009 *mut u32,
1010) -> crate::base::Status};
1011
1012pub type BootCopyMem = eficall! {fn(
1013 *mut core::ffi::c_void,
1014 *mut core::ffi::c_void,
1015 usize,
1016)};
1017
1018pub type BootSetMem = eficall! {fn(
1019 *mut core::ffi::c_void,
1020 usize,
1021 u8,
1022)};
1023
1024pub type BootCreateEventEx = eficall! {fn(
1025 u32,
1026 crate::base::Tpl,
1027 Option<EventNotify>,
1028 *const core::ffi::c_void,
1029 *const crate::base::Guid,
1030 *mut crate::base::Event,
1031) -> crate::base::Status};
1032
1033#[repr(C)]
1034pub struct BootServices {
1035 pub hdr: TableHeader,
1036
1037 pub raise_tpl: BootRaiseTpl,
1038 pub restore_tpl: BootRestoreTpl,
1039
1040 pub allocate_pages: BootAllocatePages,
1041 pub free_pages: BootFreePages,
1042 pub get_memory_map: BootGetMemoryMap,
1043 pub allocate_pool: BootAllocatePool,
1044 pub free_pool: BootFreePool,
1045
1046 pub create_event: BootCreateEvent,
1047 pub set_timer: BootSetTimer,
1048 pub wait_for_event: BootWaitForEvent,
1049 pub signal_event: BootSignalEvent,
1050 pub close_event: BootCloseEvent,
1051 pub check_event: BootCheckEvent,
1052
1053 pub install_protocol_interface: BootInstallProtocolInterface,
1054 pub reinstall_protocol_interface: BootReinstallProtocolInterface,
1055 pub uninstall_protocol_interface: BootUninstallProtocolInterface,
1056 pub handle_protocol: BootHandleProtocol,
1057 pub reserved: *mut core::ffi::c_void,
1058 pub register_protocol_notify: BootRegisterProtocolNotify,
1059 pub locate_handle: BootLocateHandle,
1060 pub locate_device_path: BootLocateDevicePath,
1061
1062 pub install_configuration_table: BootInstallConfigurationTable,
1063
1064 pub load_image: BootLoadImage,
1065 pub start_image: BootStartImage,
1066 pub exit: BootExit,
1067 pub unload_image: BootUnloadImage,
1068 pub exit_boot_services: BootExitBootServices,
1069
1070 pub get_next_monotonic_count: BootGetNextMonotonicCount,
1071 pub stall: BootStall,
1072 pub set_watchdog_timer: BootSetWatchdogTimer,
1073
1074 pub connect_controller: BootConnectController,
1076 pub disconnect_controller: BootDisconnectController,
1077
1078 pub open_protocol: BootOpenProtocol,
1079 pub close_protocol: BootCloseProtocol,
1080 pub open_protocol_information: BootOpenProtocolInformation,
1081
1082 pub protocols_per_handle: BootProtocolsPerHandle,
1083 pub locate_handle_buffer: BootLocateHandleBuffer,
1084 pub locate_protocol: BootLocateProtocol,
1085 pub install_multiple_protocol_interfaces: BootInstallMultipleProtocolInterfaces,
1086 pub uninstall_multiple_protocol_interfaces: BootUninstallMultipleProtocolInterfaces,
1087
1088 pub calculate_crc32: BootCalculateCrc32,
1089
1090 pub copy_mem: BootCopyMem,
1091 pub set_mem: BootSetMem,
1092
1093 pub create_event_ex: BootCreateEventEx,
1095}
1096
1097pub const SYSTEM_TABLE_REVISION_2_70: u32 = (2 << 16) | (70);
1098pub const SYSTEM_TABLE_REVISION_2_60: u32 = (2 << 16) | (60);
1099pub const SYSTEM_TABLE_REVISION_2_50: u32 = (2 << 16) | (50);
1100pub const SYSTEM_TABLE_REVISION_2_40: u32 = (2 << 16) | (40);
1101pub const SYSTEM_TABLE_REVISION_2_31: u32 = (2 << 16) | (31);
1102pub const SYSTEM_TABLE_REVISION_2_30: u32 = (2 << 16) | (30);
1103pub const SYSTEM_TABLE_REVISION_2_20: u32 = (2 << 16) | (20);
1104pub const SYSTEM_TABLE_REVISION_2_10: u32 = (2 << 16) | (10);
1105pub const SYSTEM_TABLE_REVISION_2_00: u32 = (2 << 16) | (0);
1106pub const SYSTEM_TABLE_REVISION_1_10: u32 = (1 << 16) | (10);
1107pub const SYSTEM_TABLE_REVISION_1_02: u32 = (1 << 16) | (2);
1108
1109pub const SYSTEM_TABLE_SIGNATURE: u64 = 0x5453595320494249u64; pub const SYSTEM_TABLE_REVISION: u32 = SYSTEM_TABLE_REVISION_2_70;
1111
1112#[repr(C)]
1113pub struct SystemTable {
1114 pub hdr: TableHeader,
1115 pub firmware_vendor: *mut crate::base::Char16,
1116 pub firmware_revision: u32,
1117
1118 pub console_in_handle: crate::base::Handle,
1119 pub con_in: *mut crate::protocols::simple_text_input::Protocol,
1120 pub console_out_handle: crate::base::Handle,
1121 pub con_out: *mut crate::protocols::simple_text_output::Protocol,
1122 pub standard_error_handle: crate::base::Handle,
1123 pub std_err: *mut crate::protocols::simple_text_output::Protocol,
1124
1125 pub runtime_services: *mut RuntimeServices,
1126 pub boot_services: *mut BootServices,
1127
1128 pub number_of_table_entries: usize,
1129 pub configuration_table: *mut ConfigurationTable,
1130}