Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rv32i: pmp: Remove power of two allignment constraint #1805

Merged
merged 1 commit into from
Apr 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 0 additions & 3 deletions arch/rv32i/src/pmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ use core::fmt;

use crate::csr;
use kernel;
use kernel::common::math;
use kernel::common::registers::register_bitfields;
use kernel::mpu;

Expand Down Expand Up @@ -399,8 +398,6 @@ impl kernel::mpu::MPU for PMPConfig {
// RISC-V PMP is not inclusive of the final address, while Tock is, increase the memory_size by 1
let mut region_size = memory_size as usize + 1;

region_size = math::PowerOfTwo::ceiling(region_size as u32).as_num::<u32>() as usize;

// Region size always has to align to 4 bytes
if region_size % 4 != 0 {
region_size += 4 - (region_size % 4);
Expand Down