diff options
Diffstat (limited to 'libc/sysdeps/linux/arm/bits')
-rw-r--r-- | libc/sysdeps/linux/arm/bits/syscalls.h | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/libc/sysdeps/linux/arm/bits/syscalls.h b/libc/sysdeps/linux/arm/bits/syscalls.h index 64c625f6d..b1b840586 100644 --- a/libc/sysdeps/linux/arm/bits/syscalls.h +++ b/libc/sysdeps/linux/arm/bits/syscalls.h @@ -14,12 +14,10 @@ glibc-2.3.2/sysdeps/unix/sysv/linux/arm/sysdep.h */ -#ifndef __ASSEMBLER__ - -#include <errno.h> - #define SYS_ify(syscall_name) (__NR_##syscall_name) +#ifdef __ASSEMBLER__ + /* Call a given syscall, with arguments loaded. For EABI, we must save and restore r7 for the syscall number. Unlike the DO_CALL macro in glibc, this macro does not load syscall arguments. */ @@ -34,8 +32,11 @@ #define DO_CALL(syscall_name) \ swi SYS_ify (syscall_name); #endif + #else +#include <errno.h> + #undef _syscall0 #define _syscall0(type,name) \ type name(void) \ @@ -114,10 +115,10 @@ return (type) (INLINE_SYSCALL(name, 7, arg1, arg2, arg3, arg4, arg5, arg6, arg7) #define INTERNAL_SYSCALL(name, err, nr, args...) \ ({unsigned int _sys_result; \ { \ - register int _a1 asm ("r0"), _nr asm ("r7"); \ + register int _a1 __asm__ ("r0"), _nr __asm__ ("r7"); \ LOAD_ARGS_##nr (args) \ _nr = SYS_ify(name); \ - asm volatile ("swi 0x0 @ syscall " #name \ + __asm__ volatile ("swi 0x0 @ syscall " #name \ : "=r" (_a1) \ : "r" (_nr) ASM_ARGS_##nr \ : "memory"); \ @@ -129,9 +130,9 @@ return (type) (INLINE_SYSCALL(name, 7, arg1, arg2, arg3, arg4, arg5, arg6, arg7) #define INTERNAL_SYSCALL(name, err, nr, args...) \ ({ unsigned int _sys_result; \ { \ - register int _a1 asm ("a1"); \ + register int _a1 __asm__ ("a1"); \ LOAD_ARGS_##nr (args) \ - asm volatile ("swi %1 @ syscall " #name \ + __asm__ volatile ("swi %1 @ syscall " #name \ : "=r" (_a1) \ : "i" (SYS_ify(name)) ASM_ARGS_##nr \ : "memory"); \ @@ -147,10 +148,10 @@ return (type) (INLINE_SYSCALL(name, 7, arg1, arg2, arg3, arg4, arg5, arg6, arg7) #define INTERNAL_SYSCALL(name, err, nr, args...) \ ({ unsigned int _sys_result; \ { \ - register int _a1 asm ("a1"); \ + register int _a1 __asm__ ("a1"); \ LOAD_ARGS_##nr (args) \ - register int _r7 asm ("r7") = (int) (SYS_ify(name)); \ - asm volatile ("swi 0 @ syscall " #name \ + register int _r7 __asm__ ("r7") = (int) (SYS_ify(name)); \ + __asm__ volatile ("swi 0 @ syscall " #name \ : "=r" (_a1) \ : "r" (_r7) ASM_ARGS_##nr \ : "memory"); \ @@ -165,10 +166,10 @@ return (type) (INLINE_SYSCALL(name, 7, arg1, arg2, arg3, arg4, arg5, arg6, arg7) #define INTERNAL_SYSCALL(name, err, nr, args...) \ ({ unsigned int _sys_result; \ { \ - register int _a1 asm ("a1"); \ + register int _a1 __asm__ ("a1"); \ LOAD_ARGS_##nr (args) \ - register int _v3 asm ("v3") = (int) (SYS_ify(name)); \ - asm volatile ("push {r7}\n" \ + register int _v3 __asm__ ("v3") = (int) (SYS_ify(name)); \ + __asm__ volatile ("push {r7}\n" \ "\tmov r7, v3\n" \ "\tswi 0 @ syscall " #name "\n" \ "\tpop {r7}" \ @@ -196,27 +197,27 @@ return (type) (INLINE_SYSCALL(name, 7, arg1, arg2, arg3, arg4, arg5, arg6, arg7) LOAD_ARGS_0 () #define ASM_ARGS_1 ASM_ARGS_0, "r" (_a1) #define LOAD_ARGS_2(a1, a2) \ - register int _a2 asm ("a2") = (int) (a2); \ + register int _a2 __asm__ ("a2") = (int) (a2); \ LOAD_ARGS_1 (a1) #define ASM_ARGS_2 ASM_ARGS_1, "r" (_a2) #define LOAD_ARGS_3(a1, a2, a3) \ - register int _a3 asm ("a3") = (int) (a3); \ + register int _a3 __asm__ ("a3") = (int) (a3); \ LOAD_ARGS_2 (a1, a2) #define ASM_ARGS_3 ASM_ARGS_2, "r" (_a3) #define LOAD_ARGS_4(a1, a2, a3, a4) \ - register int _a4 asm ("a4") = (int) (a4); \ + register int _a4 __asm__ ("a4") = (int) (a4); \ LOAD_ARGS_3 (a1, a2, a3) #define ASM_ARGS_4 ASM_ARGS_3, "r" (_a4) #define LOAD_ARGS_5(a1, a2, a3, a4, a5) \ - register int _v1 asm ("v1") = (int) (a5); \ + register int _v1 __asm__ ("v1") = (int) (a5); \ LOAD_ARGS_4 (a1, a2, a3, a4) #define ASM_ARGS_5 ASM_ARGS_4, "r" (_v1) #define LOAD_ARGS_6(a1, a2, a3, a4, a5, a6) \ - register int _v2 asm ("v2") = (int) (a6); \ + register int _v2 __asm__ ("v2") = (int) (a6); \ LOAD_ARGS_5 (a1, a2, a3, a4, a5) #define ASM_ARGS_6 ASM_ARGS_5, "r" (_v2) #define LOAD_ARGS_7(a1, a2, a3, a4, a5, a6, a7) \ - register int _v3 asm ("v3") = (int) (a7); \ + register int _v3 __asm__ ("v3") = (int) (a7); \ LOAD_ARGS_6 (a1, a2, a3, a4, a5, a6) #define ASM_ARGS_7 ASM_ARGS_6, "r" (_v3) |