feat(kernel): add Delegate syscall for capability delegation

This commit is contained in:
2026-10-18 00:22:37 +02:00
parent 07534e52d9
commit ae6023081a
4 changed files with 115 additions and 0 deletions

View File

@@ -193,4 +193,19 @@ impl<P: Platform> Kernel<P> {
}
self.scheduler.remove(tid);
}
#[cfg(test)]
pub fn create_endpoint_for_test(&mut self) -> types::id::EndpointId {
self.endpoints.create().expect("create endpoint")
}
#[cfg(test)]
pub fn grant_cap_for_test(
&mut self,
pid: ProcessId,
resource: Resource,
permissions: PermissionSet,
) -> CapSlot {
self.grant_cap(pid, resource, permissions).expect("grant cap")
}
}