2020//! default configuration of the crate.
2121//!
2222//! ### Usage
23- //! To use the library, you will need to provide an implementation of the `AcpiHandler` trait, which allows the
23+ //! To use the library, you will need to provide an implementation of the [ `AcpiHandler`] trait, which allows the
2424//! library to make requests such as mapping a particular region of physical memory into the virtual address space.
2525//!
26- //! You then need to construct an instance of `AcpiTables`, which can be done in a few ways depending on how much
26+ //! You then need to construct an instance of [ `AcpiTables`] , which can be done in a few ways depending on how much
2727//! information you have:
28- //! * Use `AcpiTables::from_rsdp` if you have the physical address of the RSDP
29- //! * Use `AcpiTables::from_rsdt` if you have the physical address of the RSDT/XSDT
30- //! * Use `AcpiTables::search_for_rsdp_bios` if you don't have the address of either, but **you know you are
31- //! running on BIOS, not UEFI**
32- //! * Use `AcpiTables::from_tables_direct` if you are using the library in an unusual setting, such as in usermode,
33- //! and have a custom method to enumerate and access the tables.
28+ //! * Use [`AcpiTables::from_rsdp`] if you have the physical address of the RSDP
29+ //! * Use [`AcpiTables::from_rsdt`] if you have the physical address of the RSDT/XSDT
30+ //! * Use [`AcpiTables::search_for_rsdp_bios`] if you don't have the address of either, but **you know you are
31+ //! running on BIOS, not UEFI**
3432//!
3533//! `AcpiTables` stores the addresses of all of the tables detected on a platform. The SDTs are parsed by this
3634//! library, or can be accessed directly with `from_sdt`, while the `DSDT` and any `SSDTs` should be parsed with
3735//! `aml`.
3836//!
3937//! To gather information out of the static tables, a few of the types you should take a look at are:
40- //! - [`PlatformInfo`](crate::platform::PlatformInfo) parses the FADT and MADT to create a nice view of the
41- //! processor topology and interrupt controllers on `x86_64`, and the interrupt controllers on other platforms.
42- //! `AcpiTables::platform_info` is a convenience method for constructing a `PlatformInfo`.
43- //! - [`HpetInfo`](crate::hpet::HpetInfo) parses the HPET table and tells you how to configure the High
44- //! Precision Event Timer.
45- //! - [`PciConfigRegions`](crate::mcfg::PciConfigRegions) parses the MCFG and tells you how PCIe configuration
46- //! space is mapped into physical memory.
38+ //! - [`PlatformInfo`] parses the FADT and MADT to create a nice view of the processor topology and interrupt
39+ //! controllers on `x86_64`, and the interrupt controllers on other platforms.
40+ //! [`AcpiTables::platform_info`] is a convenience method for constructing a `PlatformInfo`.
41+ //! - [`HpetInfo`] parses the HPET table and tells you how to configure the High Precision Event Timer.
42+ //! - [`PciConfigRegions`] parses the MCFG and tells you how PCIe configuration space is mapped into physical
43+ //! memory.
4744
4845/*
4946 * Contributing notes (you may find these useful if you're new to contributing to the library):
@@ -206,7 +203,9 @@ where
206203{
207204 /// Create an `AcpiTables` if you have the physical address of the RSDP.
208205 ///
209- /// ### Safety: Caller must ensure the provided address is valid to read as an RSDP.
206+ /// ### Safety
207+ ///
208+ /// Caller must ensure the provided address is valid to read as an RSDP.
210209 pub unsafe fn from_rsdp ( handler : H , address : usize ) -> AcpiResult < Self > {
211210 let rsdp_mapping = unsafe { handler. map_physical_region :: < Rsdp > ( address, mem:: size_of :: < Rsdp > ( ) ) } ;
212211 rsdp_mapping. validate ( ) ?;
@@ -216,8 +215,12 @@ where
216215 }
217216
218217 /// Search for the RSDP on a BIOS platform. This accesses BIOS-specific memory locations and will probably not
219- /// work on UEFI platforms. See [Rsdp::search_for_rsdp_bios](rsdp_search::Rsdp::search_for_rsdp_bios) for
218+ /// work on UEFI platforms. See [` Rsdp::search_for_on_bios`] for details.
220219 /// details.
220+ ///
221+ /// ### Safety
222+ ///
223+ /// The caller must ensure that this function is called on BIOS platforms.
221224 pub unsafe fn search_for_rsdp_bios ( handler : H ) -> AcpiResult < Self > {
222225 let rsdp_mapping = unsafe { Rsdp :: search_for_on_bios ( handler. clone ( ) ) ? } ;
223226 // Safety: RSDP has been validated from `Rsdp::search_for_on_bios`
@@ -234,7 +237,9 @@ where
234237 /// from `from_rsdp` after validation, but can also be used if you've searched for the RSDP manually on a BIOS
235238 /// system.
236239 ///
237- /// ### Safety: Caller must ensure that the provided mapping is a fully validated RSDP.
240+ /// ### Safety
241+ ///
242+ /// Caller must ensure that the provided mapping is a fully validated RSDP.
238243 pub unsafe fn from_validated_rsdp ( handler : H , rsdp_mapping : PhysicalMapping < H , Rsdp > ) -> AcpiResult < Self > {
239244 let revision = rsdp_mapping. revision ( ) ;
240245 let root_table_mapping = if revision == 0 {
@@ -259,7 +264,9 @@ where
259264
260265 /// Create an `AcpiTables` if you have the physical address of the RSDT/XSDT.
261266 ///
262- /// ### Safety: Caller must ensure the provided address is valid RSDT/XSDT address.
267+ /// ### Safety
268+ ///
269+ /// Caller must ensure the provided address is valid RSDT/XSDT address.
263270 pub unsafe fn from_rsdt ( handler : H , revision : u8 , address : usize ) -> AcpiResult < Self > {
264271 let root_table_mapping = if revision == 0 {
265272 /*
@@ -404,19 +411,17 @@ where
404411 Ok ( ( ) )
405412 }
406413
407- /// Convenience method for contructing a [`PlatformInfo`](crate::platform::PlatformInfo). This is one of the
408- /// first things you should usually do with an `AcpiTables`, and allows to collect helpful information about
409- /// the platform from the ACPI tables.
414+ /// Convenience method for contructing a [`PlatformInfo`]. This is one of the first things you should usually do
415+ /// with an `AcpiTables`, and allows to collect helpful information about the platform from the ACPI tables.
410416 ///
411- /// Like `platform_info_in`, but uses the global allocator.
417+ /// Like [ `platform_info_in`](Self::platform_info_in) , but uses the global allocator.
412418 #[ cfg( feature = "alloc" ) ]
413419 pub fn platform_info ( & self ) -> AcpiResult < PlatformInfo < alloc:: alloc:: Global > > {
414420 PlatformInfo :: new ( self )
415421 }
416422
417- /// Convenience method for contructing a [`PlatformInfo`](crate::platform::PlatformInfo). This is one of the
418- /// first things you should usually do with an `AcpiTables`, and allows to collect helpful information about
419- /// the platform from the ACPI tables.
423+ /// Convenience method for contructing a [`PlatformInfo`]. This is one of the first things you should usually do
424+ /// with an `AcpiTables`, and allows to collect helpful information about the platform from the ACPI tables.
420425 #[ cfg( feature = "allocator_api" ) ]
421426 pub fn platform_info_in < A > ( & self , allocator : A ) -> AcpiResult < PlatformInfo < A > >
422427 where
@@ -457,7 +462,9 @@ impl AmlTable {
457462 }
458463}
459464
460- /// ### Safety: Caller must ensure the provided address is valid for being read as an `SdtHeader`.
465+ /// ### Safety
466+ ///
467+ /// Caller must ensure the provided address is valid for being read as an `SdtHeader`.
461468unsafe fn read_table < H : AcpiHandler , T : AcpiTable > (
462469 handler : H ,
463470 address : usize ,
@@ -480,7 +487,7 @@ where
480487 handler : H ,
481488}
482489
483- impl < ' t , H > Iterator for SsdtIterator < ' t , H >
490+ impl < H > Iterator for SsdtIterator < ' _ , H >
484491where
485492 H : AcpiHandler ,
486493{
@@ -528,7 +535,7 @@ where
528535 handler : H ,
529536}
530537
531- impl < ' t , H > Iterator for SdtHeaderIterator < ' t , H >
538+ impl < H > Iterator for SdtHeaderIterator < ' _ , H >
532539where
533540 H : AcpiHandler ,
534541{
0 commit comments