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//!
43//! [ArceOS]: https://github.com/arceos-org/arceos
44
45#![cfg_attr(all(not(test), not(doc)), no_std)]
46#![feature(doc_cfg)]
47
48#[cfg(feature = "alloc")]
49extern crate alloc;
50
51#[cfg(feature = "alloc")]
52#[doc(no_inline)]
53pub use alloc::{boxed, collections, format, string, vec};
54
55#[doc(no_inline)]
56pub use core::{arch, cell, cmp, hint, marker, mem, ops, ptr, slice, str};
57
58#[macro_use]
59mod macros;
60
61pub mod env;
62pub mod io;
63pub mod os;
64pub mod process;
65pub mod sync;
66pub mod thread;
67pub mod time;
68
69#[cfg(feature = "fs")]
70pub mod fs;
71#[cfg(feature = "net")]
72pub mod net;