1
1
//! Exports item [`Multiboot2InformationBuilder`].
2
2
use crate :: builder:: traits:: StructAsBytes ;
3
3
use 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 ,
6
6
} ;
7
7
8
8
use alloc:: boxed:: Box ;
@@ -21,6 +21,8 @@ pub struct Multiboot2InformationBuilder {
21
21
framebuffer_tag : Option < Box < FramebufferTag > > ,
22
22
memory_map_tag : Option < Box < MemoryMapTag > > ,
23
23
module_tags : Vec < Box < ModuleTag > > ,
24
+ efisdt32 : Option < EFISdt32 > ,
25
+ efisdt64 : Option < EFISdt64 > ,
24
26
}
25
27
26
28
impl Multiboot2InformationBuilder {
@@ -29,6 +31,8 @@ impl Multiboot2InformationBuilder {
29
31
basic_memory_info_tag : None ,
30
32
boot_loader_name_tag : None ,
31
33
command_line_tag : None ,
34
+ efisdt32 : None ,
35
+ efisdt64 : None ,
32
36
elf_sections_tag : None ,
33
37
framebuffer_tag : None ,
34
38
memory_map_tag : None ,
@@ -66,6 +70,12 @@ impl Multiboot2InformationBuilder {
66
70
if let Some ( tag) = & self . command_line_tag {
67
71
len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
68
72
}
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
+ }
69
79
if let Some ( tag) = & self . elf_sections_tag {
70
80
len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
71
81
}
@@ -117,6 +127,12 @@ impl Multiboot2InformationBuilder {
117
127
if let Some ( tag) = self . command_line_tag . as_ref ( ) {
118
128
Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
119
129
}
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
+ }
120
136
if let Some ( tag) = self . elf_sections_tag . as_ref ( ) {
121
137
Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
122
138
}
@@ -147,6 +163,14 @@ impl Multiboot2InformationBuilder {
147
163
self . command_line_tag = Some ( command_line_tag) ;
148
164
}
149
165
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
+
150
174
pub fn elf_sections_tag ( & mut self , elf_sections_tag : Box < ElfSectionsTag > ) {
151
175
self . elf_sections_tag = Some ( elf_sections_tag) ;
152
176
}
0 commit comments