2
2
use crate :: builder:: traits:: StructAsBytes ;
3
3
use crate :: {
4
4
BasicMemoryInfoTag , BootInformationInner , BootLoaderNameTag , CommandLineTag ,
5
- EFISdt32 , EFISdt64 , EFIBootServicesNotExited , EFIMemoryMapTag ,
6
- ElfSectionsTag , EndTag , FramebufferTag , MemoryMapTag , ModuleTag , RsdpV1Tag ,
7
- RsdpV2Tag , SmbiosTag ,
5
+ EFIImageHandle32 , EFIImageHandle64 , EFIBootServicesNotExited ,
6
+ EFIMemoryMapTag , EFISdt32 , EFISdt64 , ElfSectionsTag , EndTag , FramebufferTag ,
7
+ MemoryMapTag , ModuleTag , RsdpV1Tag , RsdpV2Tag , SmbiosTag ,
8
8
} ;
9
9
10
10
use alloc:: boxed:: Box ;
@@ -20,6 +20,8 @@ pub struct Multiboot2InformationBuilder {
20
20
boot_loader_name_tag : Option < Box < BootLoaderNameTag > > ,
21
21
command_line_tag : Option < Box < CommandLineTag > > ,
22
22
efi_boot_services_not_exited : Option < EFIBootServicesNotExited > ,
23
+ efi_image_handle32 : Option < EFIImageHandle32 > ,
24
+ efi_image_handle64 : Option < EFIImageHandle64 > ,
23
25
efi_memory_map_tag : Option < Box < EFIMemoryMapTag > > ,
24
26
elf_sections_tag : Option < Box < ElfSectionsTag > > ,
25
27
framebuffer_tag : Option < Box < FramebufferTag > > ,
@@ -41,6 +43,8 @@ impl Multiboot2InformationBuilder {
41
43
efisdt32 : None ,
42
44
efisdt64 : None ,
43
45
efi_boot_services_not_exited : None ,
46
+ efi_image_handle32 : None ,
47
+ efi_image_handle64 : None ,
44
48
efi_memory_map_tag : None ,
45
49
elf_sections_tag : None ,
46
50
framebuffer_tag : None ,
@@ -91,6 +95,12 @@ impl Multiboot2InformationBuilder {
91
95
if let Some ( tag) = & self . efi_boot_services_not_exited {
92
96
len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
93
97
}
98
+ if let Some ( tag) = & self . efi_image_handle32 {
99
+ len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
100
+ }
101
+ if let Some ( tag) = & self . efi_image_handle64 {
102
+ len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
103
+ }
94
104
if let Some ( tag) = & self . efi_memory_map_tag {
95
105
len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
96
106
}
@@ -165,6 +175,12 @@ impl Multiboot2InformationBuilder {
165
175
if let Some ( tag) = self . efi_boot_services_not_exited . as_ref ( ) {
166
176
Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
167
177
}
178
+ if let Some ( tag) = self . efi_image_handle32 . as_ref ( ) {
179
+ Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
180
+ }
181
+ if let Some ( tag) = self . efi_image_handle64 . as_ref ( ) {
182
+ Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
183
+ }
168
184
if let Some ( tag) = self . efi_memory_map_tag . as_ref ( ) {
169
185
Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
170
186
}
@@ -219,6 +235,14 @@ impl Multiboot2InformationBuilder {
219
235
self . efi_boot_services_not_exited = Some ( EFIBootServicesNotExited :: new ( ) ) ;
220
236
}
221
237
238
+ pub fn efi_image_handle32 ( & mut self , efi_image_handle32 : EFIImageHandle32 ) {
239
+ self . efi_image_handle32 = Some ( efi_image_handle32) ;
240
+ }
241
+
242
+ pub fn efi_image_handle64 ( & mut self , efi_image_handle64 : EFIImageHandle64 ) {
243
+ self . efi_image_handle64 = Some ( efi_image_handle64) ;
244
+ }
245
+
222
246
pub fn efi_memory_map_tag ( & mut self , efi_memory_map_tag : Box < EFIMemoryMapTag > ) {
223
247
self . efi_memory_map_tag = Some ( efi_memory_map_tag) ;
224
248
}
0 commit comments