diff options
Diffstat (limited to 'src/_arch/arm/asm.rs')
-rw-r--r-- | src/_arch/arm/asm.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/_arch/arm/asm.rs b/src/_arch/arm/asm.rs index c1af5b4..5d53aa0 100644 --- a/src/_arch/arm/asm.rs +++ b/src/_arch/arm/asm.rs @@ -1,6 +1,10 @@ -//! Wrapping ARMv7-A Instructions +//! # Wrapping ARMv7-A Instructions +//! +//! This provides bindings for assembly instructions +//! to be used in other rust functions without `unsafe` +//! markers everywhere. -/// WFE +/// # Wait for event #[inline(always)] pub fn wfe() { unsafe { @@ -8,7 +12,7 @@ pub fn wfe() { } } -/// NOP +/// # No Operation #[inline(always)] pub fn nop() { unsafe { @@ -16,7 +20,7 @@ pub fn nop() { } } -/// Store u32 to address +/// # Store u32 to memory address #[inline] pub fn store32(addr: u32, value: u32) { unsafe { @@ -24,7 +28,7 @@ pub fn store32(addr: u32, value: u32) { } } -/// Read u32 value from address +/// # Read u32 from memory address #[inline] pub fn load32(addr: u32) -> u32 { unsafe { @@ -32,7 +36,7 @@ pub fn load32(addr: u32) -> u32 { } } -/// Wait for n cycles +/// # Spin CPU for `n` cycles #[inline] pub fn spin_for_n_cycles(n: u32) { unsafe { |