@@ -3,8 +3,8 @@ use crate::builder::traits::StructAsBytes;
3
3
use crate :: {
4
4
BasicMemoryInfoTag , BootInformationInner , BootLoaderNameTag , CommandLineTag ,
5
5
EFIBootServicesNotExited , EFIImageHandle32 , EFIImageHandle64 , EFIMemoryMapTag , EFISdt32 ,
6
- EFISdt64 , ElfSectionsTag , EndTag , FramebufferTag , MemoryMapTag , ModuleTag , RsdpV1Tag ,
7
- RsdpV2Tag , SmbiosTag ,
6
+ EFISdt64 , ElfSectionsTag , EndTag , FramebufferTag , ImageLoadPhysAddr , MemoryMapTag , ModuleTag ,
7
+ RsdpV1Tag , RsdpV2Tag , SmbiosTag ,
8
8
} ;
9
9
10
10
use alloc:: boxed:: Box ;
@@ -25,6 +25,7 @@ pub struct Multiboot2InformationBuilder {
25
25
efi_memory_map_tag : Option < Box < EFIMemoryMapTag > > ,
26
26
elf_sections_tag : Option < Box < ElfSectionsTag > > ,
27
27
framebuffer_tag : Option < Box < FramebufferTag > > ,
28
+ image_load_addr : Option < ImageLoadPhysAddr > ,
28
29
memory_map_tag : Option < Box < MemoryMapTag > > ,
29
30
module_tags : Vec < Box < ModuleTag > > ,
30
31
efisdt32 : Option < EFISdt32 > ,
@@ -48,6 +49,7 @@ impl Multiboot2InformationBuilder {
48
49
efi_memory_map_tag : None ,
49
50
elf_sections_tag : None ,
50
51
framebuffer_tag : None ,
52
+ image_load_addr : None ,
51
53
memory_map_tag : None ,
52
54
module_tags : Vec :: new ( ) ,
53
55
rsdp_v1_tag : None ,
@@ -110,6 +112,9 @@ impl Multiboot2InformationBuilder {
110
112
if let Some ( tag) = & self . framebuffer_tag {
111
113
len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
112
114
}
115
+ if let Some ( tag) = & self . image_load_addr {
116
+ len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
117
+ }
113
118
if let Some ( tag) = & self . memory_map_tag {
114
119
len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
115
120
}
@@ -188,6 +193,9 @@ impl Multiboot2InformationBuilder {
188
193
if let Some ( tag) = self . framebuffer_tag . as_ref ( ) {
189
194
Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
190
195
}
196
+ if let Some ( tag) = self . image_load_addr . as_ref ( ) {
197
+ Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
198
+ }
191
199
if let Some ( tag) = self . memory_map_tag . as_ref ( ) {
192
200
Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
193
201
}
@@ -253,6 +261,10 @@ impl Multiboot2InformationBuilder {
253
261
self . framebuffer_tag = Some ( framebuffer_tag) ;
254
262
}
255
263
264
+ pub fn image_load_addr ( & mut self , image_load_addr : ImageLoadPhysAddr ) {
265
+ self . image_load_addr = Some ( image_load_addr) ;
266
+ }
267
+
256
268
pub fn memory_map_tag ( & mut self , memory_map_tag : Box < MemoryMapTag > ) {
257
269
self . memory_map_tag = Some ( memory_map_tag) ;
258
270
}
0 commit comments