Skip to content

Commit

Permalink
layout: Add MMIO memory attribute
Browse files Browse the repository at this point in the history
Signed-off-by: Akira Moroo <retrage01@gmail.com>
  • Loading branch information
retrage committed Nov 7, 2023
1 parent a6f1d17 commit 5c436c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/efi/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -976,6 +976,7 @@ fn populate_allocator(info: &dyn bootinfo::Info, image_address: u64, image_size:
layout::MemoryAttribute::Code => efi::RUNTIME_SERVICES_CODE,
layout::MemoryAttribute::Data => efi::RUNTIME_SERVICES_DATA,
layout::MemoryAttribute::Unusable => efi::UNUSABLE_MEMORY,
layout::MemoryAttribute::Mmio => efi::MEMORY_MAPPED_IO,
};
ALLOCATOR.borrow_mut().allocate_pages(
efi::ALLOCATE_ADDRESS,
Expand Down
3 changes: 2 additions & 1 deletion src/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@

use core::ops::Range;

#[allow(dead_code)]
#[derive(Clone, Copy)]
pub enum MemoryAttribute {
Code,
Data,
#[allow(dead_code)]
Unusable,
Mmio,
}

#[derive(Clone, Copy)]
Expand Down

0 comments on commit 5c436c1

Please sign in to comment.