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