Add mutable functionality to the process VMAR

This commit is contained in:
Chen Chengjun
2025-03-17 10:53:56 +08:00
committed by Tate, Hongliang Tian
parent 248b24fb4e
commit 2a20f6b59a
15 changed files with 119 additions and 63 deletions

View File

@ -130,7 +130,7 @@ pub(super) fn read_linux_sched_attr_from_user(
) -> Result<LinuxSchedAttr> {
let type_size = mem::size_of::<LinuxSchedAttr>();
let space = CurrentUserSpace::new(ctx.task);
let space = ctx.user_space();
let mut attr = LinuxSchedAttr::default();
@ -160,7 +160,7 @@ pub(super) fn write_linux_sched_attr_to_user(
user_size: u32,
ctx: &Context,
) -> Result<()> {
let space = CurrentUserSpace::new(ctx.task);
let space = ctx.user_space();
attr.size = (mem::size_of::<LinuxSchedAttr>() as u32).min(user_size);

View File

@ -10,7 +10,7 @@ pub fn sys_sched_getparam(tid: Tid, addr: Vaddr, ctx: &Context) -> Result<Syscal
_ => 0,
};
let space = CurrentUserSpace::new(ctx.task);
let space = ctx.user_space();
space
.write_val(addr, &rt_prio)
.map_err(|_| Error::new(Errno::EINVAL))?;

View File

@ -4,7 +4,7 @@ use super::{sched_getattr::access_sched_attr_with, SyscallReturn};
use crate::{prelude::*, sched::SchedPolicy, thread::Tid};
pub fn sys_sched_setparam(tid: Tid, addr: Vaddr, ctx: &Context) -> Result<SyscallReturn> {
let space = CurrentUserSpace::new(ctx.task);
let space = ctx.user_space();
let prio: i32 = space
.read_val(addr)
.map_err(|_| Error::new(Errno::EINVAL))?;

View File

@ -12,7 +12,7 @@ pub fn sys_sched_setscheduler(
addr: Vaddr,
ctx: &Context,
) -> Result<SyscallReturn> {
let space = CurrentUserSpace::new(&ctx.task);
let space = ctx.user_space();
let prio = space
.read_val(addr)
.map_err(|_| Error::new(Errno::EINVAL))?;