Commit 4a573a28 authored by David Mosberger's avatar David Mosberger

ia64: Move force_successful_syscall_return() from ptrace.h to unistd.h.

parent 4c83347c
......@@ -2,7 +2,7 @@
* This file contains various system calls that have different calling
* conventions on different platforms.
*
* Copyright (C) 1999-2000, 2002 Hewlett-Packard Co
* Copyright (C) 1999-2000, 2002-2003 Hewlett-Packard Co
* David Mosberger-Tang <davidm@hpl.hp.com>
*/
#include <linux/config.h>
......@@ -20,6 +20,7 @@
#include <asm/shmparam.h>
#include <asm/uaccess.h>
#include <asm/unistd.h>
unsigned long
arch_get_unmapped_area (struct file *filp, unsigned long addr, unsigned long len,
......
......@@ -259,12 +259,6 @@ struct switch_stack {
extern void ia64_increment_ip (struct pt_regs *pt);
extern void ia64_decrement_ip (struct pt_regs *pt);
static inline void
force_successful_syscall_return (void)
{
ia64_task_regs(current)->r8 = 0;
}
#endif /* !__KERNEL__ */
/* pt_all_user_regs is used for PTRACE_GETREGS PTRACE_SETREGS */
......
......@@ -247,6 +247,8 @@
#define __NR_sys_clock_getres 1255
#define __NR_sys_clock_nanosleep 1256
#ifdef __KERNEL__
#define NR_syscalls 256 /* length of syscall table */
#if !defined(__ASSEMBLY__) && !defined(ASSEMBLER)
......@@ -347,6 +349,8 @@ waitpid (int pid, int *wait_stat, int flags)
#endif /* __KERNEL_SYSCALLS__ */
#include <asm/ptrace.h>
/*
* "Conditional" syscalls
*
......@@ -355,5 +359,20 @@ waitpid (int pid, int *wait_stat, int flags)
*/
#define cond_syscall(x) asm(".weak\t" #x "\n\t.set\t" #x ",sys_ni_syscall");
/*
* System call handlers that, upon successful completion, need to return a negative value
* should call force_successful_syscall_return() right before returning. On architectures
* where the syscall convention provides for a separate error flag (e.g., alpha, ia64,
* ppc{,64}, sparc{,64}, possibly others), this macro can be used to ensure that the error
* flag will not get set. On architectures which do not support a separate error flag,
* the macro is a no-op and the spurious error condition needs to be filtered out by some
* other means (e.g., in user-level, by passing an extra argument to the syscall handler,
* or something along those lines).
*
* On ia64, we can clear the user's pt_regs->r8 to force a successful syscall.
*/
#define force_successful_syscall_return() (ia64_task_regs(current)->r8 = 0)
#endif /* !__ASSEMBLY__ */
#endif /* __KERNEL__ */
#endif /* _ASM_IA64_UNISTD_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment