From: Julian Seward Date: Sun, 3 Jan 2010 11:39:01 +0000 (+0000) Subject: Portability fix for arm-linux. X-Git-Tag: svn/VALGRIND_3_6_0~428 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c56752a887f9c9fc9845488bed47ed4d39cf9467;p=thirdparty%2Fvalgrind.git Portability fix for arm-linux. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10995 --- diff --git a/none/tests/faultstatus.c b/none/tests/faultstatus.c index fefefe5a2e..a41dfd4422 100644 --- a/none/tests/faultstatus.c +++ b/none/tests/faultstatus.c @@ -9,16 +9,24 @@ #include "tests/sys_mman.h" #include -/* - * 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