svn commit: trunk/uClibc/libc/sysdeps/linux/arm/bits

vapier at uclibc.org vapier at uclibc.org
Thu Aug 24 18:49:16 UTC 2006


Author: vapier
Date: 2006-08-24 11:49:16 -0700 (Thu, 24 Aug 2006)
New Revision: 15977

Log:
fixups from psm for ASSEMBLER handling

Modified:
   trunk/uClibc/libc/sysdeps/linux/arm/bits/syscalls.h


Changeset:
Modified: trunk/uClibc/libc/sysdeps/linux/arm/bits/syscalls.h
===================================================================
--- trunk/uClibc/libc/sysdeps/linux/arm/bits/syscalls.h	2006-08-24 18:11:33 UTC (rev 15976)
+++ trunk/uClibc/libc/sysdeps/linux/arm/bits/syscalls.h	2006-08-24 18:49:16 UTC (rev 15977)
@@ -14,12 +14,10 @@
    glibc-2.3.2/sysdeps/unix/sysv/linux/arm/sysdep.h
 */
 
-#ifndef __ASSEMBLER__
+#define SYS_ify(syscall_name)  (__NR_##syscall_name)
 
-#include <errno.h>
+#ifdef __ASSEMBLER__
 
-#define SYS_ify(syscall_name)  (__NR_##syscall_name)
-
 /* 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 @@
 #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 @@
 #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 @@
 #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 @@
 #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 @@
   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)
 




More information about the uClibc-cvs mailing list