22use crate :: builder:: traits:: StructAsBytes ;
33use crate :: {
44 BasicMemoryInfoTag , BootInformationInner , BootLoaderNameTag , CommandLineTag ,
5- EFIBootServicesNotExited , EFIMemoryMapTag , EFISdt32 , EFISdt64 , ElfSectionsTag , EndTag ,
6- FramebufferTag , MemoryMapTag , ModuleTag , RsdpV1Tag , RsdpV2Tag , SmbiosTag ,
5+ EFIBootServicesNotExited , EFIImageHandle32 , EFIImageHandle64 , EFIMemoryMapTag , EFISdt32 ,
6+ EFISdt64 , ElfSectionsTag , EndTag , FramebufferTag , MemoryMapTag , ModuleTag , RsdpV1Tag ,
7+ RsdpV2Tag , SmbiosTag ,
78} ;
89
910use alloc:: boxed:: Box ;
@@ -19,6 +20,8 @@ pub struct Multiboot2InformationBuilder {
1920 boot_loader_name_tag : Option < Box < BootLoaderNameTag > > ,
2021 command_line_tag : Option < Box < CommandLineTag > > ,
2122 efi_boot_services_not_exited : Option < EFIBootServicesNotExited > ,
23+ efi_image_handle32 : Option < EFIImageHandle32 > ,
24+ efi_image_handle64 : Option < EFIImageHandle64 > ,
2225 efi_memory_map_tag : Option < Box < EFIMemoryMapTag > > ,
2326 elf_sections_tag : Option < Box < ElfSectionsTag > > ,
2427 framebuffer_tag : Option < Box < FramebufferTag > > ,
@@ -40,6 +43,8 @@ impl Multiboot2InformationBuilder {
4043 efisdt32 : None ,
4144 efisdt64 : None ,
4245 efi_boot_services_not_exited : None ,
46+ efi_image_handle32 : None ,
47+ efi_image_handle64 : None ,
4348 efi_memory_map_tag : None ,
4449 elf_sections_tag : None ,
4550 framebuffer_tag : None ,
@@ -90,6 +95,12 @@ impl Multiboot2InformationBuilder {
9095 if let Some ( tag) = & self . efi_boot_services_not_exited {
9196 len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
9297 }
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+ }
93104 if let Some ( tag) = & self . efi_memory_map_tag {
94105 len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
95106 }
@@ -162,6 +173,12 @@ impl Multiboot2InformationBuilder {
162173 if let Some ( tag) = self . efi_boot_services_not_exited . as_ref ( ) {
163174 Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
164175 }
176+ if let Some ( tag) = self . efi_image_handle32 . as_ref ( ) {
177+ Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
178+ }
179+ if let Some ( tag) = self . efi_image_handle64 . as_ref ( ) {
180+ Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
181+ }
165182 if let Some ( tag) = self . efi_memory_map_tag . as_ref ( ) {
166183 Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
167184 }
@@ -216,6 +233,14 @@ impl Multiboot2InformationBuilder {
216233 self . efi_boot_services_not_exited = Some ( EFIBootServicesNotExited :: new ( ) ) ;
217234 }
218235
236+ pub fn efi_image_handle32 ( & mut self , efi_image_handle32 : EFIImageHandle32 ) {
237+ self . efi_image_handle32 = Some ( efi_image_handle32) ;
238+ }
239+
240+ pub fn efi_image_handle64 ( & mut self , efi_image_handle64 : EFIImageHandle64 ) {
241+ self . efi_image_handle64 = Some ( efi_image_handle64) ;
242+ }
243+
219244 pub fn efi_memory_map_tag ( & mut self , efi_memory_map_tag : Box < EFIMemoryMapTag > ) {
220245 self . efi_memory_map_tag = Some ( efi_memory_map_tag) ;
221246 }
0 commit comments