1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//! Common operations and types in Tock.
//!
//! These are data types and access mechanisms that are used throughout the Tock
//! kernel. Mostly they simplify common operations and enable the other parts of
//! the kernel (chips and capsules) to be intuitive, valid Rust. In some cases
//! they provide safe wrappers around unsafe interface so that other kernel
//! crates do not need to use unsafe code.

pub use tock_regs::*;

pub mod deferred_call;
pub mod list;
pub mod math;
pub mod peripherals;
pub mod utils;

mod queue;
mod ring_buffer;
mod static_ref;

pub use self::list::{List, ListLink, ListNode};
pub use self::queue::Queue;
pub use self::ring_buffer::RingBuffer;
pub use self::static_ref::StaticRef;

/// Create a "fake" module inside of `common` for all of the Tock `Cell` types.
///
/// To use `TakeCell`, for example, users should use:
///
///     use kernel::common::cells::TakeCell;
pub mod cells {
    pub use tock_cells::map_cell::MapCell;
    pub use tock_cells::num_cell::NumCell;
    pub use tock_cells::optional_cell::OptionalCell;
    pub use tock_cells::take_cell::TakeCell;
    pub use tock_cells::volatile_cell::VolatileCell;
}