cortex_m/register/msplim.rs
1//! Main Stack Pointer Limit Register
2
3use core::arch::asm;
4
5/// Reads the CPU register
6#[inline]
7pub fn read() -> u32 {
8 let r;
9 unsafe { asm!("mrs {}, MSPLIM", out(reg) r, options(nomem, nostack, preserves_flags)) };
10 r
11}
12
13/// Writes `bits` to the CPU register
14#[inline]
15pub unsafe fn write(bits: u32) {
16 unsafe { asm!("msr MSPLIM, {}", in(reg) bits, options(nomem, nostack, preserves_flags)) };
17}