]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Portability fix for arm-linux.
authorJulian Seward <jseward@acm.org>
Sun, 3 Jan 2010 11:39:01 +0000 (11:39 +0000)
committerJulian Seward <jseward@acm.org>
Sun, 3 Jan 2010 11:39:01 +0000 (11:39 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10995

none/tests/faultstatus.c

index fefefe5a2e865af0db367541b6d0e384baa63d5c..a41dfd4422ed3453fb1c40a6a75257d238e3d9d6 100644 (file)
@@ -9,16 +9,24 @@
 #include "tests/sys_mman.h"
 #include <unistd.h>
 
-/*
- * Division by zero triggers a SIGFPE on x86 and x86_64,
- * but not on the PowerPC architecture.
+/* Division by zero triggers a SIGFPE on x86 and x86_64,
+   but not on the PowerPC architecture.
+
+   On ARM-Linux, we do get a SIGFPE, but not from the faulting of a
+   division instruction (there isn't any such thing) but rather
+   because the process exits via tgkill, sending itself a SIGFPE.
+   Hence we get a SIGFPE but the SI_CODE is different from that on
+   x86/amd64-linux.
  */
 #if defined(__powerpc__)
-#define DIVISION_BY_ZERO_TRIGGERS_FPE 0
-#define DIVISION_BY_ZERO_SI_CODE      SI_TKILL
+#  define DIVISION_BY_ZERO_TRIGGERS_FPE 0
+#  define DIVISION_BY_ZERO_SI_CODE      SI_TKILL
+#elif defined(__arm__)
+#  define DIVISION_BY_ZERO_TRIGGERS_FPE 1
+#  define DIVISION_BY_ZERO_SI_CODE      SI_TKILL
 #else
-#define DIVISION_BY_ZERO_TRIGGERS_FPE 1
-#define DIVISION_BY_ZERO_SI_CODE      FPE_INTDIV
+#  define DIVISION_BY_ZERO_TRIGGERS_FPE 1
+#  define DIVISION_BY_ZERO_SI_CODE      FPE_INTDIV
 #endif