Skip to content

Commit 0ac8876

Browse files
committed
Assume reserved bits read as 0
1 parent a3ac678 commit 0ac8876

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

esp-hal-common/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,10 @@ mod critical_section_impl {
220220
use super::multicore::{LockKind, MULTICORE_LOCK};
221221

222222
match MULTICORE_LOCK.lock() {
223-
LockKind::Lock => tkn &= !REENTRY_FLAG,
223+
LockKind::Lock => {
224+
// We can assume the reserved bit is 0 otherwise
225+
// rsil - wsr pairings would be undefined behavior
226+
}
224227
LockKind::Reentry => tkn |= REENTRY_FLAG,
225228
}
226229
}

0 commit comments

Comments
 (0)