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