Commit 54f79018 authored by Miles Bader's avatar Miles Bader Committed by Linus Torvalds

[PATCH] Make v850 syscall6 macro support both old and new gcc versions

Make v850 syscall6 macro support both old and new gcc versions
parent b9b42b54
...@@ -340,6 +340,30 @@ type name (atype a, btype b, ctype c, dtype d, etype e) \ ...@@ -340,6 +340,30 @@ type name (atype a, btype b, ctype c, dtype d, etype e) \
__syscall_return (type, __ret); \ __syscall_return (type, __ret); \
} }
#if __GNUC__ < 3
/* In older versions of gcc, `asm' statements with more than 10
input/output arguments produce a fatal error. To work around this
problem, we use two versions, one for gcc-3.x and one for earlier
versions of gcc (the `earlier gcc' version doesn't work with gcc-3.x
because gcc-3.x doesn't allow clobbers to also be input arguments). */
#define __SYSCALL6_TRAP(syscall, ret, a, b, c, d, e, f) \
__asm__ __volatile__ ("trap " SYSCALL_LONG_TRAP \
: "=r" (ret), "=r" (syscall) \
: "1" (syscall), \
"r" (a), "r" (b), "r" (c), "r" (d), \
"r" (e), "r" (f) \
: SYSCALL_CLOBBERS, SYSCALL_ARG4, SYSCALL_ARG5);
#else /* __GNUC__ >= 3 */
#define __SYSCALL6_TRAP(syscall, ret, a, b, c, d, e, f) \
__asm__ __volatile__ ("trap " SYSCALL_LONG_TRAP \
: "=r" (ret), "=r" (syscall), \
"=r" (e), "=r" (f) \
: "1" (syscall), \
"r" (a), "r" (b), "r" (c), "r" (d), \
"2" (e), "3" (f) \
: SYSCALL_CLOBBERS);
#endif
#define _syscall6(type, name, atype, a, btype, b, ctype, c, dtype, d, etype, e, ftype, f) \ #define _syscall6(type, name, atype, a, btype, b, ctype, c, dtype, d, etype, e, ftype, f) \
type name (atype a, btype b, ctype c, dtype d, etype e, ftype f) \ type name (atype a, btype b, ctype c, dtype d, etype e, ftype f) \
{ \ { \
...@@ -351,13 +375,7 @@ type name (atype a, btype b, ctype c, dtype d, etype e, ftype f) \ ...@@ -351,13 +375,7 @@ type name (atype a, btype b, ctype c, dtype d, etype e, ftype f) \
register etype __f __asm__ (SYSCALL_ARG5) = f; \ register etype __f __asm__ (SYSCALL_ARG5) = f; \
register unsigned long __syscall __asm__ (SYSCALL_NUM) = __NR_##name; \ register unsigned long __syscall __asm__ (SYSCALL_NUM) = __NR_##name; \
register unsigned long __ret __asm__ (SYSCALL_RET); \ register unsigned long __ret __asm__ (SYSCALL_RET); \
__asm__ __volatile__ ("trap " SYSCALL_LONG_TRAP \ __SYSCALL6_TRAP(__syscall, __ret, __a, __b, __c, __d, __e, __f); \
: "=r" (__ret), "=r" (__syscall), \
"=r" (__e), "=r" (__f) \
: "1" (__syscall), \
"r" (__a), "r" (__b), "r" (__c), "r" (__d), \
"2" (__e), "3" (__f) \
: SYSCALL_CLOBBERS); \
__syscall_return (type, __ret); \ __syscall_return (type, __ret); \
} }
......
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