22use crate :: builder:: traits:: StructAsBytes ;
33use crate :: {
44 BasicMemoryInfoTag , BootInformationInner , BootLoaderNameTag , CommandLineTag , EFISdt32 ,
5- EFISdt64 , ElfSectionsTag , EndTag , FramebufferTag , MemoryMapTag , ModuleTag , SmbiosTag ,
5+ EFISdt64 , ElfSectionsTag , EndTag , FramebufferTag , MemoryMapTag , ModuleTag , RsdpV1Tag ,
6+ RsdpV2Tag , SmbiosTag ,
67} ;
78
89use alloc:: boxed:: Box ;
@@ -23,6 +24,8 @@ pub struct Multiboot2InformationBuilder {
2324 module_tags : Vec < Box < ModuleTag > > ,
2425 efisdt32 : Option < EFISdt32 > ,
2526 efisdt64 : Option < EFISdt64 > ,
27+ rsdp_v1_tag : Option < RsdpV1Tag > ,
28+ rsdp_v2_tag : Option < RsdpV2Tag > ,
2629 smbios_tags : Vec < Box < SmbiosTag > > ,
2730}
2831
@@ -38,6 +41,8 @@ impl Multiboot2InformationBuilder {
3841 framebuffer_tag : None ,
3942 memory_map_tag : None ,
4043 module_tags : Vec :: new ( ) ,
44+ rsdp_v1_tag : None ,
45+ rsdp_v2_tag : None ,
4146 smbios_tags : Vec :: new ( ) ,
4247 }
4348 }
@@ -90,6 +95,12 @@ impl Multiboot2InformationBuilder {
9095 for tag in & self . module_tags {
9196 len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
9297 }
98+ if let Some ( tag) = & self . rsdp_v1_tag {
99+ len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
100+ }
101+ if let Some ( tag) = & self . rsdp_v2_tag {
102+ len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
103+ }
93104 for tag in & self . smbios_tags {
94105 len += Self :: size_or_up_aligned ( tag. byte_size ( ) )
95106 }
@@ -150,6 +161,12 @@ impl Multiboot2InformationBuilder {
150161 for tag in self . module_tags {
151162 Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
152163 }
164+ if let Some ( tag) = self . rsdp_v1_tag . as_ref ( ) {
165+ Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
166+ }
167+ if let Some ( tag) = self . rsdp_v2_tag . as_ref ( ) {
168+ Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
169+ }
153170 for tag in self . smbios_tags {
154171 Self :: build_add_bytes ( & mut data, & tag. struct_as_bytes ( ) , false )
155172 }
@@ -195,6 +212,14 @@ impl Multiboot2InformationBuilder {
195212 self . module_tags . push ( module_tag) ;
196213 }
197214
215+ pub fn rsdp_v1_tag ( & mut self , rsdp_v1_tag : RsdpV1Tag ) {
216+ self . rsdp_v1_tag = Some ( rsdp_v1_tag) ;
217+ }
218+
219+ pub fn rsdp_v2_tag ( & mut self , rsdp_v2_tag : RsdpV2Tag ) {
220+ self . rsdp_v2_tag = Some ( rsdp_v2_tag) ;
221+ }
222+
198223 pub fn add_smbios_tag ( & mut self , smbios_tag : Box < SmbiosTag > ) {
199224 self . smbios_tags . push ( smbios_tag) ;
200225 }
0 commit comments