File tree Expand file tree Collapse file tree 3 files changed +41
-0
lines changed Expand file tree Collapse file tree 3 files changed +41
-0
lines changed Original file line number Diff line number Diff line change 1010- Added ` proto::acpi::AcpiTable ` .
1111- Added ` proto::hii::database::HiiDatabase ` .
1212- Added ` proto::hii::config_str::MultiConfigurationStringIter ` .
13+ - Added ` proto::hii::config_routing::HiiConfigRouting ` .
1314
1415## Changed
1516- ** Breaking:** ` boot::stall ` now take ` core::time::Duration ` instead of ` usize ` .
Original file line number Diff line number Diff line change 1+ // SPDX-License-Identifier: MIT OR Apache-2.0
2+
3+ //! HII Configuration protocols.
4+
5+ use core:: ptr;
6+
7+ use alloc:: string:: { String , ToString } ;
8+ use uefi_macros:: unsafe_protocol;
9+ use uefi_raw:: Char16 ;
10+ use uefi_raw:: protocol:: hii:: config:: HiiConfigRoutingProtocol ;
11+
12+ use crate :: { CStr16 , StatusExt } ;
13+
14+ /// The HII Configuration Routing Protocol.
15+ ///
16+ /// # UEFI Spec Description
17+ ///
18+ /// The EFI HII Configuration Routing Protocol manages the movement of configuration
19+ /// data from drivers to configuration applications. It then serves as the single point
20+ /// to receive configuration information from configuration applications, routing the results
21+ /// to the appropriate drivers.
22+ #[ derive( Debug ) ]
23+ #[ repr( transparent) ]
24+ #[ unsafe_protocol( HiiConfigRoutingProtocol :: GUID ) ]
25+ pub struct HiiConfigRouting ( HiiConfigRoutingProtocol ) ;
26+ impl HiiConfigRouting {
27+ /// Request the current configuration for the entirety of the current HII database and
28+ /// return the data as string in multi configuration string format.
29+ ///
30+ /// Use `super::config_str::MultiConfigurationStringIter` to parse the returned `String`.
31+ pub fn export ( & self ) -> uefi:: Result < String > {
32+ unsafe {
33+ let mut results: * const Char16 = ptr:: null ( ) ;
34+ ( self . 0 . export_config ) ( & self . 0 , & mut results)
35+ . to_result_with_val ( || CStr16 :: from_ptr ( results. cast ( ) ) . to_string ( ) )
36+ }
37+ }
38+ }
Original file line number Diff line number Diff line change 44
55pub mod config;
66#[ cfg( feature = "alloc" ) ]
7+ pub mod config_routing;
8+ #[ cfg( feature = "alloc" ) ]
79pub mod config_str;
810#[ cfg( feature = "alloc" ) ]
911pub mod database;
You can’t perform that action at this time.
0 commit comments