|
From: <sv...@va...> - 2010-01-03 11:39:10
|
Author: sewardj Date: 2010-01-03 11:39:01 +0000 (Sun, 03 Jan 2010) New Revision: 10995 Log: Portability fix for arm-linux. Modified: trunk/none/tests/faultstatus.c Modified: trunk/none/tests/faultstatus.c =================================================================== --- trunk/none/tests/faultstatus.c 2010-01-03 11:29:35 UTC (rev 10994) +++ trunk/none/tests/faultstatus.c 2010-01-03 11:39:01 UTC (rev 10995) @@ -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 |