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 7
7
- Added ` proto::hii::config::ConfigKeywordHandler ` .
8
8
- Added ` proto::hii::config::HiiConfigAccess ` .
9
9
- Added ` proto::hii::config_str::ConfigurationString ` .
10
+ - Added ` proto::hii::database::HiiDatabase ` .
10
11
11
12
## Changed
12
13
- ** 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 Database protocol.
4
+
5
+ use alloc:: boxed:: Box ;
6
+ use uefi_macros:: unsafe_protocol;
7
+ use uefi_raw:: protocol:: hii:: database:: HiiDatabaseProtocol ;
8
+
9
+ use crate :: { StatusExt , mem:: make_boxed} ;
10
+
11
+ /// The HII Configuration Access Protocol.
12
+ ///
13
+ /// # UEFI Spec Description
14
+ ///
15
+ /// Database manager for HII-related data structures.
16
+ #[ derive( Debug ) ]
17
+ #[ repr( transparent) ]
18
+ #[ unsafe_protocol( HiiDatabaseProtocol :: GUID ) ]
19
+ pub struct HiiDatabase ( HiiDatabaseProtocol ) ;
20
+
21
+ impl HiiDatabase {
22
+ /// Export all package lists as raw byte buffer.
23
+ pub fn export_all_raw < ' a > ( & self ) -> crate :: Result < Box < [ u8 ] > > {
24
+ let fetch_data_fn = |buf : & ' a mut [ u8 ] | unsafe {
25
+ let mut size = buf. len ( ) ;
26
+ let status = {
27
+ ( self . 0 . export_package_lists ) (
28
+ & self . 0 ,
29
+ core:: ptr:: null_mut ( ) ,
30
+ & mut size,
31
+ buf. as_mut_ptr ( ) . cast ( ) ,
32
+ )
33
+ } ;
34
+ status. to_result_with_err ( |_| Some ( size) ) . map ( |_| buf)
35
+ } ;
36
+ make_boxed :: < [ u8 ] , _ > ( fetch_data_fn)
37
+ }
38
+ }
Original file line number Diff line number Diff line change 5
5
pub mod config;
6
6
#[ cfg( feature = "alloc" ) ]
7
7
pub mod config_str;
8
+ #[ cfg( feature = "alloc" ) ]
9
+ pub mod database;
You can’t perform that action at this time.
0 commit comments