From 6bc9d74193902c31b6b21bed1db80db7e5244eb9 Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Wed, 28 Aug 2024 11:13:19 -0400 Subject: [PATCH 1/2] uefi-raw: Add PAGE_SIZE constant --- uefi-raw/CHANGELOG.md | 4 ++++ uefi-raw/src/table/boot.rs | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/uefi-raw/CHANGELOG.md b/uefi-raw/CHANGELOG.md index 489bc8ca8..dcd9ff3ef 100644 --- a/uefi-raw/CHANGELOG.md +++ b/uefi-raw/CHANGELOG.md @@ -1,5 +1,9 @@ # uefi-raw - [Unreleased] +## Added + +- Added `PAGE_SIZE` constant. + # uefi-raw - 0.7.0 (2024-08-20) diff --git a/uefi-raw/src/table/boot.rs b/uefi-raw/src/table/boot.rs index d197d424a..8559a4c28 100644 --- a/uefi-raw/src/table/boot.rs +++ b/uefi-raw/src/table/boot.rs @@ -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; From 98da3901f1dc3598b8e1274256752d55334fb6bc Mon Sep 17 00:00:00 2001 From: Nicholas Bishop Date: Wed, 28 Aug 2024 11:14:10 -0400 Subject: [PATCH 2/2] uefi: Reexport uefi-raw PAGE_SIZE constant from boot modules --- uefi/src/boot.rs | 2 +- uefi/src/table/boot.rs | 8 +------- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/uefi/src/boot.rs b/uefi/src/boot.rs index b6abf4a10..04faca5c2 100644 --- a/uefi/src/boot.rs +++ b/uefi/src/boot.rs @@ -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}; diff --git a/uefi/src/table/boot.rs b/uefi/src/table/boot.rs index 69635d685..055ea60d2 100644 --- a/uefi/src/table/boot.rs +++ b/uefi/src/table/boot.rs @@ -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; @@ -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`