sel4_root_task/
printing.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//
// Copyright 2024, Colias Group, LLC
//
// SPDX-License-Identifier: BSD-2-Clause
//

use sel4::sel4_cfg_if;

sel4_cfg_if! {
    if #[sel4_cfg(PRINTING)] {
        use sel4::debug_put_char;
    } else {
        fn debug_put_char(_: u8) {}

        // Create new no-op macros instead of re-exporting from sel4_panicking_env for the sake of
        // performance.

        /// No-op for this configuration.
        #[macro_export]
        macro_rules! debug_print {
            ($($arg:tt)*) => {
                // Avoid unused argument warnings without runtime cost
                if false {
                    drop(format_args!($($arg)*))
                }
            };
        }

        /// No-op for this configuration.
        #[macro_export]
        macro_rules! debug_println {
            ($($arg:tt)*) => {
                // Avoid unused argument warnings without runtime cost
                if false {
                    drop(format_args!($($arg)*))
                }
            };
        }
    }
}

sel4_panicking_env::register_debug_put_char!(
    #[linkage = "weak"]
    debug_put_char
);