mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-20 13:06:33 +00:00
Add mutable functionality to the process VMAR
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
248b24fb4e
commit
2a20f6b59a
@ -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);
|
||||
|
||||
|
@ -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))?;
|
||||
|
@ -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))?;
|
||||
|
@ -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))?;
|
||||
|
Reference in New Issue
Block a user