Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
ℹ️ QEMU Validation Skipped - Unsupported Target BranchThe Patina QEMU PR validation workflow did not run because the PR targets an unsupported branch. Workflow run: https://github.com/OpenDevicePartnership/patina/actions/runs/37071524372
This comment was automatically generated by the Patina QEMU PR Validation Post workflow. |
joschock
approved these changes
Sep 30, 2026
vineelko
approved these changes
Sep 30, 2026
os-d
reviewed
Sep 30, 2026
makubacki
force-pushed
the
patina_uefi_services_major_update_7
branch
from
September 30, 2026 15:40
344a2f1 to
9c03ce3
Compare
os-d
approved these changes
Sep 30, 2026
To better enforce and identify "marker protocols" in the type system, a new trait is added called `MarkerProtocol`. A const assert is added that verifies the size is zero. Because it is const, it is treated as a built-time compilation failure not a runtime check. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
The existing `install_interface` function can't express a "marker" protocol because it takes `ProtocolPtr` which wraps `NonNull<c_void>`. That is intentionally to reduce the risk of installing an invalid interface and requiring the caller to work more directly with raw pointer logic. Other functions like `locate_protocol` also have logic around returning sound protocol interfaces to callers. The `ProtocolInterface` trait used to establish a protocol GUID to interface relationship already supports marker protocols with the interface being a zero-sized type. This adds new functions like `install_marker_protocol::<P>(handle)` and `uninstall_marker_protocol::<P>(handle)` to make working with marker protocols and `ProtocolInterface` obvious and ergonomic. A `is_marker_protocol_installed` function is also provided to make it simple to check if a marker protocol is installed without needing to worry about optional protocol interfaces and null pointers. Protocol notification works with marker protocols as well, so some unit tests are added to test and demonstrate that. Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
makubacki
force-pushed
the
patina_uefi_services_major_update_7
branch
from
October 2, 2026 22:05
9c03ce3 to
62be27e
Compare
makubacki
enabled auto-merge (rebase)
October 2, 2026 22:06
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
"Marker protocols" are protocols without a protocol interface structure where the pointer to the protocol structure is a null pointer. This PR has two commits to support marker protocols in UEFI Services.
sdk: Add MarkerProtocol trait
To better enforce and identify "marker protocols" in the type system, a new trait is added called
MarkerProtocol.A const assert is added that verifies the size is zero. Because it is const, it is treated as a built-time compilation failure not a runtime check.
Add marker protocol APIs to UEFI Services
The existing
install_interfacefunction can't express a "marker" protocol because it takesProtocolPtrwhich wrapsNonNull<c_void>.That is intentional to reduce the risk of installing an invalid interface and requiring the caller to work more directly with raw pointer logic. Other functions like
locate_protocolalso have logic around returning sound protocol interfaces to callers (e.g. verifying the GUID matches the protocol interface).The
ProtocolInterfacetrait used to establish a protocol GUID to interface relationship already supports marker protocols with the interface being a zero-sized type.This adds new functions like
install_marker_protocol::<P>(handle)anduninstall_marker_protocol::<P>(handle)to protocol services to make working with marker protocols andProtocolInterfaceobvious and ergonomic.An
is_marker_protocol_installedfunction is also provided to make it simple to check if a marker protocol is installed without needing to worry about optional protocol interfaces and null pointers.Protocol notification works with marker protocols as well, so some unit tests are added to test and demonstrate that.
How This Was Tested
cargo make all(including unit test changes)Integration Instructions