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_slice;
11pub mod helpers;
12pub mod leasable_buffer;
13pub mod machine_register;
14pub mod math;
15pub mod mut_imut_buffer;
16pub mod peripheral_management;
17pub mod single_thread_value;
18pub mod static_init;
19pub mod storage_volume;
20pub mod streaming_process_slice;
21
22mod static_ref;
23pub use self::static_ref::StaticRef;
24
25/// The Tock Register Interface.
26///
27/// This is a re-export of the `tock-register-interface` crate provided for
28/// convenience.
29///
30/// The Tock Register Interface provides a mechanism for accessing hardware
31/// registers and MMIO interfaces.
32pub mod registers {
33    pub use tock_registers::fields::{Field, FieldValue};
34    pub use tock_registers::interfaces;
35    pub use tock_registers::registers::InMemoryRegister;
36    pub use tock_registers::registers::{Aliased, ReadOnly, ReadWrite, WriteOnly};
37    pub use tock_registers::{register_bitfields, register_structs};
38    pub use tock_registers::{LocalRegisterCopy, RegisterLongName};
39}
40
41/// The Tock `Cell` types.
42///
43/// This is a re-export of the `tock-cells` crate provided for convenience.
44///
45/// To use `TakeCell`, for example, users should use:
46///
47///     use kernel::utilities::cells::TakeCell;
48pub mod cells {
49    pub use tock_cells::map_cell::MapCell;
50    pub use tock_cells::numeric_cell_ext::NumericCellExt;
51    pub use tock_cells::optional_cell::OptionalCell;
52    pub use tock_cells::take_cell::TakeCell;
53    pub use tock_cells::volatile_cell::VolatileCell;
54}