/* * Access to user system call parameters and results * * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. * * See asm-generic/syscall.h for descriptions of what we must do here. * * Copyright (C) 2012 Ralf Baechle <ralf@linux-mips.org>
*/
staticinlinevoid syscall_set_nr(struct task_struct *task, struct pt_regs *regs, int nr)
{ /* * New syscall number has to be assigned to regs[2] because * it is loaded from there unconditionally after return from * syscall_trace_enter() invocation. * * Consequently, if the syscall was indirect and nr != __NR_syscall, * then after this assignment the syscall will cease to be indirect.
*/
task_thread_info(task)->syscall = regs->regs[2] = nr;
}
staticinlinevoid mips_syscall_update_nr(struct task_struct *task, struct pt_regs *regs)
{ /* * v0 is the system call number, except for O32 ABI syscall(), where it * ends up in a0.
*/ if (mips_syscall_is_indirect(task, regs))
task_thread_info(task)->syscall = regs->regs[4]; else
task_thread_info(task)->syscall = regs->regs[2];
}
staticinlinevoid mips_get_syscall_arg(unsignedlong *arg, struct task_struct *task, struct pt_regs *regs, unsignedint n)
{ #ifdef CONFIG_32BIT switch (n) { case 0: case 1: case 2: case 3:
*arg = regs->regs[4 + n]; return; case 4: case 5: case 6: case 7:
*arg = regs->args[n]; return;
} #else
*arg = regs->regs[4 + n]; if ((IS_ENABLED(CONFIG_MIPS32_O32) &&
test_tsk_thread_flag(task, TIF_32BIT_REGS)))
*arg = (unsignedint)*arg; #endif
}
staticinlinevoid mips_set_syscall_arg(unsignedlong *arg, struct task_struct *task, struct pt_regs *regs, unsignedint n)
{ #ifdef CONFIG_32BIT switch (n) { case 0: case 1: case 2: case 3:
regs->regs[4 + n] = *arg; return; case 4: case 5: case 6: case 7:
*arg = regs->args[n] = *arg; return;
} #else
regs->regs[4 + n] = *arg; #endif
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.