1 #if defined(__sun__) && defined(__svr4__)
2 /* Make sure sigaction() is declared even with -std=c99. */
7 static volatile sig_atomic_t sigill_caught
;
10 sigill_hdlr (int sig
__attribute((unused
)),
11 siginfo_t
*sip
__attribute__((unused
)),
15 /* Set PC to the instruction after the faulting one to skip over it,
16 otherwise we enter an infinite loop. */
17 ucp
->uc_mcontext
.gregs
[EIP
] += 4;
22 /* Check if the OS supports executing SSE instructions. This function is
23 only used in sse-check.h, sse2-check.h, and sse3-check.h so far since
24 Solaris 8 and 9 won't run on newer CPUs anyway. */
29 #if defined(__sun__) && defined(__svr4__)
30 /* Solaris 2 before Solaris 9 4/04 cannot execute SSE instructions
31 even if the CPU supports them. Programs receive SIGILL instead, so
32 check for that at runtime. */
34 struct sigaction act
, oact
;
36 act
.sa_handler
= sigill_hdlr
;
37 sigemptyset (&act
.sa_mask
);
38 /* Need to set SA_SIGINFO so a ucontext_t * is passed to the handler. */
39 act
.sa_flags
= SA_SIGINFO
;
40 sigaction (SIGILL
, &act
, &oact
);
42 /* We need a single SSE instruction here so the handler can safely skip
44 __asm__
volatile ("movss %xmm2,%xmm1");
46 sigaction (SIGILL
, &oact
, NULL
);
54 #endif /* __sun__ && __svr4__ */