Skip to main content

kernel/utilities/
mod.rs

1// Licensed under the Apache License, Version 2.0 or the MIT License.
2// SPDX-License-Identifier: Apache-2.0 OR MIT
3// Copyright Tock Contributors 2022.
4
5//! Utility functions and macros provided by the kernel crate.
6
7pub mod arch_helpers;
8pub mod binary_write;
9pub mod capability_ptr;
10pub mod copy_range;
11pub mod copy_slice;
12pub mod dma_slice;
13pub mod helpers;
14pub mod io_write;
15pub mod leasable_buffer;
16pub mod machine_register;
17pub mod math;
18pub mod mut_imut_buffer;
19pub mod peripheral_management;
20pub mod single_thread_value;
21pub mod static_init;
22pub mod storage_volume;
23pub mod streaming_process_slice;
24
25mod static_ref;
26pub use self::static_ref::StaticRef;
27
28/// The Tock Register Interface.
29///
30/// This is a re-export of the
31/// [`tock-registers`](https://github.com/tock/tock-registers) crate provided
32/// for convenience.
33///
34/// The Tock Register Interface provides a mechanism for accessing hardware
35/// registers and MMIO interfaces.
36pub mod registers {
37    pub use tock_registers::fields::{Field, FieldValue};
38    pub use tock_registers::interfaces;
39    pub use tock_registers::registers::InMemoryRegister;
40    pub use tock_registers::registers::{Aliased, ReadOnly, ReadWrite, WriteOnly};
41    pub use tock_registers::{LocalRegisterCopy, RegisterLongName};
42    pub use tock_registers::{register_bitfields, register_structs};
43}
44
45/// The Tock `Cell` types.
46///
47/// This is a re-export of the `tock-cells` crate provided for convenience.
48///
49/// To use `TakeCell`, for example, users should use:
50///
51///     use kernel::utilities::cells::TakeCell;
52pub mod cells {
53    pub use tock_cells::map_cell::MapCell;
54    pub use tock_cells::numeric_cell_ext::NumericCellExt;
55    pub use tock_cells::optional_cell::OptionalCell;
56    pub use tock_cells::take_cell::TakeCell;
57    pub use tock_cells::volatile_cell::VolatileCell;
58}