From 0cf91a130756746dff86e95da03ac1842be81dff Mon Sep 17 00:00:00 2001 From: Philipp Schuster Date: Mon, 10 Aug 2026 22:14:15 +0200 Subject: [PATCH] Revert "Make memory maps repr(C)" --- uefi/CHANGELOG.md | 1 - uefi/src/mem/memory_map/impl_.rs | 4 ---- uefi/src/mem/memory_map/mod.rs | 1 - 3 files changed, 6 deletions(-) diff --git a/uefi/CHANGELOG.md b/uefi/CHANGELOG.md index 83928d5e..f83969e6 100644 --- a/uefi/CHANGELOG.md +++ b/uefi/CHANGELOG.md @@ -5,7 +5,6 @@ the extended processor topology. ## Changed -- Made memory map types `#[repr(C)]` - Added `char16!` const-compatible macro as convenient replacement for `Char16::try_from().unwrap()` - `proto::debug::SystemContextARM` now contains the trailing `IFAR` field mandated by the spec. diff --git a/uefi/src/mem/memory_map/impl_.rs b/uefi/src/mem/memory_map/impl_.rs index 81d3f22d..2baa7db1 100644 --- a/uefi/src/mem/memory_map/impl_.rs +++ b/uefi/src/mem/memory_map/impl_.rs @@ -44,7 +44,6 @@ impl core::error::Error for MemoryMapError {} /// Implementation of [`MemoryMap`] for the given buffer. #[derive(Debug)] -#[repr(C)] pub struct MemoryMapRef<'a> { buf: &'a [u8], meta: MemoryMapMeta, @@ -108,7 +107,6 @@ impl Index for MemoryMapRef<'_> { /// Implementation of [`MemoryMapMut`] for the given buffer. #[derive(Debug)] -#[repr(C)] pub struct MemoryMapRefMut<'a> { buf: &'a mut [u8], meta: MemoryMapMeta, @@ -289,7 +287,6 @@ impl IndexMut for MemoryMapRefMut<'_> { /// /// [`boot::get_memory_map`]: crate::boot::get_memory_map #[derive(Debug)] -#[repr(C)] pub(crate) struct MemoryMapBackingMemory(NonNull<[u8]>); impl MemoryMapBackingMemory { @@ -389,7 +386,6 @@ impl Drop for MemoryMapBackingMemory { /// Implementation of [`MemoryMapMut`] that owns the buffer on the UEFI heap. #[derive(Debug)] -#[repr(C)] pub struct MemoryMapOwned { /// Backing memory, properly initialized at this point. pub(crate) buf: MemoryMapBackingMemory, diff --git a/uefi/src/mem/memory_map/mod.rs b/uefi/src/mem/memory_map/mod.rs index 14987ac6..0ae3dc21 100644 --- a/uefi/src/mem/memory_map/mod.rs +++ b/uefi/src/mem/memory_map/mod.rs @@ -64,7 +64,6 @@ pub struct MemoryMapKey(pub(crate) usize); /// called. All following invocations (hidden, subtle, and asynchronous ones) /// will likely invalidate this. #[derive(Copy, Clone, Debug)] -#[repr(C)] pub struct MemoryMapMeta { /// The actual size of the map. pub map_size: usize,