Skip to content

Commit 7a90d73

Browse files
committed
multiboot2: EFIBootServicesNotExitedTag
1 parent ade1ddd commit 7a90d73

File tree

5 files changed

+24
-17
lines changed

5 files changed

+24
-17
lines changed

multiboot2/Changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
- **BREAKING** Renamed `ImageLoadPhysAddr` to `ImageLoadPhysAddrTag`
2323
- **BREAKING** Renamed `EFIImageHandle32` to `EFIImageHandle32Tag`
2424
- **BREAKING** Renamed `EFIImageHandle64` to `EFIImageHandle64Tag`
25+
- **BREAKING** Renamed `EFIBootServicesNotExited` to `EFIBootServicesNotExitedTag`
26+
- added `BootInformation::efi_bs_not_exited_tag`
2527

2628
## 0.15.1 (2023-03-18)
2729
- **BREAKING** `MemoryMapTag::all_memory_areas()` was renamed to `memory_areas`

multiboot2/src/builder/information.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
use crate::builder::traits::StructAsBytes;
33
use crate::{
44
BasicMemoryInfoTag, BootInformationInner, BootLoaderNameTag, CommandLineTag,
5-
EFIBootServicesNotExited, EFIImageHandle32Tag, EFIImageHandle64Tag, EFIMemoryMapTag, EFISdt32,
5+
EFIBootServicesNotExitedTag, EFIImageHandle32Tag, EFIImageHandle64Tag, EFIMemoryMapTag, EFISdt32,
66
EFISdt64, ElfSectionsTag, EndTag, FramebufferTag, ImageLoadPhysAddrTag, MemoryMapTag,
77
ModuleTag, RsdpV1Tag, RsdpV2Tag, SmbiosTag,
88
};
@@ -19,7 +19,7 @@ pub struct InformationBuilder {
1919
basic_memory_info_tag: Option<BasicMemoryInfoTag>,
2020
boot_loader_name_tag: Option<Box<BootLoaderNameTag>>,
2121
command_line_tag: Option<Box<CommandLineTag>>,
22-
efi_boot_services_not_exited: Option<EFIBootServicesNotExited>,
22+
efi_boot_services_not_exited: Option<EFIBootServicesNotExitedTag>,
2323
efi_image_handle32: Option<EFIImageHandle32Tag>,
2424
efi_image_handle64: Option<EFIImageHandle64Tag>,
2525
efi_memory_map_tag: Option<Box<EFIMemoryMapTag>>,
@@ -238,7 +238,7 @@ impl InformationBuilder {
238238
}
239239

240240
pub fn efi_boot_services_not_exited(&mut self) {
241-
self.efi_boot_services_not_exited = Some(EFIBootServicesNotExited::new());
241+
self.efi_boot_services_not_exited = Some(EFIBootServicesNotExitedTag::new());
242242
}
243243

244244
pub fn efi_image_handle32(&mut self, efi_image_handle32: EFIImageHandle32Tag) {

multiboot2/src/efi.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ use crate::builder::traits::StructAsBytes;
1111
/// EFI system table in 32 bit mode
1212
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
1313
#[repr(C)]
14-
pub struct EFISdt32 {
14+
pub struct EFISdt32Tag {
1515
typ: TagTypeId,
1616
size: u32,
1717
pointer: u32,
1818
}
1919

20-
impl EFISdt32 {
20+
impl EFISdt32Tag {
2121
/// Create a new tag to pass the EFI32 System Table pointer.
2222
pub fn new(pointer: u32) -> Self {
2323
Self {
@@ -34,7 +34,7 @@ impl EFISdt32 {
3434
}
3535

3636
#[cfg(feature = "builder")]
37-
impl StructAsBytes for EFISdt32 {
37+
impl StructAsBytes for EFISdt32Tag {
3838
fn byte_size(&self) -> usize {
3939
size_of::<Self>()
4040
}
@@ -43,13 +43,13 @@ impl StructAsBytes for EFISdt32 {
4343
/// EFI system table in 64 bit mode
4444
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
4545
#[repr(C)]
46-
pub struct EFISdt64 {
46+
pub struct EFISdt64Tag {
4747
typ: TagTypeId,
4848
size: u32,
4949
pointer: u64,
5050
}
5151

52-
impl EFISdt64 {
52+
impl EFISdt64Tag {
5353
/// Create a new tag to pass the EFI64 System Table pointer.
5454
pub fn new(pointer: u64) -> Self {
5555
Self {
@@ -66,7 +66,7 @@ impl EFISdt64 {
6666
}
6767

6868
#[cfg(feature = "builder")]
69-
impl StructAsBytes for EFISdt64 {
69+
impl StructAsBytes for EFISdt64Tag {
7070
fn byte_size(&self) -> usize {
7171
size_of::<Self>()
7272
}
@@ -140,19 +140,19 @@ impl StructAsBytes for EFIImageHandle64Tag {
140140

141141
#[cfg(all(test, feature = "builder"))]
142142
mod tests {
143-
use super::{EFIImageHandle32Tag, EFIImageHandle64Tag, EFISdt32, EFISdt64};
143+
use super::{EFIImageHandle32Tag, EFIImageHandle64Tag, EFISdt32Tag, EFISdt64Tag};
144144

145145
const ADDR: usize = 0xABCDEF;
146146

147147
#[test]
148148
fn test_build_eftsdt32() {
149-
let tag = EFISdt32::new(ADDR.try_into().unwrap());
149+
let tag = EFISdt32Tag::new(ADDR.try_into().unwrap());
150150
assert_eq!(tag.sdt_address(), ADDR);
151151
}
152152

153153
#[test]
154154
fn test_build_eftsdt64() {
155-
let tag = EFISdt64::new(ADDR.try_into().unwrap());
155+
let tag = EFISdt64Tag::new(ADDR.try_into().unwrap());
156156
assert_eq!(tag.sdt_address(), ADDR);
157157
}
158158

multiboot2/src/lib.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub use elf_sections::{
5757
pub use framebuffer::{FramebufferColor, FramebufferField, FramebufferTag, FramebufferType};
5858
pub use image_load_addr::ImageLoadPhysAddrTag;
5959
pub use memory_map::{
60-
BasicMemoryInfoTag, EFIBootServicesNotExited, EFIMemoryAreaType, EFIMemoryDesc,
60+
BasicMemoryInfoTag, EFIBootServicesNotExitedTag, EFIMemoryAreaType, EFIMemoryDesc,
6161
EFIMemoryMapTag, MemoryArea, MemoryAreaType, MemoryMapTag,
6262
};
6363
pub use module::{ModuleIter, ModuleTag};
@@ -345,6 +345,11 @@ impl BootInformation {
345345
self.get_tag::<EFIImageHandle64Tag, _>(TagType::Efi64Ih)
346346
}
347347

348+
/// Search for the EFI boot services not exited tag.
349+
pub fn efi_bs_not_exited_tag(&self) -> Option<&EFIBootServicesNotExitedTag> {
350+
self.get_tag::<EFIBootServicesNotExitedTag, _>(TagType::EfiBs)
351+
}
352+
348353
/// Search for the Image Load Base Physical Address tag.
349354
pub fn load_base_addr_tag(&self) -> Option<&ImageLoadPhysAddrTag> {
350355
self.get_tag::<ImageLoadPhysAddrTag, _>(TagType::LoadBaseAddr)

multiboot2/src/memory_map.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,20 +277,20 @@ impl StructAsBytes for EFIMemoryDesc {
277277
/// EFI ExitBootServices was not called
278278
#[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)]
279279
#[repr(C)]
280-
pub struct EFIBootServicesNotExited {
280+
pub struct EFIBootServicesNotExitedTag {
281281
typ: TagTypeId,
282282
size: u32,
283283
}
284284

285-
impl EFIBootServicesNotExited {
285+
impl EFIBootServicesNotExitedTag {
286286
#[cfg(feature = "builder")]
287287
pub fn new() -> Self {
288288
Self::default()
289289
}
290290
}
291291

292292
#[cfg(feature = "builder")]
293-
impl Default for EFIBootServicesNotExited {
293+
impl Default for EFIBootServicesNotExitedTag {
294294
fn default() -> Self {
295295
Self {
296296
typ: TagType::EfiBs.into(),
@@ -300,7 +300,7 @@ impl Default for EFIBootServicesNotExited {
300300
}
301301

302302
#[cfg(feature = "builder")]
303-
impl StructAsBytes for EFIBootServicesNotExited {
303+
impl StructAsBytes for EFIBootServicesNotExitedTag {
304304
fn byte_size(&self) -> usize {
305305
mem::size_of::<Self>()
306306
}

0 commit comments

Comments
 (0)