Blame SOURCES/redhat-lsb-arm.patch

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