Skip to content

Commit 760f0e9

Browse files
authored
Merge pull request #176 from rust-osdev/misc
misc: documentation fixes and small module reorganization
2 parents 2cf6266 + f67987f commit 760f0e9

13 files changed

+64
-39
lines changed

multiboot2/src/boot_loader_name.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Module for [`BootLoaderNameTag`].
2+
13
use crate::{Tag, TagTrait, TagType, TagTypeId};
24
use core::fmt::{Debug, Formatter};
35
use core::mem::size_of;

multiboot2/src/command_line.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Module for [CommandLineTag].
1+
//! Module for [`CommandLineTag`].
22
33
use crate::{Tag, TagTrait, TagType, TagTypeId};
44

multiboot2/src/efi.rs

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
//! All MBI tags related to (U)EFI.
1+
//! All tags related to (U)EFI with the exception of EFI memory tags:
2+
//!
3+
//! - [`EFISdt32Tag`]
4+
//! - [`EFISdt64Tag`]
5+
//! - [`EFIImageHandle32Tag`]
6+
//! - [`EFIImageHandle64Tag`]
7+
//! - [`EFIBootServicesNotExitedTag`]
28
39
use crate::TagTypeId;
410
use crate::{Tag, TagTrait, TagType};
@@ -131,6 +137,37 @@ impl TagTrait for EFIImageHandle64Tag {
131137
fn dst_size(_base_tag: &Tag) {}
132138
}
133139

140+
/// EFI ExitBootServices was not called tag.
141+
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
142+
#[repr(C)]
143+
pub struct EFIBootServicesNotExitedTag {
144+
typ: TagTypeId,
145+
size: u32,
146+
}
147+
148+
impl EFIBootServicesNotExitedTag {
149+
#[cfg(feature = "builder")]
150+
pub fn new() -> Self {
151+
Self::default()
152+
}
153+
}
154+
155+
#[cfg(feature = "builder")]
156+
impl Default for EFIBootServicesNotExitedTag {
157+
fn default() -> Self {
158+
Self {
159+
typ: TagType::EfiBs.into(),
160+
size: core::mem::size_of::<Self>().try_into().unwrap(),
161+
}
162+
}
163+
}
164+
165+
impl TagTrait for EFIBootServicesNotExitedTag {
166+
const ID: TagType = TagType::EfiBs;
167+
168+
fn dst_size(_base_tag: &Tag) {}
169+
}
170+
134171
#[cfg(all(test, feature = "builder"))]
135172
mod tests {
136173
use super::{EFIImageHandle32Tag, EFIImageHandle64Tag, EFISdt32Tag, EFISdt64Tag};

multiboot2/src/elf_sections.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Module for [`ElfSectionsTag`].
2+
13
#[cfg(feature = "builder")]
24
use crate::builder::BoxedDst;
35
use crate::{Tag, TagTrait, TagType, TagTypeId};

multiboot2/src/framebuffer.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Module for [`FramebufferTag`].
2+
13
use crate::{Tag, TagTrait, TagType, TagTypeId};
24
use core::fmt::Debug;
35
use core::mem::size_of;

multiboot2/src/image_load_addr.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Module for [`ImageLoadPhysAddrTag`].
2+
13
use crate::{Tag, TagTrait, TagType, TagTypeId};
24
#[cfg(feature = "builder")]
35
use {core::convert::TryInto, core::mem::size_of};

multiboot2/src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,18 @@ mod vbe_info;
6767

6868
pub use boot_loader_name::BootLoaderNameTag;
6969
pub use command_line::CommandLineTag;
70-
pub use efi::{EFIImageHandle32Tag, EFIImageHandle64Tag, EFISdt32Tag, EFISdt64Tag};
70+
pub use efi::{
71+
EFIBootServicesNotExitedTag, EFIImageHandle32Tag, EFIImageHandle64Tag, EFISdt32Tag, EFISdt64Tag,
72+
};
7173
pub use elf_sections::{
7274
ElfSection, ElfSectionFlags, ElfSectionIter, ElfSectionType, ElfSectionsTag,
7375
};
7476
pub use end::EndTag;
7577
pub use framebuffer::{FramebufferColor, FramebufferField, FramebufferTag, FramebufferType};
7678
pub use image_load_addr::ImageLoadPhysAddrTag;
7779
pub use memory_map::{
78-
BasicMemoryInfoTag, EFIBootServicesNotExitedTag, EFIMemoryAreaType, EFIMemoryDesc,
79-
EFIMemoryMapTag, MemoryArea, MemoryAreaType, MemoryAreaTypeId, MemoryMapTag,
80+
BasicMemoryInfoTag, EFIMemoryAreaType, EFIMemoryDesc, EFIMemoryMapTag, MemoryArea,
81+
MemoryAreaType, MemoryAreaTypeId, MemoryMapTag,
8082
};
8183
pub use module::{ModuleIter, ModuleTag};
8284
pub use ptr_meta::Pointee;

multiboot2/src/memory_map.rs

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
//! Module for [`MemoryMapTag`], [`EFIMemoryMapTag`] and [`BasicMemoryInfoTag`]
2+
//! and corresponding helper types.
3+
14
pub use uefi_raw::table::boot::MemoryDescriptor as EFIMemoryDesc;
25
pub use uefi_raw::table::boot::MemoryType as EFIMemoryAreaType;
36

@@ -334,37 +337,6 @@ impl TagTrait for EFIMemoryMapTag {
334337
}
335338
}
336339

337-
/// EFI ExitBootServices was not called tag.
338-
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
339-
#[repr(C)]
340-
pub struct EFIBootServicesNotExitedTag {
341-
typ: TagTypeId,
342-
size: u32,
343-
}
344-
345-
impl EFIBootServicesNotExitedTag {
346-
#[cfg(feature = "builder")]
347-
pub fn new() -> Self {
348-
Self::default()
349-
}
350-
}
351-
352-
#[cfg(feature = "builder")]
353-
impl Default for EFIBootServicesNotExitedTag {
354-
fn default() -> Self {
355-
Self {
356-
typ: TagType::EfiBs.into(),
357-
size: mem::size_of::<Self>().try_into().unwrap(),
358-
}
359-
}
360-
}
361-
362-
impl TagTrait for EFIBootServicesNotExitedTag {
363-
const ID: TagType = TagType::EfiBs;
364-
365-
fn dst_size(_base_tag: &Tag) {}
366-
}
367-
368340
/// An iterator over ALL EFI memory areas.
369341
#[derive(Clone, Debug)]
370342
pub struct EFIMemoryAreaIter<'a> {

multiboot2/src/module.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
use crate::{Tag, TagIter, TagTrait, TagType, TagTypeId};
1+
//! Module for [`ModuleTag`].
22
3+
use crate::{Tag, TagIter, TagTrait, TagType, TagTypeId};
34
use core::fmt::{Debug, Formatter};
45
use core::mem::size_of;
56
use core::str::Utf8Error;

multiboot2/src/rsdp.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Module for [`RsdpV1Tag`] and [`RsdpV2Tag`].
2+
13
//! Module for RSDP/ACPI. RSDP (Root System Description Pointer) is a data structure used in the
24
//! ACPI programming interface.
35
//!

multiboot2/src/smbios.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Module for [`SmbiosTag`].
2+
13
#[cfg(feature = "builder")]
24
use crate::builder::BoxedDst;
35
use crate::{Tag, TagTrait, TagType, TagTypeId};

multiboot2/src/tag.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Module for the base tag definition.
1+
//! Module for the base tag definitions and helper types.
22
//!
33
//! The relevant exports of this module is [`Tag`].
44

multiboot2/src/vbe_info.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Module for [`VBEInfoTag`].
2+
13
use crate::{Tag, TagTrait, TagType, TagTypeId};
24
use core::fmt;
35

@@ -319,7 +321,6 @@ bitflags! {
319321
}
320322

321323
bitflags! {
322-
323324
/// The DirectColorModeInfo field describes important characteristics of direct color modes.
324325
///
325326
/// Bit D0 specifies whether the color ramp of the DAC is fixed or

0 commit comments

Comments
 (0)