11//! Exports item [`Multiboot2InformationBuilder`].
22use crate :: builder:: traits:: StructAsBytes ;
33use crate :: {
4- BasicMemoryInfoTag , BootInformationInner , BootLoaderNameTag , CommandLineTag , ElfSectionsTag ,
5- EndTag , FramebufferTag , MemoryMapTag , ModuleTag ,
4+ BasicMemoryInfoTag , BootInformationInner , BootLoaderNameTag , CommandLineTag , EFISdt32 ,
5+ EFISdt64 , ElfSectionsTag , EndTag , FramebufferTag , MemoryMapTag , ModuleTag ,
66} ;
77
88use alloc:: boxed:: Box ;
@@ -21,6 +21,8 @@ pub struct Multiboot2InformationBuilder {
2121 framebuffer_tag : Option < Box < FramebufferTag > > ,
2222 memory_map_tag : Option < Box < MemoryMapTag > > ,
2323 module_tags : Vec < Box < ModuleTag > > ,
24+ efisdt32 : Option < EFISdt32 > ,
25+ efisdt64 : Option < EFISdt64 > ,
2426}
2527
2628impl Multiboot2InformationBuilder {
@@ -29,6 +31,8 @@ impl Multiboot2InformationBuilder {
2931 basic_memory_info_tag : None ,
3032 boot_loader_name_tag : None ,
3133 command_line_tag : None ,
34+ efisdt32 : None ,
35+ efisdt64 : None ,
3236 elf_sections_tag : None ,
3337 framebuffer_tag : None ,
3438 memory_map_tag : None ,
@@ -66,6 +70,12 @@ impl Multiboot2InformationBuilder {
6670 if let Some ( tag) = & self . command_line_tag {
6771 len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
6872 }
73+ if let Some ( tag) = & self . efisdt32 {
74+ len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
75+ }
76+ if let Some ( tag) = & self . efisdt64 {
77+ len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
78+ }
6979 if let Some ( tag) = & self . elf_sections_tag {
7080 len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
7181 }
@@ -117,6 +127,12 @@ impl Multiboot2InformationBuilder {
117127 if let Some ( tag) = self . command_line_tag . as_ref ( ) {
118128 Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
119129 }
130+ if let Some ( tag) = self . efisdt32 . as_ref ( ) {
131+ Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
132+ }
133+ if let Some ( tag) = self . efisdt64 . as_ref ( ) {
134+ Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
135+ }
120136 if let Some ( tag) = self . elf_sections_tag . as_ref ( ) {
121137 Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
122138 }
@@ -147,6 +163,14 @@ impl Multiboot2InformationBuilder {
147163 self . command_line_tag = Some ( command_line_tag) ;
148164 }
149165
166+ pub fn efisdt32 ( & mut self , efisdt32 : EFISdt32 ) {
167+ self . efisdt32 = Some ( efisdt32) ;
168+ }
169+
170+ pub fn efisdt64 ( & mut self , efisdt64 : EFISdt64 ) {
171+ self . efisdt64 = Some ( efisdt64) ;
172+ }
173+
150174 pub fn elf_sections_tag ( & mut self , elf_sections_tag : Box < ElfSectionsTag > ) {
151175 self . elf_sections_tag = Some ( elf_sections_tag) ;
152176 }
0 commit comments