Vendor dependencies for 0.3.0 release

This commit is contained in:
2025-09-27 10:29:08 -05:00
parent 0c8d39d483
commit 82ab7f317b
26803 changed files with 16134934 additions and 0 deletions

View File

@@ -0,0 +1,69 @@
//! Absolute Pointer Protocol
//!
//! Provides a simple method for accessing absolute pointer devices. This
//! includes devices such as touch screens and digitizers. The Absolute Pointer
//! Protocol allows information about a pointer device to be retrieved. The
//! protocol is attached to the device handle of an absolute pointer device,
//! and can be used for input from the user in the preboot environment.
//!
//! Supported devices may return 1, 2, or 3 axis of information. The Z axis may
//! optionally be used to return pressure data measurements derived from user
//! pen force.
//!
//! All supported devices must support a touch-active status. Supported devices
//! may optionally support a second input button, for example a pen
//! side-button.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x8d59d32b,
0xc655,
0x4ae9,
0x9b,
0x15,
&[0xf2, 0x59, 0x04, 0x99, 0x2a, 0x43],
);
pub const SUPPORTS_ALT_ACTIVE: u32 = 0x00000001;
pub const SUPPORTS_PRESSURE_AS_Z: u32 = 0x00000002;
#[derive(Clone, Copy, Debug, Default)]
#[repr(C)]
pub struct Mode {
pub absolute_min_x: u64,
pub absolute_min_y: u64,
pub absolute_min_z: u64,
pub absolute_max_x: u64,
pub absolute_max_y: u64,
pub absolute_max_z: u64,
pub attributes: u32,
}
pub const TOUCH_ACTIVE: u32 = 0x00000001;
pub const ALT_ACTIVE: u32 = 0x00000002;
#[derive(Clone, Copy, Debug, Default)]
#[repr(C)]
pub struct State {
pub current_x: u64,
pub current_y: u64,
pub current_z: u64,
pub active_buttons: u32,
}
pub type Reset = eficall! {fn(
this: *mut Protocol,
extended_verification: bool,
) -> crate::base::Status};
pub type GetState = eficall! {fn(
this: *mut Protocol,
state: *mut State,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub reset: Reset,
pub get_state: GetState,
pub wait_for_input: crate::efi::Event,
pub mode: *mut Mode,
}

70
vendor/r-efi/src/protocols/block_io.rs vendored Normal file
View File

@@ -0,0 +1,70 @@
//! Block I/O Protocol
//!
//! Used to abstract mass storage devices to allow code running in the EFI boot services environment
//! to access the storage devices without specific knowledge of the type of device or controller that
//! manages the device.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x964e5b21,
0x6459,
0x11d2,
0x8e,
0x39,
&[0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b],
);
pub const REVISION: u64 = 0x0000000000010000u64;
pub const REVISION2: u64 = 0x0000000000020001u64;
pub const REVISION3: u64 = 0x000000000002001fu64;
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct Media {
pub media_id: u32,
pub removable_media: bool,
pub media_present: bool,
pub logical_partition: bool,
pub read_only: bool,
pub write_caching: bool,
pub block_size: u32,
pub io_align: u32,
pub last_block: crate::base::Lba,
pub lowest_aligned_lba: crate::base::Lba,
pub logical_blocks_per_physical_block: u32,
pub optimal_transfer_length_granularity: u32,
}
pub type ProtocolReset = eficall! {fn(
*mut Protocol,
crate::base::Boolean,
) -> crate::base::Status};
pub type ProtocolReadBlocks = eficall! {fn(
*mut Protocol,
u32,
crate::base::Lba,
usize,
*mut core::ffi::c_void,
) -> crate::base::Status};
pub type ProtocolWriteBlocks = eficall! {fn(
*mut Protocol,
u32,
crate::base::Lba,
usize,
*mut core::ffi::c_void,
) -> crate::base::Status};
pub type ProtocolFlushBlocks = eficall! {fn(
*mut Protocol,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub revision: u64,
pub media: *const Media,
pub reset: ProtocolReset,
pub read_blocks: ProtocolReadBlocks,
pub write_blocks: ProtocolWriteBlocks,
pub flush_blocks: ProtocolFlushBlocks,
}

View File

@@ -0,0 +1,32 @@
//! Bus Specific Driver Override Protocol
//!
//! This protocol matches one or more drivers to a controller. This protocol is
//! produced by a bus driver, and it is installed on the child handles of buses
//! that require a bus specific algorithm for matching drivers to controllers.
//! This protocol is used by the `EFI_BOOT_SERVICES.ConnectController()` boot
//! service to select the best driver for a controller. All of the drivers
//! returned by this protocol have a higher precedence than drivers found in
//! the general EFI Driver Binding search algorithm, but a lower precedence
//! than those drivers returned by the EFI Platform Driver Override Protocol.
//! If more than one driver image handle is returned by this protocol, then the
//! drivers image handles are returned in order from highest precedence to
//! lowest precedence.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x3bc1b285,
0x8a15,
0x4a82,
0xaa,
0xbf,
&[0x4d, 0x7d, 0x13, 0xfb, 0x32, 0x65],
);
pub type ProtocolGetDriver = eficall! {fn(
*mut Protocol,
*mut crate::base::Handle,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub get_driver: ProtocolGetDriver,
}

View File

@@ -0,0 +1,835 @@
//! Debug Support Protocol
//!
//! It provides the services to allow the debug agent to register callback functions that are
//! called either periodically or when specific processor exceptions occur.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x2755590c,
0x6f3c,
0x42fa,
0x9e,
0xa4,
&[0xa3, 0xba, 0x54, 0x3c, 0xda, 0x25],
);
pub type InstructionSetArchitecture = u32;
pub const ISA_IA32: InstructionSetArchitecture = 0x014c;
pub const ISA_X64: InstructionSetArchitecture = 0x8664;
pub const ISA_IPF: InstructionSetArchitecture = 0x0200;
pub const ISA_EBC: InstructionSetArchitecture = 0x0ebc;
pub const ISA_ARM: InstructionSetArchitecture = 0x1c2;
pub const ISA_AARCH64: InstructionSetArchitecture = 0xaa64;
pub const ISA_RISCV32: InstructionSetArchitecture = 0x5032;
pub const ISA_RISCV64: InstructionSetArchitecture = 0x5064;
pub const ISA_RISCV128: InstructionSetArchitecture = 0x5128;
#[repr(C)]
#[derive(Clone, Copy)]
pub union SystemContext {
pub system_context_ebc: *mut SystemContextEbc,
pub system_context_ia32: *mut SystemContextIa32,
pub system_context_x64: *mut SystemContextX64,
pub system_context_ipf: *mut SystemContextIpf,
pub system_context_arm: *mut SystemContextArm,
pub system_context_aarch64: *mut SystemContextAArch64,
pub system_context_riscv32: *mut SystemContextRiscV32,
pub system_context_riscv64: *mut SystemContextRiscV64,
pub system_context_riscv128: *mut SystemContextRiscV128,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct SystemContextEbc {
pub r0: u64,
pub r1: u64,
pub r2: u64,
pub r3: u64,
pub r4: u64,
pub r5: u64,
pub r6: u64,
pub r7: u64,
pub flags: u64,
pub control_flags: u64,
pub ip: u64,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct SystemContextRiscV32 {
// Integer registers
pub zero: u32,
pub ra: u32,
pub sp: u32,
pub gp: u32,
pub tp: u32,
pub t0: u32,
pub t1: u32,
pub t2: u32,
pub s0fp: u32,
pub s1: u32,
pub a0: u32,
pub a1: u32,
pub a2: u32,
pub a3: u32,
pub a4: u32,
pub a5: u32,
pub a6: u32,
pub a7: u32,
pub s2: u32,
pub s3: u32,
pub s4: u32,
pub s5: u32,
pub s6: u32,
pub s7: u32,
pub s8: u32,
pub s9: u32,
pub s10: u32,
pub s11: u32,
pub t3: u32,
pub t4: u32,
pub t5: u32,
pub t6: u32,
// Floating registers for F, D and Q Standard Extensions
pub ft0: u128,
pub ft1: u128,
pub ft2: u128,
pub ft3: u128,
pub ft4: u128,
pub ft5: u128,
pub ft6: u128,
pub ft7: u128,
pub fs0: u128,
pub fs1: u128,
pub fa0: u128,
pub fa1: u128,
pub fa2: u128,
pub fa3: u128,
pub fa4: u128,
pub fa5: u128,
pub fa6: u128,
pub fa7: u128,
pub fs2: u128,
pub fs3: u128,
pub fs4: u128,
pub fs5: u128,
pub fs6: u128,
pub fs7: u128,
pub fs8: u128,
pub fs9: u128,
pub fs10: u128,
pub fs11: u128,
pub ft8: u128,
pub ft9: u128,
pub ft10: u128,
pub ft11: u128,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct SystemContextRiscV64 {
// Integer registers
pub zero: u64,
pub ra: u64,
pub sp: u64,
pub gp: u64,
pub tp: u64,
pub t0: u64,
pub t1: u64,
pub t2: u64,
pub s0fp: u64,
pub s1: u64,
pub a0: u64,
pub a1: u64,
pub a2: u64,
pub a3: u64,
pub a4: u64,
pub a5: u64,
pub a6: u64,
pub a7: u64,
pub s2: u64,
pub s3: u64,
pub s4: u64,
pub s5: u64,
pub s6: u64,
pub s7: u64,
pub s8: u64,
pub s9: u64,
pub s10: u64,
pub s11: u64,
pub t3: u64,
pub t4: u64,
pub t5: u64,
pub t6: u64,
// Floating registers for F, D and Q Standard Extensions
pub ft0: u128,
pub ft1: u128,
pub ft2: u128,
pub ft3: u128,
pub ft4: u128,
pub ft5: u128,
pub ft6: u128,
pub ft7: u128,
pub fs0: u128,
pub fs1: u128,
pub fa0: u128,
pub fa1: u128,
pub fa2: u128,
pub fa3: u128,
pub fa4: u128,
pub fa5: u128,
pub fa6: u128,
pub fa7: u128,
pub fs2: u128,
pub fs3: u128,
pub fs4: u128,
pub fs5: u128,
pub fs6: u128,
pub fs7: u128,
pub fs8: u128,
pub fs9: u128,
pub fs10: u128,
pub fs11: u128,
pub ft8: u128,
pub ft9: u128,
pub ft10: u128,
pub ft11: u128,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct SystemContextRiscV128 {
// Integer registers
pub zero: u128,
pub ra: u128,
pub sp: u128,
pub gp: u128,
pub tp: u128,
pub t0: u128,
pub t1: u128,
pub t2: u128,
pub s0fp: u128,
pub s1: u128,
pub a0: u128,
pub a1: u128,
pub a2: u128,
pub a3: u128,
pub a4: u128,
pub a5: u128,
pub a6: u128,
pub a7: u128,
pub s2: u128,
pub s3: u128,
pub s4: u128,
pub s5: u128,
pub s6: u128,
pub s7: u128,
pub s8: u128,
pub s9: u128,
pub s10: u128,
pub s11: u128,
pub t3: u128,
pub t4: u128,
pub t5: u128,
pub t6: u128,
// Floating registers for F, D and Q Standard Extensions
pub ft0: u128,
pub ft1: u128,
pub ft2: u128,
pub ft3: u128,
pub ft4: u128,
pub ft5: u128,
pub ft6: u128,
pub ft7: u128,
pub fs0: u128,
pub fs1: u128,
pub fa0: u128,
pub fa1: u128,
pub fa2: u128,
pub fa3: u128,
pub fa4: u128,
pub fa5: u128,
pub fa6: u128,
pub fa7: u128,
pub fs2: u128,
pub fs3: u128,
pub fs4: u128,
pub fs5: u128,
pub fs6: u128,
pub fs7: u128,
pub fs8: u128,
pub fs9: u128,
pub fs10: u128,
pub fs11: u128,
pub ft8: u128,
pub ft9: u128,
pub ft10: u128,
pub ft11: u128,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct SystemContextIa32 {
// ExceptionData is additional data pushed on the stack by some types of IA-32 exceptions
pub exception_data: u32,
pub fx_save_state: FxSaveStateIA32,
pub dr0: u32,
pub dr1: u32,
pub dr2: u32,
pub dr3: u32,
pub dr6: u32,
pub dr7: u32,
pub cr0: u32,
// Reserved
pub cr1: u32,
pub cr2: u32,
pub cr3: u32,
pub cr4: u32,
pub eflags: u32,
pub ldtr: u32,
pub tr: u32,
pub gdtr: [u32; 2],
pub idtr: [u32; 2],
pub eip: u32,
pub gs: u32,
pub fs: u32,
pub es: u32,
pub ds: u32,
pub cs: u32,
pub ss: u32,
pub edi: u32,
pub esi: u32,
pub ebp: u32,
pub esp: u32,
pub ebx: u32,
pub edx: u32,
pub ecx: u32,
pub eax: u32,
}
// FXSAVE_STATE - FP / MMX / XMM registers
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct FxSaveStateIA32 {
pub fcw: u16,
pub fsw: u16,
pub ftw: u16,
pub opcode: u16,
pub eip: u32,
pub cs: u16,
pub reserved_1: u16,
pub data_offset: u32,
pub ds: u16,
pub reserved_2: [u8; 10],
pub st0mm0: [u8; 10],
pub reserved_3: [u8; 6],
pub st1mm1: [u8; 10],
pub reserved_4: [u8; 6],
pub st2mm2: [u8; 10],
pub reserved_5: [u8; 6],
pub st3mm3: [u8; 10],
pub reserved_6: [u8; 6],
pub st4mm4: [u8; 10],
pub reserved_7: [u8; 6],
pub st5mm5: [u8; 10],
pub reserved_8: [u8; 6],
pub st6mm6: [u8; 10],
pub reserved_9: [u8; 6],
pub st7mm7: [u8; 10],
pub reserved_10: [u8; 6],
pub xmm0: [u8; 16],
pub xmm1: [u8; 16],
pub xmm2: [u8; 16],
pub xmm3: [u8; 16],
pub xmm4: [u8; 16],
pub xmm5: [u8; 16],
pub xmm6: [u8; 16],
pub xmm7: [u8; 16],
pub reserved_11: [u8; 14 * 16],
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct SystemContextX64 {
// ExceptionData is additional data pushed on the stack by some types of x64 64-bit mode exceptions
pub exception_data: u64,
pub fx_save_state: FxSaveStateX64,
pub dr0: u64,
pub dr1: u64,
pub dr2: u64,
pub dr3: u64,
pub dr6: u64,
pub dr7: u64,
pub cr0: u64,
// Reserved
pub cr1: u64,
pub cr2: u64,
pub cr3: u64,
pub cr4: u64,
pub cr8: u64,
pub rflags: u64,
pub ldtr: u64,
pub tr: u64,
pub gdtr: [u64; 2],
pub idtr: [u64; 2],
pub rip: u64,
pub gs: u64,
pub fs: u64,
pub es: u64,
pub ds: u64,
pub cs: u64,
pub ss: u64,
pub rdi: u64,
pub rsi: u64,
pub rbp: u64,
pub rsp: u64,
pub rbx: u64,
pub rdx: u64,
pub rcx: u64,
pub rax: u64,
pub r8: u64,
pub r9: u64,
pub r10: u64,
pub r11: u64,
pub r12: u64,
pub r13: u64,
pub r14: u64,
pub r15: u64,
}
// FXSAVE_STATE FP / MMX / XMM registers
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct FxSaveStateX64 {
pub fcw: u16,
pub fsw: u16,
pub ftw: u16,
pub opcode: u16,
pub rip: u64,
pub data_offset: u64,
pub reserved_1: [u8; 8],
pub st0mm0: [u8; 10],
pub reserved_2: [u8; 6],
pub st1mm1: [u8; 10],
pub reserved_3: [u8; 6],
pub st2mm2: [u8; 10],
pub reserved_4: [u8; 6],
pub st3mm3: [u8; 10],
pub reserved_5: [u8; 6],
pub st4mm4: [u8; 10],
pub reserved_6: [u8; 6],
pub st5mm5: [u8; 10],
pub reserved_7: [u8; 6],
pub st6mm6: [u8; 10],
pub reserved_8: [u8; 6],
pub st7mm7: [u8; 10],
pub reserved_9: [u8; 6],
pub xmm0: [u8; 16],
pub xmm1: [u8; 16],
pub xmm2: [u8; 16],
pub xmm3: [u8; 16],
pub xmm4: [u8; 16],
pub xmm5: [u8; 16],
pub xmm6: [u8; 16],
pub xmm7: [u8; 16],
pub reserved_11: [u8; 14 * 16],
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct SystemContextIpf {
pub reserved: u64,
pub r1: u64,
pub r2: u64,
pub r3: u64,
pub r4: u64,
pub r5: u64,
pub r6: u64,
pub r7: u64,
pub r8: u64,
pub r9: u64,
pub r10: u64,
pub r11: u64,
pub r12: u64,
pub r13: u64,
pub r14: u64,
pub r15: u64,
pub r16: u64,
pub r17: u64,
pub r18: u64,
pub r19: u64,
pub r20: u64,
pub r21: u64,
pub r22: u64,
pub r23: u64,
pub r24: u64,
pub r25: u64,
pub r26: u64,
pub r27: u64,
pub r28: u64,
pub r29: u64,
pub r30: u64,
pub r31: u64,
pub f2: [u64; 2],
pub f3: [u64; 2],
pub f4: [u64; 2],
pub f5: [u64; 2],
pub f6: [u64; 2],
pub f7: [u64; 2],
pub f8: [u64; 2],
pub f9: [u64; 2],
pub f10: [u64; 2],
pub f11: [u64; 2],
pub f12: [u64; 2],
pub f13: [u64; 2],
pub f14: [u64; 2],
pub f15: [u64; 2],
pub f16: [u64; 2],
pub f17: [u64; 2],
pub f18: [u64; 2],
pub f19: [u64; 2],
pub f20: [u64; 2],
pub f21: [u64; 2],
pub f22: [u64; 2],
pub f23: [u64; 2],
pub f24: [u64; 2],
pub f25: [u64; 2],
pub f26: [u64; 2],
pub f27: [u64; 2],
pub f28: [u64; 2],
pub f29: [u64; 2],
pub f30: [u64; 2],
pub f31: [u64; 2],
pub pr: u64,
pub b0: u64,
pub b1: u64,
pub b2: u64,
pub b3: u64,
pub b4: u64,
pub b5: u64,
pub b6: u64,
pub b7: u64,
// application registers
pub ar_rsc: u64,
pub ar_bsp: u64,
pub ar_bspstore: u64,
pub ar_rnat: u64,
pub ar_fcr: u64,
pub ar_eflag: u64,
pub ar_csd: u64,
pub ar_ssd: u64,
pub ar_cflg: u64,
pub ar_fsr: u64,
pub ar_fir: u64,
pub ar_fdr: u64,
pub ar_ccv: u64,
pub ar_unat: u64,
pub ar_fpsr: u64,
pub ar_pfs: u64,
pub ar_lc: u64,
pub ar_ec: u64,
// control registers
pub cr_dcr: u64,
pub cr_itm: u64,
pub cr_iva: u64,
pub cr_pta: u64,
pub cr_ipsr: u64,
pub cr_isr: u64,
pub cr_iip: u64,
pub cr_ifa: u64,
pub cr_itir: u64,
pub cr_iipa: u64,
pub cr_ifs: u64,
pub cr_iim: u64,
pub cr_iha: u64,
// debug registers
pub dbr0: u64,
pub dbr1: u64,
pub dbr2: u64,
pub dbr3: u64,
pub dbr4: u64,
pub dbr5: u64,
pub dbr6: u64,
pub dbr7: u64,
pub ibr0: u64,
pub ibr1: u64,
pub ibr2: u64,
pub ibr3: u64,
pub ibr4: u64,
pub ibr5: u64,
pub ibr6: u64,
pub ibr7: u64,
// virtual Registers
pub int_nat: u64, // nat bits for r1-r31
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct SystemContextArm {
pub r0: u32,
pub r1: u32,
pub r2: u32,
pub r3: u32,
pub r4: u32,
pub r5: u32,
pub r6: u32,
pub r7: u32,
pub r8: u32,
pub r9: u32,
pub r10: u32,
pub r11: u32,
pub r12: u32,
pub sp: u32,
pub lr: u32,
pub pc: u32,
pub cpsr: u32,
pub dfsr: u32,
pub dfar: u32,
pub ifsr: u32,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct SystemContextAArch64 {
// General Purpose Registers
pub x0: u64,
pub x1: u64,
pub x2: u64,
pub x3: u64,
pub x4: u64,
pub x5: u64,
pub x6: u64,
pub x7: u64,
pub x8: u64,
pub x9: u64,
pub x10: u64,
pub x11: u64,
pub x12: u64,
pub x13: u64,
pub x14: u64,
pub x15: u64,
pub x16: u64,
pub x17: u64,
pub x18: u64,
pub x19: u64,
pub x20: u64,
pub x21: u64,
pub x22: u64,
pub x23: u64,
pub x24: u64,
pub x25: u64,
pub x26: u64,
pub x27: u64,
pub x28: u64,
pub fp: u64, // x29 - Frame Pointer
pub lr: u64, // x30 - Link Register
pub sp: u64, // x31 - Stack Pointer
// FP/SIMD Registers
pub v0: [u64; 2],
pub v1: [u64; 2],
pub v2: [u64; 2],
pub v3: [u64; 2],
pub v4: [u64; 2],
pub v5: [u64; 2],
pub v6: [u64; 2],
pub v7: [u64; 2],
pub v8: [u64; 2],
pub v9: [u64; 2],
pub v10: [u64; 2],
pub v11: [u64; 2],
pub v12: [u64; 2],
pub v13: [u64; 2],
pub v14: [u64; 2],
pub v15: [u64; 2],
pub v16: [u64; 2],
pub v17: [u64; 2],
pub v18: [u64; 2],
pub v19: [u64; 2],
pub v20: [u64; 2],
pub v21: [u64; 2],
pub v22: [u64; 2],
pub v23: [u64; 2],
pub v24: [u64; 2],
pub v25: [u64; 2],
pub v26: [u64; 2],
pub v27: [u64; 2],
pub v28: [u64; 2],
pub v29: [u64; 2],
pub v30: [u64; 2],
pub v31: [u64; 2],
pub elr: u64, // Exception Link Register
pub spsr: u64, // Saved Processor Status Register
pub fpsr: u64, // Floating Point Status Register
pub esr: u64, // Exception Syndrome Register
pub far: u64, // Fault Address Register
}
pub type ExceptionType = isize;
// EBC Exception types
pub const EXCEPT_EBC_UNDEFINED: ExceptionType = 0;
pub const EXCEPT_EBC_DIVIDE_ERROR: ExceptionType = 1;
pub const EXCEPT_EBC_DEBUG: ExceptionType = 2;
pub const EXCEPT_EBC_BREAKPOINT: ExceptionType = 3;
pub const EXCEPT_EBC_OVERFLOW: ExceptionType = 4;
pub const EXCEPT_EBC_INVALID_OPCODE: ExceptionType = 5;
pub const EXCEPT_EBC_STACK_FAULT: ExceptionType = 6;
pub const EXCEPT_EBC_ALIGNMENT_CHECK: ExceptionType = 7;
pub const EXCEPT_EBC_INSTRUCTION_ENCODING: ExceptionType = 8;
pub const EXCEPT_EBC_BAD_BREAK: ExceptionType = 9;
pub const EXCEPT_EBC_SINGLE_STEP: ExceptionType = 10;
// IA-32 Exception types
pub const EXCEPT_IA32_DIVIDE_ERROR: ExceptionType = 0;
pub const EXCEPT_IA32_DEBUG: ExceptionType = 1;
pub const EXCEPT_IA32_NMI: ExceptionType = 2;
pub const EXCEPT_IA32_BREAKPOINT: ExceptionType = 3;
pub const EXCEPT_IA32_OVERFLOW: ExceptionType = 4;
pub const EXCEPT_IA32_BOUND: ExceptionType = 5;
pub const EXCEPT_IA32_INVALID_OPCODE: ExceptionType = 6;
pub const EXCEPT_IA32_DOUBLE_FAULT: ExceptionType = 8;
pub const EXCEPT_IA32_INVALID_TSS: ExceptionType = 10;
pub const EXCEPT_IA32_SEG_NOT_PRESENT: ExceptionType = 11;
pub const EXCEPT_IA32_STACK_FAULT: ExceptionType = 12;
pub const EXCEPT_IA32_GP_FAULT: ExceptionType = 13;
pub const EXCEPT_IA32_PAGE_FAULT: ExceptionType = 14;
pub const EXCEPT_IA32_FP_ERROR: ExceptionType = 16;
pub const EXCEPT_IA32_ALIGNMENT_CHECK: ExceptionType = 17;
pub const EXCEPT_IA32_MACHINE_CHECK: ExceptionType = 18;
pub const EXCEPT_IA32_SIMD: ExceptionType = 19;
// X64 Exception types
pub const EXCEPT_X64_DIVIDE_ERROR: ExceptionType = 0;
pub const EXCEPT_X64_DEBUG: ExceptionType = 1;
pub const EXCEPT_X64_NMI: ExceptionType = 2;
pub const EXCEPT_X64_BREAKPOINT: ExceptionType = 3;
pub const EXCEPT_X64_OVERFLOW: ExceptionType = 4;
pub const EXCEPT_X64_BOUND: ExceptionType = 5;
pub const EXCEPT_X64_INVALID_OPCODE: ExceptionType = 6;
pub const EXCEPT_X64_DOUBLE_FAULT: ExceptionType = 8;
pub const EXCEPT_X64_INVALID_TSS: ExceptionType = 10;
pub const EXCEPT_X64_SEG_NOT_PRESENT: ExceptionType = 11;
pub const EXCEPT_X64_STACK_FAULT: ExceptionType = 12;
pub const EXCEPT_X64_GP_FAULT: ExceptionType = 13;
pub const EXCEPT_X64_PAGE_FAULT: ExceptionType = 14;
pub const EXCEPT_X64_FP_ERROR: ExceptionType = 16;
pub const EXCEPT_X64_ALIGNMENT_CHECK: ExceptionType = 17;
pub const EXCEPT_X64_MACHINE_CHECK: ExceptionType = 18;
pub const EXCEPT_X64_SIMD: ExceptionType = 19;
// Itanium Processor Family Exception types
pub const EXCEPT_IPF_VHTP_TRANSLATION: ExceptionType = 0;
pub const EXCEPT_IPF_INSTRUCTION_TLB: ExceptionType = 1;
pub const EXCEPT_IPF_DATA_TLB: ExceptionType = 2;
pub const EXCEPT_IPF_ALT_INSTRUCTION_TLB: ExceptionType = 3;
pub const EXCEPT_IPF_ALT_DATA_TLB: ExceptionType = 4;
pub const EXCEPT_IPF_DATA_NESTED_TLB: ExceptionType = 5;
pub const EXCEPT_IPF_INSTRUCTION_KEY_MISSED: ExceptionType = 6;
pub const EXCEPT_IPF_DATA_KEY_MISSED: ExceptionType = 7;
pub const EXCEPT_IPF_DIRTY_BIT: ExceptionType = 8;
pub const EXCEPT_IPF_INSTRUCTION_ACCESS_BIT: ExceptionType = 9;
pub const EXCEPT_IPF_DATA_ACCESS_BIT: ExceptionType = 10;
pub const EXCEPT_IPF_BREAKPOINT: ExceptionType = 11;
pub const EXCEPT_IPF_EXTERNAL_INTERRUPT: ExceptionType = 12;
// 13 - 19 reserved
pub const EXCEPT_IPF_PAGE_NOT_PRESENT: ExceptionType = 20;
pub const EXCEPT_IPF_KEY_PERMISSION: ExceptionType = 21;
pub const EXCEPT_IPF_INSTRUCTION_ACCESS_RIGHTS: ExceptionType = 22;
pub const EXCEPT_IPF_DATA_ACCESS_RIGHTS: ExceptionType = 23;
pub const EXCEPT_IPF_GENERAL_EXCEPTION: ExceptionType = 24;
pub const EXCEPT_IPF_DISABLED_FP_REGISTER: ExceptionType = 25;
pub const EXCEPT_IPF_NAT_CONSUMPTION: ExceptionType = 26;
pub const EXCEPT_IPF_SPECULATION: ExceptionType = 27;
// 28 reserved
pub const EXCEPT_IPF_DEBUG: ExceptionType = 29;
pub const EXCEPT_IPF_UNALIGNED_REFERENCE: ExceptionType = 30;
pub const EXCEPT_IPF_UNSUPPORTED_DATA_REFERENCE: ExceptionType = 31;
pub const EXCEPT_IPF_FP_FAULT: ExceptionType = 32;
pub const EXCEPT_IPF_FP_TRAP: ExceptionType = 33;
pub const EXCEPT_IPF_LOWER_PRIVILEGE_TRANSFER_TRAP: ExceptionType = 34;
pub const EXCEPT_IPF_TAKEN_BRANCH: ExceptionType = 35;
pub const EXCEPT_IPF_SINGLE_STEP: ExceptionType = 36;
// 37 - 44 reserved
pub const EXCEPT_IPF_IA32_EXCEPTION: ExceptionType = 45;
pub const EXCEPT_IPF_IA32_INTERCEPT: ExceptionType = 46;
pub const EXCEPT_IPF_IA32_INTERRUPT: ExceptionType = 47;
// ARM processor exception types
pub const EXCEPT_ARM_RESET: ExceptionType = 0;
pub const EXCEPT_ARM_UNDEFINED_INSTRUCTION: ExceptionType = 1;
pub const EXCEPT_ARM_SOFTWARE_INTERRUPT: ExceptionType = 2;
pub const EXCEPT_ARM_PREFETCH_ABORT: ExceptionType = 3;
pub const EXCEPT_ARM_DATA_ABORT: ExceptionType = 4;
pub const EXCEPT_ARM_RESERVED: ExceptionType = 5;
pub const EXCEPT_ARM_IRQ: ExceptionType = 6;
pub const EXCEPT_ARM_FIQ: ExceptionType = 7;
pub const MAX_ARM_EXCEPTION: ExceptionType = EXCEPT_ARM_FIQ;
// AARCH64 processor exception types.
pub const EXCEPT_AARCH64_SYNCHRONOUS_EXCEPTIONS: ExceptionType = 0;
pub const EXCEPT_AARCH64_IRQ: ExceptionType = 1;
pub const EXCEPT_AARCH64_FIQ: ExceptionType = 2;
pub const EXCEPT_AARCH64_SERROR: ExceptionType = 3;
pub const MAX_AARCH64_EXCEPTION: ExceptionType = EXCEPT_AARCH64_SERROR;
// RISC-V processor exception types.
pub const EXCEPT_RISCV_INST_MISALIGNED: ExceptionType = 0;
pub const EXCEPT_RISCV_INST_ACCESS_FAULT: ExceptionType = 1;
pub const EXCEPT_RISCV_ILLEGAL_INST: ExceptionType = 2;
pub const EXCEPT_RISCV_BREAKPOINT: ExceptionType = 3;
pub const EXCEPT_RISCV_LOAD_ADDRESS_MISALIGNED: ExceptionType = 4;
pub const EXCEPT_RISCV_LOAD_ACCESS_FAULT: ExceptionType = 5;
pub const EXCEPT_RISCV_STORE_AMO_ADDRESS_MISALIGNED: ExceptionType = 6;
pub const EXCEPT_RISCV_STORE_AMO_ACCESS_FAULT: ExceptionType = 7;
pub const EXCEPT_RISCV_ENV_CALL_FROM_UMODE: ExceptionType = 8;
pub const EXCEPT_RISCV_ENV_CALL_FROM_SMODE: ExceptionType = 9;
pub const EXCEPT_RISCV_ENV_CALL_FROM_MMODE: ExceptionType = 11;
pub const EXCEPT_RISCV_INST_PAGE_FAULT: ExceptionType = 12;
pub const EXCEPT_RISCV_LOAD_PAGE_FAULT: ExceptionType = 13;
pub const EXCEPT_RISCV_STORE_AMO_PAGE_FAULT: ExceptionType = 15;
// RISC-V processor interrupt types.
pub const EXCEPT_RISCV_SUPERVISOR_SOFTWARE_INT: ExceptionType = 1;
pub const EXCEPT_RISCV_MACHINE_SOFTWARE_INT: ExceptionType = 3;
pub const EXCEPT_RISCV_SUPERVISOR_TIMER_INT: ExceptionType = 5;
pub const EXCEPT_RISCV_MACHINE_TIMER_INT: ExceptionType = 7;
pub const EXCEPT_RISCV_SUPERVISOR_EXTERNAL_INT: ExceptionType = 9;
pub const EXCEPT_RISCV_MACHINE_EXTERNAL_INT: ExceptionType = 11;
pub type GetMaximumProcessorIndex = eficall! {fn(
*mut Protocol,
*mut usize,
) -> crate::base::Status};
pub type PeriodicCallback = eficall! {fn(SystemContext)};
pub type RegisterPeriodicCallback = eficall! {fn(
*mut Protocol,
usize,
Option<PeriodicCallback>,
) -> crate::base::Status};
pub type ExceptionCallback = eficall! {fn(ExceptionType, SystemContext)};
pub type RegisterExceptionCallback = eficall! {fn(
*mut Protocol,
usize,
Option<ExceptionCallback>,
ExceptionType,
) -> crate::base::Status};
pub type InvalidateInstructionCache = eficall! {fn(
*mut Protocol,
usize,
*mut core::ffi::c_void,
u64,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub isa: InstructionSetArchitecture,
pub get_maximum_processor_index: GetMaximumProcessorIndex,
pub register_periodic_callback: RegisterPeriodicCallback,
pub register_exception_callback: RegisterExceptionCallback,
pub invalidate_instruction_cache: InvalidateInstructionCache,
}

42
vendor/r-efi/src/protocols/debugport.rs vendored Normal file
View File

@@ -0,0 +1,42 @@
//! Debug Port Protocol
//!
//! It provides the communication link between the debug agent and the remote host.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0xeba4e8d2,
0x3858,
0x41ec,
0xa2,
0x81,
&[0x26, 0x47, 0xba, 0x96, 0x60, 0xd0],
);
pub type Reset = eficall! {fn(
*mut Protocol,
) -> *mut crate::base::Status};
pub type Write = eficall! {fn(
*mut Protocol,
u32,
*mut usize,
*mut core::ffi::c_void
) -> *mut crate::base::Status};
pub type Read = eficall! {fn(
*mut Protocol,
u32,
*mut usize,
*mut core::ffi::c_void
) -> *mut crate::base::Status};
pub type Poll = eficall! {fn(
*mut Protocol,
) -> *mut crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub reset: Reset,
pub write: Write,
pub read: Read,
pub poll: Poll,
}

View File

@@ -0,0 +1,37 @@
//! Decompress Protocol
//!
//! The decompress protocol provides a decompression service that allows a compressed source
//! buffer in memory to be decompressed into a destination buffer in memory.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0xd8117cfe,
0x94a6,
0x11d4,
0x9a,
0x3a,
&[0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d],
);
pub type ProtocolGetInfo = eficall! {fn(
*mut Protocol,
*mut core::ffi::c_void,
u32,
*mut u32,
*mut u32,
) -> crate::base::Status};
pub type ProtocolDecompress = eficall! {fn(
*mut Protocol,
*mut core::ffi::c_void,
u32,
*mut core::ffi::c_void,
u32,
*mut core::ffi::c_void,
u32,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub get_info: ProtocolGetInfo,
pub decompress: ProtocolDecompress,
}

View File

@@ -0,0 +1,82 @@
//! Device Path Protocol
//!
//! The device path protocol defines how to obtain generic path/location information
//! concerning the phisycal or logical device.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x09576e91,
0x6d3f,
0x11d2,
0x8e,
0x39,
&[0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b],
);
pub const TYPE_HARDWARE: u8 = 0x01;
pub const TYPE_ACPI: u8 = 0x02;
pub const TYPE_MESSAGING: u8 = 0x03;
pub const TYPE_MEDIA: u8 = 0x04;
pub const TYPE_BIOS: u8 = 0x05;
pub const TYPE_END: u8 = 0x7f;
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct Protocol {
pub r#type: u8,
pub sub_type: u8,
pub length: [u8; 2],
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct End {
pub header: Protocol,
}
impl End {
pub const SUBTYPE_INSTANCE: u8 = 0x01;
pub const SUBTYPE_ENTIRE: u8 = 0xff;
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct Hardware {
pub header: Protocol,
}
impl Hardware {
pub const SUBTYPE_PCI: u8 = 0x01;
pub const SUBTYPE_PCCARD: u8 = 0x02;
pub const SUBTYPE_MMAP: u8 = 0x03;
pub const SUBTYPE_VENDOR: u8 = 0x04;
pub const SUBTYPE_CONTROLLER: u8 = 0x05;
pub const SUBTYPE_BMC: u8 = 0x06;
}
#[repr(C, packed)]
#[derive(Clone, Copy, Debug)]
pub struct HardDriveMedia {
pub header: Protocol,
pub partition_number: u32,
pub partition_start: u64,
pub partition_size: u64,
pub partition_signature: [u8; 16],
pub partition_format: u8,
pub signature_type: u8,
}
pub struct Media {
pub header: Protocol,
}
impl Media {
pub const SUBTYPE_HARDDRIVE: u8 = 0x01;
pub const SUBTYPE_CDROM: u8 = 0x02;
pub const SUBTYPE_VENDOR: u8 = 0x03;
pub const SUBTYPE_FILE_PATH: u8 = 0x04;
pub const SUBTYPE_MEDIA_PROTOCOL: u8 = 0x05;
pub const SUBTYPE_PIWG_FIRMWARE_FILE: u8 = 0x06;
pub const SUBTYPE_PIWG_FIRMWARE_VOLUME: u8 = 0x07;
pub const SUBTYPE_RELATIVE_OFFSET_RANGE: u8 = 0x08;
pub const SUBTYPE_RAM_DISK: u8 = 0x09;
}

View File

@@ -0,0 +1,26 @@
//! Device Path From Text Protocol
//!
//! Convert text to device paths and device nodes.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x5c99a21,
0xc70f,
0x4ad2,
0x8a,
0x5f,
&[0x35, 0xdf, 0x33, 0x43, 0xf5, 0x1e],
);
pub type DevicePathFromTextNode = eficall! {fn(
*const crate::base::Char16,
) -> *mut crate::protocols::device_path::Protocol};
pub type DevicePathFromTextPath = eficall! {fn(
*const crate::base::Char16,
) -> *mut crate::protocols::device_path::Protocol};
#[repr(C)]
pub struct Protocol {
pub convert_text_to_device_node: DevicePathFromTextNode,
pub convert_text_to_device_path: DevicePathFromTextPath,
}

View File

@@ -0,0 +1,30 @@
//! Device Path to Text Protocol
//!
//! Convert device nodes and paths to text.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x8b843e20,
0x8132,
0x4852,
0x90,
0xcc,
&[0x55, 0x1a, 0x4e, 0x4a, 0x7f, 0x1c],
);
pub type DevicePathToTextNode = eficall! {fn(
*mut crate::protocols::device_path::Protocol,
crate::base::Boolean,
crate::base::Boolean,
) -> *mut crate::base::Char16};
pub type DevicePathToTextPath = eficall! {fn(
*mut crate::protocols::device_path::Protocol,
crate::base::Boolean,
crate::base::Boolean,
) -> *mut crate::base::Char16};
#[repr(C)]
pub struct Protocol {
pub convert_device_node_to_text: DevicePathToTextNode,
pub convert_device_path_to_text: DevicePathToTextPath,
}

View File

@@ -0,0 +1,63 @@
//! Device Path Utilities Protocol
//!
//! The device-path utilities protocol provides common utilities for creating and manipulating
//! device paths and device nodes.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x379be4e,
0xd706,
0x437d,
0xb0,
0x37,
&[0xed, 0xb8, 0x2f, 0xb7, 0x72, 0xa4],
);
pub type ProtocolGetDevicePathSize = eficall! {fn(
*const crate::protocols::device_path::Protocol,
) -> usize};
pub type ProtocolDuplicateDevicePath = eficall! {fn(
*const crate::protocols::device_path::Protocol,
) -> *mut crate::protocols::device_path::Protocol};
pub type ProtocolAppendDevicePath = eficall! {fn(
*const crate::protocols::device_path::Protocol,
*const crate::protocols::device_path::Protocol,
) -> *mut crate::protocols::device_path::Protocol};
pub type ProtocolAppendDeviceNode = eficall! {fn(
*const crate::protocols::device_path::Protocol,
*const crate::protocols::device_path::Protocol,
) -> *mut crate::protocols::device_path::Protocol};
pub type ProtocolAppendDevicePathInstance = eficall! {fn(
*const crate::protocols::device_path::Protocol,
*const crate::protocols::device_path::Protocol,
) -> *mut crate::protocols::device_path::Protocol};
pub type ProtocolGetNextDevicePathInstance = eficall! {fn(
*mut *mut crate::protocols::device_path::Protocol,
*mut usize,
) -> *mut crate::protocols::device_path::Protocol};
pub type ProtocolIsDevicePathMultiInstance = eficall! {fn(
*const crate::protocols::device_path::Protocol,
) -> crate::base::Boolean};
pub type ProtocolCreateDeviceNode = eficall! {fn(
u8,
u8,
u16,
) -> *mut crate::protocols::device_path::Protocol};
#[repr(C)]
pub struct Protocol {
pub get_device_path_size: ProtocolGetDevicePathSize,
pub duplicate_device_path: ProtocolDuplicateDevicePath,
pub append_device_path: ProtocolAppendDevicePath,
pub append_device_node: ProtocolAppendDeviceNode,
pub append_device_path_instance: ProtocolAppendDevicePathInstance,
pub get_next_device_path_instance: ProtocolGetNextDevicePathInstance,
pub is_device_path_multi_instance: ProtocolIsDevicePathMultiInstance,
pub create_device_node: ProtocolCreateDeviceNode,
}

40
vendor/r-efi/src/protocols/disk_io.rs vendored Normal file
View File

@@ -0,0 +1,40 @@
//! Disk I/O Protocol
//!
//! Abstracts block accesses of the Block I/O protocol to a more general offset-length protocol.
//! Firmware is responsible for adding this protocol to any Block I/O interface that appears
//! in the system that does not already have a Disk I/O protocol. File systems and other disk
//! access code utilize the Disk I/O protocol.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0xce345171,
0xba0b,
0x11d2,
0x8e,
0x4f,
&[0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b],
);
pub const REVISION: u64 = 0x0000000000010000u64;
pub type ProtocolReadDisk = eficall! {fn(
*mut Protocol,
u32,
u64,
usize,
*mut core::ffi::c_void,
) -> crate::base::Status};
pub type ProtocolWriteDisk = eficall! {fn(
*mut Protocol,
u32,
u64,
usize,
*mut core::ffi::c_void,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub revision: u64,
pub read_disk: ProtocolReadDisk,
pub write_disk: ProtocolWriteDisk,
}

58
vendor/r-efi/src/protocols/disk_io2.rs vendored Normal file
View File

@@ -0,0 +1,58 @@
//! Disk I/O 2 Protocol
//!
//! Extends the Disk I/O protocol interface to enable non-blocking /
//! asynchronous byte-oriented disk operation.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x151c8eae,
0x7f2c,
0x472c,
0x9e,
0x54,
&[0x98, 0x28, 0x19, 0x4f, 0x6a, 0x88],
);
pub const REVISION: u64 = 0x0000000000020000u64;
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct Token {
event: crate::base::Event,
transaction_status: crate::base::Status,
}
pub type ProtocolCancel = eficall! {fn(
*mut Protocol,
) -> crate::base::Status};
pub type ProtocolReadDiskEx = eficall! {fn(
*mut Protocol,
u32,
u64,
*mut Token,
usize,
*mut core::ffi::c_void,
) -> crate::base::Status};
pub type ProtocolWriteDiskEx = eficall! {fn(
*mut Protocol,
u32,
u64,
*mut Token,
usize,
*mut core::ffi::c_void,
) -> crate::base::Status};
pub type ProtocolFlushDiskEx = eficall! {fn(
*mut Protocol,
*mut Token,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub revision: u64,
pub cancel: ProtocolCancel,
pub read_disk_ex: ProtocolReadDiskEx,
pub write_disk_ex: ProtocolWriteDiskEx,
pub flush_disk_ex: ProtocolFlushDiskEx,
}

View File

@@ -0,0 +1,42 @@
//! Driver Binding Protocol
//!
//! Provides the services required to determine if a driver supports a given controller. If
//! a controller is supported, then it also provides routines to start and stop the controller.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x18a031ab,
0xb443,
0x4d1a,
0xa5,
0xc0,
&[0x0c, 0x09, 0x26, 0x1e, 0x9f, 0x71],
);
pub type ProtocolSupported = eficall! {fn(
*mut Protocol,
crate::base::Handle,
*mut crate::protocols::device_path::Protocol,
) -> crate::base::Status};
pub type ProtocolStart = eficall! {fn(
*mut Protocol,
crate::base::Handle,
*mut crate::protocols::device_path::Protocol,
) -> crate::base::Status};
pub type ProtocolStop = eficall! {fn(
*mut Protocol,
crate::base::Handle,
usize,
*mut crate::base::Handle,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub supported: ProtocolSupported,
pub start: ProtocolStart,
pub stop: ProtocolStop,
pub version: u32,
pub image_handle: crate::base::Handle,
pub driver_binding_handle: crate::base::Handle,
}

View File

@@ -0,0 +1,38 @@
//! Driver Diagnostics Protocol
//!
//! Defined in UEFI Specification, Section 11.4
//! Used to perform diagnostics on a controller that a UEFI driver is managing.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x4d330321,
0x025f,
0x4aac,
0x90,
0xd8,
&[0x5e, 0xd9, 0x00, 0x17, 0x3b, 0x63],
);
pub type Type = u32;
pub const TYPE_STANDARD: Type = 0;
pub const TYPE_EXTENDED: Type = 1;
pub const TYPE_MANUFACTURING: Type = 2;
pub const TYPE_CANCEL: Type = 3;
pub const TYPE_MAXIMUM: Type = 4;
pub type RunDiagnostics = eficall! {fn(
*mut Protocol,
crate::base::Handle,
crate::base::Handle,
Type,
*mut crate::base::Char8,
*mut *mut crate::base::Guid,
*mut usize,
*mut *mut crate::base::Char16,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub run_diagnostics: RunDiagnostics,
pub supported_languages: *mut crate::base::Char8,
}

View File

@@ -0,0 +1,23 @@
//! Driver Family Override Protocol
//!
//! When installed, the Driver Family Override Protocol informs the UEFI Boot
//! Service `ConnectController()` that this driver is higher priority than the
//! list of drivers returned by the Bus Specific Driver Override Protocol.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0xb1ee129e,
0xda36,
0x4181,
0x91,
0xf8,
&[0x04, 0xa4, 0x92, 0x37, 0x66, 0xa7],
);
pub type ProtocolGetVersion = eficall! {fn(
*mut Protocol,
) -> u32};
#[repr(C)]
pub struct Protocol {
pub get_version: ProtocolGetVersion,
}

183
vendor/r-efi/src/protocols/file.rs vendored Normal file
View File

@@ -0,0 +1,183 @@
//! File Protocol
//!
//! Provides an interface to interact with both files and directories. This protocol is typically
//! obtained via an EFI_SIMPLE_FILE_SYSTEM protocol or via another EFI_FILE_PROTOCOL.
pub const REVISION: u64 = 0x0000_0000_0001_0000u64;
pub const REVISION2: u64 = 0x0000_0000_0002_0000u64;
pub const LATEST_REVISION: u64 = REVISION2;
pub const MODE_READ: u64 = 0x0000000000000001u64;
pub const MODE_WRITE: u64 = 0x0000000000000002u64;
pub const MODE_CREATE: u64 = 0x8000000000000000u64;
pub const READ_ONLY: u64 = 0x0000000000000001u64;
pub const HIDDEN: u64 = 0x0000000000000002u64;
pub const SYSTEM: u64 = 0x0000000000000004u64;
pub const RESERVED: u64 = 0x0000000000000008u64;
pub const DIRECTORY: u64 = 0x0000000000000010u64;
pub const ARCHIVE: u64 = 0x0000000000000020u64;
pub const VALID_ATTR: u64 = 0x0000000000000037u64;
pub const INFO_ID: crate::base::Guid = crate::base::Guid::from_fields(
0x09576e92,
0x6d3f,
0x11d2,
0x8e,
0x39,
&[0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b],
);
pub const SYSTEM_INFO_ID: crate::base::Guid = crate::base::Guid::from_fields(
0x09576e93,
0x6d3f,
0x11d2,
0x8e,
0x39,
&[0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b],
);
pub const SYSTEM_VOLUME_LABEL_ID: crate::base::Guid = crate::base::Guid::from_fields(
0xdb47d7d3,
0xfe81,
0x11d3,
0x9a,
0x35,
&[0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d],
);
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct IoToken {
pub event: crate::base::Event,
pub status: crate::base::Status,
pub buffer_size: usize,
pub buffer: *mut core::ffi::c_void,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct Info<const N: usize = 0> {
pub size: u64,
pub file_size: u64,
pub physical_size: u64,
pub create_time: crate::system::Time,
pub last_access_time: crate::system::Time,
pub modification_time: crate::system::Time,
pub attribute: u64,
pub file_name: [crate::base::Char16; N],
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct SystemInfo<const N: usize = 0> {
pub size: u64,
pub read_only: crate::base::Boolean,
pub volume_size: u64,
pub free_space: u64,
pub block_size: u32,
pub volume_label: [crate::base::Char16; N],
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct SystemVolumeLabel<const N: usize = 0> {
pub volume_label: [crate::base::Char16; N],
}
pub type ProtocolOpen = eficall! {fn(
*mut Protocol,
*mut *mut Protocol,
*mut crate::base::Char16,
u64,
u64,
) -> crate::base::Status};
pub type ProtocolClose = eficall! {fn(
*mut Protocol,
) -> crate::base::Status};
pub type ProtocolDelete = eficall! {fn(
*mut Protocol,
) -> crate::base::Status};
pub type ProtocolRead = eficall! {fn(
*mut Protocol,
*mut usize,
*mut core::ffi::c_void,
) -> crate::base::Status};
pub type ProtocolWrite = eficall! {fn(
*mut Protocol,
*mut usize,
*mut core::ffi::c_void,
) -> crate::base::Status};
pub type ProtocolGetPosition = eficall! {fn(
*mut Protocol,
*mut u64,
) -> crate::base::Status};
pub type ProtocolSetPosition = eficall! {fn(
*mut Protocol,
u64,
) -> crate::base::Status};
pub type ProtocolGetInfo = eficall! {fn(
*mut Protocol,
*mut crate::base::Guid,
*mut usize,
*mut core::ffi::c_void,
) -> crate::base::Status};
pub type ProtocolSetInfo = eficall! {fn(
*mut Protocol,
*mut crate::base::Guid,
usize,
*mut core::ffi::c_void,
) -> crate::base::Status};
pub type ProtocolFlush = eficall! {fn(
*mut Protocol,
) -> crate::base::Status};
pub type ProtocolOpenEx = eficall! {fn(
*mut Protocol,
*mut *mut Protocol,
*mut crate::base::Char16,
u64,
u64,
*mut IoToken,
) -> crate::base::Status};
pub type ProtocolReadEx = eficall! {fn(
*mut Protocol,
*mut IoToken,
) -> crate::base::Status};
pub type ProtocolWriteEx = eficall! {fn(
*mut Protocol,
*mut IoToken,
) -> crate::base::Status};
pub type ProtocolFlushEx = eficall! {fn(
*mut Protocol,
*mut IoToken,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub revision: u64,
pub open: ProtocolOpen,
pub close: ProtocolClose,
pub delete: ProtocolDelete,
pub read: ProtocolRead,
pub write: ProtocolWrite,
pub get_position: ProtocolGetPosition,
pub set_position: ProtocolSetPosition,
pub get_info: ProtocolGetInfo,
pub set_info: ProtocolSetInfo,
pub flush: ProtocolFlush,
pub open_ex: ProtocolOpenEx,
pub read_ex: ProtocolReadEx,
pub write_ex: ProtocolWriteEx,
pub flush_ex: ProtocolFlushEx,
}

View File

@@ -0,0 +1,103 @@
//! Graphics Output Protocol
//!
//! Provides means to configure graphics hardware and get access to
//! framebuffers. Replaces the old UGA interface from EFI with a
//! VGA-independent API.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x9042a9de,
0x23dc,
0x4a38,
0x96,
0xfb,
&[0x7a, 0xde, 0xd0, 0x80, 0x51, 0x6a],
);
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct PixelBitmask {
pub red_mask: u32,
pub green_mask: u32,
pub blue_mask: u32,
pub reserved_mask: u32,
}
pub type GraphicsPixelFormat = u32;
pub const PIXEL_RED_GREEN_BLUE_RESERVED_8_BIT_PER_COLOR: GraphicsPixelFormat = 0x00000000;
pub const PIXEL_BLUE_GREEN_RED_RESERVED_8_BIT_PER_COLOR: GraphicsPixelFormat = 0x00000001;
pub const PIXEL_BIT_MASK: GraphicsPixelFormat = 0x00000002;
pub const PIXEL_BLT_ONLY: GraphicsPixelFormat = 0x00000003;
pub const PIXEL_FORMAT_MAX: GraphicsPixelFormat = 0x00000004;
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct ModeInformation {
pub version: u32,
pub horizontal_resolution: u32,
pub vertical_resolution: u32,
pub pixel_format: GraphicsPixelFormat,
pub pixel_information: PixelBitmask,
pub pixels_per_scan_line: u32,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct Mode {
pub max_mode: u32,
pub mode: u32,
pub info: *mut ModeInformation,
pub size_of_info: usize,
pub frame_buffer_base: crate::base::PhysicalAddress,
pub frame_buffer_size: usize,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct BltPixel {
pub blue: u8,
pub green: u8,
pub red: u8,
pub reserved: u8,
}
pub type BltOperation = u32;
pub const BLT_VIDEO_FILL: BltOperation = 0x00000000;
pub const BLT_VIDEO_TO_BLT_BUFFER: BltOperation = 0x00000001;
pub const BLT_BUFFER_TO_VIDEO: BltOperation = 0x00000002;
pub const BLT_VIDEO_TO_VIDEO: BltOperation = 0x00000003;
pub const BLT_OPERATION_MAX: BltOperation = 0x00000004;
pub type ProtocolQueryMode = eficall! {fn(
*mut Protocol,
u32,
*mut usize,
*mut *mut ModeInformation,
) -> crate::base::Status};
pub type ProtocolSetMode = eficall! {fn(
*mut Protocol,
u32,
) -> crate::base::Status};
pub type ProtocolBlt = eficall! {fn(
*mut Protocol,
*mut BltPixel,
BltOperation,
usize,
usize,
usize,
usize,
usize,
usize,
usize,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub query_mode: ProtocolQueryMode,
pub set_mode: ProtocolSetMode,
pub blt: ProtocolBlt,
pub mode: *mut Mode,
}

View File

@@ -0,0 +1,299 @@
//! Human Interface Infrastructure (HII) Protocol
//!
//! Database manager for HII-related data structures.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0xef9fc172,
0xa1b2,
0x4693,
0xb3,
0x27,
&[0x6d, 0x32, 0xfc, 0x41, 0x60, 0x42],
);
pub const SET_KEYBOARD_LAYOUT_EVENT_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x14982a4f,
0xb0ed,
0x45b8,
0xa8,
0x11,
&[0x5a, 0x7a, 0x9b, 0xc2, 0x32, 0xdf],
);
pub type ProtocolNewPackageList = eficall! {fn(
*const Protocol,
*const crate::hii::PackageListHeader,
crate::base::Handle,
*mut crate::hii::Handle,
) -> crate::base::Status};
pub type ProtocolRemovePackageList = eficall! {fn(
*const Protocol,
crate::hii::Handle,
) -> crate::base::Status};
pub type ProtocolUpdatePackageList = eficall! {fn(
*const Protocol,
crate::hii::Handle,
*const crate::hii::PackageListHeader,
) -> crate::base::Status};
pub type ProtocolListPackageLists = eficall! {fn(
*const Protocol,
u8,
*const crate::base::Guid,
*mut usize,
*mut crate::hii::Handle,
) -> crate::base::Status};
pub type ProtocolExportPackageLists = eficall! {fn(
*const Protocol,
crate::hii::Handle,
*mut usize,
*mut crate::hii::PackageListHeader,
) -> crate::base::Status};
pub type ProtocolRegisterPackageNotify = eficall! {fn(
*const Protocol,
u8,
*const crate::base::Guid,
Notify,
NotifyType,
*mut crate::base::Handle,
) -> crate::base::Status};
pub type ProtocolUnregisterPackageNotify = eficall! {fn(
*const Protocol,
crate::base::Handle,
) -> crate::base::Status};
pub type ProtocolFindKeyboardLayouts = eficall! {fn(
*const Protocol,
*mut u16,
*mut crate::base::Guid,
) -> crate::base::Status};
pub type ProtocolGetKeyboardLayout = eficall! {fn(
*const Protocol,
*const crate::base::Guid,
*mut u16,
*mut KeyboardLayout,
) -> crate::base::Status};
pub type ProtocolSetKeyboardLayout = eficall! {fn(
*const Protocol,
*mut crate::base::Guid,
) -> crate::base::Status};
pub type ProtocolGetPackageListHandle = eficall! {fn(
*const Protocol,
crate::hii::Handle,
*mut crate::base::Handle,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub new_package_list: ProtocolNewPackageList,
pub remove_package_list: ProtocolRemovePackageList,
pub update_package_list: ProtocolUpdatePackageList,
pub list_package_lists: ProtocolListPackageLists,
pub export_package_lists: ProtocolExportPackageLists,
pub register_package_notify: ProtocolRegisterPackageNotify,
pub unregister_package_notify: ProtocolUnregisterPackageNotify,
pub find_keyboard_layouts: ProtocolFindKeyboardLayouts,
pub get_keyboard_layout: ProtocolGetKeyboardLayout,
pub set_keyboard_layout: ProtocolSetKeyboardLayout,
pub get_package_list_handle: ProtocolGetPackageListHandle,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct KeyboardLayout<const N: usize = 0> {
pub layout_length: u16,
pub guid: crate::base::Guid,
pub layout_descriptor_string_offset: u32,
pub descriptor_count: u8,
pub descriptors: [KeyDescriptor; N],
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct KeyDescriptor {
pub key: Key,
pub unicode: crate::base::Char16,
pub shifted_unicode: crate::base::Char16,
pub alt_gr_unicode: crate::base::Char16,
pub shifted_alt_gr_unicode: crate::base::Char16,
pub modifier: u16,
pub affected_attribute: u16,
}
pub const AFFECTED_BY_STANDARD_SHIFT: u16 = 0x0001;
pub const AFFECTED_BY_CAPS_LOCK: u16 = 0x0002;
pub const AFFECTED_BY_NUM_LOCK: u16 = 0x0004;
pub type Key = u32;
pub const EFI_KEY_LCTRL: Key = 0x00000000;
pub const EFI_KEY_A0: Key = 0x00000001;
pub const EFI_KEY_LALT: Key = 0x00000002;
pub const EFI_KEY_SPACE_BAR: Key = 0x00000003;
pub const EFI_KEY_A2: Key = 0x00000004;
pub const EFI_KEY_A3: Key = 0x00000005;
pub const EFI_KEY_A4: Key = 0x00000006;
pub const EFI_KEY_RCTRL: Key = 0x00000007;
pub const EFI_KEY_LEFT_ARROW: Key = 0x00000008;
pub const EFI_KEY_DOWN_ARROW: Key = 0x00000009;
pub const EFI_KEY_RIGHT_ARROW: Key = 0x0000000a;
pub const EFI_KEY_ZERO: Key = 0x0000000b;
pub const EFI_KEY_PERIOD: Key = 0x0000000c;
pub const EFI_KEY_ENTER: Key = 0x0000000d;
pub const EFI_KEY_LSHIFT: Key = 0x0000000e;
pub const EFI_KEY_B0: Key = 0x0000000f;
pub const EFI_KEY_B1: Key = 0x00000010;
pub const EFI_KEY_B2: Key = 0x00000011;
pub const EFI_KEY_B3: Key = 0x00000012;
pub const EFI_KEY_B4: Key = 0x00000013;
pub const EFI_KEY_B5: Key = 0x00000014;
pub const EFI_KEY_B6: Key = 0x00000015;
pub const EFI_KEY_B7: Key = 0x00000016;
pub const EFI_KEY_B8: Key = 0x00000017;
pub const EFI_KEY_B9: Key = 0x00000018;
pub const EFI_KEY_B10: Key = 0x00000019;
pub const EFI_KEY_RSHIFT: Key = 0x0000001a;
pub const EFI_KEY_UP_ARROW: Key = 0x0000001b;
pub const EFI_KEY_ONE: Key = 0x0000001c;
pub const EFI_KEY_TWO: Key = 0x0000001d;
pub const EFI_KEY_THREE: Key = 0x0000001e;
pub const EFI_KEY_CAPS_LOCK: Key = 0x0000001f;
pub const EFI_KEY_C1: Key = 0x00000020;
pub const EFI_KEY_C2: Key = 0x00000021;
pub const EFI_KEY_C3: Key = 0x00000022;
pub const EFI_KEY_C4: Key = 0x00000023;
pub const EFI_KEY_C5: Key = 0x00000024;
pub const EFI_KEY_C6: Key = 0x00000025;
pub const EFI_KEY_C7: Key = 0x00000026;
pub const EFI_KEY_C8: Key = 0x00000027;
pub const EFI_KEY_C9: Key = 0x00000028;
pub const EFI_KEY_C10: Key = 0x00000029;
pub const EFI_KEY_C11: Key = 0x0000002a;
pub const EFI_KEY_C12: Key = 0x0000002b;
pub const EFI_KEY_FOUR: Key = 0x0000002c;
pub const EFI_KEY_FIVE: Key = 0x0000002d;
pub const EFI_KEY_SIX: Key = 0x0000002e;
pub const EFI_KEY_PLUS: Key = 0x0000002f;
pub const EFI_KEY_TAB: Key = 0x00000030;
pub const EFI_KEY_D1: Key = 0x00000031;
pub const EFI_KEY_D2: Key = 0x00000032;
pub const EFI_KEY_D3: Key = 0x00000033;
pub const EFI_KEY_D4: Key = 0x00000034;
pub const EFI_KEY_D5: Key = 0x00000035;
pub const EFI_KEY_D6: Key = 0x00000036;
pub const EFI_KEY_D7: Key = 0x00000037;
pub const EFI_KEY_D8: Key = 0x00000038;
pub const EFI_KEY_D9: Key = 0x00000039;
pub const EFI_KEY_D10: Key = 0x0000003a;
pub const EFI_KEY_D11: Key = 0x0000003b;
pub const EFI_KEY_D12: Key = 0x0000003c;
pub const EFI_KEY_D13: Key = 0x0000003d;
pub const EFI_KEY_DEL: Key = 0x0000003e;
pub const EFI_KEY_END: Key = 0x0000003f;
pub const EFI_KEY_PGDN: Key = 0x00000040;
pub const EFI_KEY_SEVEN: Key = 0x00000041;
pub const EFI_KEY_EIGHT: Key = 0x00000042;
pub const EFI_KEY_NINE: Key = 0x00000043;
pub const EFI_KEY_E0: Key = 0x00000044;
pub const EFI_KEY_E1: Key = 0x00000045;
pub const EFI_KEY_E2: Key = 0x00000046;
pub const EFI_KEY_E3: Key = 0x00000047;
pub const EFI_KEY_E4: Key = 0x00000048;
pub const EFI_KEY_E5: Key = 0x00000049;
pub const EFI_KEY_E6: Key = 0x0000004a;
pub const EFI_KEY_E7: Key = 0x0000004b;
pub const EFI_KEY_E8: Key = 0x0000004c;
pub const EFI_KEY_E9: Key = 0x0000004d;
pub const EFI_KEY_E10: Key = 0x0000004e;
pub const EFI_KEY_E11: Key = 0x0000004f;
pub const EFI_KEY_E12: Key = 0x00000050;
pub const EFI_KEY_BACK_SPACE: Key = 0x00000051;
pub const EFI_KEY_INS: Key = 0x00000052;
pub const EFI_KEY_HOME: Key = 0x00000053;
pub const EFI_KEY_PGUP: Key = 0x00000054;
pub const EFI_KEY_NLCK: Key = 0x00000055;
pub const EFI_KEY_SLASH: Key = 0x00000056;
pub const EFI_KEY_ASTERISK: Key = 0x00000057;
pub const EFI_KEY_MINUS: Key = 0x00000058;
pub const EFI_KEY_ESC: Key = 0x00000059;
pub const EFI_KEY_F1: Key = 0x0000005a;
pub const EFI_KEY_F2: Key = 0x0000005b;
pub const EFI_KEY_F3: Key = 0x0000005c;
pub const EFI_KEY_F4: Key = 0x0000005d;
pub const EFI_KEY_F5: Key = 0x0000005e;
pub const EFI_KEY_F6: Key = 0x0000005f;
pub const EFI_KEY_F7: Key = 0x00000060;
pub const EFI_KEY_F8: Key = 0x00000061;
pub const EFI_KEY_F9: Key = 0x00000062;
pub const EFI_KEY_F10: Key = 0x00000063;
pub const EFI_KEY_F11: Key = 0x00000064;
pub const EFI_KEY_F12: Key = 0x00000065;
pub const EFI_KEY_PRINT: Key = 0x00000066;
pub const EFI_KEY_SLCK: Key = 0x00000067;
pub const EFI_KEY_PAUSE: Key = 0x00000068;
pub const NULL_MODIFIER: u16 = 0x0000;
pub const LEFT_CONTROL_MODIFIER: u16 = 0x0001;
pub const RIGHT_CONTROL_MODIFIER: u16 = 0x0002;
pub const LEFT_ALT_MODIFIER: u16 = 0x0003;
pub const RIGHT_ALT_MODIFIER: u16 = 0x0004;
pub const ALT_GR_MODIFIER: u16 = 0x0005;
pub const INSERT_MODIFIER: u16 = 0x0006;
pub const DELETE_MODIFIER: u16 = 0x0007;
pub const PAGE_DOWN_MODIFIER: u16 = 0x0008;
pub const PAGE_UP_MODIFIER: u16 = 0x0009;
pub const HOME_MODIFIER: u16 = 0x000A;
pub const END_MODIFIER: u16 = 0x000B;
pub const LEFT_SHIFT_MODIFIER: u16 = 0x000C;
pub const RIGHT_SHIFT_MODIFIER: u16 = 0x000D;
pub const CAPS_LOCK_MODIFIER: u16 = 0x000E;
pub const NUM_LOCK_MODIFIER: u16 = 0x000F;
pub const LEFT_ARROW_MODIFIER: u16 = 0x0010;
pub const RIGHT_ARROW_MODIFIER: u16 = 0x0011;
pub const DOWN_ARROW_MODIFIER: u16 = 0x0012;
pub const UP_ARROW_MODIFIER: u16 = 0x0013;
pub const NS_KEY_MODIFIER: u16 = 0x0014;
pub const NS_KEY_DEPENDENCY_MODIFIER: u16 = 0x0015;
pub const FUNCTION_KEY_ONE_MODIFIER: u16 = 0x0016;
pub const FUNCTION_KEY_TWO_MODIFIER: u16 = 0x0017;
pub const FUNCTION_KEY_THREE_MODIFIER: u16 = 0x0018;
pub const FUNCTION_KEY_FOUR_MODIFIER: u16 = 0x0019;
pub const FUNCTION_KEY_FIVE_MODIFIER: u16 = 0x001A;
pub const FUNCTION_KEY_SIX_MODIFIER: u16 = 0x001B;
pub const FUNCTION_KEY_SEVEN_MODIFIER: u16 = 0x001C;
pub const FUNCTION_KEY_EIGHT_MODIFIER: u16 = 0x001D;
pub const FUNCTION_KEY_NINE_MODIFIER: u16 = 0x001E;
pub const FUNCTION_KEY_TEN_MODIFIER: u16 = 0x001F;
pub const FUNCTION_KEY_ELEVEN_MODIFIER: u16 = 0x0020;
pub const FUNCTION_KEY_TWELVE_MODIFIER: u16 = 0x0021;
pub const PRINT_MODIFIER: u16 = 0x0022;
pub const SYS_REQUEST_MODIFIER: u16 = 0x0023;
pub const SCROLL_LOCK_MODIFIER: u16 = 0x0024;
pub const PAUSE_MODIFIER: u16 = 0x0025;
pub const BREAK_MODIFIER: u16 = 0x0026;
pub const LEFT_LOGO_MODIFIER: u16 = 0x0027;
pub const RIGHT_LOGO_MODIFIER: u16 = 0x0028;
pub const MENU_MODIFIER: u16 = 0x0029;
pub type Notify = eficall! {fn(
u8,
*const crate::base::Guid,
*const crate::hii::PackageHeader,
crate::hii::Handle,
NotifyType,
) -> crate::base::Status};
pub type NotifyType = usize;
pub const NOTIFY_NEW_PACK: NotifyType = 0x00000001;
pub const NOTIFY_REMOVE_PACK: NotifyType = 0x00000002;
pub const NOTIFY_EXPORT_PACK: NotifyType = 0x00000004;
pub const NOTIFY_ADD_PACK: NotifyType = 0x00000008;

87
vendor/r-efi/src/protocols/hii_font.rs vendored Normal file
View File

@@ -0,0 +1,87 @@
//! HII Font Protocol
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0xe9ca4775,
0x8657,
0x47fc,
0x97,
0xe7,
&[0x7e, 0xd6, 0x5a, 0x08, 0x43, 0x24],
);
pub type ProtocolStringToImage = eficall! {fn(
*const Protocol,
OutFlags,
String,
*const super::hii_font_ex::DisplayInfo,
*mut *mut super::hii_font_ex::ImageOutput,
usize,
usize,
*mut *mut RowInfo,
*mut usize,
*mut usize,
) -> crate::base::Status};
pub type ProtocolStringIdToImage = eficall! {fn(
*const Protocol,
OutFlags,
crate::hii::Handle,
crate::hii::StringId,
*const crate::base::Char8,
*const super::hii_font_ex::DisplayInfo,
*mut *mut super::hii_font_ex::ImageOutput,
usize,
usize,
*mut *mut RowInfo,
*mut usize,
*mut usize,
) -> crate::base::Status};
pub type ProtocolGetGlyph = eficall! {fn(
*const Protocol,
crate::base::Char16,
*const super::hii_font_ex::DisplayInfo,
*mut *mut super::hii_font_ex::ImageOutput,
*mut usize,
) -> crate::base::Status};
pub type ProtocolGetFontInfo = eficall! {fn(
*const Protocol,
*mut Handle,
*const super::hii_font_ex::DisplayInfo,
*mut *mut super::hii_font_ex::DisplayInfo,
String,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub string_to_image: ProtocolStringToImage,
pub string_id_to_image: ProtocolStringIdToImage,
pub get_glyph: ProtocolGetGlyph,
pub get_font_info: ProtocolGetFontInfo,
}
pub type OutFlags = u32;
pub const OUT_FLAG_CLIP: OutFlags = 0x00000001;
pub const OUT_FLAG_WRAP: OutFlags = 0x00000002;
pub const OUT_FLAG_CLIP_CLEAN_Y: OutFlags = 0x00000004;
pub const OUT_FLAG_CLIP_CLEAN_X: OutFlags = 0x00000008;
pub const OUT_FLAG_TRANSPARENT: OutFlags = 0x00000010;
pub const IGNORE_IF_NO_GLYPH: OutFlags = 0x00000020;
pub const IGNORE_LINE_BREAK: OutFlags = 0x00000040;
pub const DIRECT_TO_SCREEN: OutFlags = 0x00000080;
pub type String = *mut crate::base::Char16;
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct RowInfo {
pub start_index: usize,
pub end_index: usize,
pub line_height: usize,
pub line_width: usize,
pub baseline_offset: usize,
}
pub type Handle = *mut core::ffi::c_void;

View File

@@ -0,0 +1,107 @@
//! HII Font Ex Protocol
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x849e6875,
0xdb35,
0x4df8,
0xb4,
0x1e,
&[0xc8, 0xf3, 0x37, 0x18, 0x07, 0x3f],
);
pub type ProtocolStringToImageEx = eficall! {fn(
*const Protocol,
super::hii_font::OutFlags,
super::hii_font::String,
*const DisplayInfo,
*mut *mut ImageOutput,
usize,
usize,
*mut *mut super::hii_font::RowInfo,
*mut usize,
*mut usize,
) -> crate::base::Status};
pub type ProtocolStringIdToImageEx = eficall! {fn(
*const Protocol,
super::hii_font::OutFlags,
crate::hii::Handle,
crate::hii::StringId,
*const crate::base::Char8,
*const DisplayInfo,
*mut *mut ImageOutput,
usize,
usize,
*mut *mut super::hii_font::RowInfo,
*mut usize,
*mut usize,
) -> crate::base::Status};
pub type ProtocolGetGlyphEx = eficall! {fn(
*const Protocol,
crate::base::Char16,
*const DisplayInfo,
*mut *mut ImageOutput,
usize,
) -> crate::base::Status};
pub type ProtocolGetFontInfoEx = eficall! {fn(
*const Protocol,
*mut super::hii_font::Handle,
*const DisplayInfo,
*mut *mut DisplayInfo,
super::hii_font::String,
) -> crate::base::Status};
pub type ProtocolGetGlyphInfo = eficall! {fn(
*const Protocol,
crate::base::Char16,
*const DisplayInfo,
*mut crate::hii::GlyphInfo,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub string_to_image_ex: ProtocolStringToImageEx,
pub string_id_to_image_ex: ProtocolStringIdToImageEx,
pub get_glyph_ex: ProtocolGetGlyphEx,
pub get_font_info_ex: ProtocolGetFontInfoEx,
pub get_glyph_info: ProtocolGetGlyphInfo,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct DisplayInfo {
pub foreground_color: super::graphics_output::BltPixel,
pub background_color: super::graphics_output::BltPixel,
pub font_info_mask: InfoMask,
pub font_info: super::hii_string::Info,
}
pub type InfoMask = u32;
pub const INFO_SYS_FONT: InfoMask = 0x00000001;
pub const INFO_SYS_SIZE: InfoMask = 0x00000002;
pub const INFO_SYS_STYLE: InfoMask = 0x00000004;
pub const INFO_SYS_FORE_COLOR: InfoMask = 0x00000010;
pub const INFO_SYS_BACK_COLOR: InfoMask = 0x00000020;
pub const INFO_RESIZE: InfoMask = 0x00001000;
pub const INFO_RESTYLE: InfoMask = 0x00002000;
pub const INFO_ANY_FONT: InfoMask = 0x00010000;
pub const INFO_ANY_SIZE: InfoMask = 0x00020000;
pub const INFO_ANY_STYLE: InfoMask = 0x00040000;
#[repr(C)]
#[derive(Clone, Copy)]
pub union ImageOutputImage {
pub bitmap: *mut super::graphics_output::BltPixel,
pub screen: *mut super::graphics_output::Protocol,
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct ImageOutput {
pub width: u16,
pub height: u16,
pub image: ImageOutputImage,
}

View File

@@ -0,0 +1,14 @@
//! Human Interface Infrastructure (HII) Package List Protocol
//!
//! Installed onto an image handle during load if the image contains a custom PE/COFF
//! resource with type 'HII'. The protocol's interface pointer points to the HII package
//! list which is contained in the resource's data.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x6a1ee763,
0xd47a,
0x43b4,
0xaa,
0xbe,
&[0xef, 0x1d, 0xe2, 0xab, 0x56, 0xfc],
);

View File

@@ -0,0 +1,71 @@
//! HII String Protocol
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0xfd96974,
0x23aa,
0x4cdc,
0xb9,
0xcb,
&[0x98, 0xd1, 0x77, 0x50, 0x32, 0x2a],
);
pub type ProtocolNewString = eficall! {fn(
*const Protocol,
crate::hii::Handle,
*mut crate::hii::StringId,
*const crate::base::Char8,
*const crate::base::Char16,
super::hii_font::String,
*const Info,
) -> crate::base::Status};
pub type ProtocolGetString = eficall! {fn(
*const Protocol,
*const crate::base::Char8,
crate::hii::Handle,
crate::hii::StringId,
super::hii_font::String,
*mut usize,
*mut *mut Info,
) -> crate::base::Status};
pub type ProtocolSetString = eficall! {fn(
*const Protocol,
crate::hii::Handle,
crate::hii::StringId,
*const crate::base::Char8,
super::hii_font::String,
*const Info,
) -> crate::base::Status};
pub type ProtocolGetLanguages = eficall! {fn(
*const Protocol,
crate::hii::Handle,
*mut crate::base::Char8,
*mut usize,
) -> crate::base::Status};
pub type ProtocolGetSecondaryLanguages = eficall! {fn(
*const Protocol,
crate::hii::Handle,
*const crate::base::Char8,
*mut crate::base::Char8,
*mut usize,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub new_string: ProtocolNewString,
pub get_string: ProtocolGetString,
pub set_string: ProtocolSetString,
pub get_languages: ProtocolGetLanguages,
pub get_secondary_languages: ProtocolGetSecondaryLanguages,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct Info<const N: usize = 0> {
pub font_style: crate::hii::FontStyle,
pub font_size: u16,
pub font_name: [crate::base::Char16; N],
}

202
vendor/r-efi/src/protocols/ip4.rs vendored Normal file
View File

@@ -0,0 +1,202 @@
//! IPv4 Protocol
//!
//! It implements a simple packet-oriented interface that can be used by
//! drivers, daemons, and applications to transmit and receive network packets.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x41d94cd2,
0x35b6,
0x455a,
0x82,
0x58,
&[0xd4, 0xe5, 0x13, 0x34, 0xaa, 0xdd],
);
pub const SERVICE_BINDING_PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0xc51711e7,
0xb4bf,
0x404a,
0xbf,
0xb8,
&[0x0a, 0x04, 0x8e, 0xf1, 0xff, 0xe4],
);
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct ConfigData {
pub default_protocol: u8,
pub accept_any_protocol: crate::base::Boolean,
pub accept_icmp_errors: crate::base::Boolean,
pub accept_broadcast: crate::base::Boolean,
pub accept_promiscuous: crate::base::Boolean,
pub use_default_address: crate::base::Boolean,
pub station_address: crate::base::Ipv4Address,
pub subnet_mask: crate::base::Ipv4Address,
pub type_of_service: u8,
pub time_to_live: u8,
pub do_not_fragment: crate::base::Boolean,
pub raw_data: crate::base::Boolean,
pub receive_timeout: u32,
pub transmit_timeout: u32,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct RouteTable {
pub subnet_address: crate::base::Ipv4Address,
pub subnet_mask: crate::base::Ipv4Address,
pub gateway_address: crate::base::Ipv4Address,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct IcmpType {
pub r#type: u8,
pub code: u8,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct ModeData {
pub is_started: crate::base::Boolean,
pub max_packet_size: u32,
pub config_data: ConfigData,
pub is_configured: crate::base::Boolean,
pub group_count: u32,
pub group_table: *mut crate::base::Ipv4Address,
pub route_count: u32,
pub route_table: *mut RouteTable,
pub icmp_type_count: u32,
pub icmp_type_list: *mut IcmpType,
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct CompletionToken {
pub event: crate::base::Event,
pub status: crate::base::Status,
pub packet: CompletionTokenPacket,
}
#[repr(C)]
#[derive(Clone, Copy)]
pub union CompletionTokenPacket {
pub rx_data: *mut ReceiveData,
pub tx_data: *mut TransmitData,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct ReceiveData<const N: usize = 0> {
pub time_stamp: crate::system::Time,
pub recycle_signal: crate::base::Event,
pub header_length: u32,
pub header: *mut Header,
pub options_length: u32,
pub options: *mut core::ffi::c_void,
pub data_length: u32,
pub fragment_count: u32,
pub fragment_table: [FragmentData; N],
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct TransmitData<const N: usize = 0> {
pub destination_address: crate::base::Ipv4Address,
pub override_data: *mut OverrideData,
pub options_length: u32,
pub options_buffer: *mut core::ffi::c_void,
pub total_data_length: u32,
pub fragment_count: u32,
pub fragment_table: [FragmentData; N],
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct Header {
pub header_length_and_version: u8,
pub type_of_service: u8,
pub total_length: u16,
pub identification: u16,
pub fragmentation: u16,
pub time_to_live: u8,
pub protocol: u8,
pub checksum: u16,
pub source_address: crate::base::Ipv4Address,
pub destination_address: crate::base::Ipv4Address,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct FragmentData {
pub fragment_length: u32,
pub fragment_buffer: *mut core::ffi::c_void,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct OverrideData {
pub source_address: crate::base::Ipv4Address,
pub gateway_address: crate::base::Ipv4Address,
pub protocol: u8,
pub type_of_service: u8,
pub time_to_live: u8,
pub do_not_fragment: crate::base::Boolean,
}
pub type ProtocolGetModeData = eficall! {fn(
*mut Protocol,
*mut ModeData,
*mut crate::protocols::managed_network::ConfigData,
*mut crate::protocols::simple_network::Mode,
) -> crate::base::Status};
pub type ProtocolConfigure = eficall! {fn(
*mut Protocol,
*mut ConfigData,
) -> crate::base::Status};
pub type ProtocolGroups = eficall! {fn(
*mut Protocol,
crate::base::Boolean,
*mut crate::base::Ipv4Address,
) -> crate::base::Status};
pub type ProtocolRoutes = eficall! {fn(
*mut Protocol,
crate::base::Boolean,
*mut crate::base::Ipv4Address,
*mut crate::base::Ipv4Address,
*mut crate::base::Ipv4Address,
) -> crate::base::Status};
pub type ProtocolTransmit = eficall! {fn(
*mut Protocol,
*mut CompletionToken,
) -> crate::base::Status};
pub type ProtocolReceive = eficall! {fn(
*mut Protocol,
*mut CompletionToken,
) -> crate::base::Status};
pub type ProtocolCancel = eficall! {fn(
*mut Protocol,
*mut CompletionToken,
) -> crate::base::Status};
pub type ProtocolPoll = eficall! {fn(
*mut Protocol,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub get_mode_data: ProtocolGetModeData,
pub configure: ProtocolConfigure,
pub groups: ProtocolGroups,
pub routes: ProtocolRoutes,
pub transmit: ProtocolTransmit,
pub receive: ProtocolReceive,
pub cancel: ProtocolCancel,
pub poll: ProtocolPoll,
}

264
vendor/r-efi/src/protocols/ip6.rs vendored Normal file
View File

@@ -0,0 +1,264 @@
//! IPv6 Protocol
//!
//! It implements a simple packet-oriented interface that can be used by
//! drivers, daemons, and applications to transmit and receive network packets.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x2c8759d5,
0x5c2d,
0x66ef,
0x92,
0x5f,
&[0xb6, 0x6c, 0x10, 0x19, 0x57, 0xe2],
);
pub const SERVICE_BINDING_PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0xec835dd3,
0xfe0f,
0x617b,
0xa6,
0x21,
&[0xb3, 0x50, 0xc3, 0xe1, 0x33, 0x88],
);
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct ModeData {
pub is_started: crate::base::Boolean,
pub max_packet_size: u32,
pub config_data: ConfigData,
pub is_configured: crate::base::Boolean,
pub address_count: u32,
pub address_list: *mut AddressInfo,
pub group_count: u32,
pub group_table: *mut crate::base::Ipv6Address,
pub route_count: u32,
pub route_table: *mut RouteTable,
pub neighbor_count: u32,
pub neighbor_cache: *mut NeighborCache,
pub prefix_count: u32,
pub prefix_table: *mut AddressInfo,
pub icmp_type_count: u32,
pub icmp_type_list: *mut IcmpType,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct ConfigData {
pub default_protocol: u8,
pub accept_any_protocol: crate::base::Boolean,
pub accept_icmp_errors: crate::base::Boolean,
pub accept_promiscuous: crate::base::Boolean,
pub destination_address: crate::base::Ipv6Address,
pub station_address: crate::base::Ipv6Address,
pub traffic_class: u8,
pub hop_limit: u8,
pub flow_lable: u32,
pub receive_timeout: u32,
pub transmit_timeout: u32,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct AddressInfo {
pub address: crate::base::Ipv6Address,
pub prefix_length: u8,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct RouteTable {
pub gateway: crate::base::Ipv6Address,
pub destination: crate::base::Ipv6Address,
pub prefix_length: u8,
}
pub type NeighborState = u32;
pub const NEIGHBOR_IN_COMPLETE: NeighborState = 0x00000000;
pub const NEIGHBOR_REACHABLE: NeighborState = 0x00000001;
pub const NEIGHBOR_STATE: NeighborState = 0x00000002;
pub const NEIGHBOR_DELAY: NeighborState = 0x00000003;
pub const NEIGHBOR_PROBE: NeighborState = 0x00000004;
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct NeighborCache {
pub neighbor: crate::base::Ipv6Address,
pub link_address: crate::base::MacAddress,
pub state: NeighborState,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct IcmpType {
pub r#type: u8,
pub code: u8,
}
pub const ICMP_V6_DEST_UNREACHABLE: u8 = 0x01;
pub const ICMP_V6_PACKET_TOO_BIG: u8 = 0x02;
pub const ICMP_V6_TIME_EXCEEDED: u8 = 0x03;
pub const ICMP_V6_PARAMETER_PROBLEM: u8 = 0x04;
pub const ICMP_V6_ECHO_REQUEST: u8 = 0x80;
pub const ICMP_V6_ECHO_REPLY: u8 = 0x81;
pub const ICMP_V6_LISTENER_QUERY: u8 = 0x82;
pub const ICMP_V6_LISTENER_REPORT: u8 = 0x83;
pub const ICMP_V6_LISTENER_DONE: u8 = 0x84;
pub const ICMP_V6_ROUTER_SOLICIT: u8 = 0x85;
pub const ICMP_V6_ROUTER_ADVERTISE: u8 = 0x86;
pub const ICMP_V6_NEIGHBOR_SOLICIT: u8 = 0x87;
pub const ICMP_V6_NEIGHBOR_ADVERTISE: u8 = 0x88;
pub const ICMP_V6_REDIRECT: u8 = 0x89;
pub const ICMP_V6_LISTENER_REPORT_2: u8 = 0x8f;
pub const ICMP_V6_NO_ROUTE_TO_DEST: u8 = 0x00;
pub const ICMP_V6_COMM_PROHIBITED: u8 = 0x01;
pub const ICMP_V6_BEYOND_SCOPE: u8 = 0x02;
pub const ICMP_V6_ADDR_UNREACHABLE: u8 = 0x03;
pub const ICMP_V6_PORT_UNREACHABLE: u8 = 0x04;
pub const ICMP_V6_SOURCE_ADDR_FAILED: u8 = 0x05;
pub const ICMP_V6_ROUTE_REJECTED: u8 = 0x06;
pub const ICMP_V6_TIMEOUT_HOP_LIMIT: u8 = 0x00;
pub const ICMP_V6_TIMEOUT_REASSEMBLE: u8 = 0x01;
pub const ICMP_V6_ERRONEOUS_HEADER: u8 = 0x00;
pub const ICMP_V6_UNRECOGNIZE_NEXT_HDR: u8 = 0x01;
pub const ICMP_V6_UNRECOGNIZE_OPTION: u8 = 0x02;
#[repr(C)]
#[derive(Clone, Copy)]
pub struct CompletionToken {
pub event: crate::base::Event,
pub status: crate::base::Status,
pub packet: CompletionTokenPacket,
}
#[repr(C)]
#[derive(Clone, Copy)]
pub union CompletionTokenPacket {
pub rx_data: *mut ReceiveData,
pub tx_data: *mut TransmitData,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct ReceiveData<const N: usize = 0> {
pub time_stamp: crate::system::Time,
pub recycle_signal: crate::base::Event,
pub header_length: u32,
pub header: *mut Header,
pub data_length: u32,
pub fragment_count: u32,
pub fragment_table: [FragmentData; N],
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct Header {
pub traffic_class_h_version: u8,
pub flow_label_h_traffic_class_l: u8,
pub flow_label_l: u16,
pub payload_length: u16,
pub next_header: u8,
pub hop_limit: u8,
pub source_address: crate::base::Ipv6Address,
pub destination_address: crate::base::Ipv6Address,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct FragmentData {
pub fragment_length: u32,
pub fragment_buffer: *mut core::ffi::c_void,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct TransmitData<const N: usize = 0> {
pub destination_address: *mut crate::base::Ipv6Address,
pub override_data: *mut OverrideData,
pub ext_hdrs_length: u32,
pub ext_hdrs: *mut core::ffi::c_void,
pub next_header: u8,
pub data_length: u32,
pub fragment_count: u32,
pub fragment_table: [FragmentData; N],
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct OverrideData {
pub protocol: u8,
pub hop_limit: u8,
pub flow_label: u32,
}
pub type ProtocolGetModeData = eficall! {fn(
*mut Protocol,
*mut ModeData,
*mut crate::protocols::managed_network::ConfigData,
*mut crate::protocols::simple_network::Mode,
) -> crate::base::Status};
pub type ProtocolConfigure = eficall! {fn(
*mut Protocol,
*mut ConfigData,
) -> crate::base::Status};
pub type ProtocolGroups = eficall! {fn(
*mut Protocol,
crate::base::Boolean,
*mut crate::base::Ipv6Address,
) -> crate::base::Status};
pub type ProtocolRoutes = eficall! {fn(
*mut Protocol,
crate::base::Boolean,
*mut crate::base::Ipv6Address,
u8,
*mut crate::base::Ipv6Address,
) -> crate::base::Status};
pub type ProtocolNeighbors = eficall! {fn(
*mut Protocol,
crate::base::Boolean,
*mut crate::base::Ipv6Address,
*mut crate::base::MacAddress,
u32,
crate::base::Boolean,
) -> crate::base::Status};
pub type ProtocolTransmit = eficall! {fn(
*mut Protocol,
*mut CompletionToken,
) -> crate::base::Status};
pub type ProtocolReceive = eficall! {fn(
*mut Protocol,
*mut CompletionToken,
) -> crate::base::Status};
pub type ProtocolCancel = eficall! {fn(
*mut Protocol,
*mut CompletionToken,
) -> crate::base::Status};
pub type ProtocolPoll = eficall! {fn(
*mut Protocol,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub get_mode_data: ProtocolGetModeData,
pub configure: ProtocolConfigure,
pub groups: ProtocolGroups,
pub routes: ProtocolRoutes,
pub neighbors: ProtocolNeighbors,
pub transmit: ProtocolTransmit,
pub receive: ProtocolReceive,
pub cancel: ProtocolCancel,
pub poll: ProtocolPoll,
}

26
vendor/r-efi/src/protocols/load_file.rs vendored Normal file
View File

@@ -0,0 +1,26 @@
//! Load File Protocol
//!
//! The Load File protocol is used to obtain files, that are primarily boot
//! options, from arbitrary devices.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x56ec3091,
0x954c,
0x11d2,
0x8e,
0x3f,
&[0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b],
);
pub type ProtocolLoadFile = eficall! {fn(
*mut Protocol,
*mut crate::protocols::device_path::Protocol,
crate::base::Boolean,
*mut usize,
*mut core::ffi::c_void
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub load_file: ProtocolLoadFile,
}

View File

@@ -0,0 +1,15 @@
//! Load File 2 Protocol
//!
//! The Load File 2 protocol is used to obtain files from arbitrary devices
//! that are not boot options.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x4006c0c1,
0xfcb3,
0x403e,
0x99,
0x6d,
&[0x4a, 0x6c, 0x87, 0x24, 0xe0, 0x6d],
);
pub type Protocol = crate::protocols::load_file::Protocol;

View File

@@ -0,0 +1,39 @@
//! Loaded Image Protocol
//!
//! The loaded image protocol defines how to obtain information about a loaded image from an
//! image handle.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x5b1b31a1,
0x9562,
0x11d2,
0x8e,
0x3f,
&[0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b],
);
pub const REVISION: u32 = 0x00001000u32;
pub type ProtocolUnload = eficall! {fn(
crate::base::Handle,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub revision: u32,
pub parent_handle: crate::base::Handle,
pub system_table: *mut crate::system::SystemTable,
pub device_handle: crate::base::Handle,
pub file_path: *mut crate::protocols::device_path::Protocol,
pub reserved: *mut core::ffi::c_void,
pub load_options_size: u32,
pub load_options: *mut core::ffi::c_void,
pub image_base: *mut core::ffi::c_void,
pub image_size: u64,
pub image_code_type: crate::system::MemoryType,
pub image_data_type: crate::system::MemoryType,
pub unload: Option<ProtocolUnload>,
}

View File

@@ -0,0 +1,13 @@
//! Loaded Image Device Path Protocol
//!
//! The loaded image device path protocol provides the device path of a loaded image, using the
//! protocol structures of the device-path and loaded-image protocols.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0xbc62157e,
0x3e33,
0x4fec,
0x99,
0x20,
&[0x2d, 0x3b, 0x36, 0xd7, 0x50, 0xdf],
);

View File

@@ -0,0 +1,147 @@
//! Managed Network Protocol
//!
//! It provides raw (unformatted) asynchronous network packet I/O services.
//! These services make it possible for multiple-event-driven drivers and
//! applications to access and use the system network interfaces at the same
//! time.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x7ab33a91,
0xace5,
0x4326,
0xb5,
0x72,
&[0xe7, 0xee, 0x33, 0xd3, 0x9f, 0x16],
);
pub const SERVICE_BINDING_PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0xf36ff770,
0xa7e1,
0x42cf,
0x9e,
0xd2,
&[0x56, 0xf0, 0xf2, 0x71, 0xf4, 0x4c],
);
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct ConfigData {
pub received_queue_timeout_value: u32,
pub transmit_queue_timeout_value: u32,
pub protocol_type_filter: u16,
pub enable_unicast_receive: crate::base::Boolean,
pub enable_multicast_receive: crate::base::Boolean,
pub enable_broadcast_receive: crate::base::Boolean,
pub enable_promiscuous_receive: crate::base::Boolean,
pub flush_queues_on_reset: crate::base::Boolean,
pub enable_receive_timestamps: crate::base::Boolean,
pub disable_background_polling: crate::base::Boolean,
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct CompletionToken {
pub event: crate::base::Event,
pub status: crate::base::Status,
pub packet: CompletionTokenPacket,
}
#[repr(C)]
#[derive(Clone, Copy)]
pub union CompletionTokenPacket {
pub rx_data: *mut ReceiveData,
pub tx_data: *mut TransmitData,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct ReceiveData {
pub timestamp: crate::system::Time,
pub recycle_event: crate::base::Event,
pub packet_length: u32,
pub header_length: u32,
pub address_length: u32,
pub data_length: u32,
pub broadcast_flag: crate::base::Boolean,
pub multicast_flag: crate::base::Boolean,
pub promiscuous_flag: crate::base::Boolean,
pub protocol_type: u16,
pub destination_address: *mut core::ffi::c_void,
pub source_address: *mut core::ffi::c_void,
pub media_header: *mut core::ffi::c_void,
pub packet_data: *mut core::ffi::c_void,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct TransmitData<const N: usize = 0> {
pub destination_address: *mut crate::base::MacAddress,
pub source_address: *mut crate::base::MacAddress,
pub protocol_type: u16,
pub data_length: u32,
pub header_length: u16,
pub fragment_count: u16,
pub fragment_table: [FragmentData; N],
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct FragmentData {
pub fragment_length: u32,
pub fragment_buffer: *mut core::ffi::c_void,
}
pub type ProtocolGetModeData = eficall! {fn(
*mut Protocol,
*mut ConfigData,
*mut crate::protocols::simple_network::Mode,
) -> crate::base::Status};
pub type ProtocolConfigure = eficall! {fn(
*mut Protocol,
*mut ConfigData,
) -> crate::base::Status};
pub type ProtocolMcastIpToMac = eficall! {fn(
*mut Protocol,
crate::base::Boolean,
*mut crate::base::IpAddress,
*mut crate::base::MacAddress,
) -> crate::base::Status};
pub type ProtocolGroups = eficall! {fn(
*mut Protocol,
crate::base::Boolean,
*mut crate::base::MacAddress,
) -> crate::base::Status};
pub type ProtocolTransmit = eficall! {fn(
*mut Protocol,
*mut CompletionToken,
) -> crate::base::Status};
pub type ProtocolReceive = eficall! {fn(
*mut Protocol,
*mut CompletionToken,
) -> crate::base::Status};
pub type ProtocolCancel = eficall! {fn(
*mut Protocol,
*mut CompletionToken,
) -> crate::base::Status};
pub type ProtocolPoll = eficall! {fn(
*mut Protocol,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub get_mode_data: ProtocolGetModeData,
pub configure: ProtocolConfigure,
pub mcast_ip_to_mac: ProtocolMcastIpToMac,
pub groups: ProtocolGroups,
pub transmit: ProtocolTransmit,
pub receive: ProtocolReceive,
pub cancel: ProtocolCancel,
pub poll: ProtocolPoll,
}

View File

@@ -0,0 +1,40 @@
//! Memory Attribute Protocol
//!
//! Provides an interface to abstract setting or getting of memory attributes in the UEFI environment.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0xf4560cf6,
0x40ec,
0x4b4a,
0xa1,
0x92,
&[0xbf, 0x1d, 0x57, 0xd0, 0xb1, 0x89],
);
pub type GetMemoryAttributes = eficall! {fn(
*mut Protocol,
crate::base::PhysicalAddress,
u64,
*mut u64,
) -> crate::base::Status};
pub type SetMemoryAttributes = eficall! {fn(
*mut Protocol,
crate::base::PhysicalAddress,
u64,
u64,
) -> crate::base::Status};
pub type ClearMemoryAttributes = eficall! {fn(
*mut Protocol,
crate::base::PhysicalAddress,
u64,
u64,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub get_memory_attributes: GetMemoryAttributes,
pub set_memory_attributes: SetMemoryAttributes,
pub clear_memory_attributes: ClearMemoryAttributes,
}

View File

@@ -0,0 +1,121 @@
//! Multi-Processor Services Protocol
//!
//! This Protocol is defined in the UEFI Platform Integration Specification,
//! Section 13.4.
//!
//! This provides a generalized way of performing the following tasks:
//! - Retrieving information of multi-processor environments.
//! - Dispatching user-provided function to APs.
//! - Maintain MP-related processor status.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x3fdda605,
0xa76e,
0x4f46,
0xad,
0x29,
&[0x12, 0xf4, 0x53, 0x1b, 0x3d, 0x08],
);
pub const PROCESSOR_AS_BSP_BIT: u32 = 0x00000001;
pub const PROCESSOR_ENABLED_BIT: u32 = 0x00000002;
pub const PROCESSOR_HEALTH_STATUS_BIT: u32 = 0x00000004;
pub const END_OF_CPU_LIST: usize = usize::MAX;
#[repr(C)]
#[derive(Debug, Clone, Copy)]
pub struct CpuPhysicalLocation {
pub package: u32,
pub core: u32,
pub thread: u32,
}
#[repr(C)]
#[derive(Debug, Clone, Copy)]
pub struct CpuPhysicalLocation2 {
pub package: u32,
pub module: u32,
pub tile: u32,
pub die: u32,
pub core: u32,
pub thread: u32,
}
#[repr(C)]
#[derive(Clone, Copy)]
pub union ExtendedProcessorInformation {
pub location2: CpuPhysicalLocation2,
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct ProcessorInformation {
pub processor_id: u64,
pub status_flag: u32,
pub location: CpuPhysicalLocation,
pub extended_information: ExtendedProcessorInformation,
}
pub type ApProcedure = eficall! {fn(*mut core::ffi::c_void)};
pub type GetNumberOfProcessors = eficall! {fn(
*mut Protocol,
*mut usize,
*mut usize,
) -> crate::base::Status};
pub type GetProcessorInfo = eficall! {fn(
*mut Protocol,
usize,
*mut ProcessorInformation,
) -> crate::base::Status};
pub type StartupAllAps = eficall! {fn(
*mut Protocol,
ApProcedure,
crate::base::Boolean,
crate::base::Event,
usize,
*mut core::ffi::c_void,
*mut *mut usize,
) -> crate::base::Status};
pub type StartupThisAp = eficall! {fn(
*mut Protocol,
ApProcedure,
usize,
crate::base::Event,
usize,
*mut core::ffi::c_void,
*mut crate::base::Boolean,
) -> crate::base::Status};
pub type SwitchBsp = eficall! {fn(
*mut Protocol,
usize,
crate::base::Boolean,
) -> crate::base::Status};
pub type EnableDisableAp = eficall! {fn(
*mut Protocol,
usize,
crate::base::Boolean,
*mut u32,
) -> crate::base::Status};
pub type WhoAmI = eficall! {fn(
*mut Protocol,
*mut usize,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub get_number_of_processors: GetNumberOfProcessors,
pub get_processor_info: GetProcessorInfo,
pub startup_all_aps: StartupAllAps,
pub startup_this_ap: StartupThisAp,
pub switch_bsp: SwitchBsp,
pub enable_disable_ap: EnableDisableAp,
pub who_am_i: WhoAmI,
}

203
vendor/r-efi/src/protocols/pci_io.rs vendored Normal file
View File

@@ -0,0 +1,203 @@
//! PCI I/O Protocol
//!
//! Used by code, typically drivers, running in the EFI boot services
//! environment to access memory and I/O on a PCI controller.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x4cf5b200,
0x68b8,
0x4ca5,
0x9e,
0xec,
&[0xb2, 0x3e, 0x3f, 0x50, 0x02, 0x9a],
);
pub type Width = u32;
pub const WIDTH_UINT8: Width = 0x00000000;
pub const WIDTH_UINT16: Width = 0x00000001;
pub const WIDTH_UINT32: Width = 0x00000002;
pub const WIDTH_UINT64: Width = 0x00000003;
pub const WIDTH_FIFO_UINT8: Width = 0x00000004;
pub const WIDTH_FIFO_UINT16: Width = 0x00000005;
pub const WIDTH_FIFO_UINT32: Width = 0x00000006;
pub const WIDTH_FIFO_UINT64: Width = 0x00000007;
pub const WIDTH_FILL_UINT8: Width = 0x00000008;
pub const WIDTH_FILL_UINT16: Width = 0x00000009;
pub const WIDTH_FILL_UINT32: Width = 0x0000000a;
pub const WIDTH_FILL_UINT64: Width = 0x0000000b;
pub const WIDTH_MAXIMUM: Width = 0x0000000c;
pub type Operation = u32;
pub const OPERATION_BUS_MASTER_READ: Operation = 0x00000000;
pub const OPERATION_BUS_MASTER_WRITE: Operation = 0x00000001;
pub const OPERATION_BUS_MASTER_COMMON_BUFFER: Operation = 0x00000002;
pub const OPERATION_MAXIMUM: Operation = 0x00000003;
pub type Attribute = u64;
pub const ATTRIBUTE_ISA_MOTHERBOARD_IO: Attribute = 0x00000001;
pub const ATTRIBUTE_ISA_IO: Attribute = 0x00000002;
pub const ATTRIBUTE_VGA_PALETTE_IO: Attribute = 0x00000004;
pub const ATTRIBUTE_VGA_MEMORY: Attribute = 0x00000008;
pub const ATTRIBUTE_VGA_IO: Attribute = 0x00000010;
pub const ATTRIBUTE_IDE_PRIMARY_IO: Attribute = 0x00000020;
pub const ATTRIBUTE_IDE_SECONDARY_IO: Attribute = 0x00000040;
pub const ATTRIBUTE_MEMORY_WRITE_COMBINE: Attribute = 0x00000080;
pub const ATTRIBUTE_IO: Attribute = 0x00000100;
pub const ATTRIBUTE_MEMORY: Attribute = 0x00000200;
pub const ATTRIBUTE_BUS_MASTER: Attribute = 0x00000400;
pub const ATTRIBUTE_MEMORY_CACHED: Attribute = 0x00000800;
pub const ATTRIBUTE_MEMORY_DISABLE: Attribute = 0x00001000;
pub const ATTRIBUTE_EMBEDDED_DEVICE: Attribute = 0x00002000;
pub const ATTRIBUTE_EMBEDDED_ROM: Attribute = 0x00004000;
pub const ATTRIBUTE_DUAL_ADDRESS_CYCLE: Attribute = 0x00008000;
pub const ATTRIBUTE_ISA_IO_16: Attribute = 0x00010000;
pub const ATTRIBUTE_VGA_PALETTE_IO_16: Attribute = 0x00020000;
pub const ATTRIBUTE_VGA_IO_16: Attribute = 0x00040000;
pub type AttributeOperation = u32;
pub const ATTRIBUTE_OPERATION_GET: AttributeOperation = 0x00000000;
pub const ATTRIBUTE_OPERATION_SET: AttributeOperation = 0x00000001;
pub const ATTRIBUTE_OPERATION_ENABLE: AttributeOperation = 0x00000002;
pub const ATTRIBUTE_OPERATION_DISABLE: AttributeOperation = 0x00000003;
pub const ATTRIBUTE_OPERATION_SUPPORTED: AttributeOperation = 0x00000004;
pub const ATTRIBUTE_OPERATION_MAXIMUM: AttributeOperation = 0x00000005;
pub const PASS_THROUGH_BAR: u8 = 0xff;
pub type ProtocolPollIoMem = eficall! {fn(
*mut Protocol,
Width,
u8,
u64,
u64,
u64,
u64,
*mut u64,
) -> crate::base::Status};
pub type ProtocolIoMem = eficall! {fn(
*mut Protocol,
Width,
u8,
u64,
usize,
*mut core::ffi::c_void,
) -> crate::base::Status};
pub type ProtocolConfig = eficall! {fn(
*mut Protocol,
Width,
u32,
usize,
*mut core::ffi::c_void,
) -> crate::base::Status};
pub type ProtocolCopyMem = eficall! {fn(
*mut Protocol,
Width,
u8,
u64,
u8,
u64,
usize,
) -> crate::base::Status};
pub type ProtocolMap = eficall! {fn(
*mut Protocol,
Operation,
*mut core::ffi::c_void,
*mut usize,
*mut crate::base::PhysicalAddress,
*mut *mut core::ffi::c_void,
) -> crate::base::Status};
pub type ProtocolUnmap = eficall! {fn(
*mut Protocol,
*mut core::ffi::c_void,
) -> crate::base::Status};
pub type ProtocolAllocateBuffer = eficall! {fn(
*mut Protocol,
crate::system::AllocateType,
crate::system::MemoryType,
usize,
*mut *mut core::ffi::c_void,
Attribute,
) -> crate::base::Status};
pub type ProtocolFreeBuffer = eficall! {fn(
*mut Protocol,
usize,
*mut core::ffi::c_void,
) -> crate::base::Status};
pub type ProtocolFlush = eficall! {fn(
*mut Protocol,
) -> crate::base::Status};
pub type ProtocolGetLocation = eficall! {fn(
*mut Protocol,
*mut usize,
*mut usize,
*mut usize,
*mut usize,
) -> crate::base::Status};
pub type ProtocolAttributes = eficall! {fn(
*mut Protocol,
AttributeOperation,
Attribute,
*mut Attribute,
) -> crate::base::Status};
pub type ProtocolGetBarAttributes = eficall! {fn(
*mut Protocol,
u8,
*mut Attribute,
*mut *mut core::ffi::c_void,
) -> crate::base::Status};
pub type ProtocolSetBarAttributes = eficall! {fn(
*mut Protocol,
Attribute,
u8,
*mut u64,
*mut u64,
) -> crate::base::Status};
#[repr(C)]
pub struct Access {
pub read: ProtocolIoMem,
pub write: ProtocolIoMem,
}
#[repr(C)]
pub struct ConfigAccess {
pub read: ProtocolConfig,
pub write: ProtocolConfig,
}
#[repr(C)]
pub struct Protocol {
pub poll_mem: ProtocolPollIoMem,
pub poll_io: ProtocolPollIoMem,
pub mem: Access,
pub io: Access,
pub pci: ConfigAccess,
pub copy_mem: ProtocolCopyMem,
pub map: ProtocolMap,
pub unmap: ProtocolUnmap,
pub allocate_buffer: ProtocolAllocateBuffer,
pub free_buffer: ProtocolFreeBuffer,
pub flush: ProtocolFlush,
pub get_location: ProtocolGetLocation,
pub attributes: ProtocolAttributes,
pub get_bar_attributes: ProtocolGetBarAttributes,
pub set_bar_attributes: ProtocolSetBarAttributes,
pub rom_size: u64,
pub rom_image: *mut core::ffi::c_void,
}

View File

@@ -0,0 +1,46 @@
//! Platform Driver Override Protocol
//!
//! This protocol matches one or more drivers to a controller. A platform driver
//! produces this protocol, and it is installed on a separate handle. This
//! protocol is used by the `EFI_BOOT_SERVICES.ConnectController()` boot service
//! to select the best driver for a controller. All of the drivers returned by
//! this protocol have a higher precedence than drivers found from an EFI Bus
//! Specific Driver Override Protocol or drivers found from the general UEFI
//! driver binding search algorithm. If more than one driver is returned by this
//! protocol, then the drivers are returned in order from highest precedence to
//! lowest precedence.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x6b30c738,
0xa391,
0x11d4,
0x9a,
0x3b,
&[0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d],
);
pub type ProtocolGetDriver = eficall! {fn(
*mut Protocol,
crate::base::Handle,
*mut crate::base::Handle,
) -> crate::base::Status};
pub type ProtocolGetDriverPath = eficall! {fn(
*mut Protocol,
crate::base::Handle,
*mut *mut crate::protocols::device_path::Protocol
) -> crate::base::Status};
pub type ProtocolDriverLoaded = eficall! {fn(
*mut Protocol,
crate::base::Handle,
*mut crate::protocols::device_path::Protocol,
crate::base::Handle,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub get_driver: ProtocolGetDriver,
pub get_driver_path: ProtocolGetDriverPath,
pub driver_loaded: ProtocolDriverLoaded,
}

83
vendor/r-efi/src/protocols/rng.rs vendored Normal file
View File

@@ -0,0 +1,83 @@
//! Random Number Generator Protocol
//!
//! This protocol is used to provide random numbers for use in applications, or
//! entropy for seeding other random number generators.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x3152bca5,
0xeade,
0x433d,
0x86,
0x2e,
&[0xc0, 0x1c, 0xdc, 0x29, 0x1f, 0x44],
);
pub type Algorithm = crate::base::Guid;
pub const ALGORITHM_SP800_90_HASH_256_GUID: Algorithm = crate::base::Guid::from_fields(
0xa7af67cb,
0x603b,
0x4d42,
0xba,
0x21,
&[0x70, 0xbf, 0xb6, 0x29, 0x3f, 0x96],
);
pub const ALGORITHM_SP800_90_HMAC_256_GUID: Algorithm = crate::base::Guid::from_fields(
0xc5149b43,
0xae85,
0x4f53,
0x99,
0x82,
&[0xb9, 0x43, 0x35, 0xd3, 0xa9, 0xe7],
);
pub const ALGORITHM_SP800_90_CTR_256_GUID: Algorithm = crate::base::Guid::from_fields(
0x44f0de6e,
0x4d8c,
0x4045,
0xa8,
0xc7,
&[0x4d, 0xd1, 0x68, 0x85, 0x6b, 0x9e],
);
pub const ALGORITHM_X9_31_3DES_GUID: Algorithm = crate::base::Guid::from_fields(
0x63c4785a,
0xca34,
0x4012,
0xa3,
0xc8,
&[0x0b, 0x6a, 0x32, 0x4f, 0x55, 0x46],
);
pub const ALGORITHM_X9_31_AES_GUID: Algorithm = crate::base::Guid::from_fields(
0xacd03321,
0x777e,
0x4d3d,
0xb1,
0xc8,
&[0x20, 0xcf, 0xd8, 0x88, 0x20, 0xc9],
);
pub const ALGORITHM_RAW: Algorithm = crate::base::Guid::from_fields(
0xe43176d7,
0xb6e8,
0x4827,
0xb7,
0x84,
&[0x7f, 0xfd, 0xc4, 0xb6, 0x85, 0x61],
);
pub type ProtocolGetInfo = eficall! {fn(
*mut Protocol,
*mut usize,
*mut Algorithm,
) -> crate::base::Status};
pub type ProtocolGetRng = eficall! {fn(
*mut Protocol,
*mut Algorithm,
usize,
*mut u8,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub get_info: ProtocolGetInfo,
pub get_rng: ProtocolGetRng,
}

View File

@@ -0,0 +1,20 @@
//! Service Binding Protocol
//!
//! Provides services that are required to create and destroy child handles
//! that support a given set of protocols.
pub type ProtocolCreateChild = eficall! {fn(
*mut Protocol,
*mut crate::base::Handle,
) -> crate::base::Status};
pub type ProtocolDestroyChild = eficall! {fn(
*mut Protocol,
crate::base::Handle,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub create_child: ProtocolCreateChild,
pub destroy_child: ProtocolDestroyChild,
}

295
vendor/r-efi/src/protocols/shell.rs vendored Normal file
View File

@@ -0,0 +1,295 @@
//! Shell Protocol
//!
//! Provides shell services to UEFI applications.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x6302d008,
0x7f9b,
0x4f30,
0x87,
0xac,
&[0x60, 0xc9, 0xfe, 0xf5, 0xda, 0x4e],
);
pub const MAJOR_VERSION: u32 = 0x00000002;
pub const MINOR_VERSION: u32 = 0x00000002;
pub type FileHandle = *mut core::ffi::c_void;
pub type DeviceNameFlags = u32;
pub const DEVICE_NAME_USE_COMPONENT_NAME: DeviceNameFlags = 0x00000001;
pub const DEVICE_NAME_USE_DEVICE_PATH: DeviceNameFlags = 0x00000002;
#[repr(C)]
pub struct ListEntry {
pub flink: *mut ListEntry,
pub blink: *mut ListEntry,
}
#[repr(C)]
pub struct FileInfo {
pub link: ListEntry,
pub status: crate::base::Status,
pub full_name: *mut crate::base::Char16,
pub file_name: *mut crate::base::Char16,
pub handle: FileHandle,
pub info: *mut crate::protocols::file::Info,
}
pub type Execute = eficall! {fn(
*mut crate::base::Handle,
*mut crate::base::Char16,
*mut *mut crate::base::Char16,
*mut crate::base::Status,
) -> crate::base::Status};
pub type GetEnv = eficall! {fn(
*mut crate::base::Char16,
) -> *mut crate::base::Char16};
pub type SetEnv = eficall! {fn(
*mut crate::base::Char16,
*mut crate::base::Char16,
crate::base::Boolean,
) -> crate::base::Status};
pub type GetAlias = eficall! {fn(
*mut crate::base::Char16,
*mut crate::base::Boolean,
) -> *mut crate::base::Char16};
pub type SetAlias = eficall! {fn(
*mut crate::base::Char16,
*mut crate::base::Char16,
crate::base::Boolean,
crate::base::Boolean,
) -> crate::base::Status};
pub type GetHelpText = eficall! {fn(
*mut crate::base::Char16,
*mut crate::base::Char16,
*mut *mut crate::base::Char16,
) -> crate::base::Status};
pub type GetDevicePathFromMap = eficall! {fn(
*mut crate::base::Char16,
) -> *mut crate::protocols::device_path::Protocol};
pub type GetMapFromDevicePath = eficall! {fn(
*mut *mut crate::protocols::device_path::Protocol,
) -> *mut crate::base::Char16};
pub type GetDevicePathFromFilePath = eficall! {fn(
*mut crate::base::Char16,
) -> *mut crate::protocols::device_path::Protocol};
pub type GetFilePathFromDevicePath = eficall! {fn(
*mut crate::protocols::device_path::Protocol,
) -> *mut crate::base::Char16};
pub type SetMap = eficall! {fn(
*mut crate::protocols::device_path::Protocol,
*mut crate::base::Char16,
) -> crate::base::Status};
pub type GetCurDir = eficall! {fn(
*mut crate::base::Char16,
) -> *mut crate::base::Char16};
pub type SetCurDir = eficall! {fn(
*mut crate::base::Char16,
*mut crate::base::Char16,
) -> crate::base::Status};
pub type OpenFileList = eficall! {fn(
*mut crate::base::Char16,
u64,
*mut *mut FileInfo,
) -> crate::base::Status};
pub type FreeFileList = eficall! {fn(
*mut *mut FileInfo,
) -> crate::base::Status};
pub type RemoveDupInFileList = eficall! {fn(
*mut *mut FileInfo,
) -> crate::base::Status};
pub type BatchIsActive = eficall! {fn() -> crate::base::Boolean};
pub type IsRootShell = eficall! {fn() -> crate::base::Boolean};
pub type EnablePageBreak = eficall! {fn()};
pub type DisablePageBreak = eficall! {fn()};
pub type GetPageBreak = eficall! {fn() -> crate::base::Boolean};
pub type GetDeviceName = eficall! {fn(
crate::base::Handle,
DeviceNameFlags,
*mut crate::base::Char8,
*mut *mut crate::base::Char16,
) -> crate::base::Status};
pub type GetFileInfo = eficall! {fn(
FileHandle,
) -> *mut crate::protocols::file::Info};
pub type SetFileInfo = eficall! {fn(
FileHandle,
*mut crate::protocols::file::Info
) -> crate::base::Status};
pub type OpenFileByName = eficall! {fn(
*mut crate::base::Char16,
*mut FileHandle,
u64,
) -> crate::base::Status};
pub type CloseFile = eficall! {fn(
FileHandle,
) -> crate::base::Status};
pub type CreateFile = eficall! {fn(
*mut crate::base::Char16,
u64,
*mut FileHandle,
) -> crate::base::Status};
pub type ReadFile = eficall! {fn(
FileHandle,
*mut usize,
*mut core::ffi::c_void,
) -> crate::base::Status};
pub type WriteFile = eficall! {fn(
FileHandle,
*mut usize,
*mut core::ffi::c_void,
) -> crate::base::Status};
pub type DeleteFile = eficall! {fn(
FileHandle,
) -> crate::base::Status};
pub type DeleteFileByName = eficall! {fn(
*mut crate::base::Char16,
) -> crate::base::Status};
pub type GetFilePosition = eficall! {fn(
FileHandle,
*mut u64,
) -> crate::base::Status};
pub type SetFilePosition = eficall! {fn(
FileHandle,
u64,
) -> crate::base::Status};
pub type FlushFile = eficall! {fn(
FileHandle,
) -> crate::base::Status};
pub type FindFiles = eficall! {fn(
*mut crate::base::Char16,
*mut *mut FileInfo,
) -> crate::base::Status};
pub type FindFilesInDir = eficall! {fn(
FileHandle,
*mut *mut FileInfo,
) -> crate::base::Status};
pub type GetFileSize = eficall! {fn(
FileHandle,
*mut u64,
) -> crate::base::Status};
pub type OpenRoot = eficall! {fn(
*mut crate::protocols::device_path::Protocol,
*mut FileHandle,
) -> crate::base::Status};
pub type OpenRootByHandle = eficall! {fn(
crate::base::Handle,
*mut FileHandle,
) -> crate::base::Status};
pub type RegisterGuidName = eficall! {fn(
*mut crate::base::Guid,
*mut crate::base::Char16,
) -> crate::base::Status};
pub type GetGuidName = eficall! {fn(
*mut crate::base::Guid,
*mut *mut crate::base::Char16,
) -> crate::base::Status};
pub type GetGuidFromName = eficall! {fn(
*mut crate::base::Char16,
*mut crate::base::Guid,
) -> crate::base::Status};
pub type GetEnvEx = eficall! {fn(
*mut crate::base::Char16,
*mut u32,
) -> *mut crate::base::Char16};
#[repr(C)]
pub struct Protocol {
pub execute: Execute,
pub get_env: GetEnv,
pub set_env: SetEnv,
pub get_alias: GetAlias,
pub set_alias: SetAlias,
pub get_help_text: GetHelpText,
pub get_device_path_from_map: GetDevicePathFromMap,
pub get_map_from_device_path: GetMapFromDevicePath,
pub get_device_path_from_file_path: GetDevicePathFromFilePath,
pub get_file_path_from_device_path: GetFilePathFromDevicePath,
pub set_map: SetMap,
pub get_cur_dir: GetCurDir,
pub set_cur_dir: SetCurDir,
pub open_file_list: OpenFileList,
pub free_file_list: FreeFileList,
pub remove_dup_in_file_list: RemoveDupInFileList,
pub batch_is_active: BatchIsActive,
pub is_root_shell: IsRootShell,
pub enable_page_break: EnablePageBreak,
pub disable_page_break: DisablePageBreak,
pub get_page_break: GetPageBreak,
pub get_device_name: GetDeviceName,
pub get_file_info: GetFileInfo,
pub set_file_info: SetFileInfo,
pub open_file_by_name: OpenFileByName,
pub close_file: CloseFile,
pub create_file: CreateFile,
pub read_file: ReadFile,
pub write_file: WriteFile,
pub delete_file: DeleteFile,
pub delete_file_by_name: DeleteFileByName,
pub get_file_position: GetFilePosition,
pub set_file_position: SetFilePosition,
pub flush_file: FlushFile,
pub find_files: FindFiles,
pub find_files_in_dir: FindFilesInDir,
pub get_file_size: GetFileSize,
pub open_root: OpenRoot,
pub open_root_by_handle: OpenRootByHandle,
pub execution_break: crate::base::Event,
pub major_version: u32,
pub minor_version: u32,
pub register_guid_name: RegisterGuidName,
pub get_guid_name: GetGuidName,
pub get_guid_from_name: GetGuidFromName,
// Shell 2.1
pub get_env_ex: GetEnvEx,
}

View File

@@ -0,0 +1,33 @@
//! Shell Dynamic Command Protocol
//!
//! Defined in UEFI Shell Specification, Section 2.4
use super::{shell, shell_parameters};
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x3c7200e9,
0x005f,
0x4ea4,
0x87,
0xde,
&[0xa3, 0xdf, 0xac, 0x8a, 0x27, 0xc3],
);
pub type CommandHandler = eficall! {fn(
*mut Protocol,
*mut crate::system::SystemTable,
*mut shell_parameters::Protocol,
*mut shell::Protocol,
) -> crate::base::Status};
pub type CommandGetHelp = eficall! {fn(
*mut Protocol,
*mut crate::base::Char8,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub command_name: *mut crate::base::Char16,
pub handler: CommandHandler,
pub get_help: CommandGetHelp,
}

View File

@@ -0,0 +1,23 @@
//! Shell Parameters Protocol
//!
//! Defined in the UEFI Shell Specification, Section 2.3.
use super::shell;
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x752f3136,
0x4e16,
0x4fdc,
0xa2,
0x2a,
&[0xe5, 0xf4, 0x68, 0x12, 0xf4, 0xca],
);
#[repr(C)]
pub struct Protocol {
pub argv: *mut *mut crate::base::Char16,
pub argc: usize,
pub std_in: shell::FileHandle,
pub std_out: shell::FileHandle,
pub std_err: shell::FileHandle,
}

View File

@@ -0,0 +1,26 @@
//! Simple File System Protocol
//!
//! Provides the `open_volume` function returning a file protocol representing the root directory
//! of a filesystem.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x964e5b22,
0x6459,
0x11d2,
0x8e,
0x39,
&[0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b],
);
pub const REVISION: u64 = 0x0000000000010000u64;
pub type ProtocolOpenVolume = eficall! {fn(
*mut Protocol,
*mut *mut crate::protocols::file::Protocol,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub revision: u64,
pub open_volume: ProtocolOpenVolume,
}

View File

@@ -0,0 +1,196 @@
//! Simple Network Protocol
//!
//! The simple network protcol provides services to initialize a network interface, transmit
//! packets, receive packets, and close a network interface.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0xa19832b9,
0xac25,
0x11d3,
0x9a,
0x2d,
&[0x00, 0x90, 0x27, 0x3f, 0xc1, 0x4d],
);
pub const REVISION: u64 = 0x0000000000010000u64;
pub const MAX_MCAST_FILTER_CNT: usize = 16;
pub const RECEIVE_UNICAST: u32 = 0x00000001u32;
pub const RECEIVE_MULTICAST: u32 = 0x00000002u32;
pub const RECEIVE_BROADCAST: u32 = 0x00000004u32;
pub const RECEIVE_PROMISCUOUS: u32 = 0x00000008u32;
pub const RECEIVE_PROMISCUOUS_MULTICAST: u32 = 0x00000010u32;
pub const RECEIVE_INTERRUPT: u32 = 0x00000001u32;
pub const TRANSMIT_INTERRUPT: u32 = 0x00000002u32;
pub const COMMAND_INTERRUPT: u32 = 0x00000004u32;
pub const SOFTWARE_INTERRUPT: u32 = 0x000000008u32;
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct Mode {
pub state: u32,
pub hw_address_size: u32,
pub media_header_size: u32,
pub max_packet_size: u32,
pub nvram_size: u32,
pub nvram_access_size: u32,
pub receive_filter_mask: u32,
pub receive_filter_setting: u32,
pub max_mcast_filter_count: u32,
pub mcast_filter_count: u32,
pub mcast_filter: [crate::base::MacAddress; MAX_MCAST_FILTER_CNT],
pub current_address: crate::base::MacAddress,
pub broadcast_address: crate::base::MacAddress,
pub permanent_address: crate::base::MacAddress,
pub if_type: u8,
pub mac_address_changeable: crate::base::Boolean,
pub multiple_tx_supported: crate::base::Boolean,
pub media_present_supported: crate::base::Boolean,
pub media_present: crate::base::Boolean,
}
pub type State = u32;
pub const STOPPED: State = 0x00000000;
pub const STARTED: State = 0x00000001;
pub const INITIALIZED: State = 0x00000002;
pub const MAX_STATE: State = 0x00000003;
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct Statistics {
pub rx_total_frames: u64,
pub rx_good_frames: u64,
pub rx_undersize_frames: u64,
pub rx_oversize_frames: u64,
pub rx_dropped_frames: u64,
pub rx_unicast_frames: u64,
pub rx_broadcast_frames: u64,
pub rx_multicast_frames: u64,
pub rx_crc_error_frames: u64,
pub rx_total_bytes: u64,
pub tx_total_frames: u64,
pub tx_good_frames: u64,
pub tx_undersize_frames: u64,
pub tx_oversize_frames: u64,
pub tx_dropped_frames: u64,
pub tx_unicast_frames: u64,
pub tx_broadcast_frames: u64,
pub tx_multicast_frames: u64,
pub tx_crc_error_frames: u64,
pub tx_total_bytes: u64,
pub collisions: u64,
pub unsupported_protocol: u64,
pub rx_duplicated_frames: u64,
pub rx_decrypt_error_frames: u64,
pub tx_error_frames: u64,
pub tx_retry_frames: u64,
}
pub type ProtocolStart = eficall! {fn(
*mut Protocol,
) -> crate::base::Status};
pub type ProtocolStop = eficall! {fn(
*mut Protocol,
) -> crate::base::Status};
pub type ProtocolInitialize = eficall! {fn(
*mut Protocol,
usize,
usize,
) -> crate::base::Status};
pub type ProtocolReset = eficall! {fn(
*mut Protocol,
crate::base::Boolean,
) -> crate::base::Status};
pub type ProtocolShutdown = eficall! {fn(
*mut Protocol,
) -> crate::base::Status};
pub type ProtocolReceiveFilters = eficall! {fn(
*mut Protocol,
u32,
u32,
crate::base::Boolean,
usize,
*mut crate::base::MacAddress,
) -> crate::base::Status};
pub type ProtocolStationAddress = eficall! {fn(
*mut Protocol,
crate::base::Boolean,
*mut crate::base::MacAddress,
) -> crate::base::Status};
pub type ProtocolStatistics = eficall! {fn(
*mut Protocol,
crate::base::Boolean,
*mut usize,
*mut Statistics,
) -> crate::base::Status};
pub type ProtocolMcastIpToMac = eficall! {fn(
*mut Protocol,
crate::base::Boolean,
*mut crate::base::IpAddress,
*mut crate::base::MacAddress,
) -> crate::base::Status};
pub type ProtocolNvData = eficall! {fn(
*mut Protocol,
crate::base::Boolean,
usize,
usize,
*mut core::ffi::c_void,
) -> crate::base::Status};
pub type ProtocolGetStatus = eficall! {fn(
*mut Protocol,
*mut u32,
*mut *mut core::ffi::c_void,
) -> crate::base::Status};
pub type ProtocolTransmit = eficall! {fn(
*mut Protocol,
usize,
usize,
*mut core::ffi::c_void,
*mut crate::base::MacAddress,
*mut crate::base::MacAddress,
*mut u16,
) -> crate::base::Status};
pub type ProtocolReceive = eficall! {fn(
*mut Protocol,
*mut usize,
*mut usize,
*mut core::ffi::c_void,
*mut crate::base::MacAddress,
*mut crate::base::MacAddress,
*mut u16,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub revision: u64,
pub start: ProtocolStart,
pub stop: ProtocolStop,
pub initialize: ProtocolInitialize,
pub reset: ProtocolReset,
pub shutdown: ProtocolShutdown,
pub receive_filters: ProtocolReceiveFilters,
pub station_address: ProtocolStationAddress,
pub statistics: ProtocolStatistics,
pub mcast_ip_to_mac: ProtocolMcastIpToMac,
pub nv_data: ProtocolNvData,
pub get_status: ProtocolGetStatus,
pub transmit: ProtocolTransmit,
pub receive: ProtocolReceive,
pub wait_for_packet: crate::base::Event,
pub mode: *mut Mode,
}

View File

@@ -0,0 +1,38 @@
//! Simple Text Input Protocol
//!
//! The simple-text-input protocol defines how to read basic key-strokes. It is limited to
//! non-modifiers and lacks any detailed reporting. It is mostly useful for debugging and admin
//! interaction.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x387477c1,
0x69c7,
0x11d2,
0x8e,
0x39,
&[0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b],
);
#[repr(C)]
#[derive(Clone, Copy, Debug, Default)]
pub struct InputKey {
pub scan_code: u16,
pub unicode_char: crate::base::Char16,
}
pub type ProtocolReset = eficall! {fn(
*mut Protocol,
crate::base::Boolean,
) -> crate::base::Status};
pub type ProtocolReadKeyStroke = eficall! {fn(
*mut Protocol,
*mut InputKey,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub reset: ProtocolReset,
pub read_key_stroke: ProtocolReadKeyStroke,
pub wait_for_key: crate::base::Event,
}

View File

@@ -0,0 +1,85 @@
//! Extended Simple Text Input Protocol
//!
//! The simple-text-input-ex protocol extends the simple-text-input protocol by allowing more
//! details reporting about modifiers, etc.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0xdd9e7534,
0x7762,
0x4698,
0x8c,
0x14,
&[0xf5, 0x85, 0x17, 0xa6, 0x25, 0xaa],
);
pub const SHIFT_STATE_VALID: u32 = 0x80000000u32;
pub const RIGHT_SHIFT_PRESSED: u32 = 0x00000001u32;
pub const LEFT_SHIFT_PRESSED: u32 = 0x00000002u32;
pub const RIGHT_CONTROL_PRESSED: u32 = 0x00000004u32;
pub const LEFT_CONTROL_PRESSED: u32 = 0x00000008u32;
pub const RIGHT_ALT_PRESSED: u32 = 0x00000010u32;
pub const LEFT_ALT_PRESSED: u32 = 0x00000020u32;
pub const RIGHT_LOGO_PRESSED: u32 = 0x00000040u32;
pub const LEFT_LOGO_PRESSED: u32 = 0x00000080u32;
pub const MENU_KEY_PRESSED: u32 = 0x00000100u32;
pub const SYS_REQ_PRESSED: u32 = 0x00000200u32;
pub const TOGGLE_STATE_VALID: u8 = 0x80u8;
pub const KEY_STATE_EXPOSED: u8 = 0x40u8;
pub const SCROLL_LOCK_ACTIVE: u8 = 0x01u8;
pub const NUM_LOCK_ACTIVE: u8 = 0x02u8;
pub const CAPS_LOCK_ACTIVE: u8 = 0x04u8;
pub type KeyToggleState = u8;
pub type KeyNotifyFunction = eficall! {fn(*mut KeyData) -> crate::base::Status};
#[repr(C)]
#[derive(Clone, Copy, Debug, Default)]
pub struct KeyState {
pub key_shift_state: u32,
pub key_toggle_state: KeyToggleState,
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Default)]
pub struct KeyData {
pub key: crate::protocols::simple_text_input::InputKey,
pub key_state: KeyState,
}
pub type ProtocolReset = eficall! {fn(
*mut Protocol,
crate::base::Boolean,
) -> crate::base::Status};
pub type ProtocolReadKeyStrokeEx = eficall! {fn(
*mut Protocol,
*mut KeyData,
) -> crate::base::Status};
pub type ProtocolSetState = eficall! {fn(
*mut Protocol,
*mut KeyToggleState,
) -> crate::base::Status};
pub type ProtocolRegisterKeyNotify = eficall! {fn(
*mut Protocol,
*mut KeyData,
KeyNotifyFunction,
*mut *mut core::ffi::c_void,
) -> crate::base::Status};
pub type ProtocolUnregisterKeyNotify = eficall! {fn(
*mut Protocol,
*mut core::ffi::c_void,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub reset: ProtocolReset,
pub read_key_stroke_ex: ProtocolReadKeyStrokeEx,
pub wait_for_key_ex: crate::base::Event,
pub set_state: ProtocolSetState,
pub register_key_notify: ProtocolRegisterKeyNotify,
pub unregister_key_notify: ProtocolUnregisterKeyNotify,
}

View File

@@ -0,0 +1,86 @@
//! Simple Text Output Protocol
//!
//! The simple-text-output protocol provides a simple way to print text on screen. It is modeled
//! around the old VGA-consoles, but does not carry all the old cruft. It expects a rectangular
//! text array and allows you to move the cursor around to write Unicode symbols to screen.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x387477c2,
0x69c7,
0x11d2,
0x8e,
0x39,
&[0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b],
);
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct Mode {
pub max_mode: i32,
pub mode: i32,
pub attribute: i32,
pub cursor_column: i32,
pub cursor_row: i32,
pub cursor_visible: crate::base::Boolean,
}
pub type ProtocolReset = eficall! {fn(
*mut Protocol,
crate::base::Boolean,
) -> crate::base::Status};
pub type ProtocolOutputString = eficall! {fn(
*mut Protocol,
*mut crate::base::Char16,
) -> crate::base::Status};
pub type ProtocolTestString = eficall! {fn(
*mut Protocol,
*mut crate::base::Char16,
) -> crate::base::Status};
pub type ProtocolQueryMode = eficall! {fn(
*mut Protocol,
usize,
*mut usize,
*mut usize,
) -> crate::base::Status};
pub type ProtocolSetMode = eficall! {fn(
*mut Protocol,
usize,
) -> crate::base::Status};
pub type ProtocolSetAttribute = eficall! {fn(
*mut Protocol,
usize,
) -> crate::base::Status};
pub type ProtocolClearScreen = eficall! {fn(
*mut Protocol,
) -> crate::base::Status};
pub type ProtocolSetCursorPosition = eficall! {fn(
*mut Protocol,
usize,
usize,
) -> crate::base::Status};
pub type ProtocolEnableCursor = eficall! {fn(
*mut Protocol,
crate::base::Boolean,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub reset: ProtocolReset,
pub output_string: ProtocolOutputString,
pub test_string: ProtocolTestString,
pub query_mode: ProtocolQueryMode,
pub set_mode: ProtocolSetMode,
pub set_attribute: ProtocolSetAttribute,
pub clear_screen: ProtocolClearScreen,
pub set_cursor_position: ProtocolSetCursorPosition,
pub enable_cursor: ProtocolEnableCursor,
pub mode: *mut Mode,
}

224
vendor/r-efi/src/protocols/tcp4.rs vendored Normal file
View File

@@ -0,0 +1,224 @@
//! Transmission Control Protocol version 4
//!
//! It provides services to send and receive data streams.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x65530bc7,
0xa359,
0x410f,
0xb0,
0x10,
&[0x5a, 0xad, 0xc7, 0xec, 0x2b, 0x62],
);
pub const SERVICE_BINDING_PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x00720665,
0x67eb,
0x4a99,
0xba,
0xf7,
&[0xd3, 0xc3, 0x3a, 0x1c, 0x7c, 0xc9],
);
pub type ConnectionState = u32;
pub const STATE_CLOSED: ConnectionState = 0x00000000;
pub const STATE_LISTEN: ConnectionState = 0x00000001;
pub const STATE_SYN_SENT: ConnectionState = 0x00000002;
pub const STATE_SYN_RECEIVED: ConnectionState = 0x00000003;
pub const STATE_ESTABLISHED: ConnectionState = 0x00000004;
pub const STATE_FIN_WAIT1: ConnectionState = 0x00000005;
pub const STATE_FIN_WAIT2: ConnectionState = 0x00000006;
pub const STATE_CLOSING: ConnectionState = 0x00000007;
pub const STATE_TIME_WAIT: ConnectionState = 0x00000008;
pub const STATE_CLOSE_WAIT: ConnectionState = 0x00000009;
pub const STATE_LAST_ACK: ConnectionState = 0x0000000a;
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct ConfigData {
pub type_of_service: u8,
pub time_to_live: u8,
pub access_point: AccessPoint,
pub control_option: *mut r#Option,
}
impl Default for ConfigData {
fn default() -> Self {
Self {
type_of_service: Default::default(),
time_to_live: Default::default(),
access_point: Default::default(),
control_option: core::ptr::null_mut(),
}
}
}
#[repr(C)]
#[derive(Clone, Copy, Debug, Default)]
pub struct AccessPoint {
pub use_default_address: crate::base::Boolean,
pub station_address: crate::base::Ipv4Address,
pub subnet_mask: crate::base::Ipv4Address,
pub station_port: u16,
pub remote_address: crate::base::Ipv4Address,
pub remote_port: u16,
pub active_flag: crate::base::Boolean,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct r#Option {
pub receive_buffer_size: u32,
pub send_buffer_size: u32,
pub max_syn_back_log: u32,
pub connection_timeout: u32,
pub data_retries: u32,
pub fin_timeout: u32,
pub time_wait_timeout: u32,
pub keep_alive_probes: u32,
pub keep_alive_time: u32,
pub keep_alive_interval: u32,
pub enable_nagle: crate::base::Boolean,
pub enable_time_stamp: crate::base::Boolean,
pub enable_window_scaling: crate::base::Boolean,
pub enable_selective_ack: crate::base::Boolean,
pub enable_path_mtu_discovery: crate::base::Boolean,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct CompletionToken {
pub event: crate::base::Event,
pub status: crate::base::Status,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct ConnectionToken {
pub completion_token: CompletionToken,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct ListenToken {
pub completion_token: CompletionToken,
pub new_child_handle: crate::base::Handle,
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct IoToken {
pub completion_token: CompletionToken,
pub packet: IoTokenPacket,
}
#[repr(C)]
#[derive(Clone, Copy)]
pub union IoTokenPacket {
pub rx_data: *mut ReceiveData,
pub tx_data: *mut TransmitData,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct ReceiveData<const N: usize = 0> {
pub urgent_flag: crate::base::Boolean,
pub data_length: u32,
pub fragment_count: u32,
pub fragment_table: [FragmentData; N],
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct FragmentData {
pub fragment_length: u32,
pub fragment_buffer: *mut core::ffi::c_void,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct TransmitData<const N: usize = 0> {
pub push: crate::base::Boolean,
pub urgent: crate::base::Boolean,
pub data_length: u32,
pub fragment_count: u32,
pub fragment_table: [FragmentData; N],
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct CloseToken {
pub completion_token: CompletionToken,
pub abort_on_close: crate::base::Boolean,
}
pub type ProtocolGetModeData = eficall! {fn(
*mut Protocol,
*mut ConnectionState,
*mut ConfigData,
*mut crate::protocols::ip4::ModeData,
*mut crate::protocols::managed_network::ConfigData,
*mut crate::protocols::simple_network::Mode,
) -> crate::base::Status};
pub type ProtocolConfigure = eficall! {fn(
*mut Protocol,
*mut ConfigData,
) -> crate::base::Status};
pub type ProtocolRoutes = eficall! {fn(
*mut Protocol,
crate::base::Boolean,
*mut crate::base::Ipv4Address,
*mut crate::base::Ipv4Address,
*mut crate::base::Ipv4Address,
) -> crate::base::Status};
pub type ProtocolConnect = eficall! {fn(
*mut Protocol,
*mut ConnectionToken,
) -> crate::base::Status};
pub type ProtocolAccept = eficall! {fn(
*mut Protocol,
*mut ListenToken,
) -> crate::base::Status};
pub type ProtocolTransmit = eficall! {fn(
*mut Protocol,
*mut IoToken,
) -> crate::base::Status};
pub type ProtocolReceive = eficall! {fn(
*mut Protocol,
*mut IoToken,
) -> crate::base::Status};
pub type ProtocolClose = eficall! {fn(
*mut Protocol,
*mut CloseToken,
) -> crate::base::Status};
pub type ProtocolCancel = eficall! {fn(
*mut Protocol,
*mut CompletionToken,
) -> crate::base::Status};
pub type ProtocolPoll = eficall! {fn(
*mut Protocol,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub get_mode_data: ProtocolGetModeData,
pub configure: ProtocolConfigure,
pub routes: ProtocolRoutes,
pub connect: ProtocolConnect,
pub accept: ProtocolAccept,
pub transmit: ProtocolTransmit,
pub receive: ProtocolReceive,
pub close: ProtocolClose,
pub cancel: ProtocolCancel,
pub poll: ProtocolPoll,
}

202
vendor/r-efi/src/protocols/tcp6.rs vendored Normal file
View File

@@ -0,0 +1,202 @@
//! Transmission Control Protocol version 6
//!
//! It provides services to send and receive data streams.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x46e44855,
0xbd60,
0x4ab7,
0xab,
0x0d,
&[0xa6, 0x79, 0xb9, 0x44, 0x7d, 0x77],
);
pub const SERVICE_BINDING_PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0xec20eb79,
0x6c1a,
0x4664,
0x9a,
0x0d,
&[0xd2, 0xe4, 0xcc, 0x16, 0xd6, 0x64],
);
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct AccessPoint {
pub station_address: crate::base::Ipv6Address,
pub station_port: u16,
pub remote_address: crate::base::Ipv6Address,
pub remote_port: u16,
pub active_flag: crate::base::Boolean,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct r#Option {
pub receive_buffer_size: u32,
pub send_buffer_size: u32,
pub max_syn_back_log: u32,
pub connection_timeout: u32,
pub data_retries: u32,
pub fin_timeout: u32,
pub time_wait_timeout: u32,
pub keep_alive_probes: u32,
pub keep_alive_time: u32,
pub keep_alive_interval: u32,
pub enable_nagle: crate::base::Boolean,
pub enable_time_stamp: crate::base::Boolean,
pub enable_window_scaling: crate::base::Boolean,
pub enable_selective_ack: crate::base::Boolean,
pub enable_path_mtu_discovery: crate::base::Boolean,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct ConfigData {
pub traffic_class: u8,
pub hop_limit: u8,
pub access_point: AccessPoint,
pub control_option: *mut r#Option,
}
pub type ConnectionState = u32;
pub const STATE_CLOSED: ConnectionState = 0x00000000;
pub const STATE_LISTEN: ConnectionState = 0x00000001;
pub const STATE_SYN_SENT: ConnectionState = 0x00000002;
pub const STATE_SYN_RECEIVED: ConnectionState = 0x00000003;
pub const STATE_ESTABLISHED: ConnectionState = 0x00000004;
pub const STATE_FIN_WAIT1: ConnectionState = 0x00000005;
pub const STATE_FIN_WAIT2: ConnectionState = 0x00000006;
pub const STATE_CLOSING: ConnectionState = 0x00000007;
pub const STATE_TIME_WAIT: ConnectionState = 0x00000008;
pub const STATE_CLOSE_WAIT: ConnectionState = 0x00000009;
pub const STATE_LAST_ACK: ConnectionState = 0x0000000a;
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct CompletionToken {
pub event: crate::base::Event,
pub status: crate::base::Status,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct ConnectionToken {
pub completion_token: CompletionToken,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct ListenToken {
pub completion_token: CompletionToken,
pub new_child_handle: crate::base::Handle,
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct IoToken {
pub completion_token: CompletionToken,
pub packet: IoTokenPacket,
}
#[repr(C)]
#[derive(Clone, Copy)]
pub union IoTokenPacket {
pub rx_data: *mut ReceiveData,
pub tx_data: *mut TransmitData,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct ReceiveData<const N: usize = 0> {
pub urgent_flag: crate::base::Boolean,
pub data_length: u32,
pub fragment_count: u32,
pub fragment_table: [FragmentData; N],
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct FragmentData {
pub fragment_length: u32,
pub fragment_buffer: *mut core::ffi::c_void,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct TransmitData<const N: usize = 0> {
pub push: crate::base::Boolean,
pub urgent: crate::base::Boolean,
pub data_length: u32,
pub fragment_count: u32,
pub fragment_table: [FragmentData; N],
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct CloseToken {
pub completion_token: CompletionToken,
pub abort_on_close: crate::base::Boolean,
}
pub type ProtocolGetModeData = eficall! {fn(
*mut Protocol,
*mut ConnectionState,
*mut ConfigData,
*mut crate::protocols::ip6::ModeData,
*mut crate::protocols::managed_network::ConfigData,
*mut crate::protocols::simple_network::Mode,
) -> crate::base::Status};
pub type ProtocolConfigure = eficall! {fn(
*mut Protocol,
*mut ConfigData,
) -> crate::base::Status};
pub type ProtocolConnect = eficall! {fn(
*mut Protocol,
*mut ConnectionToken,
) -> crate::base::Status};
pub type ProtocolAccept = eficall! {fn(
*mut Protocol,
*mut ListenToken,
) -> crate::base::Status};
pub type ProtocolTransmit = eficall! {fn(
*mut Protocol,
*mut IoToken,
) -> crate::base::Status};
pub type ProtocolReceive = eficall! {fn(
*mut Protocol,
*mut IoToken,
) -> crate::base::Status};
pub type ProtocolClose = eficall! {fn(
*mut Protocol,
*mut CloseToken,
) -> crate::base::Status};
pub type ProtocolCancel = eficall! {fn(
*mut Protocol,
*mut CompletionToken,
) -> crate::base::Status};
pub type ProtocolPoll = eficall! {fn(
*mut Protocol,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub get_mode_data: ProtocolGetModeData,
pub configure: ProtocolConfigure,
pub connect: ProtocolConnect,
pub accept: ProtocolAccept,
pub transmit: ProtocolTransmit,
pub receive: ProtocolReceive,
pub close: ProtocolClose,
pub cancel: ProtocolCancel,
pub poll: ProtocolPoll,
}

32
vendor/r-efi/src/protocols/timestamp.rs vendored Normal file
View File

@@ -0,0 +1,32 @@
//! EFI Timestamp Protocol
//!
//! The Timestamp protocol provides a platform independent interface for
//! retrieving a high resolution timestamp counter.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0xafbfde41,
0x2e6e,
0x4262,
0xba,
0x65,
&[0x62, 0xb9, 0x23, 0x6e, 0x54, 0x95],
);
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct Properties {
pub frequency: u64,
pub end_value: u64,
}
pub type ProtocolGetTimestamp = eficall! {fn() -> u64};
pub type ProtocolGetProperties = eficall! {fn(
*mut Properties,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub get_timestamp: ProtocolGetTimestamp,
pub get_properties: ProtocolGetProperties,
}

151
vendor/r-efi/src/protocols/udp4.rs vendored Normal file
View File

@@ -0,0 +1,151 @@
//! User Datagram Protocol V4
//!
//! It provides simple packet-oriented services to transmit and receive UDP packets.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x3ad9df29,
0x4501,
0x478d,
0xb1,
0xf8,
&[0x7f, 0x7f, 0xe7, 0x0e, 0x50, 0xf3],
);
pub const SERVICE_BINDING_PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x83f01464,
0x99bd,
0x45e5,
0xb3,
0x83,
&[0xaf, 0x63, 0x05, 0xd8, 0xe9, 0xe6],
);
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct ConfigData {
pub accept_broadcast: crate::base::Boolean,
pub accept_promiscuous: crate::base::Boolean,
pub accept_any_port: crate::base::Boolean,
pub allow_duplicate_port: crate::base::Boolean,
pub type_of_service: u8,
pub time_to_live: u8,
pub do_not_fragment: crate::base::Boolean,
pub receive_timeout: u32,
pub transmit_timeout: u32,
pub use_default_address: crate::base::Boolean,
pub station_address: crate::base::Ipv4Address,
pub subnet_mask: crate::base::Ipv4Address,
pub station_port: u16,
pub remote_address: crate::base::Ipv4Address,
pub remote_port: u16,
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct SessionData {
pub source_address: crate::base::Ipv4Address,
pub source_port: u16,
pub destination_address: crate::base::Ipv4Address,
pub destination_port: u16,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct FragmentData {
pub fragment_length: u32,
pub fragment_buffer: *mut core::ffi::c_void,
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct ReceiveData<const N: usize = 0> {
pub time_stamp: crate::system::Time,
pub recycle_signal: crate::base::Event,
pub udp_session: SessionData,
pub data_length: u32,
pub fragment_count: u32,
pub fragment_table: [FragmentData; N],
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct TransmitData<const N: usize = 0> {
pub udp_session_data: *mut SessionData,
pub gateway_address: *mut crate::base::Ipv4Address,
pub data_length: u32,
pub fragment_count: u32,
pub fragment_table: [FragmentData; N],
}
#[repr(C)]
#[derive(Clone, Copy)]
pub union CompletionTokenPacket {
pub rx_data: *mut ReceiveData,
pub tx_data: *mut TransmitData,
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct CompletionToken {
pub event: crate::base::Event,
pub status: crate::base::Status,
pub packet: CompletionTokenPacket,
}
pub type ProtocolGetModeData = eficall! {fn(
*mut Protocol,
*mut ConfigData,
*mut crate::protocols::ip4::ModeData,
*mut crate::protocols::managed_network::ConfigData,
*mut crate::protocols::simple_network::Mode,
) -> crate::base::Status};
pub type ProtocolConfigure = eficall! {fn(
*mut Protocol,
*mut ConfigData,
) -> crate::base::Status};
pub type ProtocolGroups = eficall! {fn(
*mut Protocol,
crate::base::Boolean,
*mut crate::base::Ipv4Address,
) -> crate::base::Status};
pub type ProtocolRoutes = eficall! {fn(
*mut Protocol,
crate::base::Boolean,
*mut crate::base::Ipv4Address,
*mut crate::base::Ipv4Address,
*mut crate::base::Ipv4Address,
) -> crate::base::Status};
pub type ProtocolTransmit = eficall! {fn(
*mut Protocol,
*mut CompletionToken,
) -> crate::base::Status};
pub type ProtocolReceive = eficall! {fn(
*mut Protocol,
*mut CompletionToken,
) -> crate::base::Status};
pub type ProtocolCancel = eficall! {fn(
*mut Protocol,
*mut CompletionToken,
) -> crate::base::Status};
pub type ProtocolPoll = eficall! {fn(
*mut Protocol,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub get_mode_data: ProtocolGetModeData,
pub configure: ProtocolConfigure,
pub groups: ProtocolGroups,
pub routes: ProtocolRoutes,
pub transmit: ProtocolTransmit,
pub receive: ProtocolReceive,
pub cancel: ProtocolCancel,
pub poll: ProtocolPoll,
}

137
vendor/r-efi/src/protocols/udp6.rs vendored Normal file
View File

@@ -0,0 +1,137 @@
//! User Datagram Protocol V6
//!
//! It provides simple packet-oriented services to transmit and receive UDP packets.
pub const PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x4f948815,
0xb4b9,
0x43cb,
0x8a,
0x33,
&[0x90, 0xe0, 0x60, 0xb3, 0x49, 0x55],
);
pub const SERVICE_BINDING_PROTOCOL_GUID: crate::base::Guid = crate::base::Guid::from_fields(
0x66ed4721,
0x3c98,
0x4d3e,
0x81,
0xe3,
&[0xd0, 0x3d, 0xd3, 0x9a, 0x72, 0x54],
);
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct ConfigData {
pub accept_promiscuous: crate::base::Boolean,
pub accept_any_port: crate::base::Boolean,
pub allow_duplicate_port: crate::base::Boolean,
pub traffic_class: u8,
pub hop_limit: u8,
pub receive_timeout: u32,
pub transmit_timeout: u32,
pub station_address: crate::base::Ipv6Address,
pub station_port: u16,
pub remote_address: crate::base::Ipv6Address,
pub remote_port: u16,
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct SessionData {
pub source_address: crate::base::Ipv6Address,
pub source_port: u16,
pub destination_address: crate::base::Ipv6Address,
pub destination_port: u16,
}
#[repr(C)]
#[derive(Clone, Copy, Debug)]
pub struct FragmentData {
pub fragment_length: u32,
pub fragment_buffer: *mut core::ffi::c_void,
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct ReceiveData<const N: usize = 0> {
pub time_stamp: crate::system::Time,
pub recycle_signal: crate::base::Event,
pub udp_session: SessionData,
pub data_length: u32,
pub fragment_count: u32,
pub fragment_table: [FragmentData; N],
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct TransmitData<const N: usize = 0> {
pub udp_session_data: *mut SessionData,
pub data_length: u32,
pub fragment_count: u32,
pub fragment_table: [FragmentData; N],
}
#[repr(C)]
#[derive(Clone, Copy)]
pub union CompletionTokenPacket {
pub rx_data: *mut ReceiveData,
pub tx_data: *mut TransmitData,
}
#[repr(C)]
#[derive(Clone, Copy)]
pub struct CompletionToken {
pub event: crate::base::Event,
pub status: crate::base::Status,
pub packet: CompletionTokenPacket,
}
pub type ProtocolGetModeData = eficall! {fn(
*mut Protocol,
*mut ConfigData,
*mut crate::protocols::ip6::ModeData,
*mut crate::protocols::managed_network::ConfigData,
*mut crate::protocols::simple_network::Mode,
) -> crate::base::Status};
pub type ProtocolConfigure = eficall! {fn(
*mut Protocol,
*mut ConfigData,
) -> crate::base::Status};
pub type ProtocolGroups = eficall! {fn(
*mut Protocol,
crate::base::Boolean,
*mut crate::base::Ipv6Address,
) -> crate::base::Status};
pub type ProtocolTransmit = eficall! {fn(
*mut Protocol,
*mut CompletionToken,
) -> crate::base::Status};
pub type ProtocolReceive = eficall! {fn(
*mut Protocol,
*mut CompletionToken,
) -> crate::base::Status};
pub type ProtocolCancel = eficall! {fn(
*mut Protocol,
*mut CompletionToken,
) -> crate::base::Status};
pub type ProtocolPoll = eficall! {fn(
*mut Protocol,
) -> crate::base::Status};
#[repr(C)]
pub struct Protocol {
pub get_mode_data: ProtocolGetModeData,
pub configure: ProtocolConfigure,
pub groups: ProtocolGroups,
pub transmit: ProtocolTransmit,
pub receive: ProtocolReceive,
pub cancel: ProtocolCancel,
pub poll: ProtocolPoll,
}