xref: /dragonos-dsc/src/lib.rs (revision 29f2a1e928bffd4b9daaf7e0639e1d24a244c01b)
1 //! # dsc - DragonOS Raw Syscall Binding
2 //!
3 //! This is a raw syscall binding for DragonOS. It is not meant to be used directly, but rather as a dependency for other crates.
4 //!
5 //! ## Usage
6 //!
7 //! Add this to your `Cargo.toml`:
8 //!
9 //! ```toml
10 //! [dependencies]
11 //! dsc = { git = "https://github.com/DragonOS-Community/dsc.git" , rev = "The Git Commit You Want" }
12 //! ```
13 //!
14 //! ## 其他
15 //!
16 //! 如果您正在开发dsc,请您在引入dsc的库的`Cargo.toml`中添加如下内容,而不是使用上述的代码:
17 //!
18 //! ```toml
19 //! [dependencies]
20 //! dsc = { path = "您本地存放dsc的源代码的路径" }
21 //! ```
22 //!
23 //! ## How to build
24 //!
25 //! ```bash
26 //! ARCH=x86_64 && cargo build -Zbuild-std --release --target src/platform/$ARCH/target.json
27 //! ```
28 //!
29 //! ## How to build docs
30 //!
31 //! ```bash
32 //! ARCH=x86_64 && cargo doc -Zbuild-std --release --target src/platform/$ARCH/target.json
33 //! ```
34 //!
35 //! ## What is DragonOS?
36 //!
37 //! DragonOS is an opensource operating system developed for the server field.
38 //! Its kernel and user mode environment are developed from scratch, and provides Linux compatibility.
39 //!
40 //! - [DragonOS Website](https://dragonos.org)
41 //! - [DragonOS Github](https://github.com/DragonOS-Community)
42 //!
43 //! ## License
44 //!
45 //! Licensed under
46 //!   * MIT license (<http://opensource.org/licenses/MIT>)
47 
48 #![allow(deprecated)] // llvm_asm!
49 #![deny(warnings)]
50 #![no_std]
51 #![cfg_attr(
52     any(
53         target_arch = "arm",
54         target_arch = "mips",
55         target_arch = "mips64",
56         target_arch = "powerpc",
57         target_arch = "powerpc64",
58         target_arch = "sparc64",
59         target_arch = "x86"
60     ),
61     feature(llvm_asm)
62 )]
63 
64 #[cfg(test)]
65 extern crate std;
66 
67 pub use platform::*;
68 
69 pub(crate) mod macros;
70 
71 #[cfg(all(any(target_os = "dragonos"), target_arch = "x86_64"))]
72 #[path = "platform/x86_64/mod.rs"]
73 pub mod platform;
74