components/appid/
checker_null.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 2024.
4
5//! Component for creating a NULL process checking machine that approves all
6//! processes.
7
8use core::mem::MaybeUninit;
9use kernel::component::Component;
10
11#[macro_export]
12macro_rules! app_checker_null_component_static {
13    () => {{
14        kernel::static_buf!(capsules_system::process_checker::basic::AppCheckerNull)
15    };};
16}
17
18pub type AppCheckerNullComponentType = capsules_system::process_checker::basic::AppCheckerNull;
19
20pub struct AppCheckerNullComponent {}
21
22impl AppCheckerNullComponent {
23    pub fn new() -> Self {
24        Self {}
25    }
26}
27
28impl Component for AppCheckerNullComponent {
29    type StaticInput =
30        &'static mut MaybeUninit<capsules_system::process_checker::basic::AppCheckerNull>;
31    type Output = &'static capsules_system::process_checker::basic::AppCheckerNull;
32
33    fn finalize(self, s: Self::StaticInput) -> Self::Output {
34        s.write(capsules_system::process_checker::basic::AppCheckerNull::new())
35    }
36}