sel4_sys/syscalls/helpers/arch/
mod.rs

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
//
// Copyright 2023, Colias Group, LLC
//
// SPDX-License-Identifier: BSD-2-Clause
//

use core::ffi::c_int;

use sel4_config::sel4_cfg_if;

use crate::seL4_Word;

sel4_cfg_if! {
    if #[sel4_cfg(ARCH_AARCH64)] {
        #[path = "aarch64.rs"]
        mod imp;
    } else if #[sel4_cfg(ARCH_AARCH32)] {
        #[path = "aarch32.rs"]
        mod imp;
    } else if #[sel4_cfg(any(ARCH_RISCV64, ARCH_RISCV32))] {
        #[path = "riscv.rs"]
        mod imp;
    } else if #[sel4_cfg(ARCH_X86_64)] {
        #[path = "x86_64.rs"]
        mod imp;
    }
}

// HACK for rustfmt
#[cfg(any())]
mod aarch32;
#[cfg(any())]
mod aarch64;
#[cfg(any())]
mod riscv;
#[cfg(any())]
mod x86_64;

pub use imp::*;

fn sys_id_to_word(sys_id: c_int) -> seL4_Word {
    sys_id as seL4_Word
}