-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IA64] utrace syscall.h support for ia64
Add asm/syscall.h for IA64. Utrace requires this. Signed-off-by: Shaohua Li <shaohua.li@intel.com> Signed-off-by: Tony Luck <tony.luck@intel.com>
- Loading branch information
Shaohua Li
authored and
Tony Luck
committed
Oct 6, 2008
1 parent
fec6ed1
commit cfb361f
Showing
3 changed files
with
163 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* | ||
* Access to user system call parameters and results | ||
* | ||
* Copyright (C) 2008 Intel Corp. Shaohua Li <shaohua.li@intel.com> | ||
* | ||
* This copyrighted material is made available to anyone wishing to use, | ||
* modify, copy, or redistribute it subject to the terms and conditions | ||
* of the GNU General Public License v.2. | ||
* | ||
* See asm-generic/syscall.h for descriptions of what we must do here. | ||
*/ | ||
|
||
#ifndef _ASM_SYSCALL_H | ||
#define _ASM_SYSCALL_H 1 | ||
|
||
#include <linux/sched.h> | ||
#include <linux/err.h> | ||
|
||
static inline long syscall_get_nr(struct task_struct *task, | ||
struct pt_regs *regs) | ||
{ | ||
BUG_ON(IS_IA32_PROCESS(regs)); | ||
|
||
if ((long)regs->cr_ifs < 0) /* Not a syscall */ | ||
return -1; | ||
return regs->r15; | ||
} | ||
|
||
static inline void syscall_rollback(struct task_struct *task, | ||
struct pt_regs *regs) | ||
{ | ||
BUG_ON(IS_IA32_PROCESS(regs)); | ||
/* do nothing */ | ||
} | ||
|
||
static inline long syscall_get_error(struct task_struct *task, | ||
struct pt_regs *regs) | ||
{ | ||
BUG_ON(IS_IA32_PROCESS(regs)); | ||
|
||
return regs->r10 == -1 ? regs->r8:0; | ||
} | ||
|
||
static inline long syscall_get_return_value(struct task_struct *task, | ||
struct pt_regs *regs) | ||
{ | ||
BUG_ON(IS_IA32_PROCESS(regs)); | ||
|
||
return regs->r8; | ||
} | ||
|
||
static inline void syscall_set_return_value(struct task_struct *task, | ||
struct pt_regs *regs, | ||
int error, long val) | ||
{ | ||
BUG_ON(IS_IA32_PROCESS(regs)); | ||
|
||
if (error) { | ||
/* error < 0, but ia64 uses > 0 return value */ | ||
regs->r8 = -error; | ||
regs->r10 = -1; | ||
} else { | ||
regs->r8 = val; | ||
regs->r10 = 0; | ||
} | ||
} | ||
|
||
extern void ia64_syscall_get_set_arguments(struct task_struct *task, | ||
struct pt_regs *regs, unsigned int i, unsigned int n, | ||
unsigned long *args, int rw); | ||
static inline void syscall_get_arguments(struct task_struct *task, | ||
struct pt_regs *regs, | ||
unsigned int i, unsigned int n, | ||
unsigned long *args) | ||
{ | ||
BUG_ON(IS_IA32_PROCESS(regs)); | ||
BUG_ON(i + n > 6); | ||
|
||
ia64_syscall_get_set_arguments(task, regs, i, n, args, 0); | ||
} | ||
|
||
static inline void syscall_set_arguments(struct task_struct *task, | ||
struct pt_regs *regs, | ||
unsigned int i, unsigned int n, | ||
unsigned long *args) | ||
{ | ||
BUG_ON(IS_IA32_PROCESS(regs)); | ||
BUG_ON(i + n > 6); | ||
|
||
ia64_syscall_get_set_arguments(task, regs, i, n, args, 1); | ||
} | ||
#endif /* _ASM_SYSCALL_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters