Commit 40e03b6857051ea61ebdb4a53e65485acfb1d98e
Committed by
Kyle McMartin
1 parent
ecd3d4bc06
Exists in
master
and in
39 other branches
parisc: add skeleton syscall.h
Needed for lib/syscall.c when HAVE_ARCH_TRACEHOOK. Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>
Showing 2 changed files with 44 additions and 1 deletions Side-by-side Diff
arch/parisc/include/asm/ptrace.h
... | ... | @@ -59,9 +59,12 @@ |
59 | 59 | #define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0) |
60 | 60 | #define user_space(regs) (((regs)->iasq[1] != 0) ? 1 : 0) |
61 | 61 | #define instruction_pointer(regs) ((regs)->iaoq[0] & ~3) |
62 | +#define user_stack_pointer(regs) ((regs)->gr[30]) | |
62 | 63 | unsigned long profile_pc(struct pt_regs *); |
63 | 64 | extern void show_regs(struct pt_regs *); |
64 | -#endif | |
65 | + | |
66 | + | |
67 | +#endif /* __KERNEL__ */ | |
65 | 68 | |
66 | 69 | #endif |
arch/parisc/include/asm/syscall.h
1 | +/* syscall.h */ | |
2 | + | |
3 | +#ifndef _ASM_PARISC_SYSCALL_H_ | |
4 | +#define _ASM_PARISC_SYSCALL_H_ | |
5 | + | |
6 | +#include <linux/err.h> | |
7 | +#include <asm/ptrace.h> | |
8 | + | |
9 | +static inline long syscall_get_nr(struct task_struct *tsk, | |
10 | + struct pt_regs *regs) | |
11 | +{ | |
12 | + return regs->gr[20]; | |
13 | +} | |
14 | + | |
15 | +static inline void syscall_get_arguments(struct task_struct *tsk, | |
16 | + struct pt_regs *regs, unsigned int i, | |
17 | + unsigned int n, unsigned long *args) | |
18 | +{ | |
19 | + BUG_ON(i); | |
20 | + | |
21 | + switch (n) { | |
22 | + case 6: | |
23 | + args[5] = regs->gr[21]; | |
24 | + case 5: | |
25 | + args[4] = regs->gr[22]; | |
26 | + case 4: | |
27 | + args[3] = regs->gr[23]; | |
28 | + case 3: | |
29 | + args[2] = regs->gr[24]; | |
30 | + case 2: | |
31 | + args[1] = regs->gr[25]; | |
32 | + case 1: | |
33 | + args[0] = regs->gr[26]; | |
34 | + break; | |
35 | + default: | |
36 | + BUG(); | |
37 | + } | |
38 | +} | |
39 | + | |
40 | +#endif /*_ASM_PARISC_SYSCALL_H_*/ |