summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2018-06-22 14:18:43 -0400
committerMike Blumenkrantz <zmike@samsung.com>2018-06-22 14:18:43 -0400
commitb60a9999ca760b229baaa9261efae80cb832066d (patch)
tree1c23f4ee06a9446110d0eaa9433b8d35cd031b8e
parentcd20ca85f42aed4f883b9b1d729d90e13d374c45 (diff)
evas/cpu: rework SIGILL code for non-x86 (and fix windows build)
Summary: the previous patch which improved this code for x86 archs broke compiling for non-x86 and, coincidentally, for windows builds on x86 due to some unusual #ifdef blocks this attempts to restore handling on non-x86 and adds additional #ifdefs for functions which did not build on windows due to removed code ref 6b1ab3cd9c7e19908690e9e913df7504cc8ae7c8 Reviewers: ManMower, devilhorns Reviewed By: ManMower Subscribers: cedric, #committers Tags: #efl Maniphest Tasks: T7062 Differential Revision: https://phab.enlightenment.org/D6368
-rw-r--r--src/lib/evas/common/evas_cpu.c30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/lib/evas/common/evas_cpu.c b/src/lib/evas/common/evas_cpu.c
index 2aef0af26b..6283d97f39 100644
--- a/src/lib/evas/common/evas_cpu.c
+++ b/src/lib/evas/common/evas_cpu.c
@@ -5,17 +5,32 @@
5#endif 5#endif
6#endif 6#endif
7 7
8static int cpu_feature_mask = 0;
9
10
11#ifdef BUILD_ALTIVEC
12# ifdef __POWERPC__
13# ifdef __VEC__
14# define NEED_FEATURE_TEST
15# endif
16# endif
17#endif
18#ifdef __SPARC__
19# define NEED_FEATURE_TEST
20#endif
21#if defined(__ARM_ARCH__)
22# ifdef BUILD_NEON
23# define NEED_FEATURE_TEST
24# endif
25#endif
26
27#ifdef NEED_FEATURE_TEST
8#if defined (HAVE_STRUCT_SIGACTION) && defined (HAVE_SIGLONGJMP) 28#if defined (HAVE_STRUCT_SIGACTION) && defined (HAVE_SIGLONGJMP)
9#include <signal.h> 29#include <signal.h>
10#include <setjmp.h> 30#include <setjmp.h>
11#include <errno.h> 31#include <errno.h>
12 32
13static sigjmp_buf detect_buf; 33static sigjmp_buf detect_buf;
14#endif
15
16static int cpu_feature_mask = 0;
17
18#if defined (HAVE_STRUCT_SIGACTION) && defined (HAVE_SIGLONGJMP)
19static void evas_common_cpu_catch_ill(int sig); 34static void evas_common_cpu_catch_ill(int sig);
20static void evas_common_cpu_catch_segv(int sig); 35static void evas_common_cpu_catch_segv(int sig);
21 36
@@ -73,7 +88,7 @@ evas_common_cpu_vis_test(void)
73#ifdef __SPARC__ 88#ifdef __SPARC__
74#endif /* __SPARC__ */ 89#endif /* __SPARC__ */
75} 90}
76 91#endif /* NEED_FEATURE_TEST */
77static Eina_Bool 92static Eina_Bool
78_cpu_check(Eina_Cpu_Features f) 93_cpu_check(Eina_Cpu_Features f)
79{ 94{
@@ -83,6 +98,8 @@ _cpu_check(Eina_Cpu_Features f)
83 return (features & f) == f; 98 return (features & f) == f;
84} 99}
85 100
101
102#ifdef NEED_FEATURE_TEST
86int 103int
87evas_common_cpu_feature_test(void (*feature)(void)) 104evas_common_cpu_feature_test(void (*feature)(void))
88{ 105{
@@ -123,6 +140,7 @@ evas_common_cpu_feature_test(void (*feature)(void))
123 return 0; 140 return 0;
124#endif 141#endif
125} 142}
143#endif
126 144
127EAPI void 145EAPI void
128evas_common_cpu_init(void) 146evas_common_cpu_init(void)