2
2
use crate :: builder:: traits:: StructAsBytes ;
3
3
use crate :: {
4
4
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 ,
7
8
} ;
8
9
9
10
use alloc:: boxed:: Box ;
@@ -19,6 +20,8 @@ pub struct Multiboot2InformationBuilder {
19
20
boot_loader_name_tag : Option < Box < BootLoaderNameTag > > ,
20
21
command_line_tag : Option < Box < CommandLineTag > > ,
21
22
efi_boot_services_not_exited : Option < EFIBootServicesNotExited > ,
23
+ efi_image_handle32 : Option < EFIImageHandle32 > ,
24
+ efi_image_handle64 : Option < EFIImageHandle64 > ,
22
25
efi_memory_map_tag : Option < Box < EFIMemoryMapTag > > ,
23
26
elf_sections_tag : Option < Box < ElfSectionsTag > > ,
24
27
framebuffer_tag : Option < Box < FramebufferTag > > ,
@@ -40,6 +43,8 @@ impl Multiboot2InformationBuilder {
40
43
efisdt32 : None ,
41
44
efisdt64 : None ,
42
45
efi_boot_services_not_exited : None ,
46
+ efi_image_handle32 : None ,
47
+ efi_image_handle64 : None ,
43
48
efi_memory_map_tag : None ,
44
49
elf_sections_tag : None ,
45
50
framebuffer_tag : None ,
@@ -90,6 +95,12 @@ impl Multiboot2InformationBuilder {
90
95
if let Some ( tag) = & self . efi_boot_services_not_exited {
91
96
len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
92
97
}
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
+ }
93
104
if let Some ( tag) = & self . efi_memory_map_tag {
94
105
len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
95
106
}
@@ -162,6 +173,12 @@ impl Multiboot2InformationBuilder {
162
173
if let Some ( tag) = self . efi_boot_services_not_exited . as_ref ( ) {
163
174
Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
164
175
}
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
+ }
165
182
if let Some ( tag) = self . efi_memory_map_tag . as_ref ( ) {
166
183
Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
167
184
}
@@ -216,6 +233,14 @@ impl Multiboot2InformationBuilder {
216
233
self . efi_boot_services_not_exited = Some ( EFIBootServicesNotExited :: new ( ) ) ;
217
234
}
218
235
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
+
219
244
pub fn efi_memory_map_tag ( & mut self , efi_memory_map_tag : Box < EFIMemoryMapTag > ) {
220
245
self . efi_memory_map_tag = Some ( efi_memory_map_tag) ;
221
246
}
0 commit comments