Skip to content

Commit 98be526

Browse files
Overlaps on cortex-m only need to consider the accessible start and end (#28)
1 parent 685492c commit 98be526

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

arch/cortex-m/src/mpu.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,10 @@ flux_rs::defs! {
223223
// region specific
224224
fn regions_overlap(region1: CortexMRegion, region2: CortexMRegion) -> bool {
225225
if region1.set && region2.set {
226-
let fst_region_start = region1.rstart;
227-
let fst_region_end = region1.rstart + region1.rsize;
228-
let snd_region_start = region2.rstart;
229-
let snd_region_end = region2.rstart + region2.rsize;
226+
let fst_region_start = region1.astart;
227+
let fst_region_end = region1.astart + region1.asize;
228+
let snd_region_start = region2.astart;
229+
let snd_region_end = region2.astart + region2.asize;
230230
fst_region_start < snd_region_end && snd_region_start < fst_region_end
231231
} else {
232232
false
@@ -1193,11 +1193,11 @@ impl CortexMRegion {
11931193
pub(crate) fn region_overlaps(&self, other: &CortexMRegion) -> bool {
11941194
match (self.location(), other.location()) {
11951195
(Some(fst_region_loc), Some(snd_region_loc)) => {
1196-
let fst_region_start = fst_region_loc.region_start.as_usize();
1197-
let fst_region_end = fst_region_start + fst_region_loc.region_size;
1196+
let fst_region_start = fst_region_loc.accessible_start.as_usize();
1197+
let fst_region_end = fst_region_start + fst_region_loc.accessible_size;
11981198

1199-
let snd_region_start = snd_region_loc.region_start.as_usize();
1200-
let snd_region_end = snd_region_start + snd_region_loc.region_size;
1199+
let snd_region_start = snd_region_loc.accessible_start.as_usize();
1200+
let snd_region_end = snd_region_start + snd_region_loc.accessible_size;
12011201

12021202
fst_region_start < snd_region_end && snd_region_start < fst_region_end
12031203
}

0 commit comments

Comments
 (0)