Fix all doc warnings

This commit is contained in:
Zhang Junyang 2024-03-15 10:27:14 +08:00 committed by Tate, Hongliang Tian
parent 160cb9cdb5
commit b49e11a25e
15 changed files with 29 additions and 25 deletions

View File

@ -309,7 +309,7 @@ impl UserContextApiInternal for UserContext {
}
}
/// As Osdev Wiki defines(https://wiki.osdev.org/Exceptions):
/// As Osdev Wiki defines(<https://wiki.osdev.org/Exceptions>):
/// CPU exceptions are classified as:
///
/// Faults: These can be corrected and the program may continue as if nothing happened.

View File

@ -7,7 +7,7 @@ use crate::arch::x86::device::io_port::{IoPort, ReadWriteAccess, WriteOnlyAccess
/// A serial port.
///
/// Serial ports are a legacy communications port common on IBM-PC compatible computers.
/// Ref: https://wiki.osdev.org/Serial_Ports
/// Ref: <https://wiki.osdev.org/Serial_Ports>
pub struct SerialPort {
pub data: IoPort<u8, ReadWriteAccess>,
pub int_en: IoPort<u8, WriteOnlyAccess>,

View File

@ -4,7 +4,7 @@
//! a prescaler and 3 independent frequency dividers. Each frequency divider has an output, which is
//! used to allow the timer to control external circuitry (for example, IRQ 0).
//!
//! Reference: https://wiki.osdev.org/Programmable_Interval_Timer
//! Reference: <https://wiki.osdev.org/Programmable_Interval_Timer>
//!
use crate::{

View File

@ -5,7 +5,7 @@
//! The format of the Asterinas command line string conforms
//! to the Linux kernel command line rules:
//!
//! https://www.kernel.org/doc/html/v6.4/admin-guide/kernel-parameters.html
//! <https://www.kernel.org/doc/html/v6.4/admin-guide/kernel-parameters.html>
//!
use alloc::{

View File

@ -9,7 +9,7 @@
//!
//! Use case:
//!
//! ```rust norun
//! ```rust no_run
//! #[derive(Debug)]
//! pub struct PciDeviceA {
//! common_device: PciCommonDevice,

View File

@ -103,7 +103,7 @@ impl Drop for IrqLine {
///
/// # Example
///
/// ``rust
/// ```rust
/// use aster_frame::irq;
///
/// {

View File

@ -3,10 +3,10 @@
//! Big zImage PE/COFF header generation.
//!
//! The definition of the PE/COFF header is in the Microsoft PE/COFF specification:
//! https://learn.microsoft.com/en-us/windows/win32/debug/pe-format
//! <https://learn.microsoft.com/en-us/windows/win32/debug/pe-format>
//!
//! The reference to the Linux PE header definition:
//! https://github.com/torvalds/linux/blob/master/include/linux/pe.h
//! <https://github.com/torvalds/linux/blob/master/include/linux/pe.h>
use std::{mem::size_of, ops::Range};

View File

@ -22,7 +22,7 @@ pub fn _print(args: Arguments) {
VirtioConsolesPrinter.write_fmt(args).unwrap();
}
/// Copy from Rust std: https://github.com/rust-lang/rust/blob/master/library/std/src/macros.rs
/// Copied from Rust std: <https://github.com/rust-lang/rust/blob/master/library/std/src/macros.rs>
#[macro_export]
macro_rules! print {
($($arg:tt)*) => {{
@ -30,7 +30,7 @@ macro_rules! print {
}};
}
/// Copy from Rust std: https://github.com/rust-lang/rust/blob/master/library/std/src/macros.rs
/// Copied from Rust std: <https://github.com/rust-lang/rust/blob/master/library/std/src/macros.rs>
#[macro_export]
macro_rules! println {
() => {

View File

@ -39,7 +39,7 @@ pub trait Iface: internal::IfaceInternal + Send + Sync {
/// Bind a socket to the iface. So the packet for this socket will be dealt with by the interface.
/// If port is None, the iface will pick up an empheral port for the socket.
/// FIXME: The reason for binding socket and interface together is because there are limitations inside smoltcp.
/// See discussion at https://github.com/smoltcp-rs/smoltcp/issues/779.
/// See discussion at <https://github.com/smoltcp-rs/smoltcp/issues/779>.
fn bind_socket(
&self,
socket: Box<AnyUnboundSocket>,

View File

@ -3,7 +3,7 @@
use crate::prelude::*;
/// Shutdown types
/// From https://elixir.bootlin.com/linux/v6.0.9/source/include/linux/net.h
/// From <https://elixir.bootlin.com/linux/v6.0.9/source/include/linux/net.h>
#[repr(i32)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, TryFromInt)]
#[allow(non_camel_case_types)]

View File

@ -2,7 +2,7 @@
//! This module defines the process initial stack.
//! The process initial stack, contains arguments, environmental variables and auxiliary vectors
//! The data layout of init stack can be seen in Figure 3.9 in https://uclibc.org/docs/psABI-x86_64.pdf
//! The data layout of init stack can be seen in Figure 3.9 in <https://uclibc.org/docs/psABI-x86_64.pdf>
use core::mem;

View File

@ -24,7 +24,7 @@
//!
//! First, the option should be added in the net module for the TCP socket.
//!
//! ```rust norun
//! ```rust no_run
//! impl_socket_option!(TcpNodelay(bool));
//! ```
//!
@ -32,15 +32,19 @@
//! in the utils module. These util functions can be shared if multiple options have the value
//! of same type.
//!
//! ```rust norun
//! impl ReadFromUser for bool { // content omitted here }
//! impl WriteFromUser for bool { // content omitted here }
//! ```rust compile_fail
//! impl ReadFromUser for bool {
//! // content omitted here
//! }
//! impl WriteFromUser for bool {
//! // content omitted here
//! }
//! ```
//!
//! At last, we can implement `RawSocketOption` for `TcpNodelay` so that it can be read/from
//! user space.
//!
//! ```rust norun
//! ```rust no_run
//! impl_raw_socket_option!(TcpNodeley);
//! ```
//!

View File

@ -35,7 +35,7 @@ use crate::transport::VirtioTransport;
pub static DEVICE_NAME: &str = "Virtio-Input";
/// Select value used for [`VirtIOInput::query_config_select()`].
/// Select value used for [`device::InputDevice::query_config_select()`].
#[repr(u8)]
#[derive(Debug, Clone, Copy)]
pub enum InputConfigSelect {

View File

@ -4,11 +4,11 @@
//! When use this crate, typeflags and typeflags-util should also be added as dependency.
//!
//! The require macro are used to ensure that an object has the enough capability to call the function.
//! The **require** macro can accept constraint [SomeRightSet] > [SomeRight],
//! which means the SomeRightSet should **contain** the SomeRight.
//! The **require** macro can also accept constraint [SomeRightSet] > [AnotherRightSet],
//! which means the SomeRightSet should **include** the AnotherRightSet. In this case, AnotherRightSet should be a **generic parameter**.
//! i.e., AnotherRightSet should occur the the generic param list of the function.
//! The **require** macro can accept constraint `SomeRightSet` > `SomeRight`,
//! which means the `SomeRightSet` should **contain** the `SomeRight`.
//! The **require** macro can also accept constraint `SomeRightSet` > `AnotherRightSet`,
//! which means the `SomeRightSet` should **include** the `AnotherRightSet`. In this case, `AnotherRightSet` should be a **generic parameter**.
//! i.e., `AnotherRightSet` should occur the the generic param list of the function.
//!
//! If there are multiple constraits, they can be seperated with `|`, which means all constraits should be satisfied.
//!

View File

@ -55,7 +55,7 @@ pub type WriteOp = TRights![Write];
pub type FullOp = TRights![Read, Write, Dup];
/// Wrapper for TRights, used to bypass an error message from the Rust compiler,
/// the relevant issue is: https://github.com/rust-lang/rfcs/issues/2758
/// the relevant issue is: <https://github.com/rust-lang/rfcs/issues/2758>
///
/// Example:
///