xref: /dragonos-dsc/src/lib.rs (revision 29f2a1e928bffd4b9daaf7e0639e1d24a244c01b)
1943c158aSlongjin //! # dsc - DragonOS Raw Syscall Binding
2943c158aSlongjin //!
3943c158aSlongjin //! This is a raw syscall binding for DragonOS. It is not meant to be used directly, but rather as a dependency for other crates.
4943c158aSlongjin //!
5943c158aSlongjin //! ## Usage
6943c158aSlongjin //!
7943c158aSlongjin //! Add this to your `Cargo.toml`:
8943c158aSlongjin //!
9943c158aSlongjin //! ```toml
10943c158aSlongjin //! [dependencies]
11943c158aSlongjin //! dsc = { git = "https://github.com/DragonOS-Community/dsc.git" , rev = "The Git Commit You Want" }
12943c158aSlongjin //! ```
13943c158aSlongjin //!
14943c158aSlongjin //! ## 其他
15943c158aSlongjin //!
16943c158aSlongjin //! 如果您正在开发dsc,请您在引入dsc的库的`Cargo.toml`中添加如下内容,而不是使用上述的代码:
17943c158aSlongjin //!
18943c158aSlongjin //! ```toml
19943c158aSlongjin //! [dependencies]
20943c158aSlongjin //! dsc = { path = "您本地存放dsc的源代码的路径" }
21943c158aSlongjin //! ```
22943c158aSlongjin //!
23943c158aSlongjin //! ## How to build
24943c158aSlongjin //!
25943c158aSlongjin //! ```bash
26943c158aSlongjin //! ARCH=x86_64 && cargo build -Zbuild-std --release --target src/platform/$ARCH/target.json
27943c158aSlongjin //! ```
28943c158aSlongjin //!
29943c158aSlongjin //! ## How to build docs
30943c158aSlongjin //!
31943c158aSlongjin //! ```bash
32943c158aSlongjin //! ARCH=x86_64 && cargo doc -Zbuild-std --release --target src/platform/$ARCH/target.json
33943c158aSlongjin //! ```
34943c158aSlongjin //!
35943c158aSlongjin //! ## What is DragonOS?
36943c158aSlongjin //!
37943c158aSlongjin //! DragonOS is an opensource operating system developed for the server field.
38943c158aSlongjin //! Its kernel and user mode environment are developed from scratch, and provides Linux compatibility.
39943c158aSlongjin //!
40943c158aSlongjin //! - [DragonOS Website](https://dragonos.org)
41943c158aSlongjin //! - [DragonOS Github](https://github.com/DragonOS-Community)
42943c158aSlongjin //!
43943c158aSlongjin //! ## License
44943c158aSlongjin //!
45943c158aSlongjin //! Licensed under
46943c158aSlongjin //!   * MIT license (<http://opensource.org/licenses/MIT>)
47943c158aSlongjin 
48f0737732Slongjin #![allow(deprecated)] // llvm_asm!
49f0737732Slongjin #![deny(warnings)]
50f0737732Slongjin #![no_std]
51*29f2a1e9SLoGin #![cfg_attr(
52*29f2a1e9SLoGin     any(
53f0737732Slongjin         target_arch = "arm",
54f0737732Slongjin         target_arch = "mips",
55f0737732Slongjin         target_arch = "mips64",
56f0737732Slongjin         target_arch = "powerpc",
57f0737732Slongjin         target_arch = "powerpc64",
58f0737732Slongjin         target_arch = "sparc64",
59f0737732Slongjin         target_arch = "x86"
60*29f2a1e9SLoGin     ),
61*29f2a1e9SLoGin     feature(llvm_asm)
62*29f2a1e9SLoGin )]
63f0737732Slongjin 
64f0737732Slongjin #[cfg(test)]
65f0737732Slongjin extern crate std;
66f0737732Slongjin 
67f0737732Slongjin pub use platform::*;
68f0737732Slongjin 
69943c158aSlongjin pub(crate) mod macros;
70f0737732Slongjin 
71*29f2a1e9SLoGin #[cfg(all(any(target_os = "dragonos"), target_arch = "x86_64"))]
72f0737732Slongjin #[path = "platform/x86_64/mod.rs"]
73f0737732Slongjin pub mod platform;
74