Make store operations constant wrt flash operations

This commit is contained in:
Julien Cretin
2020-12-10 18:29:31 +01:00
parent c34d5c7d8a
commit edcc206e9d
5 changed files with 162 additions and 123 deletions

View File

@@ -1077,4 +1077,12 @@ mod tests {
0xff800000
);
}
#[test]
fn position_offsets_fit_in_a_halfword() {
// The store stores the entry positions as their offset from the head. Those offsets are
// represented as u16. The bound below is a large over-approximation of the maximal offset
// but it already fits.
assert_eq!((MAX_PAGE_INDEX + 1) * MAX_VIRT_PAGE_SIZE, 0xff80);
}
}