Skip to content

Commit af42d25

Browse files
committed
parisc: Clean up unistd.h file
Clean up the internal unistd.h file, so that syscallX() can be used internally to call syscalls from userspace. This is used later by the vDSO C-code. Signed-off-by: Helge Deller <[email protected]>
1 parent 6ba59ff commit af42d25

File tree

1 file changed

+15
-39
lines changed

1 file changed

+15
-39
lines changed

arch/parisc/include/asm/unistd.h

Lines changed: 15 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* sysdeps/unix/sysv/linux/hppa/sysdep.h
2121
*/
2222

23-
#ifdef PIC
23+
#ifndef DONT_USE_PIC
2424
/* WARNING: CANNOT BE USED IN A NOP! */
2525
# define K_STW_ASM_PIC " copy %%r19, %%r4\n"
2626
# define K_LDW_ASM_PIC " copy %%r4, %%r19\n"
@@ -43,7 +43,7 @@
4343
across the syscall. */
4444

4545
#define K_CALL_CLOB_REGS "%r1", "%r2", K_USING_GR4 \
46-
"%r20", "%r29", "%r31"
46+
"%r20", "%r29", "%r31"
4747

4848
#undef K_INLINE_SYSCALL
4949
#define K_INLINE_SYSCALL(name, nr, args...) ({ \
@@ -58,7 +58,7 @@
5858
" ldi %1, %%r20\n" \
5959
K_LDW_ASM_PIC \
6060
: "=r" (__res) \
61-
: "i" (SYS_ify(name)) K_ASM_ARGS_##nr \
61+
: "i" (name) K_ASM_ARGS_##nr \
6262
: "memory", K_CALL_CLOB_REGS K_CLOB_ARGS_##nr \
6363
); \
6464
__sys_res = (long)__res; \
@@ -104,42 +104,18 @@
104104
#define K_CLOB_ARGS_1 K_CLOB_ARGS_2, "%r25"
105105
#define K_CLOB_ARGS_0 K_CLOB_ARGS_1, "%r26"
106106

107-
#define _syscall0(type,name) \
108-
type name(void) \
109-
{ \
110-
return K_INLINE_SYSCALL(name, 0); \
111-
}
112-
113-
#define _syscall1(type,name,type1,arg1) \
114-
type name(type1 arg1) \
115-
{ \
116-
return K_INLINE_SYSCALL(name, 1, arg1); \
117-
}
118-
119-
#define _syscall2(type,name,type1,arg1,type2,arg2) \
120-
type name(type1 arg1, type2 arg2) \
121-
{ \
122-
return K_INLINE_SYSCALL(name, 2, arg1, arg2); \
123-
}
124-
125-
#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
126-
type name(type1 arg1, type2 arg2, type3 arg3) \
127-
{ \
128-
return K_INLINE_SYSCALL(name, 3, arg1, arg2, arg3); \
129-
}
130-
131-
#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
132-
type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
133-
{ \
134-
return K_INLINE_SYSCALL(name, 4, arg1, arg2, arg3, arg4); \
135-
}
136-
137-
/* select takes 5 arguments */
138-
#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
139-
type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
140-
{ \
141-
return K_INLINE_SYSCALL(name, 5, arg1, arg2, arg3, arg4, arg5); \
142-
}
107+
#define syscall0(name) \
108+
K_INLINE_SYSCALL(name, 0)
109+
#define syscall1(name, arg1) \
110+
K_INLINE_SYSCALL(name, 1, arg1)
111+
#define syscall2(name, arg1, arg2) \
112+
K_INLINE_SYSCALL(name, 2, arg1, arg2)
113+
#define syscall3(name, arg1, arg2, arg3) \
114+
K_INLINE_SYSCALL(name, 3, arg1, arg2, arg3)
115+
#define syscall4(name, arg1, arg2, arg3, arg4) \
116+
K_INLINE_SYSCALL(name, 4, arg1, arg2, arg3, arg4)
117+
#define syscall5(name, arg1, arg2, arg3, arg4, arg5) \
118+
K_INLINE_SYSCALL(name, 5, arg1, arg2, arg3, arg4, arg5)
143119

144120
#define __ARCH_WANT_NEW_STAT
145121
#define __ARCH_WANT_STAT64

0 commit comments

Comments
 (0)