feat: add Platform::map_shared and wire memory delegation to page mapping
This commit is contained in:
@@ -39,10 +39,22 @@ impl<P: Platform> Kernel<P> {
|
||||
Err(e) => return SyscallOutcome::Complete(SyscallResult::Error(e)),
|
||||
};
|
||||
|
||||
match self.grant_cap(target_pid, resource, restricted) {
|
||||
Ok(_) => SyscallOutcome::Complete(SyscallResult::Ok),
|
||||
Err(e) => SyscallOutcome::Complete(SyscallResult::Error(e)),
|
||||
if let Err(e) = self.grant_cap(target_pid, resource.clone(), restricted) {
|
||||
return SyscallOutcome::Complete(SyscallResult::Error(e));
|
||||
}
|
||||
|
||||
if let domain::resource::Resource::Memory(region_id) = &resource {
|
||||
if let Some(region) = self.regions.get(*region_id) {
|
||||
self.platform.map_shared(
|
||||
target_pid,
|
||||
region.base(),
|
||||
region.size(),
|
||||
restricted,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
SyscallOutcome::Complete(SyscallResult::Ok)
|
||||
}
|
||||
|
||||
pub(crate) fn handle_revoke(
|
||||
|
||||
Reference in New Issue
Block a user