/* SPDX-License-Identifier: GPL-2.0-only */ /* * Access to user system call parameters and results * * Copyright (C) 2008-2009 Red Hat, Inc. All rights reserved. * * See asm-generic/syscall.h for descriptions of what we must do here.
*/
/* This is used purely for kernel/trace/trace_syscalls.c */ typedeflong (*sys_call_ptr_t)(conststruct pt_regs *); externconst sys_call_ptr_t sys_call_table[];
/* * These may not exist, but still put the prototypes in so we * can use IS_ENABLED().
*/ externlong ia32_sys_call(conststruct pt_regs *, unsignedint nr); externlong x32_sys_call(conststruct pt_regs *, unsignedint nr); externlong x64_sys_call(conststruct pt_regs *, unsignedint nr);
/* * Only the low 32 bits of orig_ax are meaningful, so we return int. * This importantly ignores the high bits on 64-bit, so comparisons * sign-extend the low 32 bits.
*/ staticinlineint syscall_get_nr(struct task_struct *task, struct pt_regs *regs)
{ return regs->orig_ax;
}
staticinlinelong syscall_get_error(struct task_struct *task, struct pt_regs *regs)
{ unsignedlong error = regs->ax; #ifdef CONFIG_IA32_EMULATION /* * TS_COMPAT is set for 32-bit syscall entries and then * remains set until we return to user mode.
*/ if (task->thread_info.status & (TS_COMPAT|TS_I386_REGS_POKED)) /* * Sign-extend the value so (int)-EFOO becomes (long)-EFOO * and will match correctly in comparisons.
*/
error = (long) (int) error; #endif return IS_ERR_VALUE(error) ? error : 0;
}
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.