1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/***********************************************************************************************************************
 * Copyright (c) 2020 by the authors
 *
 * Author: André Borrmann <pspwizard@gmx.de>
 * License: Apache License 2.0 / MIT
 **********************************************************************************************************************/

//! # Instructions
//!
//! Functions to emit specific assembly instructions
//!

/// assembly NOP instruction
#[inline]
#[allow(dead_code)]
pub fn nop() {
  unsafe { asm!("nop") };
}

/// assembly instruction WFE
#[inline]
#[allow(dead_code)]
pub fn wfe() {
  unsafe { asm!("wfe") };
}

/// assembly instruction SEV
#[inline]
#[allow(dead_code)]
pub fn sev() {
  unsafe { asm!("sev") };
}

/// assembly instruction ISB
#[inline]
#[allow(dead_code)]
pub fn isb() {
  unsafe { asm!("isb sy") };
}

/// assembly instruction DSB
#[inline]
#[allow(dead_code)]
pub fn dsb() {
  unsafe { asm!("dsb sy") };
}

/// assembly instruction DSB
#[inline]
#[allow(dead_code)]
pub fn dmb() {
  unsafe { asm!("dmb sy") };
}