1use super::{VmiOs, impl_ops};
2use crate::{Va, VmiDriver, VmiError, VmiVa};
3
4impl_ops! {
5 ThreadId, u32
7}
8
9impl_ops! {
10 ThreadObject, Va
14}
15
16impl VmiVa for ThreadObject {
17 fn va(&self) -> Va {
18 self.0
19 }
20}
21
22impl ThreadObject {
23 pub fn is_null(&self) -> bool {
25 self.0.0 == 0
26 }
27
28 pub fn to_u64(&self) -> u64 {
30 self.0.0
31 }
32}
33
34pub trait VmiOsThread<'a, Driver>: VmiVa + 'a
38where
39 Driver: VmiDriver,
40{
41 type Os: VmiOs<Driver = Driver>;
43
44 fn id(&self) -> Result<ThreadId, VmiError>;
46
47 fn object(&self) -> Result<ThreadObject, VmiError>;
49}