11//! Exports item [`Multiboot2InformationBuilder`].
22use crate :: builder:: traits:: StructAsBytes ;
33use crate :: {
4- BasicMemoryInfoTag , BootInformationInner , BootLoaderNameTag , CommandLineTag , EFIMemoryMapTag ,
5- EFISdt32 , EFISdt64 , ElfSectionsTag , EndTag , FramebufferTag , MemoryMapTag , ModuleTag , RsdpV1Tag ,
6- RsdpV2Tag , SmbiosTag ,
4+ BasicMemoryInfoTag , BootInformationInner , BootLoaderNameTag , CommandLineTag ,
5+ EFIBootServicesNotExited , EFIMemoryMapTag , EFISdt32 , EFISdt64 , ElfSectionsTag , EndTag ,
6+ FramebufferTag , MemoryMapTag , ModuleTag , RsdpV1Tag , RsdpV2Tag , SmbiosTag ,
77} ;
88
99use alloc:: boxed:: Box ;
@@ -18,6 +18,7 @@ pub struct Multiboot2InformationBuilder {
1818 basic_memory_info_tag : Option < BasicMemoryInfoTag > ,
1919 boot_loader_name_tag : Option < Box < BootLoaderNameTag > > ,
2020 command_line_tag : Option < Box < CommandLineTag > > ,
21+ efi_boot_services_not_exited : Option < EFIBootServicesNotExited > ,
2122 efi_memory_map_tag : Option < Box < EFIMemoryMapTag > > ,
2223 elf_sections_tag : Option < Box < ElfSectionsTag > > ,
2324 framebuffer_tag : Option < Box < FramebufferTag > > ,
@@ -38,6 +39,7 @@ impl Multiboot2InformationBuilder {
3839 command_line_tag : None ,
3940 efisdt32 : None ,
4041 efisdt64 : None ,
42+ efi_boot_services_not_exited : None ,
4143 efi_memory_map_tag : None ,
4244 elf_sections_tag : None ,
4345 framebuffer_tag : None ,
@@ -85,6 +87,9 @@ impl Multiboot2InformationBuilder {
8587 if let Some ( tag) = & self . efisdt64 {
8688 len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
8789 }
90+ if let Some ( tag) = & self . efi_boot_services_not_exited {
91+ len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
92+ }
8893 if let Some ( tag) = & self . efi_memory_map_tag {
8994 len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
9095 }
@@ -154,6 +159,9 @@ impl Multiboot2InformationBuilder {
154159 if let Some ( tag) = self . efisdt64 . as_ref ( ) {
155160 Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
156161 }
162+ if let Some ( tag) = self . efi_boot_services_not_exited . as_ref ( ) {
163+ Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
164+ }
157165 if let Some ( tag) = self . efi_memory_map_tag . as_ref ( ) {
158166 Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
159167 }
@@ -204,6 +212,10 @@ impl Multiboot2InformationBuilder {
204212 self . efisdt64 = Some ( efisdt64) ;
205213 }
206214
215+ pub fn efi_boot_services_not_exited ( & mut self ) {
216+ self . efi_boot_services_not_exited = Some ( EFIBootServicesNotExited :: new ( ) ) ;
217+ }
218+
207219 pub fn efi_memory_map_tag ( & mut self , efi_memory_map_tag : Box < EFIMemoryMapTag > ) {
208220 self . efi_memory_map_tag = Some ( efi_memory_map_tag) ;
209221 }
0 commit comments