Skip to content

Commit

Permalink
multiboot2: move EFIBootServicesNotExitedTag to efi module
Browse files Browse the repository at this point in the history
This change is not breaking as this path change is publicly not visible.
  • Loading branch information
phip1611 committed Sep 21, 2023
1 parent 47380ec commit 1e22a66
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 34 deletions.
31 changes: 31 additions & 0 deletions multiboot2/src/efi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,37 @@ impl TagTrait for EFIImageHandle64Tag {
fn dst_size(_base_tag: &Tag) {}
}

/// EFI ExitBootServices was not called tag.
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(C)]
pub struct EFIBootServicesNotExitedTag {
typ: TagTypeId,
size: u32,
}

impl EFIBootServicesNotExitedTag {
#[cfg(feature = "builder")]
pub fn new() -> Self {
Self::default()
}
}

#[cfg(feature = "builder")]
impl Default for EFIBootServicesNotExitedTag {
fn default() -> Self {
Self {
typ: TagType::EfiBs.into(),
size: core::mem::size_of::<Self>().try_into().unwrap(),
}
}
}

impl TagTrait for EFIBootServicesNotExitedTag {
const ID: TagType = TagType::EfiBs;

fn dst_size(_base_tag: &Tag) {}
}

#[cfg(all(test, feature = "builder"))]
mod tests {
use super::{EFIImageHandle32Tag, EFIImageHandle64Tag, EFISdt32Tag, EFISdt64Tag};
Expand Down
8 changes: 5 additions & 3 deletions multiboot2/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,18 @@ mod vbe_info;

pub use boot_loader_name::BootLoaderNameTag;
pub use command_line::CommandLineTag;
pub use efi::{EFIImageHandle32Tag, EFIImageHandle64Tag, EFISdt32Tag, EFISdt64Tag};
pub use efi::{
EFIBootServicesNotExitedTag, EFIImageHandle32Tag, EFIImageHandle64Tag, EFISdt32Tag, EFISdt64Tag,
};
pub use elf_sections::{
ElfSection, ElfSectionFlags, ElfSectionIter, ElfSectionType, ElfSectionsTag,
};
pub use end::EndTag;
pub use framebuffer::{FramebufferColor, FramebufferField, FramebufferTag, FramebufferType};
pub use image_load_addr::ImageLoadPhysAddrTag;
pub use memory_map::{
BasicMemoryInfoTag, EFIBootServicesNotExitedTag, EFIMemoryAreaType, EFIMemoryDesc,
EFIMemoryMapTag, MemoryArea, MemoryAreaType, MemoryAreaTypeId, MemoryMapTag,
BasicMemoryInfoTag, EFIMemoryAreaType, EFIMemoryDesc, EFIMemoryMapTag, MemoryArea,
MemoryAreaType, MemoryAreaTypeId, MemoryMapTag,
};
pub use module::{ModuleIter, ModuleTag};
pub use ptr_meta::Pointee;
Expand Down
31 changes: 0 additions & 31 deletions multiboot2/src/memory_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,37 +334,6 @@ impl TagTrait for EFIMemoryMapTag {
}
}

/// EFI ExitBootServices was not called tag.
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
#[repr(C)]
pub struct EFIBootServicesNotExitedTag {
typ: TagTypeId,
size: u32,
}

impl EFIBootServicesNotExitedTag {
#[cfg(feature = "builder")]
pub fn new() -> Self {
Self::default()
}
}

#[cfg(feature = "builder")]
impl Default for EFIBootServicesNotExitedTag {
fn default() -> Self {
Self {
typ: TagType::EfiBs.into(),
size: mem::size_of::<Self>().try_into().unwrap(),
}
}
}

impl TagTrait for EFIBootServicesNotExitedTag {
const ID: TagType = TagType::EfiBs;

fn dst_size(_base_tag: &Tag) {}
}

/// An iterator over ALL EFI memory areas.
#[derive(Clone, Debug)]
pub struct EFIMemoryAreaIter<'a> {
Expand Down

0 comments on commit 1e22a66

Please sign in to comment.