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
//
// Copyright 2023, Colias Group, LLC
// Copyright (c) 2020 Arm Limited
//
// SPDX-License-Identifier: MIT
//

use crate::{sys, InvocationContext, CapType, cap, Cap};

/// Corresponds to `seL4_DebugSnapshot`.
pub fn debug_snapshot() {
    sys::seL4_DebugSnapshot()
}

impl<C: InvocationContext> cap::Tcb<C> {
    /// Corresponds to `seL4_DebugNameThread`.
    pub fn debug_name(self, name: &[u8]) {
        self.invoke(|cptr, ipc_buffer| {
            sys::seL4_DebugNameThread(cptr.bits(), name, ipc_buffer.inner_mut())
        })
    }
}

impl<T: CapType> Cap<T> {
    /// Corresponds to `seL4_DebugCapIdentify`.
    pub fn debug_identify(self) -> u32 {
        sys::seL4_DebugCapIdentify(self.bits())
    }
}