You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
411 B
21 lines
411 B
// ANCHOR: handle
|
|
use super::{KernelObject, Rights};
|
|
use alloc::sync::Arc;
|
|
|
|
pub type HandleValue = u32;
|
|
|
|
/// 内核对象句柄
|
|
#[derive(Clone)]
|
|
pub struct Handle {
|
|
pub object: Arc<dyn KernelObject>,
|
|
pub rights: Rights,
|
|
}
|
|
|
|
impl Handle {
|
|
/// 创建一个新句柄
|
|
pub fn new(object: Arc<dyn KernelObject>, rights: Rights) -> Self {
|
|
Handle { object, rights }
|
|
}
|
|
}
|
|
// ANCHOR_END: handle
|