Skip to content

Commit

Permalink
Merge pull request #1805 from alistair23/alistair/pmp-fixes
Browse files Browse the repository at this point in the history
rv32i: pmp: Remove power of two allignment constraint
  • Loading branch information
bradjc committed Apr 30, 2020
2 parents ae0f004 + 2ae4331 commit 1f99412
Showing 1 changed file with 0 additions and 3 deletions.
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

0 comments on commit 1f99412

Please sign in to comment.