11//! Module for [`Builder`].
22
3+ use crate :: apm:: ApmTag ;
34use crate :: {
45 BasicMemoryInfoTag , BootInformationHeader , BootLoaderNameTag , CommandLineTag ,
56 EFIBootServicesNotExitedTag , EFIImageHandle32Tag , EFIImageHandle64Tag , EFIMemoryMapTag ,
@@ -23,7 +24,7 @@ pub struct Builder {
2324 vbe : Option < VBEInfoTag > ,
2425 framebuffer : Option < Box < FramebufferTag > > ,
2526 elf_sections : Option < Box < ElfSectionsTag > > ,
26- // missing apm:
27+ apm : Option < ApmTag > ,
2728 efi32 : Option < EFISdt32Tag > ,
2829 efi64 : Option < EFISdt64Tag > ,
2930 smbios : Vec < Box < SmbiosTag > > ,
@@ -57,6 +58,7 @@ impl Builder {
5758 vbe : None ,
5859 framebuffer : None ,
5960 elf_sections : None ,
61+ apm : None ,
6062 efi32 : None ,
6163 efi64 : None ,
6264 smbios : vec ! [ ] ,
@@ -127,6 +129,13 @@ impl Builder {
127129 self
128130 }
129131
132+ /// Sets the [`ApmTag`] tag.
133+ #[ must_use]
134+ pub fn apm ( mut self , apm : ApmTag ) -> Self {
135+ self . apm = Some ( apm) ;
136+ self
137+ }
138+
130139 /// Sets the [`EFISdt32Tag`] tag.
131140 #[ must_use]
132141 pub const fn efi32 ( mut self , efi32 : EFISdt32Tag ) -> Self {
@@ -214,6 +223,9 @@ impl Builder {
214223 pub fn build ( self ) -> Box < DynSizedStructure < BootInformationHeader > > {
215224 let header = BootInformationHeader :: new ( 0 ) ;
216225 let mut byte_refs = Vec :: new ( ) ;
226+ if let Some ( tag) = self . apm . as_ref ( ) {
227+ byte_refs. push ( tag. as_bytes ( ) . as_ref ( ) ) ;
228+ }
217229 if let Some ( tag) = self . cmdline . as_ref ( ) {
218230 byte_refs. push ( tag. as_bytes ( ) . as_ref ( ) ) ;
219231 }
@@ -238,6 +250,9 @@ impl Builder {
238250 if let Some ( tag) = self . elf_sections . as_ref ( ) {
239251 byte_refs. push ( tag. as_bytes ( ) . as_ref ( ) ) ;
240252 }
253+ if let Some ( tag) = self . apm . as_ref ( ) {
254+ byte_refs. push ( tag. as_bytes ( ) . as_ref ( ) ) ;
255+ }
241256 if let Some ( tag) = self . efi32 . as_ref ( ) {
242257 byte_refs. push ( tag. as_bytes ( ) . as_ref ( ) ) ;
243258 }
0 commit comments