2
2
use crate :: builder:: traits:: StructAsBytes ;
3
3
use crate :: {
4
4
BasicMemoryInfoTag , BootInformationInner , BootLoaderNameTag , CommandLineTag ,
5
- ElfSectionsTag , EndTag , FramebufferTag , MemoryMapTag , ModuleTag ,
5
+ EFISdt32 , EFISdt64 , ElfSectionsTag , EndTag , FramebufferTag , MemoryMapTag ,
6
+ ModuleTag ,
6
7
} ;
7
8
8
9
use alloc:: boxed:: Box ;
@@ -21,6 +22,8 @@ pub struct Multiboot2InformationBuilder {
21
22
framebuffer_tag : Option < Box < FramebufferTag > > ,
22
23
memory_map_tag : Option < Box < MemoryMapTag > > ,
23
24
module_tags : Vec < Box < ModuleTag > > ,
25
+ efisdt32 : Option < EFISdt32 > ,
26
+ efisdt64 : Option < EFISdt64 > ,
24
27
}
25
28
26
29
impl Multiboot2InformationBuilder {
@@ -29,6 +32,8 @@ impl Multiboot2InformationBuilder {
29
32
basic_memory_info_tag : None ,
30
33
boot_loader_name_tag : None ,
31
34
command_line_tag : None ,
35
+ efisdt32 : None ,
36
+ efisdt64 : None ,
32
37
elf_sections_tag : None ,
33
38
framebuffer_tag : None ,
34
39
memory_map_tag : None ,
@@ -66,6 +71,12 @@ impl Multiboot2InformationBuilder {
66
71
if let Some ( tag) = & self . command_line_tag {
67
72
len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
68
73
}
74
+ if let Some ( tag) = & self . efisdt32 {
75
+ len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
76
+ }
77
+ if let Some ( tag) = & self . efisdt64 {
78
+ len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
79
+ }
69
80
if let Some ( tag) = & self . elf_sections_tag {
70
81
len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
71
82
}
@@ -119,6 +130,12 @@ impl Multiboot2InformationBuilder {
119
130
if let Some ( tag) = self . command_line_tag . as_ref ( ) {
120
131
Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
121
132
}
133
+ if let Some ( tag) = self . efisdt32 . as_ref ( ) {
134
+ Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
135
+ }
136
+ if let Some ( tag) = self . efisdt64 . as_ref ( ) {
137
+ Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
138
+ }
122
139
if let Some ( tag) = self . elf_sections_tag . as_ref ( ) {
123
140
Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
124
141
}
@@ -149,6 +166,14 @@ impl Multiboot2InformationBuilder {
149
166
self . command_line_tag = Some ( command_line_tag) ;
150
167
}
151
168
169
+ pub fn efisdt32 ( & mut self , efisdt32 : EFISdt32 ) {
170
+ self . efisdt32 = Some ( efisdt32) ;
171
+ }
172
+
173
+ pub fn efisdt64 ( & mut self , efisdt64 : EFISdt64 ) {
174
+ self . efisdt64 = Some ( efisdt64) ;
175
+ }
176
+
152
177
pub fn elf_sections_tag ( & mut self , elf_sections_tag : Box < ElfSectionsTag > ) {
153
178
self . elf_sections_tag = Some ( elf_sections_tag) ;
154
179
}
0 commit comments