| 1 |
// Copyright 2014 The syscall.rs Project Developers. See the |
| 2 |
// COPYRIGHT file at the top-level directory of this distribution. |
| 3 |
// |
| 4 |
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
| 5 |
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 6 |
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
| 7 |
// option. This file may not be copied, modified, or distributed |
| 8 |
// except according to those terms. |
| 9 |
|
| 10 |
//! Raw system calls for Rust. |
| 11 |
//! |
| 12 |
//! NOTE: Only these architectures have been ported to the stable (as of 1.59) `asm!` macro |
| 13 |
//! |
| 14 |
//! - aarch64 |
| 15 |
//! - riscv64 |
| 16 |
//! - x86_64 |
| 17 |
//! |
| 18 |
//! All the other architectures use the deprecated `llvm_asm!` macro which has already been removed. |
| 19 |
//! To use this crate with those architectures you'll need to use an older nightly like |
| 20 |
//! `nightly-2022-01-14` |
| 21 |
|
| 22 |
// Reference http://man7.org/linux/man-pages/man2/syscall.2.html |
| 23 |
|
| 24 |
#![allow(deprecated)] // llvm_asm! |
| 25 |
#![deny(warnings)] |
| 26 |
#![no_std] |
| 27 |
#![cfg_attr(any( |
| 28 |
target_arch = "arm", |
| 29 |
target_arch = "mips", |
| 30 |
target_arch = "mips64", |
| 31 |
target_arch = "powerpc", |
| 32 |
target_arch = "powerpc64", |
| 33 |
target_arch = "sparc64", |
| 34 |
target_arch = "x86" |
| 35 |
), feature(llvm_asm))] |
| 36 |
|
| 37 |
#[cfg(test)] |
| 38 |
extern crate std; |
| 39 |
|
| 40 |
pub use platform::*; |
| 41 |
|
| 42 |
pub mod macros; |
| 43 |
|
| 44 |
#[cfg(all(any(target_os = "linux", target_os = "android"), |
| 45 |
target_arch = "aarch64"))] |
| 46 |
#[path="platform/linux-aarch64/mod.rs"] |
| 47 |
pub mod platform; |
| 48 |
|
| 49 |
#[cfg(all(any(target_os = "linux", target_os = "android"), |
| 50 |
target_arch = "arm"))] |
| 51 |
#[path="platform/linux-armeabi/mod.rs"] |
| 52 |
pub mod platform; |
| 53 |
|
| 54 |
#[cfg(all(any(target_os = "linux", target_os = "android"), |
| 55 |
target_arch = "mips"))] |
| 56 |
#[path="platform/linux-mips/mod.rs"] |
| 57 |
pub mod platform; |
| 58 |
|
| 59 |
#[cfg(all(any(target_os = "linux", target_os = "android"), |
| 60 |
target_arch = "mips64"))] |
| 61 |
#[path="platform/linux-mips64/mod.rs"] |
| 62 |
pub mod platform; |
| 63 |
|
| 64 |
#[cfg(all(any(target_os = "linux", target_os = "android"), |
| 65 |
target_arch = "powerpc"))] |
| 66 |
#[path="platform/linux-powerpc/mod.rs"] |
| 67 |
pub mod platform; |
| 68 |
|
| 69 |
#[cfg(all(any(target_os = "linux", target_os = "android"), |
| 70 |
target_arch = "powerpc64"))] |
| 71 |
#[path="platform/linux-powerpc64/mod.rs"] |
| 72 |
pub mod platform; |
| 73 |
|
| 74 |
#[cfg(all(any(target_os = "linux", target_os = "android"), |
| 75 |
target_arch = "riscv64"))] |
| 76 |
#[path="platform/linux-riscv64/mod.rs"] |
| 77 |
pub mod platform; |
| 78 |
|
| 79 |
#[cfg(all(any(target_os = "linux", target_os = "android"), |
| 80 |
target_arch = "sparc64"))] |
| 81 |
#[path="platform/linux-sparc64/mod.rs"] |
| 82 |
pub mod platform; |
| 83 |
|
| 84 |
#[cfg(all(any(target_os = "linux", target_os = "android"), |
| 85 |
target_arch = "x86"))] |
| 86 |
#[path="platform/linux-x86/mod.rs"] |
| 87 |
pub mod platform; |
| 88 |
|
| 89 |
#[cfg(all(any(target_os = "linux", target_os = "android"), |
| 90 |
target_arch = "x86_64"))] |
| 91 |
#[path="platform/linux-x86_64/mod.rs"] |
| 92 |
pub mod platform; |
| 93 |
|
| 94 |
#[cfg(all(target_os = "freebsd", |
| 95 |
target_arch = "x86_64"))] |
| 96 |
#[path="platform/freebsd-x86_64/mod.rs"] |
| 97 |
pub mod platform; |
| 98 |
|
| 99 |
#[cfg(all(target_os = "macos", |
| 100 |
target_arch = "x86_64"))] |
| 101 |
#[path="platform/macos-x86_64/mod.rs"] |
| 102 |
pub mod platform; |
| 103 |
|
| 104 |
#[cfg(all(target_os = "macos", |
| 105 |
target_arch = "aarch64"))] |
| 106 |
#[path="platform/macos-aarch64/mod.rs"] |
| 107 |
pub mod platform; |