mirror of
https://github.com/hexagonal-sun/moss-kernel.git
synced 2026-04-21 15:48:39 -04:00
Replace `CUR_TASK_PTR` with `ProcessCtx`. This allows differentiation between functions that access process context (take in `ProcessCtx` as a parameter) and those that don't. When creating a new class of scheduleable tasks (softirqs, kthreads), this ensure that those functions cannot call context-sensitive functions.
15 lines
363 B
Rust
15 lines
363 B
Rust
use core::convert::Infallible;
|
|
|
|
use crate::sched::syscall_ctx::ProcessCtx;
|
|
|
|
pub fn sys_umask(ctx: &ProcessCtx, new_umask: u32) -> core::result::Result<usize, Infallible> {
|
|
let task = ctx.shared();
|
|
let mut umask_guard = task.process.umask.lock_save_irq();
|
|
|
|
let old_umask = *umask_guard;
|
|
|
|
*umask_guard = new_umask & 0o777;
|
|
|
|
Ok(old_umask as _)
|
|
}
|