Skip to content

Commit

Permalink
Merge pull request #1383 from nicholasbishop/bishop-raw-page-size
Browse files Browse the repository at this point in the history
Move PAGE_SIZE to uefi-raw and reexport from uefi boot modules
  • Loading branch information
phip1611 committed Aug 30, 2024
2 parents 70122b5 + 98da390 commit e7b3118
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
4 changes: 4 additions & 0 deletions uefi-raw/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# uefi-raw - [Unreleased]

## Added

- Added `PAGE_SIZE` constant.


# uefi-raw - 0.7.0 (2024-08-20)

Expand Down
6 changes: 6 additions & 0 deletions uefi-raw/src/table/boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -478,3 +478,9 @@ pub enum Tpl: usize => {
/// Even processor interrupts are disable at this level.
HIGH_LEVEL = 31,
}}

/// Size in bytes of a UEFI page.
///
/// Note that this is not necessarily the processor's page size. The UEFI page
/// size is always 4 KiB.
pub const PAGE_SIZE: usize = 4096;
2 changes: 1 addition & 1 deletion uefi/src/boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
//!
//! [`proto`]: crate::proto

pub use uefi_raw::table::boot::{EventType, MemoryAttribute, MemoryDescriptor, MemoryType, Tpl};
pub use uefi_raw::table::boot::{EventType, MemoryAttribute, MemoryDescriptor, MemoryType, Tpl, PAGE_SIZE};

use crate::data_types::PhysicalAddress;
use crate::mem::memory_map::{MemoryMapBackingMemory, MemoryMapKey, MemoryMapMeta, MemoryMapOwned};
Expand Down
8 changes: 1 addition & 7 deletions uefi/src/table/boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pub use crate::boot::{
ProtocolSearchKey, SearchType, TimerTrigger,
};
pub use uefi_raw::table::boot::{
EventType, InterfaceType, MemoryAttribute, MemoryDescriptor, MemoryType, Tpl,
EventType, InterfaceType, MemoryAttribute, MemoryDescriptor, MemoryType, Tpl, PAGE_SIZE,
};

use super::Revision;
Expand All @@ -29,12 +29,6 @@ use core::ops::{Deref, DerefMut};
use core::ptr::NonNull;
use core::{ptr, slice};

/// Size in bytes of a UEFI page.
///
/// Note that this is not necessarily the processor's page size. The UEFI page
/// size is always 4 KiB.
pub const PAGE_SIZE: usize = 4096;

/// Contains pointers to all of the boot services.
///
/// # Accessing `BootServices`
Expand Down

0 comments on commit e7b3118

Please sign in to comment.