aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Роман Кривенков <qwerty19106@gmail.com> 2020-03-17 22:28:05 +0400
committerGravatar Роман Кривенков <qwerty19106@gmail.com> 2020-03-17 22:35:41 +0400
commitc3dba123a7a01144f8f092f7c0c361b955ebf674 (patch)
tree990c0a597e13769730806aab84799448e8b6b238 /src
parent536575c843068e59761570d5c800f3619a284b25 (diff)
downloadcortex-m-c3dba123a7a01144f8f092f7c0c361b955ebf674.tar.gz
cortex-m-c3dba123a7a01144f8f092f7c0c361b955ebf674.tar.zst
cortex-m-c3dba123a7a01144f8f092f7c0c361b955ebf674.zip
Update unsafe comments
Diffstat (limited to 'src')
-rw-r--r--src/peripheral/scb.rs12
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| {