|
15 | 15 | //! The `proto` module contains the standard UEFI protocols, which are normally provided
|
16 | 16 | //! by the various UEFI drivers and firmware layers.
|
17 | 17 | //!
|
18 |
| -//! ## Optional crate features: |
| 18 | +//! ## Optional crate features |
19 | 19 | //!
|
20 |
| -//! - `alloc`: Enables functionality requiring the `alloc` crate from the Rust standard library. |
21 |
| -//! - For example, this allows many convenient `uefi-rs` functions to operate on heap data (`Box`). |
22 |
| -//! - It is up to the user to provide a `#[global_allocator]`. |
23 |
| -//! - `global_allocator`: implements a `#[global_allocator]` using UEFI functions. |
24 |
| -//! - This allows you to use all abstractions from the `alloc` crate from the Rust standard library |
25 |
| -//! during runtime. Hence, `Vec`, `Box`, etc. will be able to allocate memory. |
26 |
| -//! **This is optional**, so you can provide a custom `#[global_allocator]` as well. |
27 |
| -//! - There's no guarantee of the efficiency of UEFI's allocator. |
28 |
| -//! - `logger`: logging implementation for the standard [`log`] crate. |
29 |
| -//! - Prints output to UEFI console. |
30 |
| -//! - No buffering is done: this is not a high-performance logger. |
| 20 | +//! - `alloc`: Enable functionality requiring the [`alloc`] crate from |
| 21 | +//! the Rust standard library. For example, methods that return a |
| 22 | +//! `Vec` rather than filling a statically-sized array. This requires |
| 23 | +//! a global allocator; you can use the `global_allocator` feature or |
| 24 | +//! provide your own. |
| 25 | +//! - `global_allocator`: Implement a [global allocator] using UEFI |
| 26 | +//! functions. This is a simple allocator that relies on the UEFI pool |
| 27 | +//! allocator. You can choose to provide your own allocator instead of |
| 28 | +//! using this feature, or no allocator at all if you don't need to |
| 29 | +//! dynamically allocate any memory. |
| 30 | +//! - `logger`: Logging implementation for the standard [`log`] crate |
| 31 | +//! that prints output to the UEFI console. No buffering is done; this |
| 32 | +//! is not a high-performance logger. |
| 33 | +//! - `panic-on-logger-errors` (enabled by default): Panic if a text |
| 34 | +//! output error occurs in the logger. |
| 35 | +//! |
| 36 | +//! The `global_allocator` and `logger` features require special |
| 37 | +//! handling to perform initialization and tear-down. The |
| 38 | +//! [`uefi-services`] crate provides an `init` method that takes care of |
| 39 | +//! this. |
31 | 40 | //!
|
32 | 41 | //! ## Adapting to local conditions
|
33 | 42 | //!
|
|
36 | 45 | //!
|
37 | 46 | //! For example, a PC with no network card might not contain a network driver,
|
38 | 47 | //! therefore all the network protocols will be unavailable.
|
| 48 | +//! |
| 49 | +//! [`GlobalAlloc`]: alloc::alloc::GlobalAlloc |
| 50 | +//! [`uefi-services`]: https://crates.io/crates/uefi-services |
39 | 51 |
|
40 | 52 | #![feature(abi_efiapi)]
|
41 | 53 | #![feature(maybe_uninit_slice)]
|
|
0 commit comments