@@ -4,7 +4,7 @@ use crate::{
4
4
BasicMemoryInfoTag , BootInformationInner , BootLoaderNameTag , CommandLineTag ,
5
5
EFIImageHandle32 , EFIImageHandle64 , EFIBootServicesNotExited ,
6
6
EFIMemoryMapTag , EFISdt32 , EFISdt64 , ElfSectionsTag , EndTag , FramebufferTag ,
7
- MemoryMapTag , ModuleTag , RsdpV1Tag , RsdpV2Tag , SmbiosTag ,
7
+ ImageLoadPhysAddr , MemoryMapTag , ModuleTag , 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
}
@@ -190,6 +195,9 @@ impl Multiboot2InformationBuilder {
190
195
if let Some ( tag) = self . framebuffer_tag . as_ref ( ) {
191
196
Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
192
197
}
198
+ if let Some ( tag) = self . image_load_addr . as_ref ( ) {
199
+ Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
200
+ }
193
201
if let Some ( tag) = self . memory_map_tag . as_ref ( ) {
194
202
Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
195
203
}
@@ -255,6 +263,10 @@ impl Multiboot2InformationBuilder {
255
263
self . framebuffer_tag = Some ( framebuffer_tag) ;
256
264
}
257
265
266
+ pub fn image_load_addr ( & mut self , image_load_addr : ImageLoadPhysAddr ) {
267
+ self . image_load_addr = Some ( image_load_addr) ;
268
+ }
269
+
258
270
pub fn memory_map_tag ( & mut self , memory_map_tag : Box < MemoryMapTag > ) {
259
271
self . memory_map_tag = Some ( memory_map_tag) ;
260
272
}
0 commit comments