cortex_ar/
lib.rs

1//! CPU/peripheral support for Arm Cortex-R
2
3#![no_std]
4
5mod critical_section;
6
7#[cfg(any(doc, target_arch = "arm"))]
8pub mod asm;
9
10pub mod cache;
11pub mod interrupt;
12pub mod mmu;
13pub mod register;
14
15#[cfg(any(test, doc, arm_architecture = "v7-r"))]
16pub mod pmsav7;
17
18#[cfg(any(test, doc, arm_architecture = "v8-r"))]
19pub mod generic_timer;
20
21#[cfg(any(test, doc, arm_architecture = "v8-r"))]
22pub mod pmsav8;
23
24/// Generate an SVC call with the given argument.
25///
26/// Safe to call even in Supervisor (SupervisorCall) mode, as long as your Svc handler
27/// saves and restores SPSR_svc correctly.
28#[macro_export]
29macro_rules! svc {
30    ($r0:expr) => {
31        unsafe {
32            core::arch::asm!("svc {arg}", arg = const $r0, out("lr") _);
33        }
34    }
35}