1
1
//! Module for [`Builder`].
2
2
3
+ use crate :: apm:: ApmTag ;
3
4
use crate :: {
4
5
BasicMemoryInfoTag , BootInformationHeader , BootLoaderNameTag , CommandLineTag ,
5
6
EFIBootServicesNotExitedTag , EFIImageHandle32Tag , EFIImageHandle64Tag , EFIMemoryMapTag ,
@@ -23,7 +24,7 @@ pub struct Builder {
23
24
vbe : Option < VBEInfoTag > ,
24
25
framebuffer : Option < Box < FramebufferTag > > ,
25
26
elf_sections : Option < Box < ElfSectionsTag > > ,
26
- // missing apm:
27
+ apm : Option < ApmTag > ,
27
28
efi32 : Option < EFISdt32Tag > ,
28
29
efi64 : Option < EFISdt64Tag > ,
29
30
smbios : Vec < Box < SmbiosTag > > ,
@@ -57,6 +58,7 @@ impl Builder {
57
58
vbe : None ,
58
59
framebuffer : None ,
59
60
elf_sections : None ,
61
+ apm : None ,
60
62
efi32 : None ,
61
63
efi64 : None ,
62
64
smbios : vec ! [ ] ,
@@ -127,6 +129,13 @@ impl Builder {
127
129
self
128
130
}
129
131
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
+
130
139
/// Sets the [`EFISdt32Tag`] tag.
131
140
#[ must_use]
132
141
pub const fn efi32 ( mut self , efi32 : EFISdt32Tag ) -> Self {
@@ -214,6 +223,9 @@ impl Builder {
214
223
pub fn build ( self ) -> Box < DynSizedStructure < BootInformationHeader > > {
215
224
let header = BootInformationHeader :: new ( 0 ) ;
216
225
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
+ }
217
229
if let Some ( tag) = self . cmdline . as_ref ( ) {
218
230
byte_refs. push ( tag. as_bytes ( ) . as_ref ( ) ) ;
219
231
}
@@ -238,6 +250,9 @@ impl Builder {
238
250
if let Some ( tag) = self . elf_sections . as_ref ( ) {
239
251
byte_refs. push ( tag. as_bytes ( ) . as_ref ( ) ) ;
240
252
}
253
+ if let Some ( tag) = self . apm . as_ref ( ) {
254
+ byte_refs. push ( tag. as_bytes ( ) . as_ref ( ) ) ;
255
+ }
241
256
if let Some ( tag) = self . efi32 . as_ref ( ) {
242
257
byte_refs. push ( tag. as_bytes ( ) . as_ref ( ) ) ;
243
258
}
0 commit comments