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
28/// [`tock-registers`](https://github.com/tock/tock-registers) crate provided
29/// for convenience.
30///
31/// The Tock Register Interface provides a mechanism for accessing hardware
32/// registers and MMIO interfaces.
33pub mod registers {
34    pub use tock_registers::fields::{Field, FieldValue};
35    pub use tock_registers::interfaces;
36    pub use tock_registers::registers::InMemoryRegister;
37    pub use tock_registers::registers::{Aliased, ReadOnly, ReadWrite, WriteOnly};
38    pub use tock_registers::{register_bitfields, register_structs};
39    pub use tock_registers::{LocalRegisterCopy, RegisterLongName};
40}
41
42/// The Tock `Cell` types.
43///
44/// This is a re-export of the `tock-cells` crate provided for convenience.
45///
46/// To use `TakeCell`, for example, users should use:
47///
48///     use kernel::utilities::cells::TakeCell;
49pub mod cells {
50    pub use tock_cells::map_cell::MapCell;
51    pub use tock_cells::numeric_cell_ext::NumericCellExt;
52    pub use tock_cells::optional_cell::OptionalCell;
53    pub use tock_cells::take_cell::TakeCell;
54    pub use tock_cells::volatile_cell::VolatileCell;
55}