- MSRV increased to 1.79.
See Deprecating SystemTable/BootServices/RuntimeServices for details of the deprecated items that were removed in this release.
- Impl
PartialEq
andEq
forGptPartitionEntry
. - Added
CStr16::from_u16_until_nul
andCStr16::from_char16_until_nul
.
- Breaking: Deleted the deprecated
BootServices
,RuntimeServices
, andSystemTable
structs. - Breaking: Deleted deprecated functions
allocator::init
,allocator::exit_boot_services
,helpers::system_table
,table::system_table_boot
, andtable::system_table_runtime
. - Breaking:
FileSystem
no longer has a lifetime parameter, and the deprecated conversion fromuefi::table::boot::ScopedProtocol
has been removed. - Fixed
boot::open_protocol
to properly handle a null interface pointer. VariableKey
now has a publicname
field. Thisname
field always contains a valid string, so theVariableKey::name()
method has been deprecated. Since all fields ofVariableKey
are now public, the type can be constructed by users.- The
VariableKeys
iterator will now yield an error item if a variable name is not UCS-2.
See Deprecating SystemTable/BootServices/RuntimeServices for details of the deprecations in this release.
We added documentation to lib.rs
and the uefi-rs book about how
uefi
compares to "standard Rust binaries" for UEFI (those using std
), and
how to integrate the uefi
crate into them.
- Added
Handle::new
. - Added the
uefi::boot
,uefi::runtime
, anduefi::system
modules to the prelude. - Added
runtime::variable_exists
.
- The
BootServices
,RuntimeServices
, andSystemTable
structs have been deprecated (as well as related typesBoot
,Runtime
, andSystemTableView
). Use theuefi::boot
anduefi::runtime
, anduefi::system
modules instead. - In
uefi::table::boot
,ScopedProtocol
,TplGuard
,ProtocolsPerHandle
, andHandleBuffer
have been deprecated. Use the structs of the same name inuefi::boot
instead. uefi::table::system_table_boot
anduefi::table::system_table_runtime
have been deprecated. Use theuefi::runtime
anduefi::boot
modules instead.- Breaking: The conversion functions between device paths and text no longer
take a
BootServices
argument. The global system table is used instead. - Breaking:
GraphicsOutput::modes
no longer takes aBootServices
argument. The global system table is used instead. - Breaking:
ComponentName::open
no longer takes aBootServices
argument. The global system table is used instead. allocator::init
andallocator::exit_boot_services
have been deprecated. These functions are now no-ops. The allocator now internally uses the global system table.FileSystem::new
now acceptsboot::ScopedProtocol
in addition totable::boot::ScopedProtocol
.
See Deprecating SystemTable/BootServices/RuntimeServices for
details of the new system
/boot
/runtime
modules, and upcoming deprecations.
uefi::system
is a new module that provides freestanding functions for accessing fields of the global system table.uefi::boot
is a new module that provides freestanding functions for boot services using the global system table.uefi::runtime
is a new module that provides freestanding functions for runtime services using the global system table.uefi::table::system_table_raw
is a new function to retrieve a raw pointer to the global system table.- Add standard derives for
ConfigTableEntry
. PcrEvent
/PcrEventInputs
implAlign
,Eq
, andPartialEq
.- Added
PcrEvent::new_in_box
andPcrEventInputs::new_in_box
. VariableKey
implsClone
,Eq
,PartialEq
,Ord
,PartialOrd
, andHash
.- The traits
MemoryMap
andMemoryMapMut
have been introduced together with the implementationsMemoryMapRef
,MemoryMapRefMut
, andMemoryMapOwned
. This comes with some changes. Read below. We recommend to directly use the implementations instead of the traits. - Added
LoadFile
andLoadFile2
which abstracts over theLOAD_FILE
andLOAD_FILE2
protocols. The UEFI test runner includes an integration test that shows how Linux loaders can use this to implement the initrd loading mechanism used in Linux.
- Breaking:
uefi::helpers::init
no longer takes an argument. - The lifetime of the
SearchType
returned fromBootServices::register_protocol_notify
is now tied to the protocol GUID. The oldMemoryMap
was renamed toMemoryMapOwned
.pub fn memory_map(&self, mt: MemoryType) -> Result<MemoryMap>
now returns aMemoryMapOwned
.
- Breaking:
PcrEvent::new_in_buffer
andPcrEventInputs::new_in_buffer
now take an initialized buffer ([u8
] instead of[MaybeUninit<u8>]
), and if the buffer is too small the required size is returned in the error data. - Breaking: The type
MemoryMap
was renamed toMemoryMapOwned
.MemoryMap
is now a trait. Read the documentation of theuefi > mem > memory_map
module to learn more. - Breaking: Exports of Memory Map-related types from
uefi::table::boot
are now removed. Useuefi::mem::memory_map
instead. The patch you have to apply to theuse
statements of your code might look as follows:< use uefi::table::boot::{BootServices, MemoryMap, MemoryMapMut, MemoryType}; --- > use uefi::mem::memory_map::{MemoryMap, MemoryMapMut, MemoryType}; > use uefi::table::boot::BootServices;
- Breaking: Added a new
BootPolicy
type which breaks existing usages ofLoadImageSource
.
- Breaking:: Fixed a bug in the impls of
TryFrom<&[u8]>
for&DevicePathHeader
,&DevicePathNode
and&DevicePath
that could lead to memory unsafety. See #1281.
- Added
RuntimeServices::update_capsule
. - Added
RuntimeServices::query_capsule_capabilities
. - The logger from
uefi::helpers
now also logs to the debugcon device (QEMU) respectively the debug-console (cloud-hypervisor). This only works on x86. It is activated by default (only on x86) and can be deactivated by removing thelog-debugcon
cargo feature. The major benefit is that one can get log messages even after one exited the boot services. - Added
table::{set_system_table, system_table_boot, system_table_runtime}
. This provides an initial API for global tables that do not require passing around a reference. - Added
ResetNotification
protocol. - Added
TryFrom<&[u8]>
forDevicePathHeader
,DevicePathNode
andDevicePath
. - Added
ByteConversionError
. - Re-exported
CapsuleFlags
. - One can now specify in
TimeError
what fields ofTime
are outside its valid range.Time::is_valid
has been updated accordingly. MemoryMap::as_raw
which provides raw access to the memory map. This is for example useful if you create your own Multiboot2 bootloader that embeds the EFI mmap in a Multiboot2 boot information structure.Mode
is nowCopy
andClone
.- Added
TryFrom<&[u8]>
forTime
.
SystemTable::exit_boot_services
is nowunsafe
. See that method's documentation for details of obligations for callers.BootServices::allocate_pool
now returnsNonZero<u8>
instead of*mut u8
.helpers::system_table
is deprecated, usetable::system_table_boot
instead.BootServices::memory_map
changed its signature from
pub fn memory_map<'buf>(&self, buffer: &'buf mut [u8]) -> Result<MemoryMap<'buf>> {
to
pub fn memory_map(&self, mt: MemoryType) -> Result<MemoryMap>
- Allocations now happen automatically internally on the UEFI heap. Also, the returned type is automatically freed on the UEFI heap, as long as boot services are not excited. By removing the need for that explicit buffer and the lifetime, the API is simpler.
GraphicsOutput::query_mode
is now private. UseGraphicsOutput::modes
instead.
- Removed the
panic-on-logger-errors
feature of theuefi
crate. Logger errors are now silently ignored.
- Added
Timestamp
protocol. - Added
UnalignedSlice::as_ptr
. - Added common derives for
Event
andHandle
. uefi::helpers::init
with the functionality that used to be inuefi::services
. With that, new features were added:global_allocator
panic_handler
qemu
- Implemented
PartialEq<char>
forChar8
andChar16
. - Added
CStr16::from_char16_with_nul
andChar16::from_char16_with_nul_unchecked
. - Added terminal GUID constants to
device_path::messaging::Vendor
. - Added
MemoryMap::from_raw
. - Implemented
Hash
for all char and string types.
DevicePath::to_string
andDevicePathNode::to_string
now return out-of-memory errors as part of the error type rather than with anOption
.
- Implemented
Index
,IndexMut
,get
, andget_mut
onMemoryMap
. - Added
SystemTable::as_ptr
.
- We fixed a memory leak in
GraphicsOutput::query_mode
. As a consequence, we had to add&BootServices
as additional parameter. BootServices::free_pages
andBootServices::free_pool
are nowunsafe
to call, since it is possible to trigger UB by freeing memory that is still in use.Logger
no longer requires exterior mutability.Logger::new
is nowconst
, takes no arguments, and creates the logger in a disabled state. CallLogger::set_output
to enable it.uefi::allocator::init
now takes a&mut SystemTable<Boot>
instead of&BootServices
.BootServices::{install,reinstall,uninstall}_protocol_interface
now takeconst
interface pointers.
- MSRV bumped to 1.70.
Input::wait_for_key_event
now returns anOption<Event>
, and is no longerconst
.Protocol::wait_for_input_event
now returns anOption<Event>
, and is no longerconst
.LoadedImage::device
now returns anOption<Handle>
and is no longerconst
.BootServices::get_image_file_system
now returnsScopedProtocol<SimpleFileSystem>
instead offs::FileSystem
.uefi::proto::shim
is now available on 32-bit x86 targets.Parity
andStopBits
are now a newtype-enums instead of Rust enums. Their members now have upper-case names.FileSystem::try_exists
now returnsFileSystemResult<bool>
.FileSystem::copy
is now more efficient for large files.MpService::startup_all_aps
andMpService::startup_this_ap
now accept an optionalevent
parameter to allow non-blocking operation.- Added
core::error::Error
implementations to all error types. SystemTable::exit_boot_services
now takes one parammemory_type
to ensure the memory type of memory map.- Added the
ShellParams
protocol
BootServices::memmove
andBootServices::set_mem
have been removed, use standard functions likecore::ptr::copy
andcore::ptr::write_bytes
instead.
DevicePath::to_boxed
,DevicePath::to_owned
, andDevicePath::as_bytes
DevicePathInstance::to_boxed
,DevicePathInstance::to_owned
, andDevicePathInstance::as_bytes
DevicePathNode::data
- Added
Event::from_ptr
,Event::as_ptr
, andHandle::as_ptr
. - Added
ScopedProtocol::get
andScopedProtocol::get_mut
to access potentially-null interfaces without panicking. DevicePath::to_string
andDevicePathNode::to_string
- Renamed
LoadImageSource::FromFilePath
toLoadImageSource::FromDevicePath
- The
Deref
andDerefMut
impls forScopedProtocol
will now panic if the interface pointer is null.
- Fixed function signature bug in
BootServices::install_configuration_table
.
- Added
BootServices::install_configuration_table
.
- Renamed
FileSystemIOErrorContext
toIoErrorContext
. ResetType
is now a newtype-enum instead of a Rust enum. Its members now have upper-case names.PointerMode
andPointerState
now contain arrays rather than tuples, as tuples are not FFI safe.RegularFile::read
no longer returnsOption<usize>
in error data. ABUFFER_TOO_SMALL
error can only occur when reading a directory, not a file.RegularFile::read
now reads in 1 MiB chunks to avoid a bug in some firmware. This fix also applies tofs::FileSystem::read
.
- There is a new
fs
module that provides a high-level API for file-system access. The API is close to thestd::fs
module. The module also provides aPath
and aPathBuf
abstraction that is similar to the ones fromstd::path
. However, they are adapted for UEFI. - Multiple convenience methods for
CString16
andCStr16
, including:CStr16::as_slice()
CStr16::num_chars()
CStr16::is_empty()
CString16::new()
CString16::is_empty()
CString16::num_chars()
CString16::replace_char()
CString16::push()
CString16::push_str()
From<&CStr16>
forCString16
From<&CStr16>
forString
From<&CString16>
forString
- Added
RuntimeServices::get_variable_boxed
(requires thealloc
feature). - Added
CStr16::as_bytes
- Added
AsRef<[u8]>
andBorrow<[u8]>
forCstr8
andCStr16
. - Added
LoadedImageDevicePath
protocol. - Added
FileAttribute::is_directory(&self)
andFileAttribute::is_regular_file(&self)
- Added
LoadedImage::code_type()
andLoadedImage::data_type()
Allocator
will now use the memory type of the running UEFI binary:MemoryType::LOADER_DATA
for UEFI applicationsMemoryType::BOOT_SERVICES_DATA
for UEFI boot driversMemoryType::RUNTIME_SERVICES_DATA
for UEFI runtime drivers
- The
global_allocator
module has been renamed toallocator
, and is now available regardless of whether theglobal_allocator
feature is enabled. Theglobal_allocator
feature now only controls whetherallocator::Allocator
is set as Rust's global allocator. Error::new
andError::from
now panic if the status isSUCCESS
.Image::get_image_file_system
now returns afs::FileSystem
instead of the protocol.CString16::default
now always contains a null character.- Conversion from
Status
toResult
has been reworked. Theinto_with
,into_with_val
, andinto_with_err
methods have been removed fromStatus
.impl From<Status> for Result
has also been removed. A newStatusExt
trait has been added that provides conversion methods to replace the ones that have been removed.StatusExt
has been added to the prelude. - The
Guid
struct andguid!
macro implementations have been replaced with re-exports from theuguid
crate. Thefrom_values
method has been removed; usually theguid!
macro is a more convenient choice, butnew
orfrom_bytes
can also be used if needed. There are also a number of newGuid
methods. - The
MEMORY_DESCRIPTOR_VERSION
constant has been moved toMemoryDescriptor::VERSION
. - The
Revision
struct's one field is now public. - Renamed
CStr8::to_bytes
toCStr8::as_bytes
and changed the semantics: The trailing null character is now always included in the returned slice. DevicePathBuilder::with_vec
now clears theVec
before use.bitflags
bumped from1.3
to2.1
GptPartitionAttributes
now has 16 additionalTYPE_SPECIFIC_BIT_<N>
constants.
As of this release, the UEFI crates work on the stable channel. This requires Rust 1.68 or higher.
- Added the
ComponentName1
andComponentName2
protocols. TheComponentName
wrapper will automatically selectComponentName2
if available, and fall back toComponentName1
otherwise. FileType
,FileHandle
,RegularFile
, andDirectory
now implementDebug
.- Added
RuntimeServices::delete_variable()
helper method. - Implement
Borrow
forCString16
andToOwned
forCStr16
. - Every public struct now implements
Debug
. Exceptions are cases when there is no sensible way of presenting a useful Debug representation, such as for Unions.
SystemTable::exit_boot_services
now takes no parameters and handles the memory map allocation itself. Errors are now treated as unrecoverable and will cause the system to reset.- Re-export the
cstr8
,cstr16
, andentry
macros from the root of theuefi
crate. HandleBuffer
andProtocolsPerHandle
now implementDeref
. TheHandleBuffer::handles
andProtocolsPerHandle::protocols
methods have been deprecated.- Removed
'boot
lifetime from theGraphicsOutput
,Output
,Pointer
, andSerial
protocols. - The generic type
Data
ofuefi::Error<Data: Debug>
doesn't need to beDisplay
to be compatible withcore::error::Error
. Note that the error Trait requires theunstable
feature. - deprecation removals:
- interfaces
BootServices::locate_protocol
andBootServices::handle_protocol
were removed.BootServices::open_protocol
andBootServices::open_protocol_exclusive
are better variants and available since EFI 1.10 (2002). ScopedProtocol::interface
is not public anymore. Use theDeref
trait.
- interfaces
- Added
table::boot::PAGE_SIZE
constant.
- Fixed several protocol functions so that they work with unsized protocols
(like
DevicePath
):BootServices::locate_device_path
,BootServices::get_handle_for_protocol
,BootServices::test_protocol
,BootServices::find_handles
, andSearchType::from_proto
. - Fixed a warning printed when using
uefi
as a dependency: "the following packages contain code that will be rejected by a future version".
- Implementations for the trait
EqStrUntilNul
now allow?Sized
inputs. This means that you can writesome_cstr16.eq_str_until_nul("test")
instead ofsome_cstr16.eq_str_until_nul(&"test")
now. - Added
TryFrom<core::ffi::CStr>
implementation forCStr8
. - Added
Directory::read_entry_boxed
which works similar toFile::get_boxed_info
. This allows easier iteration over the entries in a directory. (requires the alloc feature) - Added
Directory::read_entry_boxed_in
andFile::get_boxed_info_in
that use theallocator_api
feature. (requires the unstable and alloc features) - Added an
core::error::Error
implementation forError
to ease integration with error-handling crates. (requires the unstable feature) - Added partial support for the TCG protocols for TPM devices under
uefi::proto::tcg
.
UnalignedSlice
now implementsClone
, and theDebug
impl now prints the elements instead of the internal fields.- The unstable
negative_impls
feature is no longer required to use this library. BootServices::memory_map()
now returnsMemoryMapIter
instead ofimpl Iterator
which simplifies usage.BootServices::exit_boot_services()
now returnsMemoryMapIter
instead ofimpl Iterator
which simplifies usage.GraphicsOutput::modes()
now returnsModesIter
instead ofimpl Iterator
which simplifies usage.- Use of the unstable
ptr_metadata
feature has been replaced with a dependency on theptr_meta
crate. pxe::DiscoverInfo
is now a DST. Create withnew_in_buffer
by supplying aMaybeUninit<u8>
slice of appropriate length.- Redundant private field used for padding in
MemoryDescriptor
structure was removed. Now all fields of this struct are public.
- Added
PhysicalAddress
andVirtualAddress
type aliases. - Added
Guid::from_bytes
andGuid::to_bytes
. - Added
UnalignedSlice
for representing a reference to an unaligned slice. - Added
DeviceSubType::MESSAGING_REST_SERVICE
andDeviceSubType::MESSAGING_NVME_OF_NAMESPACE
. - Added
MemoryAttribute::SPECIAL_PURPOSE
,MemoryAttribute::CPU_CRYPTO
,MemoryAttribute::ISA_VALID
, andMemoryAttribute::ISA_MASK
. - Added the
UnicodeCollation
protocol - Added structs to represent each type of device path node. All node types specified in the UEFI 2.10 Specification are now supported.
- Added
DevicePathBuilder
for building new device paths. - Added
BootServices::install_protocol_interface
,BootServices::uninstall_protocol_interface
, andBootServices::reinstall_protocol_interface
. - Added
BootServices::register_protocol_notify
. - Added
SearchType::ByRegisterNotify
andProtocolSearchKey
.
- Renamed crate feature
alloc
toglobal_allocator
. - Renamed crate feature
exts
toalloc
. - Fixed the definition of
AllocateType
so thatMaxAddress
andAddress
always take a 64-bit value, regardless of target platform. - The conversion methods on
DevicePathToText
andDevicePathFromText
now return auefi::Result
instead of anOption
. Event
is now a newtype aroundNonNull<c_void>
instead of*mut c_void
.- Changed
SystemTable::firmware_revision
to return au32
instead of aRevision
. The firmware revision's format is vendor specific and may not have the same semantics as the UEFI revision. - Changed
Revision
torepr(transparent)
. - Add
Revision::EFI_2_100
constant. - The
Revision
type now implementsDisplay
with correct formatting for all UEFI versions. The customDebug
impl has been removed and replaced with a derivedDebug
impl. CStr16::from_u16_with_nul_unchecked
andcstr16!
are now allowed inconst
contexts.
- Removed
UnalignedCStr16
; useUnalignedSlice
instead. AnUnalignedSlice<u16>
can be converted to a string withto_cstr16
orto_cstring16
. - Removed
as_file_path_media_device_path
andas_hard_drive_media_device_path
fromDevicePathNode
. UseDevicePathNode::as_enum
instead. Alternatively, convert withTryInto
, e.g.let node: &proto::device_path::media::HardDrive = node.try_into()?
. - Removed
AcpiDevicePath
andHardDriveMediaDevicePath
. Useproto::device_path::acpi::Acpi
andproto::device_path::media::HardDrive
instead. `
- Added
Deref
andDerefMut
trait implementations toScopedProtocol
. This eliminates the need to explicitly access theinterface
field, which is now marked as deprecated. - Implemented
core::fmt::Write
for theSerial
protocol. - Added the
MemoryProtection
protocol. - Added
BootServices::get_handle_for_protocol
. - Added trait
EqStrUntilNul
and implemented it forCStr8
,CStr16
, andCString16
(CString8 doesn't exist yet). Now you can compare everything that isAsRef<str>
(such asString
andstr
from the standard library) to UEFI strings. Please head to the documentation ofEqStrUntilNul
to find out limitations and further information. - Added
BootServices::image_handle
to get the handle of the executing image. The image is set automatically by the#[entry]
macro; if a program does not use that macro then it should callBootServices::set_image_handle
. - Added
BootServices::open_protocol_exclusive
. This provides a safe and convenient subset ofopen_protocol
that can be used whenever a resource doesn't need to be shared. In same cases sharing is useful (e.g. you might want to draw to the screen using the graphics protocol, but still allow stdout output to go to the screen as well), and in those casesopen_protocol
can still be used. - Added
DiskIo
andDiskIo2
protocols. - Added
HardDriveMediaDevicePath
and related types. - Added
PartialOrd
andOrd
to the traits derived byGuid
. - The
File
trait now knows the methodsis_regular_file
andis_directory
. Developers profit from this on the structFileHandle
, for example.
- Marked
BootServices::handle_protocol
asunsafe
. (This method is also deprecated -- useopen_protocol_exclusive
oropen_protocol
instead.) - Deprecated
BootServices::locate_protocol
and marked itunsafe
. UseBootServices::get_handle_for_protocol
andBootServices::open_protocol_exclusive
(orBootServices::open_protocol
) instead. - Renamed feature
ignore-logger-errors
topanic-on-logger-errors
so that it is additive. It is now a default feature. - Corrected the name of
BlockIOMedia::is_media_preset
tois_media_present
.
- Removed the
exts::allocate_buffer
function. This function could cause undefined behavior when called with aLayout
with an alignment other than 1. A safe alternative is to useVec::into_boxed_slice
. - Removed
From
conversions fromucs2::Error
toStatus
andError
. - Removed use of the unstable
try_trait_v2
feature, which allowed?
to be used withStatus
in a function returninguefi::Result
. This can be replaced by callingstatus.into()
, orResult::from(status)
in cases where the compiler needs a type hint.
- Added EFI revision constants to
Revision
.
- The table
Header
struct'sDebug
impl now prints the correct signature. - The
BootServices::create_event_ex
andRuntimeServices::query_variable_info
methods now check the table version to make sure it's 2.0 or higher before calling the associated function pointers. This prevents potential invalid pointer access. - Fixed an incorrect pointer cast in the
Rng
protocol that could cause undefined behavior.
- Relaxed the version requirements for the
bitflags
andlog
dependencies to allow earlier patch versions. - Enabled
doc_auto_cfg
on docs.rs to show badges on items that are gated behind a feature.
- Added
FileHandle::into_directory
andFileHandle::into_regular_file
. - Added
TimeParams
,Time::invalid
, andTime::is_invalid
. - Added
RuntimeServices::query_variable_info
andVariableStorageInfo
. - Added
DevicePathToText
andDevicePathFromText
. - Added
LoadedImage::file_path
- Implemented
TryFrom<Vec<u16>> for CString16
. - Added
UnalignedCStr16
. - Added
FilePathMediaDevicePath
. - Added
DevicePath::as_acpi_device_path
andDevicePath::as_file_path_media_device_path
. - Included
cstr8
andcstr16
macros fromuefi-macros
in the prelude. - Added
DevicePathInstance
,DevicePathNode
, andFfiDevicePath
.
Time::new
now takes a singleTimeParams
argument so that date and time fields can be explicitly named at the call site.- The file info types now derive
PartialEq
andEq
. - The
FileAttributes
type is nowrepr(transparent)
. DevicePath
is now a DST that represents an entire device path. TheDevicePathInstance
andDevicePathNode
provide views of path instances and nodes, respectively.- The methods of
Revision
are nowconst
.
- Fixed undefined behavior in
proto::media::file::File::get_boxed_info
.
- Added
PartialEq
impls forCStr16 == CStr16
,&CStr16 == CString
, andCString == &CStr16
. - Added
Display
impl forCString16
. - Added
Handle::from_ptr
andSystemTable<View>::from_ptr
, which areunsafe
methods for initializing from a raw pointer. - Added
CStr16::as_slice_with_nul
to provide immutable access to the underlying slice. - Added
LoadedImage::load_options_as_bytes
andLoadedImage::load_options_as_cstr16
. - Added
Align::offset_up_to_alignment
,Align::round_up_to_alignment
, andAlign::align_buf
. - Added
BootServices::connect_controller
andBootServices::disconnect_controller
. - Added
BootServices::load_image
andLoadImageSource
. Together these replaceBootServices::load_image_from_buffer
and also allow an image to be loaded via theSimpleFileSystem
protocol. - Added
Rng
protocol. - Added
GptPartitionAttributes
struct and associated constants. - Added
Output::output_string_lossy
. - Added
ResultExt::handle_warning
.
- Updated to the 2021 edition.
File::open
now takes the filename as&CStr16
instead of&str
, avoiding an implicit string conversion.FileInfo::new
,FileSystemInfo::new
, andFileSystemVolumeLabel::new
now take theirname
parameter as&CStr16
instead of&str
, avoiding an implicit string conversion. Additionally, an unaligned storage buffer is now allowed as long as it is big enough to provide an aligned subslice.LoadImage::set_load_options
now takes au8
pointer instead ofChar16
.- The
Error
type is now public. - The type of
GptPartitionEntry.attributes
is nowGptPartitionAttributes
. - The
uefi::Result
type now treats UEFI warnings as errors by default. Theuefi::Result::Ok
variant no longer contains aCompletion
, so the type behaves more like a regular RustResult
type.
- Removed
CStr16::as_string
method. UseToString
instead. - Removed
FileInfoCreationError::InvalidChar
. This error type is no longer needed due to the removal of implicit string conversions in file info types. - Removed
LoadedImage::load_options
, useLoadedImage::load_options_as_bytes
orLoadedImage::load_options_as_cstr16
instead. - Removed
NamedFileProtocolInfo
,FileInfoHeader
,FileSystemInfoHeader
, andFileSystemVolumeLabelHeader
. UseFileInfo
,FileSystemInfo
, andFileSystemVolumeLabel
instead. - Removed
BootServices::load_image_from_buffer
. UseBootServices::load_image
instead. - Removed
Completion
type. Warnings are now treated as errors. - Removed many
ResultExt
methods, for most of them the standardResult
methods can be used instead. Useunwrap
instead ofunwrap_success
,expect
instead ofexpect_success
,expect_err
instead ofexpect_error
, andmap
instead ofmap_inner
. Thelog_warning
method has also been removed, use the newResultExt::handle_warning
method instead.
- Fixed compilation with Rust 1.60 by no longer enabling the
vec_spare_capacity
feature, which has been stabilized. - Fixed the header size calculated by
FileInfo::new
andFileSystemInfo::new
. - Fixed incorrect alignment of the volume label field in
FileSystemInfo
. This caused the beginning of the string to be truncated and could result in out-of-bounds reads. - Fixed size check for file info types so that alignment padding is taken into account. This fixes potential out-of-bounds writes.