Skip to content

Commit

Permalink
uefi: Copy 'Accessing Protocols' docs to uefi::boot
Browse files Browse the repository at this point in the history
The new section is copied from the BootServices docstring. Also update various
places that link to that doc.
  • Loading branch information
nicholasbishop committed Aug 26, 2024
1 parent 5d52fd8 commit 31492e0
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 10 deletions.
17 changes: 17 additions & 0 deletions uefi/src/boot.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
//! UEFI boot services.
//!
//! These functions will panic if called after exiting boot services.
//!
//! # Accessing protocols
//!
//! Protocols can be opened using several methods of `BootServices`. Most
//! commonly, [`open_protocol_exclusive`] should be used. This ensures that
//! nothing else can use the protocol until it is closed, and returns a
//! [`ScopedProtocol`] that takes care of closing the protocol when it is
//! dropped.
//!
//! Other methods for opening protocols:
//!
//! * [`open_protocol`]
//! * [`get_image_file_system`]
//!
//! For protocol definitions, see the [`proto`] module.
//!
//! [`proto`]: crate::proto
pub use uefi_raw::table::boot::{EventType, MemoryAttribute, MemoryDescriptor, MemoryType, Tpl};

Expand Down
2 changes: 1 addition & 1 deletion uefi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
//! application depends on the device. For example, a PC with no network card
//! may not provide network protocols.
//!
//! See the [`BootServices`] documentation for details of how to open a
//! See the [`boot`] documentation for details of how to open a
//! protocol, and see the [`proto`] module for protocol implementations. New
//! protocols can be defined with the [`unsafe_protocol`] macro.
//!
Expand Down
4 changes: 2 additions & 2 deletions uefi/src/proto/console/text/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ use uefi_raw::protocol::console::{SimpleTextOutputMode, SimpleTextOutputProtocol
/// using [`SystemTable::stdout`] and [`SystemTable::stderr`], respectively.
///
/// An `Output` protocol can also be accessed like any other UEFI protocol.
/// See the [`BootServices`] documentation for more details of how to open a
/// See the [`boot`] documentation for more details of how to open a
/// protocol.
///
/// [`SystemTable::stdout`]: crate::table::SystemTable::stdout
/// [`SystemTable::stderr`]: crate::table::SystemTable::stderr
/// [`BootServices`]: crate::table::boot::BootServices#accessing-protocols
/// [`boot`]: crate::boot#accessing-protocols
#[derive(Debug)]
#[repr(transparent)]
#[unsafe_protocol(SimpleTextOutputProtocol::GUID)]
Expand Down
8 changes: 4 additions & 4 deletions uefi/src/proto/media/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ use uefi_raw::protocol::file_system::SimpleFileSystemProtocol;
///
/// # Accessing `SimpleFileSystem` protocol
///
/// Use [`BootServices::get_image_file_system`] to retrieve the `SimpleFileSystem`
/// Use [`boot::get_image_file_system`] to retrieve the `SimpleFileSystem`
/// protocol associated with a given image handle.
///
/// See the [`BootServices`] documentation for more details of how to open a protocol.
/// See the [`boot`] documentation for more details of how to open a protocol.
///
/// [`BootServices::get_image_file_system`]: crate::table::boot::BootServices::get_image_file_system
/// [`BootServices`]: crate::table::boot::BootServices#accessing-protocols
/// [`boot::get_image_file_system`]: crate::boot::get_image_file_system
/// [`boot`]: crate::boot#accessing-protocols
#[derive(Debug)]
#[repr(transparent)]
#[unsafe_protocol(SimpleFileSystemProtocol::GUID)]
Expand Down
5 changes: 2 additions & 3 deletions uefi/src/proto/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
//! ID. They can be implemented by a UEFI driver or occasionally by a
//! UEFI application.
//!
//! See the [`BootServices`] documentation for details of how to open a
//! protocol.
//! See the [`boot`] documentation for details of how to open a protocol.
//!
//! [`BootServices`]: crate::table::boot::BootServices#accessing-protocols
//! [`boot`]: crate::boot#accessing-protocols
pub mod console;
pub mod debug;
Expand Down

0 comments on commit 31492e0

Please sign in to comment.