Bot releases are visible (Hide)
Published by github-actions[bot] 25 days ago
Updates the crate version in anticipation of a v1.0.1 tagged release.
Full Changelog: https://github.com/microsoft/mu_rust_helpers/compare/v1.0.0...v1.0.1
Published by github-actions[bot] 26 days ago
Add a test for free_pool()
Added new test_free_pool
unit test for free_pool, test passes.
N/A
Adds a test for allocate pool wrapper.
Run Test with PASS result
N/A
Add a test for free_pages()
Added new test_free_pages
unit test for free_pages, test passes.
N/A
Modified locate_protocol
to return an Option<&'static mut I>
. There are many protocols that are only indicators of events/feature availability. These protocols are installed with null pointers; without this change, locate_protocol panics due to dereferencing the null protocol interface.
BootServices
structlocate_protocol
now has an extra Option
layer that will need to be handled.Added and ran tests for locate_protocol
Update existing locate_protocol
usage to handle Option
.
New non-Indicator protocol patterns:
let protocol_interface = boot_services.locate_protocol(&ADVANCED_LOGGER_PROTOCOL, None)?.ok_or(efi::Status::INCOMPATIBLE_VERSION)?;
let protcol_interface = match boot_services.locate_protocol(&ADVANCED_LOGGER_PROTOCOL, None) {
Ok(Some(protcol_interface)) => protcol_interface,
Ok(None) => {
return efi::Status::INCOMPATIBLE_VERSION;
}
Err(status) => {
return status;
}
};
Indicator protocol patterns:
boot_services.locate_protocol(&VARIABLE_WRITE_ARCH_PROTOCOL_GUID, None)?;
match boot_services.locate_protocol(&VARIABLE_WRITE_ARCH_PROTOCOL_GUID, None) {
Err(status) => Err(status)?,
Ok(..) => { /* do stuff */ }
// or more pedantic
Ok(Some(inteface)) => Err(efi::Status::INCOMPATIBLE_VERSION)?,
Ok(None) => { /* do stuff */ }
};
let located = boot_services.locate_protocol(&VARIABLE_WRITE_ARCH_PROTOCOL_GUID, None).is_ok_and(|option| option.is_none());
// or just
let located = boot_services.locate_protocol(&VARIABLE_WRITE_ARCH_PROTOCOL_GUID, None).is_ok();
Those are example patterns.
Adding various GUID helpers:
guid!
macro to create const efi::Guid
from a GUID string.
guid_fmt!
macro to format an efi::Guid
for printing.
guid_to_uuid!
macro to use an efi::Guid
as a uuid::Uuid
.
guid::CALLER_ID
to replicate gEfiCallerIdGuid from AutoGen.c.
guid::ZERO
for filling data structs.
Various unit tests as well as use in an EDK2 project with results verified in hardware.
Include uuid
crate and mu_rust_helpers::guid
as dependencies.
See tests module for code samples.
guid_fmt!
returns a core::fmt::Arguments
which can be passed to debugln!
Modified locate_protocol
to return an Option<&'static mut I>
. There are many protocols that are only indicators of events/feature availability. These protocols are installed with null pointers; without this change, locate_protocol panics due to dereferencing the null protocol interface.
BootServices
structlocate_protocol
now has an extra Option
layer that will need to be handled.Added and ran tests for locate_protocol
Update existing locate_protocol
usage to handle Option
.
New non-Indicator protocol patterns:
let protocol_interface = boot_services.locate_protocol(&ADVANCED_LOGGER_PROTOCOL, None)?.ok_or(efi::Status::INCOMPATIBLE_VERSION)?;
let protcol_interface = match boot_services.locate_protocol(&ADVANCED_LOGGER_PROTOCOL, None) {
Ok(Some(protcol_interface)) => protcol_interface,
Ok(None) => {
return efi::Status::INCOMPATIBLE_VERSION;
}
Err(status) => {
return status;
}
};
Indicator protocol patterns:
boot_services.locate_protocol(&VARIABLE_WRITE_ARCH_PROTOCOL_GUID, None)?;
match boot_services.locate_protocol(&VARIABLE_WRITE_ARCH_PROTOCOL_GUID, None) {
Err(status) => Err(status)?,
Ok(..) => { /* do stuff */ }
// or more pedantic
Ok(Some(inteface)) => Err(efi::Status::INCOMPATIBLE_VERSION)?,
Ok(None) => { /* do stuff */ }
};
let located = boot_services.locate_protocol(&VARIABLE_WRITE_ARCH_PROTOCOL_GUID, None).is_ok_and(|option| option.is_none());
// or just
let located = boot_services.locate_protocol(&VARIABLE_WRITE_ARCH_PROTOCOL_GUID, None).is_ok();
Those are example patterns.
Added Rust wrappers for all four variable services within runtime services. Additionally added a UEFI variable name streaming iterator that wraps around GetNextVariableName(), allowing for easy iteration through all UEFI variable names. Credit to Edwin Zhang (@edwinzMSFT) for creating the runtime_services crate and adding boilerplate functions.
Added 19 unit tests, which all pass. Additionally, @edwinzMSFT modified a driver to intake these wrappers and saw preliminary success.
Replace existing calls to variable services within runtime services with calls to wrappers included in the runtime_services crate.
Added Rust wrappers for all four variable services within runtime services. Additionally added a UEFI variable name streaming iterator that wraps around GetNextVariableName(), allowing for easy iteration through all UEFI variable names. Credit to Edwin Zhang (@edwinzMSFT) for creating the runtime_services crate and adding boilerplate functions.
Added 19 unit tests, which all pass. Additionally, @edwinzMSFT modified a driver to intake these wrappers and saw preliminary success.
Replace existing calls to variable services within runtime services with calls to wrappers included in the runtime_services crate.
Added UEFI sections descriptions in documentation.
Minor changes to certain unchecked methods which were not marked unsafe, not sure if that was deliberate or just missed.
Ran following commands and they all passed.
Cargo build
Cargo fmt
Cargo test --all
Cargo doc
N/A
Adding various GUID helpers:
guid!
macro to create const efi::Guid
from a GUID string.
guid_fmt!
macro to format an efi::Guid
for printing.
guid_to_uuid!
macro to use an efi::Guid
as a uuid::Uuid
.
guid::CALLER_ID
to replicate gEfiCallerIdGuid from AutoGen.c.
guid::ZERO
for filling data structs.
Various unit tests as well as use in an EDK2 project with results verified in hardware.
Include uuid
crate and mu_rust_helpers::guid
as dependencies.
See tests module for code samples.
guid_fmt!
returns a core::fmt::Arguments
which can be passed to debugln!
add Event, Timer, and Task priority services with their respective unit tests and documentation.
add allocation services
add protocol handler services
For details on how to complete to complete these options and their meaning refer to CONTRIBUTING.md.
Event, Timer, and Task priority services have unit tests.
N/A
Full Changelog: https://github.com/microsoft/mu_rust_helpers/compare/v0.1.0...v1.0.0
Adds the build and test Azure pipeline YAML file and GitHub workflow
files for GitHub automation.
Add TplMutex helper and basic boot services for tpl sevices use in the mutex.
With unit tests
N/A
Full Changelog: https://github.com/microsoft/mu_rust_helpers/compare/...v0.1.0