Blame SOURCES/redhat-lsb-arm.patch

bcef3c
--- redhat-lsb-3.2.orig/redhat_lsb_trigger.c	2008-04-16 13:50:14.000000000 -0400
bcef3c
+++ redhat-lsb-3.2/redhat_lsb_trigger.c	2009-02-03 04:39:06.000000000 -0500
bcef3c
@@ -223,6 +223,42 @@ register void *__thread_self __asm ("g7"
bcef3c
 # define ASMFMT_1 , "0" (gpr2)
bcef3c
 # define ASMFMT_2 , "0" (gpr2), "d" (gpr3)
bcef3c
 # define ASMFMT_3 , "0" (gpr2), "d" (gpr3), "d" (gpr4)
bcef3c
+#elif defined __arm__
bcef3c
+# if defined (__ARM_EABI__)
bcef3c
+#undef INTERNAL_SYSCALL_DECL
bcef3c
+#define INTERNAL_SYSCALL_DECL(err) do { } while (0)
bcef3c
+#undef INTERNAL_SYSCALL_RAW
bcef3c
+#define INTERNAL_SYSCALL_RAW(name, err, nr, args...)		\
bcef3c
+  ({								\
bcef3c
+       register int _a1 asm ("r0"), _nr asm ("r7");		\
bcef3c
+       LOAD_ARGS_##nr (args)					\
bcef3c
+       _nr = name;						\
bcef3c
+       asm volatile ("swi	0x0	@ syscall " #name	\
bcef3c
+		     : "=r" (_a1)				\
bcef3c
+		     : "r" (_nr) ASM_ARGS_##nr			\
bcef3c
+		     : "memory");				\
bcef3c
+       _a1; })
bcef3c
+
bcef3c
+#undef INTERNAL_SYSCALL
bcef3c
+#define INTERNAL_SYSCALL(name, err, nr, args...)		\
bcef3c
+	INTERNAL_SYSCALL_RAW(SYS_ify(name), err, nr, args)
bcef3c
+
bcef3c
+#define LOAD_ARGS_0()
bcef3c
+#define ASM_ARGS_0
bcef3c
+#define LOAD_ARGS_1(a1)				\
bcef3c
+  int _a1tmp = (int) (a1);			\
bcef3c
+  LOAD_ARGS_0 ()				\
bcef3c
+  _a1 = _a1tmp;
bcef3c
+#define ASM_ARGS_1	ASM_ARGS_0, "r" (_a1)
bcef3c
+#define LOAD_ARGS_2(a1, a2)			\
bcef3c
+  int _a2tmp = (int) (a2);			\
bcef3c
+  LOAD_ARGS_1 (a1)				\
bcef3c
+  register int _a2 asm ("a2") = _a2tmp;
bcef3c
+#define ASM_ARGS_2	ASM_ARGS_1, "r" (_a2)
bcef3c
+#undef SYS_ify
bcef3c
+#define SWI_BASE  (0x900000)
bcef3c
+#define SYS_ify(syscall_name)	(__NR_##syscall_name)
bcef3c
+#endif
bcef3c
 #elif defined __sparc__
bcef3c
 # ifndef __arch64__
bcef3c
 #  define __INTERNAL_SYSCALL_STRING					\