3
3
use crate :: framebuffer:: UnknownFramebufferType ;
4
4
use crate :: tag:: TagHeader ;
5
5
use crate :: {
6
- module, BasicMemoryInfoTag , BootLoaderNameTag , CommandLineTag , EFIBootServicesNotExitedTag ,
7
- EFIImageHandle32Tag , EFIImageHandle64Tag , EFIMemoryMapTag , EFISdt32Tag , EFISdt64Tag ,
8
- ElfSectionIter , ElfSectionsTag , EndTag , FramebufferTag , ImageLoadPhysAddrTag , MemoryMapTag ,
9
- ModuleIter , RsdpV1Tag , RsdpV2Tag , SmbiosTag , TagIter , TagType , VBEInfoTag ,
6
+ module, ApmTag , BasicMemoryInfoTag , BootLoaderNameTag , BootdevTag , CommandLineTag ,
7
+ EFIBootServicesNotExitedTag , EFIImageHandle32Tag , EFIImageHandle64Tag , EFIMemoryMapTag ,
8
+ EFISdt32Tag , EFISdt64Tag , ElfSectionIter , ElfSectionsTag , EndTag , FramebufferTag ,
9
+ ImageLoadPhysAddrTag , MemoryMapTag , ModuleIter , NetworkTag , RsdpV1Tag , RsdpV2Tag , SmbiosTag ,
10
+ TagIter , TagType , VBEInfoTag ,
10
11
} ;
11
12
#[ cfg( feature = "unstable" ) ]
12
13
use core:: error:: Error ;
@@ -165,44 +166,46 @@ impl<'a> BootInformation<'a> {
165
166
// ######################################################
166
167
// ### BEGIN OF TAG GETTERS (in alphabetical order)
167
168
168
- /*fn apm(&self) {
169
- // also add to debug output
170
- todo!()
171
- }*/
169
+ /// Search for the [`ApmTag`].
170
+ #[ must_use]
171
+ pub fn apm_tag ( & self ) -> Option < & ApmTag > {
172
+ self . get_tag :: < ApmTag > ( )
173
+ }
172
174
173
- /// Search for the basic memory info tag .
175
+ /// Search for the [`BasicMemoryInfoTag`] .
174
176
#[ must_use]
175
177
pub fn basic_memory_info_tag ( & self ) -> Option < & BasicMemoryInfoTag > {
176
178
self . get_tag :: < BasicMemoryInfoTag > ( )
177
179
}
178
180
179
- /// Search for the BootLoader name tag .
181
+ /// Search for the [`BootLoaderNameTag`] .
180
182
#[ must_use]
181
183
pub fn boot_loader_name_tag ( & self ) -> Option < & BootLoaderNameTag > {
182
184
self . get_tag :: < BootLoaderNameTag > ( )
183
185
}
184
186
185
- /*fn bootdev(&self) {
186
- // also add to debug output
187
- todo!()
188
- }*/
187
+ /// Search for the [`BootdevTag`].
188
+ #[ must_use]
189
+ pub fn bootdev_tag ( & self ) -> Option < & BootdevTag > {
190
+ self . get_tag :: < BootdevTag > ( )
191
+ }
189
192
190
- /// Search for the Command line tag .
193
+ /// Search for the [`CommandLineTag`] .
191
194
#[ must_use]
192
195
pub fn command_line_tag ( & self ) -> Option < & CommandLineTag > {
193
196
self . get_tag :: < CommandLineTag > ( )
194
197
}
195
198
196
- /// Search for the EFI boot services not exited tag .
199
+ /// Search for the [`EFIBootServicesNotExitedTag`] .
197
200
#[ must_use]
198
201
pub fn efi_bs_not_exited_tag ( & self ) -> Option < & EFIBootServicesNotExitedTag > {
199
202
self . get_tag :: < EFIBootServicesNotExitedTag > ( )
200
203
}
201
204
202
- /// Search for the EFI Memory map tag , if the boot services were exited.
205
+ /// Search for the [`EFIMemoryMapTag`] , if the boot services were exited.
203
206
/// Otherwise, if the [`TagType::EfiBs`] tag is present, this returns `None`
204
- /// as it is strictly recommended to get the memory map from the `uefi`
205
- /// services .
207
+ /// as it is strictly recommended to get the memory map from `uefi`
208
+ /// instead .
206
209
///
207
210
/// [`TagType::EfiBs`]: crate::TagType::EfiBs
208
211
#[ must_use]
@@ -216,25 +219,25 @@ impl<'a> BootInformation<'a> {
216
219
} )
217
220
}
218
221
219
- /// Search for the EFI 32-bit SDT tag .
222
+ /// Search for the [`EFISdt32Tag`] .
220
223
#[ must_use]
221
224
pub fn efi_sdt32_tag ( & self ) -> Option < & EFISdt32Tag > {
222
225
self . get_tag :: < EFISdt32Tag > ( )
223
226
}
224
227
225
- /// Search for the EFI 64-bit SDT tag .
228
+ /// Search for the [`EFISdt64Tag`] .
226
229
#[ must_use]
227
230
pub fn efi_sdt64_tag ( & self ) -> Option < & EFISdt64Tag > {
228
231
self . get_tag :: < EFISdt64Tag > ( )
229
232
}
230
233
231
- /// Search for the EFI 32-bit image handle pointer tag .
234
+ /// Search for the [`EFIImageHandle32Tag`] .
232
235
#[ must_use]
233
236
pub fn efi_ih32_tag ( & self ) -> Option < & EFIImageHandle32Tag > {
234
237
self . get_tag :: < EFIImageHandle32Tag > ( )
235
238
}
236
239
237
- /// Search for the EFI 64-bit image handle pointer tag .
240
+ /// Search for the [`EFIImageHandle64Tag`] .
238
241
#[ must_use]
239
242
pub fn efi_ih64_tag ( & self ) -> Option < & EFIImageHandle64Tag > {
240
243
self . get_tag :: < EFIImageHandle64Tag > ( )
@@ -266,61 +269,62 @@ impl<'a> BootInformation<'a> {
266
269
} )
267
270
}
268
271
269
- /// Search for the VBE framebuffer tag . The result is `Some(Err(e))`, if the
272
+ /// Search for the [`FramebufferTag`] . The result is `Some(Err(e))`, if the
270
273
/// framebuffer type is unknown, while the framebuffer tag is present.
271
274
#[ must_use]
272
275
pub fn framebuffer_tag ( & self ) -> Option < Result < & FramebufferTag , UnknownFramebufferType > > {
273
276
self . get_tag :: < FramebufferTag > ( )
274
- // TODO temporarily. Someone needs to fix the framebuffer thingy.
275
- . map ( Ok )
276
- /*.map(|tag| match tag.buffer_type() {
277
- Ok(_) => Ok(tag),
278
- Err(e) => Err(e),
279
- })*/
277
+ . map ( |tag| match tag. buffer_type ( ) {
278
+ Ok ( _) => Ok ( tag) ,
279
+ Err ( e) => Err ( e) ,
280
+ } )
280
281
}
281
282
282
- /// Search for the Image Load Base Physical Address tag .
283
+ /// Search for the [`ImageLoadPhysAddrTag`] .
283
284
#[ must_use]
284
285
pub fn load_base_addr_tag ( & self ) -> Option < & ImageLoadPhysAddrTag > {
285
286
self . get_tag :: < ImageLoadPhysAddrTag > ( )
286
287
}
287
288
288
- /// Search for the Memory map tag .
289
+ /// Search for the [`MemoryMapTag`] .
289
290
#[ must_use]
290
291
pub fn memory_map_tag ( & self ) -> Option < & MemoryMapTag > {
291
292
self . get_tag :: < MemoryMapTag > ( )
292
293
}
293
294
294
- /// Get an iterator of all module tags.
295
+ /// Get an iterator of all [`ModuleTag`]s.
296
+ ///
297
+ /// [`ModuleTag`]: crate::ModuleTag
295
298
#[ must_use]
296
299
pub fn module_tags ( & self ) -> ModuleIter {
297
300
module:: module_iter ( self . tags ( ) )
298
301
}
299
302
300
- /*fn network_tag(&self) {
301
- // also add to debug output
302
- todo!()
303
- }*/
303
+ /// Search for the [`NetworkTag`].
304
+ #[ must_use]
305
+ pub fn network_tag ( & self ) -> Option < & NetworkTag > {
306
+ self . get_tag :: < NetworkTag > ( )
307
+ }
304
308
305
- /// Search for the (ACPI 1.0) RSDP tag .
309
+ /// Search for the [`RsdpV1Tag`] .
306
310
#[ must_use]
307
311
pub fn rsdp_v1_tag ( & self ) -> Option < & RsdpV1Tag > {
308
312
self . get_tag :: < RsdpV1Tag > ( )
309
313
}
310
314
311
- /// Search for the (ACPI 2.0 or later) RSDP tag .
315
+ /// Search for the [`RsdpV2Tag`] .
312
316
#[ must_use]
313
317
pub fn rsdp_v2_tag ( & self ) -> Option < & RsdpV2Tag > {
314
318
self . get_tag :: < RsdpV2Tag > ( )
315
319
}
316
320
317
- /// Search for the SMBIOS tag .
321
+ /// Search for the [`SmbiosTag`] .
318
322
#[ must_use]
319
323
pub fn smbios_tag ( & self ) -> Option < & SmbiosTag > {
320
324
self . get_tag :: < SmbiosTag > ( )
321
325
}
322
326
323
- /// Search for the VBE information tag .
327
+ /// Search for the [`VBEInfoTag`] .
324
328
#[ must_use]
325
329
pub fn vbe_info_tag ( & self ) -> Option < & VBEInfoTag > {
326
330
self . get_tag :: < VBEInfoTag > ( )
0 commit comments