Skip to content

Commit d6fb22e

Browse files
Merge #297
297: Deprecate msp::write r=adamgreig a=jonas-schievink The function can not be used from Rust code, because it destroys the stack frame. Users must use an assembly block (inline or out-of-line) that both sets MSP and performs a method call. Co-authored-by: Jonas Schievink <[email protected]>
2 parents 038396e + 99cf0fb commit d6fb22e

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1212
- New assembly methods `asm::semihosting_syscall`, `asm::bootstrap`, and
1313
`asm::bootload`.
1414

15+
### Changed
16+
17+
- `msp::write` has been deprecated in favor of `asm::bootstrap`. It was not
18+
possible to use `msp::write` without causing Undefined Behavior, so all
19+
existing users are encouraged to migrate.
20+
1521
## [v0.7.0] - 2020-11-09
1622

1723
### Added

src/register/msp.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ pub fn read() -> u32 {
88

99
/// Writes `bits` to the CPU register
1010
#[inline]
11+
#[deprecated = "calling this function invokes Undefined Behavior"]
1112
pub unsafe fn write(bits: u32) {
1213
call_asm!(__msp_w(bits: u32));
1314
}

0 commit comments

Comments
 (0)