axstd/
lib.rs

1//! # The ArceOS Standard Library
2//!
3//! The [ArceOS] Standard Library is a mini-std library, with an interface similar
4//! to rust [std], but calling the functions directly in ArceOS modules, instead
5//! of using libc and system calls.
6//!
7//! These features are exactly the same as those in [axfeat], they are used to
8//! provide users with the selection of features in axfeat, without import
9//! [axfeat] additionally:
10//!
11//! ## Cargo Features
12//!
13//! - CPU
14//!     - `smp`: Enable SMP (symmetric multiprocessing) support.
15//!     - `fp_simd`: Enable floating point and SIMD support.
16//! - Interrupts:
17//!     - `irq`: Enable interrupt handling support.
18//! - Memory
19//!     - `alloc`: Enable dynamic memory allocation.
20//!     - `alloc-tlsf`: Use the TLSF allocator.
21//!     - `alloc-slab`: Use the slab allocator.
22//!     - `alloc-buddy`: Use the buddy system allocator.
23//!     - `paging`: Enable page table manipulation.
24//!     - `tls`: Enable thread-local storage.
25//! - Task management
26//!     - `multitask`: Enable multi-threading support.
27//!     - `sched_fifo`: Use the FIFO cooperative scheduler.
28//!     - `sched_rr`: Use the Round-robin preemptive scheduler.
29//!     - `sched_cfs`: Use the Completely Fair Scheduler (CFS) preemptive scheduler.
30//! - Upperlayer stacks
31//!     - `fs`: Enable file system support.
32//!     - `myfs`: Allow users to define their custom filesystems to override the default.
33//!     - `net`: Enable networking support.
34//!     - `dns`: Enable DNS lookup support.
35//!     - `display`: Enable graphics support.
36//! - Device drivers
37//!     - `bus-mmio`: Use device tree to probe all MMIO devices.
38//!     - `bus-pci`: Use PCI bus to probe all PCI devices.
39//!     - `driver-ramdisk`: Use the RAM disk to emulate the block device.
40//!     - `driver-ixgbe`: Enable the Intel 82599 10Gbit NIC driver.
41//!     - `driver-bcm2835-sdhci`: Enable the BCM2835 SDHCI driver (Raspberry Pi SD card).
42//! - Logging
43//!     - `log-level-off`: Disable all logging.
44//!     - `log-level-error`, `log-level-warn`, `log-level-info`, `log-level-debug`,
45//!       `log-level-trace`: Keep logging only at the specified level or higher.
46//!
47//! [ArceOS]: https://github.com/arceos-org/arceos
48
49#![cfg_attr(all(not(test), not(doc)), no_std)]
50#![feature(doc_cfg)]
51#![feature(doc_auto_cfg)]
52
53#[cfg(feature = "alloc")]
54extern crate alloc;
55
56#[cfg(feature = "alloc")]
57#[doc(no_inline)]
58pub use alloc::{boxed, collections, format, string, vec};
59
60#[doc(no_inline)]
61pub use core::{arch, cell, cmp, hint, marker, mem, ops, ptr, slice, str};
62
63#[macro_use]
64mod macros;
65
66pub mod env;
67pub mod io;
68pub mod os;
69pub mod process;
70pub mod sync;
71pub mod thread;
72pub mod time;
73
74#[cfg(feature = "fs")]
75pub mod fs;
76#[cfg(feature = "net")]
77pub mod net;