#define _LINUX_ARM_SYSDEP_H 1
#include <common/sysdep.h>
+#include <bits/arm_asm.h>
#include <sys/syscall.h>
/* For Linux we can use the system call table in the header file
#define ret_ERRVAL PSEUDO_RET_NOERRNO
-#if NOT_IN_libc
+#if defined NOT_IN_libc
# define SYSCALL_ERROR __local_syscall_error
# ifdef RTLD_PRIVATE_ERRNO
# define SYSCALL_ERROR_HANDLER \
/* Define a macro which expands into the inline wrapper code for a system
call. */
#undef INLINE_SYSCALL
-#define INLINE_SYSCALL(name, nr, args...) \
- ({ unsigned int _sys_result = INTERNAL_SYSCALL (name, , nr, args); \
- if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (_sys_result, ), 0)) \
- { \
- __set_errno (INTERNAL_SYSCALL_ERRNO (_sys_result, )); \
- _sys_result = (unsigned int) -1; \
- } \
- (int) _sys_result; })
+#define INLINE_SYSCALL(name, nr, args...) \
+ ({ unsigned int _inline_sys_result = INTERNAL_SYSCALL (name, , nr, args); \
+ if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (_inline_sys_result, ), 0)) \
+ { \
+ __set_errno (INTERNAL_SYSCALL_ERRNO (_inline_sys_result, )); \
+ _inline_sys_result = (unsigned int) -1; \
+ } \
+ (int) _inline_sys_result; })
#undef INTERNAL_SYSCALL_DECL
#define INTERNAL_SYSCALL_DECL(err) do { } while (0)
* unwinding (ie. thread cancellation).
*/
#define INTERNAL_SYSCALL_RAW(name, err, nr, args...) \
- ({ unsigned int _sys_result; \
+ ({ unsigned int _internal_sys_result; \
{ \
int _sys_buf[2]; \
- register int _a1 __asm__ ("a1"); \
+ register int __a1 __asm__ ("a1"); \
register int *_v3 __asm__ ("v3") = _sys_buf; \
LOAD_ARGS_##nr (args) \
*_v3 = (int) (name); \
"\tldr r7, [v3]\n" \
"\tswi 0 @ syscall " #name "\n" \
"\tldr r7, [v3, #4]" \
- : "=r" (_a1) \
+ : "=r" (__a1) \
: "r" (_v3) ASM_ARGS_##nr \
: "memory"); \
- _sys_result = _a1; \
+ _internal_sys_result = __a1; \
} \
- (int) _sys_result; })
+ (int) _internal_sys_result; })
#elif defined(__ARM_EABI__)
#define INTERNAL_SYSCALL_RAW(name, err, nr, args...) \
- ({unsigned int _sys_result; \
+ ({unsigned int _internal_sys_result; \
{ \
- register int _a1 __asm__ ("r0"), _nr __asm__ ("r7"); \
+ register int __a1 __asm__ ("r0"), _nr __asm__ ("r7"); \
LOAD_ARGS_##nr (args) \
_nr = name; \
__asm__ __volatile__ ("swi 0x0 @ syscall " #name \
- : "=r" (_a1) \
+ : "=r" (__a1) \
: "r" (_nr) ASM_ARGS_##nr \
: "memory"); \
- _sys_result = _a1; \
+ _internal_sys_result = __a1; \
} \
- (int) _sys_result; })
+ (int) _internal_sys_result; })
#else /* !defined(__ARM_EABI__) */
#define INTERNAL_SYSCALL_RAW(name, err, nr, args...) \
- ({ unsigned int _sys_result; \
+ ({ unsigned int _internal_sys_result; \
{ \
- register int _a1 __asm__ ("a1"); \
+ register int __a1 __asm__ ("a1"); \
LOAD_ARGS_##nr (args) \
__asm__ __volatile__ ("swi %1 @ syscall " #name \
- : "=r" (_a1) \
+ : "=r" (__a1) \
: "i" (name) ASM_ARGS_##nr \
: "memory"); \
- _sys_result = _a1; \
+ _internal_sys_result = __a1; \
} \
- (int) _sys_result; })
+ (int) _internal_sys_result; })
#endif
#undef INTERNAL_SYSCALL