sel4/
debug.rs

1//
2// Copyright 2023, Colias Group, LLC
3// Copyright (c) 2020 Arm Limited
4//
5// SPDX-License-Identifier: MIT
6//
7
8use crate::{sys, InvocationContext, CapType, cap, Cap};
9
10/// Corresponds to `seL4_DebugSnapshot`.
11pub fn debug_snapshot() {
12    sys::seL4_DebugSnapshot()
13}
14
15impl<C: InvocationContext> cap::Tcb<C> {
16    /// Corresponds to `seL4_DebugNameThread`.
17    pub fn debug_name(self, name: &[u8]) {
18        self.invoke(|cptr, ipc_buffer| {
19            sys::seL4_DebugNameThread(cptr.bits(), name, ipc_buffer.inner_mut())
20        })
21    }
22}
23
24impl<T: CapType> Cap<T> {
25    /// Corresponds to `seL4_DebugCapIdentify`.
26    pub fn debug_identify(self) -> u32 {
27        sys::seL4_DebugCapIdentify(self.bits())
28    }
29}