Skip to content

Commit

Permalink
raspi: fix wrong memory flag of spintable
Browse files Browse the repository at this point in the history
  • Loading branch information
equation314 committed Jul 24, 2023
1 parent 195485d commit 1cb5662
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
1 change: 0 additions & 1 deletion modules/axconfig/.gitignore

This file was deleted.

8 changes: 5 additions & 3 deletions modules/axhal/src/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ bitflags::bitflags! {
const WRITE = 1 << 1;
/// Executable.
const EXECUTE = 1 << 2;
/// Device memory.
/// Device memory. (e.g., MMIO regions)
const DEVICE = 1 << 4;
/// Uncachable memory. (e.g., framebuffer)
const UNCACHED = 1 << 5;
/// Reserved memory, do not use for allocation.
const RESERVED = 1 << 5;
const RESERVED = 1 << 6;
/// Free memory for allocation.
const FREE = 1 << 6;
const FREE = 1 << 7;
}
}

Expand Down
3 changes: 3 additions & 0 deletions modules/axhal/src/paging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ impl From<MemRegionFlags> for MappingFlags {
if f.contains(MemRegionFlags::DEVICE) {
ret |= Self::DEVICE;
}
if f.contains(MemRegionFlags::UNCACHED) {
ret |= Self::UNCACHED;
}
ret
}
}
Expand Down
2 changes: 1 addition & 1 deletion modules/axhal/src/platform/aarch64_raspi/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub(crate) fn extern_memory_region_at(idx: usize) -> Option<MemRegion> {
Some(MemRegion {
paddr: 0x0.into(),
size: 0x1000,
flags: MemRegionFlags::FREE | MemRegionFlags::READ | MemRegionFlags::WRITE,
flags: MemRegionFlags::READ | MemRegionFlags::WRITE,
name: "spintable",
})
} else {
Expand Down

0 comments on commit 1cb5662

Please sign in to comment.