diff options
author | 2020-03-17 22:28:05 +0400 | |
---|---|---|
committer | 2020-03-17 22:35:41 +0400 | |
commit | c3dba123a7a01144f8f092f7c0c361b955ebf674 (patch) | |
tree | 990c0a597e13769730806aab84799448e8b6b238 | |
parent | 536575c843068e59761570d5c800f3619a284b25 (diff) | |
download | cortex-m-c3dba123a7a01144f8f092f7c0c361b955ebf674.tar.gz cortex-m-c3dba123a7a01144f8f092f7c0c361b955ebf674.tar.zst cortex-m-c3dba123a7a01144f8f092f7c0c361b955ebf674.zip |
Update unsafe comments
-rw-r--r-- | src/peripheral/scb.rs | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/peripheral/scb.rs b/src/peripheral/scb.rs index d2aacd7..949f890 100644 --- a/src/peripheral/scb.rs +++ b/src/peripheral/scb.rs @@ -950,8 +950,7 @@ impl SCB { { // NOTE(unsafe) atomic read with no side effects - // NOTE(unsafe): prevent unnecessary bounds check! Index of shpr array is - // true by SystemHandler design. + // NOTE(unsafe): Index is bounded to [4,15] by SystemHandler design. let priority_ref = unsafe {(*Self::ptr()).shpr.get_unchecked(usize::from(index - 4))}; priority_ref.read() @@ -961,8 +960,7 @@ impl SCB { { // NOTE(unsafe) atomic read with no side effects - // NOTE(unsafe): prevent unnecessary bounds check! Index of shpr array is - // true by SystemHandler design. + // NOTE(unsafe): Index is bounded to [11,15] by SystemHandler design. let priority_ref = unsafe {(*Self::ptr()).shpr.get_unchecked(usize::from((index - 8) / 4))}; let shpr = priority_ref.read(); @@ -989,8 +987,7 @@ impl SCB { #[cfg(not(armv6m))] { - // NOTE(unsafe): prevent unnecessary bounds check! Index of shpr array is - // true by SystemHandler design. + // NOTE(unsafe): Index is bounded to [4,15] by SystemHandler design. let priority_ref = (*Self::ptr()).shpr.get_unchecked(usize::from(index - 4)); priority_ref.write(prio) @@ -998,8 +995,7 @@ impl SCB { #[cfg(armv6m)] { - // NOTE(unsafe): prevent unnecessary bounds check! Index of shpr array is - // true by SystemHandler design. + // NOTE(unsafe): Index is bounded to [11,15] by SystemHandler design. let priority_ref = (*Self::ptr()).shpr.get_unchecked(usize::from((index - 8) / 4)); priority_ref.modify(|value| { |